Promotions are a mechanism to reward accounts for completing certain actions.
Attributes
type
field
amount
Attributes
assetType
collectionId
amount
exchangeRate
Attributes
field
value
operator
/api/loyalty-programs/{id}/promotions
Attributes
Errors
PROMOTION_REWARDS_INVALID
Request
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",
"description": "Make a payment of $1 or more",
"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"
}
]
}
'
Response
{
"id": "8aoMfscvtuewsuJzmzBzAs",
"accountId": "57SyRRgZ1U8Kq2wKpCnSR5",
"programId": "WRhAxxWpTKb5U7pXyxQjjY",
"name": "Spend a Buck",
"description": "Make a payment of $1 or more",
"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"
}
/api/accountId/{id}/promotions
Returns a paginated API list of Promotions for an Account API .
Request
curl -X GET \
https://service.centrapay.com/api/accounts/57SyRRgZ1U8Kq2wKpCnSR5/promotions \
-H 'x-api-key: <TOKEN>'
Response
{
"items": [
{
"id": "8aoMfscvtuewsuJzmzBzAs",
"accountId": "57SyRRgZ1U8Kq2wKpCnSR5",
"programId": "WRhAxxWpTKb5U7pXyxQjjY",
"name": "Spend a Buck",
"description": "Make a payment of $1 or more",
"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"
}
]
}