Promotions
Promotions are a mechanism to reward accounts for completing certain actions.
Promotion Model
Attributes
Promotion Target Model
Attributes
-
type
string -
field
string -
amount
number
Promotion Reward Model
Attributes
-
assetType
string -
collectionId
string -
name
string -
img
string -
amount
number -
exchangeRate
number
Promotion Condition Model
Attributes
-
field
string -
value
string -
operator
string
Create Promotion experimental
Attributes
Errors
-
PROMOTION_REWARDS_INVALID
403
curl -X POST \ https://service.centrapay.com/api/loyalty-programs/WRhAxxWpTKb5U7pXyxQjjY/promotions \ -H 'content-type: application/json' \ -H 'x-api-key: <TOKEN>' \ -d '{ "name": "Spend a Buck", "summary": "Make a payment", "mediaUploadId": "26yUWG6wFgmva8UaDiCTWq", "startsAt": "2023-02-16T00:47:54.131Z", "endsAt": "2024-02-16T00:47:54.131Z", "rewards": [ { "assetType": "centrapay.nzd.main", "amount": "500" } ], "eventType": "payment", "target": { "type": "count", "amount": "1" }, "type": "challenge", "conditions": [ { "field": "amount", "value": "99", "operator": "greater-than" } ], "description": "The amount of the payment must be greater than $1."}'
{ "id": "8aoMfscvtuewsuJzmzBzAs", "accountId": "57SyRRgZ1U8Kq2wKpCnSR5", "programId": "WRhAxxWpTKb5U7pXyxQjjY", "name": "Spend a Buck", "summary": "Make a payment", "mediaUploadId": "26yUWG6wFgmva8UaDiCTWq", "img": "https://media-upload.centrapay.com/image.png?jhbdsfau67ewejshb=487hsdjhbdgs743", "startsAt": "2023-02-16T00:47:54.131Z", "endsAt": "2024-02-16T00:47:54.131Z", "rewards": [ { "assetType": "centrapay.nzd.main", "amount": "500" } ], "eventType": "payment", "target": { "type": "count", "amount": "1" }, "type": "challenge", "conditions": [ { "field": "amount", "value": "99", "operator": "greater-than" } ], "description": "The amount of the payment must be greater than $1.", "createdAt": "2023-02-08T04:04:27.426Z", "createdBy": "crn::user:1234", "updatedAt": "2023-02-08T04:04:27.426Z", "updatedBy": "crn::user:1234"}
curl -X GET \ https://service.centrapay.com/api/accounts/57SyRRgZ1U8Kq2wKpCnSR5/promotions \ -H 'x-api-key: <TOKEN>'
{ "items": [ { "id": "8aoMfscvtuewsuJzmzBzAs", "accountId": "57SyRRgZ1U8Kq2wKpCnSR5", "programId": "WRhAxxWpTKb5U7pXyxQjjY", "name": "Spend a Buck", "summary": "Make a payment", "description": "The amount of the payment must be greater than $1.", "mediaUploadId": "26yUWG6wFgmva8UaDiCTWq", "img": "https://media-upload.centrapay.com/image.png?jhbdsfau67ewejshb=487hsdjhbdgs743", "startsAt": "2023-02-16T00:47:54.131Z", "endsAt": "2024-02-16T00:47:54.131Z", "rewards": [ { "assetType": "centrapay.nzd.main", "amount": "500" } ], "eventType": "payment", "target": { "type": "count", "amount": 1 }, "type": "challenge", "conditions": [ { "field": "amount", "value": "99", "operator": "greater-than" } ], "createdAt": "2023-02-08T04:04:27.426Z", "createdBy": "crn::user:1234", "updatedAt": "2023-02-08T04:04:27.426Z", "updatedBy": "crn::user:1234" } ]}
List Promotions by Loyalty Program experimental
Returns a list of Promotions for a Loyalty Program .
curl -X GET \ https://service.centrapay.com/api/loyalty-programs/WRhAxxWpTKb5U7pXyxQjjY/promotions \ -H 'x-api-key: <TOKEN>'
{ "items": [ { "id": "8aoMfscvtuewsuJzmzBzAs", "accountId": "57SyRRgZ1U8Kq2wKpCnSR5", "programId": "WRhAxxWpTKb5U7pXyxQjjY", "name": "Spend a Buck", "summary": "Make a payment", "description": "The amount of the payment must be greater than $1.", "mediaUploadId": "26yUWG6wFgmva8UaDiCTWq", "img": "https://media-upload.centrapay.com/image.png?jhbdsfau67ewejshb=487hsdjhbdgs743", "startsAt": "2023-02-16T00:47:54.131Z", "endsAt": "2024-02-16T00:47:54.131Z", "rewards": [ { "assetType": "centrapay.nzd.main", "amount": "500" } ], "eventType": "payment", "target": { "type": "count", "amount": 1 }, "type": "challenge", "conditions": [ { "field": "amount", "value": "100", "operator": "greater-than" } ], "createdAt": "2023-02-08T04:04:27.426Z", "createdBy": "crn::user:1234", "updatedAt": "2023-02-08T04:04:27.426Z", "updatedBy": "crn::user:1234" } ]}