curl --request POST \
--url https://{cluster}.voucherify.io/v2/loyalties/programs/{programId}/members/batch \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '
[
{
"customer_identification": {
"type": "customer_id",
"customer_id": "cust_X07elh40iNWLujRmDNmBufxd"
}
},
{
"customer_identification": {
"type": "customer_source_id",
"customer_source_id": "crm-1001"
},
"status": "ACTIVE"
}
]
'{
"async_action_id": "aa_12c30928a207efcc66"
}Batch create program members
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.
curl --request POST \
--url https://{cluster}.voucherify.io/v2/loyalties/programs/{programId}/members/batch \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '
[
{
"customer_identification": {
"type": "customer_id",
"customer_id": "cust_X07elh40iNWLujRmDNmBufxd"
}
},
{
"customer_identification": {
"type": "customer_source_id",
"customer_source_id": "crm-1001"
},
"status": "ACTIVE"
}
]
'{
"async_action_id": "aa_12c30928a207efcc66"
}Authorizations
Path Parameters
Unique loyalty program ID (format lprg_[a-f0-9]+).
^lprg_[a-f0-9]+$Body
Identifies the existing customer to enroll. Send exactly one identifier, matching type.
- Customer ID
- Customer source ID
Show child attributes
Show child attributes
Sets the initial member status. Allowed values are ACTIVE and INACTIVE. Defaults to ACTIVE when omitted or null.
ACTIVE, INACTIVE 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.
Response body schema for POST /v2/loyalties/programs/{programId}/members/batch.
Identifies the async action that processes the batch.
^aa_[a-f0-9]+$
