> ## Documentation Index
> Fetch the complete documentation index at: https://docs.voucherify.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Batch create program members

> ⚠️ **BETA endpoint**

This is a work-in-progress documentation of a BETA endpoint. The parameters, fields, request and response bodies, and other data may subject to change. If you want to share feedback or improvements, contact Voucherify support or your Technical Account Manager.

Schedules asynchronous batch creation of program members. The request body is a
JSON array of member entries (maximum body size 10485760 bytes / 10 MB). The
request is processed asynchronously in batches of 100 entries.

The program must exist (404) and be in `ACTIVE` status (423). Each entry is
validated during background processing the same way as single member creation;
entries that fail validation (missing/invalid `customer_id`, unknown customer,
invalid `status`, member already exists) are reported per-entry in the async action
result and do not fail the whole batch (conflicting members are skipped).

Returns 202 with the identifier of the scheduled async action.




## OpenAPI

````yaml /openapi/loyalties-v2.json post /v2/loyalties/programs/{programId}/members/batch
openapi: 3.1.0
info:
  title: Voucherify Loyalty v2 API
  version: 2.0.0
  description: >-
    Complete OpenAPI specification for the Voucherify Loyalty v2 API.

    All endpoints require the LOYALTY_V2 feature flag.


    Combined from per-domain specs: programs.yaml, members.yaml,
    program-operations.yaml, card-definitions.yaml, earning-rules.yaml,
    tier-structures.yaml, benefits.yaml, rewards.yaml, examine.yaml
servers:
  - url: '{protocol}://{host}'
    variables:
      protocol:
        default: https
        enum:
          - https
          - http
      host:
        default: api.voucherify.io
security:
  - bearerAuth: []
    X-App-Id: []
    X-App-Token: []
tags:
  - name: Programs
    description: >-
      Loyalty program CRUD, lifecycle management, program-scoped resource
      assignments (card definitions, earning rules, rewards, tier structures),
      member management (create, list, get, activate, deactivate, delete), card
      operations (points adjustment, pending points, expiring points,
      transactions), reward purchases, and activity history.
  - name: Card Definitions
    description: >-
      CRUD operations, lifecycle management, and activity history for card
      definitions. Card definitions describe the configuration for loyalty
      cards, including code generation, points expiration, earning/spending
      limits, pending points, refunds, and balance settings.
  - name: Earning Rules
    description: >-
      Manage earning rules that define how customers earn points or receive
      incentives based on triggers (events, segments, custom events). Includes
      CRUD, lifecycle, and activity history.
  - name: Tier Structures
    description: >-
      CRUD operations, lifecycle management, and activity history for tier
      structures. Includes nested tier definitions (create, list, update,
      delete) within tier structures. Tier structures define the tiering model
      for loyalty programs — how members qualify for and move between tiers.
  - name: Benefits
    description: >-
      Manage benefit definitions (fixed points, proportional points, material,
      digital). Includes CRUD, lifecycle transitions, and activity history.
  - name: Rewards
    description: >-
      CRUD, lifecycle operations, and activity history for reward definitions.
      Rewards can be material (product/SKU) or digital (discount coupons, gift
      vouchers).
  - name: Examine
    description: >-
      Evaluation endpoints that estimate earning opportunities and reward
      availability for a customer across their loyalty program memberships,
      without side effects.
paths:
  /v2/loyalties/programs/{programId}/members/batch:
    post:
      tags:
        - Programs
      summary: Batch create program members
      description: >
        ⚠️ **BETA endpoint**


        This is a work-in-progress documentation of a BETA endpoint. The
        parameters, fields, request and response bodies, and other data may
        subject to change. If you want to share feedback or improvements,
        contact Voucherify support or your Technical Account Manager.


        Schedules asynchronous batch creation of program members. The request
        body is a

        JSON array of member entries (maximum body size 10485760 bytes / 10 MB).
        The

        request is processed asynchronously in batches of 100 entries.


        The program must exist (404) and be in `ACTIVE` status (423). Each entry
        is

        validated during background processing the same way as single member
        creation;

        entries that fail validation (missing/invalid `customer_id`, unknown
        customer,

        invalid `status`, member already exists) are reported per-entry in the
        async action

        result and do not fail the whole batch (conflicting members are
        skipped).


        Returns 202 with the identifier of the scheduled async action.
      operationId: batchCreateProgramMembers
      parameters:
        - name: programId
          in: path
          required: true
          description: Loyalty program ID (format `lprg_[a-f0-9]+`).
          schema:
            type: string
            pattern: ^lprg_[a-f0-9]+$
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MemberBatchCreateRequest'
      responses:
        '202':
          description: Batch creation has been scheduled.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MemberBatchScheduleResponse'
        '400':
          description: >-
            Validation error - request body or query parameters failed
            validation, or the operation is not allowed in the current resource
            state.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Resource not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Conflict - e.g. duplicate resource or invalid state transition.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '423':
          description: >-
            Resource locked - a related resource is in a state that prevents
            this operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    MemberBatchCreateRequest:
      type: array
      description: >
        Request body for batch member creation - a JSON array of member entries.
        The raw

        body is limited to 10485760 bytes (10 MB) and is processed
        asynchronously in

        batches of 100 entries. Each entry is validated like a single member
        creation

        request during background processing; per-entry failures (invalid
        customer_id

        format, unknown customer, invalid status, member already exists) are
        reported in

        the async action result.
      items:
        $ref: '#/components/schemas/MemberBatchCreateItem'
    MemberBatchScheduleResponse:
      type: object
      description: |
        Result of scheduling the members batch creation.
      properties:
        async_action_id:
          type: string
          pattern: ^aa_[a-f0-9]+$
          description: ID of the scheduled async action processing the batch.
      required:
        - async_action_id
    ErrorResponse:
      type: object
      description: Standard error response returned by all Loyalty v2 endpoints.
      properties:
        code:
          type: integer
          description: HTTP status code of the error.
        key:
          type: string
          description: Machine-readable error key.
        message:
          type: string
          description: Human-readable error message.
        details:
          type: string
          description: Additional details about the error.
        request_id:
          type: string
          description: Identifier of the request that produced the error.
    MemberBatchCreateItem:
      type: object
      description: A single member entry of the batch creation payload.
      properties:
        customer_id:
          type: string
          pattern: ^cust_[a-zA-Z0-9]+
          description: >-
            ID of an existing customer to enroll as a member. Required per
            entry.
        status:
          description: Initial member status. Defaults to `ACTIVE` when omitted.
          oneOf:
            - type: string
              enum:
                - ACTIVE
                - INACTIVE
            - type: 'null'
          default: ACTIVE
        metadata:
          description: >-
            Free-form metadata attached to the member. Defaults to an empty
            object.
          oneOf:
            - type: object
            - type: 'null'
          default: {}
      required:
        - customer_id
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    X-App-Id:
      type: apiKey
      name: X-App-Id
      in: header
    X-App-Token:
      type: apiKey
      name: X-App-Token
      in: header

````