Skip to content
Loyalty Programs

Create Loyalty Programexperimental

POST/api/loyalty-programs

This endpoint allows you to create a Loyalty Program.

Request body

  • accountIdrequired string
    The Account that will own the Loyalty Program.
  • descriptionoptional string
    The displayable description for the Loyalty Program.
  • joinConditionsoptional array of objects
    The list of Join Conditions that an Account must meet to join the Loyalty Program.
    • paramsrequired object
      The parameters for the join condition. The structure depends on the type field.
      • Asset Ownership Join Condition

        When type is asset-ownership, the params object must contain:

        • assetTyperequired string
          The Asset Type that the Account must own to join the Loyalty Program.
      • Bank Account Ownership Join Condition

        When type is bank-account-ownership, the params object must contain:

        • bankrequired string
          The bank account identifier that the Account must own to join the Loyalty Program.
    • typerequired enum
      The type of join condition.
      • asset-ownership
        The account must hold an active asset of params.assetType.
      • bank-account-ownership
        The account must have an active bank account with params.bank.
      • email-domain-verified
        The user must verify an email address at params.emailDomain.
  • mediaUploadIdoptional string
    The id of the Media Upload image of the Loyalty Program.
  • namerequired string
    The display name of the Loyalty Program.

Responses

Request
curl -X POST https://service.centrapay.com/api/loyalty-programs \
-H 'content-type: application/json' \
-H 'x-api-key: <TOKEN>' \
-d '{
"accountId": "Jaim1Cu1Q55uooxSens6yk",
"description": "Centrapay Cafe Loyalty: Earn rewards, enjoy perks! Join now!",
"joinConditions": [
{
"params": {
"assetType": "quartz.nzd.main"
},
"type": "asset-ownership"
}
],
"mediaUploadId": "8aoMfscvtuewsuJzmzBzAs",
"name": "Centrapay Cafe Loyalty Program"
}'