Programs

Batch create program members

Changed on

Schedules creation of program members from a JSON array and returns 202 with async_action_id. The program must exist, be ACTIVE, and be inside its validity window. The body isn't checked before that response. Entries are processed in batches of 100. The raw body must be at most 10 MB.

Each entry uses the same fields as Create program member. A failed entry is skipped. Its report row sets created to false and explains the failure in error. Skipped cases include an invalid customer_identification, an unknown customer, an invalid status, a duplicate customer in the batch (Duplicate customer ID), a customer who is already a member (Member already exists), metadata that doesn't match the vl_member schema, and entries past the loyalty members plan limit. Successful entries enroll the customer and create a loyalty card for each card definition on the program. Report columns are identification_type, customer_id, customer_source_id, program_id, member_id, created, and error.

An empty array or a null entry fails the async action with invalid_request_payload. A body that isn't a JSON array fails it with top_level_object_should_be_an_array. Use Get async action to read the status and the report. You can also open the result from Audit log, Background tasks.

post/v2/loyalties/programs/{programId}/members/batch

Request

  • Base URL
    https://api.voucherify.io
  • URL
    https://api.voucherify.io/v2/loyalties/programs/{programId}/members/batch
  • Auth
    • API key in header X-App-Id and API key in header X-App-Token
    • or HTTP bearer

Request body

status'ACTIVE' | 'INACTIVE' nullable

Sets the initial member status. Allowed values are ACTIVE and INACTIVE. Defaults to ACTIVE when omitted or null.

metadataobject nullable

Stores custom metadata on the member. Validated against the metadata schema for the vl_member related object when one is configured. Defaults to an empty object when omitted or null.

Response

The batch is scheduled. Use async_action_id to follow processing.

async_action_idstring required

Identifies the async action that processes the batch.

Changes

    • breaking

      added to the request body allOf list

    • breaking

      the request's body type changed from array to no type

    • breaking

      removed the required property from the response with the status

    • warning

      deleted the path request parameter programId

    • info

      added to the response body allOf list for the response status

    • breaking

      added the new path request parameter programId

    • breaking

      the request's body type changed from no type to array

    • warning

      removed from the request body allOf list

    • info

      removed from the response body allOf list for the response status

    • info

      added the required property to the response with the status