Skip to content
Tokens

Create Token Collectionexperimental

POST/api/collections

This endpoint allows you to create a Token Collection.

Request body

  • accountIdrequired string
    The Account that will own the Collection.
  • externalIdoptional string
    An identifier to associate the Collection with an external campaign or event.
  • maxValueoptional monetary
    The maximum agreed value that any merchants will be settled for a Token redemption. Required for Collections of type discount, where it defines the value that each Token will discount from a payment.
  • mediaUploadIdoptional string
    The id of the Media Upload image of the Collection.
  • namerequired string
    The display name of the Collection.
  • tokenExpiresAfteroptional object
    The active duration of all Tokens created from this Collection.
  • tokenExpiresAtoptional timestamp
    A date that all tokens will expire on if they haven’t expired earlier.
  • typerequired enum
    The type of value gained by redeeming Tokens.
    • discount
      Tokens give money off a purchase, up to the collection's maxValue.
    • product
      Tokens are redeemed for specific products, which redemption conditions can restrict.

Responses

Request
curl -X POST https://service.centrapay.com/api/collections \
-H 'content-type: application/json' \
-H 'x-api-key: <TOKEN>' \
-d '{
"accountId": "T3y6hogYA4d612BExypWYH",
"externalId": "ABC",
"maxValue": {
"amount": "400",
"currency": "NZD"
},
"mediaUploadId": "12345",
"name": "Bread",
"tokenExpiresAfter": {
"duration": "1",
"period": "month"
},
"type": "product"
}'