Returns a list of Promotions for a Loyalty Program.
GET
/api/loyalty-programs/{loyaltyProgramId}/promotionsconditionsarray of objectsThe list of Conditions that need to be met when incrementing/completing the Promotion.fieldstringThe field to look at in the Event object. Required unlesstypeis set, in which case it is not allowed.
rewardsobjectDescribes the rewards the account will receive upon completing the Promotion. Rewards are a tree ofandgroups - each item a leaf Promotion Reward or a nested group - with every leaf issued on completion.fieldstringOnly supplied iftypeissum. This denotes which field to sum on the Event to reach the target amount.
rewardsarray of objectsdeprecatedUseparams.rewardsinstead. A flattened list of Rewards that the account will receive upon completing the Promotion. Retained on responses for backwards compatibility.amountbignumberThe amount of the chosen asset to reward. Only supplied if Promotion is typechallenge.collectionIdstringThe ID of the Token Collection that should be rewarded. Only supplied ifassetTypeiscentrapay.token.testorcentrapay.token.main.issuedToAccountIdsarray of stringsThe IDs of the accounts this reward was issued to. Only supplied once the draw for adrawPromotion has been run. An empty array means the reward went unclaimed. Where a reward is grouped withand, every reward in the group lists the same accounts, since a winner of that group receives all of them.
fieldstringOnly supplied iftypeissum. This denotes which field to sum on the Event to reach the target amount.
errorstringThe name of the HTTP status. AlwaysBad Request.messageenumThe error code, or for a 400 a description of what's wrong with the request.Bad RequestThe request is malformed or missing required fields. The message says what's wrong, egamount is required. See 400 Malformed Request.
statusCodeintegerThe HTTP status code. Always400.
errorstringThe name of the HTTP status. AlwaysUnauthorized.messageenumThe error code, or for a 400 a description of what's wrong with the request.Missing authenticationAPI key or JWT is missing, expired or invalid. See Auth.
statusCodeintegerThe HTTP status code. Always401.
errorstringThe name of the HTTP status. AlwaysForbidden.messageenumThe error code, or for a 400 a description of what's wrong with the request.ForbiddenThe resource doesn't exist, or your user or API key doesn't have permission to access it. See 403 Forbidden.
statusCodeintegerThe HTTP status code. Always403.
errorstringThe name of the HTTP status. AlwaysNot Found.messageenumThe error code, or for a 400 a description of what's wrong with the request.Not FoundThe route doesn't exist. Check the URL and HTTP method against the examples. See 404 Route Not Found.
statusCodeintegerThe HTTP status code. Always404.
errorstringThe name of the HTTP status. AlwaysToo Many Requests.messageenumThe error code, or for a 400 a description of what's wrong with the request.RATE_LIMIT_EXCEEDEDCentrapay API rate limits have been exceeded. See Rate Limits.
statusCodeintegerThe HTTP status code. Always429.
errorstringThe name of the HTTP status. AlwaysInternal Server Error.messageenumThe error code, or for a 400 a description of what's wrong with the request.An internal server error occurredSomething went wrong on our end. Retrying should solve the issue. See 5xx Server Error.
statusCodeintegerThe HTTP status code. Always500.
curl -X GET https://service.centrapay.com/api/loyalty-programs/WRhAxxWpTKb5U7pXyxQjjY/promotions \-H 'x-api-key: <TOKEN>'{ "items": [ { "accountId": "57SyRRgZ1U8Kq2wKpCnSR5", "conditions": [ { "field": "amount", "operator": "greater-than", "value": "100" } ], "createdAt": "2023-02-08T04:04:27.426Z", "createdBy": "crn::user:1234", "description": "The amount of the payment must be greater than $1.", "endsAt": "2024-02-16T00:47:54.131Z", "eventType": "payment", "id": "8aoMfscvtuewsuJzmzBzAs", "img": "https://media-upload.centrapay.com/image.png?jhbdsfau67ewejshb=487hsdjhbdgs743", "mediaUploadId": "26yUWG6wFgmva8UaDiCTWq", "name": "Spend a Buck", "params": { "rewards": { "and": [ { "amount": "500", "assetType": "centrapay.nzd.main" } ] }, "target": { "amount": "1", "type": "count" } }, "programId": "WRhAxxWpTKb5U7pXyxQjjY", "rewards": [ { "amount": "500", "assetType": "centrapay.nzd.main" } ], "startsAt": "2023-02-16T00:47:54.131Z", "summary": "Make a payment", "target": { "amount": "1", "type": "count" }, "type": "challenge" } ]}{ "error": "Bad Request", "message": "amount is required", "statusCode": 400}{ "error": "Unauthorized", "message": "Missing authentication", "statusCode": 401}{ "error": "Forbidden", "message": "Forbidden", "statusCode": 403}{ "error": "Not Found", "message": "Not Found", "statusCode": 404}{ "error": "Too Many Requests", "message": "RATE_LIMIT_EXCEEDED", "statusCode": 429}{ "error": "Internal Server Error", "message": "An internal server error occurred", "statusCode": 500}