> ## Documentation Index
> Fetch the complete documentation index at: https://voucherify-rc-lv2-guides.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Batch create program members

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

The program must exist (otherwise, it returns a `404` error) and be in `ACTIVE` status (otherwise, it returns a `423` error). Supported member fields are validated during background processing using the same domain validation rules as single member creation. Entries that fail validation (missing/invalid `customer_id`, unknown customer, invalid `status`, duplicate `customer_id` within the same batch, member already exists) are reported per-entry  individually in the report linked from the async action result. The failed entries do not fail the whole batch (conflicting members are skipped).

Returns `202` status with the identifier of the scheduled async action. Use the [GET Async Action](/api-reference/async-actions/get-async-action) endpoint to check the status of the batch creation. You can also check the processing status and the result in the Audit log – [Background tasks](/analyze/audit-logs#background-tasks) in the Voucherify dashboard.



## 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:
  - X-App-Id: []
    X-App-Token: []
  - bearerAuth: []
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),
      membership retrieval (member + program + cards with tier progress, by
      customer ID, customer source ID, or member ID), 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: >-
        Schedules asynchronous batch creation of program members. The request
        body is a JSON array of member entries (maximum body size is 10 MB). The
        request is processed asynchronously in batches of 100 entries.


        The program must exist (otherwise, it returns a `404` error) and be in
        `ACTIVE` status (otherwise, it returns a `423` error). Supported member
        fields are validated during background processing using the same domain
        validation rules as single member creation. Entries that fail validation
        (missing/invalid `customer_id`, unknown customer, invalid `status`,
        duplicate `customer_id` within the same batch, member already exists)
        are reported per-entry  individually in the report linked from the async
        action result. The failed entries do not fail the whole batch
        (conflicting members are skipped).


        Returns `202` status with the identifier of the scheduled async action.
        Use the [GET Async
        Action](/api-reference/async-actions/get-async-action) endpoint to check
        the status of the batch creation. You can also check the processing
        status and the result in the Audit log – [Background
        tasks](/analyze/audit-logs#background-tasks) in the Voucherify
        dashboard.
      operationId: batchCreateProgramMembers
      parameters:
        - name: programId
          in: path
          required: true
          description: Unique 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/MemberBatchCreateResponse'
              examples:
                'Create members in batch: Async action':
                  value:
                    async_action_id: aa_12c30928a207efcc66
        '404':
          description: Resource not found - the program ID could not be found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                Program not found:
                  value:
                    code: 404
                    key: not_found
                    message: Resource not found
                    details: Cannot find program with id lprg_128f5829f4c4bf7b2
                    request_id: v-12c31c59130a67bb28
                    resource_id: lprg_128f5829f4c4bf7b2
                    resource_type: program
        '413':
          description: Payload too large - the request body exceeds the 10 MB limit.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
              examples:
                Request Entity Too Large:
                  value:
                    statusCode: 413
                    error: Request Entity Too Large
                    message: >-
                      Payload content length greater than maximum allowed:
                      10485760
        '423':
          description: >-
            Resource locked - a related resource is in a state that prevents
            this operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                Non-active program:
                  value:
                    code: 423
                    key: non_active_program
                    message: Invalid program status
                    details: Cannot create members when program status is not ACTIVE
                    request_id: v-12c31c59130a67bb28
        '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/MemberCreate'
    MemberBatchCreateResponse:
      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: Unique identifier of the request that produced the error.
        resource_id:
          type: string
          description: Unique identifier of the resource that produced the error.
        resource_type:
          type: string
          description: Type of the resource that produced the error.
    BadRequest:
      type: object
      description: >-
        Framework-level error returned when the raw request payload is rejected
        before reaching domain validation (for example, when it exceeds a
        configured size limit).
      properties:
        statusCode:
          type: integer
          description: HTTP status code of the error.
        error:
          type: string
          description: Short, human-readable description of the HTTP status.
        message:
          type: string
          description: Human-readable message with more details about the error.
    MemberCreate:
      type: object
      properties:
        customer_id:
          type: string
          pattern: ^cust_[a-zA-Z0-9]+
          description: >-
            Unique Voucherify customer ID of an existing customer to enroll as a
            member. Required.
        status:
          description: Initial member status. Defaults to `ACTIVE` when omitted or `null`.
          oneOf:
            - type: string
              enum:
                - ACTIVE
                - INACTIVE
            - type: 'null'
          default: ACTIVE
        metadata:
          description: >-
            Free-form metadata attached to the member. Validated against the
            metadata schema defined for the `vl_member` related object (when one
            is configured). Defaults to an empty object.
          oneOf:
            - type: object
            - type: 'null'
          default: {}
      required:
        - customer_id
  securitySchemes:
    X-App-Id:
      type: apiKey
      name: X-App-Id
      in: header
    X-App-Token:
      type: apiKey
      name: X-App-Token
      in: header
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````