Loyalty cards

Import loyalty cards

[!note] Management API endpoints are not meant to be used in real-time integrations that directly serve your end users. Rate limit: 3 requests per second.

Upload a CSV file containing the loyalty cards that you want to use in your card-based loyalty program.

Send the file as multipart data.

It contains the following columns for each card:

  • identifier (required): The identifier of the loyalty card, which must match the regular expression ^[A-Za-z0-9._%+@-]+$.
  • state (required): The state of the loyalty card. It can be active or inactive.
  • customerprofileids (optional): An array of strings representing the identifiers of the customer profiles linked to the loyalty card. The identifiers should be separated with a semicolon (;).
  • attributes (optional): A JSON object that contains the loyalty card's custom attributes and their values. These attributes must be created and connected to this loyalty program before they can be assigned to the cards through this endpoint.

[!note] Your CSV file must contain less than 500,000 rows. Requests time out after 30 seconds.

Example

identifier,state,customerprofileids,attributes
123-456-789AT,active,Alexa001;UserA,'{""my_attributes"": ""10_off""}"
post/v1/loyalty_programs/{loyaltyProgramId}/import_cards

Request

Path parameters

loyaltyProgramIdinteger required

Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the List loyalty programs endpoint.

Request body multipart/form-data

upFilestring binary

The CSV file containing the data that is being imported.

Response

OK

idinteger required

The internal ID of this entity.

createdstring date-time required

The time this entity was created.

accountIdinteger required

The ID of the account that owns this entity.

userIdinteger required

The ID of the user associated with this entity.

entitystring required

The name of the entity that was imported.

amountinteger required

The number of values that were imported.

Example response

{
  "id": 6,
  "created": "2020-06-10T09:05:27.993483Z",
  "accountId": 3886,
  "userId": 388,
  "entity": "AttributeAllowedList",
  "amount": 10
}

Changes

No recorded changes to this operation across all 2 revisions of this API.