Loyalty cards

Create loyalty cards

Changed on

[!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.

Create a batch of loyalty cards in a specified card-based loyalty program.

Customers can use loyalty cards to collect and spend loyalty points.

[!important] Note

  • The specified card-based loyalty program must have a defined card code format that is used to generate the loyalty card codes.
  • Trying to create more than 20,000 loyalty cards in a single request returns an error message with a 400 status code.
post/v1/loyalty_programs/{loyaltyProgramId}/cards/batch

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

numberOfCardsinteger required

Number of loyalty cards in the batch.

batchIdstring

ID of the loyalty card batch.

status'active' | 'inactive'

Status of the loyalty cards in the batch.

attributesobject

Set values for the custom attributes of a loyalty card. These attributes must be created in the Campaign Manager before their values can be updated through this endpoint.

Example request

{
  "numberOfCards": 5000,
  "batchId": "hwernpjz",
  "status": "active",
  "attributes": {
    "PIN": 1234,
    "Language": "DE"
  },
  "cardCodeSettings": {
    "validCharacters": [
      "A",
      "B",
      "C",
      "D",
      "E",
      "F",
      "G",
      "H",
      "I",
      "J",
      "K",
      "L",
      "M",
      "N",
      "O",
      "P",
      "Q",
      "R",
      "S",
      "T",
      "U",
      "V",
      "W",
      "X",
      "Y",
      "Z",
      "0",
      "1",
      "2",
      "3",
      "4",
      "5",
      "6",
      "7",
      "8",
      "9"
    ],
    "couponPattern": "SUMMER-####-####"
  }
}

Response

OK

numberOfCardsGeneratedinteger required

Number of loyalty cards in the batch.

batchIdstring required

ID of the loyalty card batch.

Example response

{
  "numberOfCardsGenerated": 5000,
  "batchId": "hwernpjz"
}

Changes

    • warning

      the / request property's max was set to 20000.00

    • warning

      the / request property's min was set to 1.00

    • info

      added the new optional request property /