List Promotion Codes
Returns the codes of one promotion, oldest first, one page at a time, with the number of payments that took each code.
GET
List Promotion Codes
This endpoint lists the batch codes of a code promotion of the account in the
X-Account-Code header. The codes are secret: keep them safe, and share each one only with the customers who may use it.
Pages
Results come oldest first, bycreated_at. A page holds up to limit codes: 100 by default, 1 to 500 allowed. When more codes exist, next_cursor is a string: pass it as cursor to read the next page. On the last page next_cursor is null. The cursor is opaque. A cursor that is not valid answers 400 INVALID_REQUEST with the message cursor: FORMAT. A limit outside 1 to 500 answers 400 INVALID_REQUEST with limit: RANGE; a limit with a character that is not a digit, or with more than three digits, answers limit: FORMAT.
What each code shows
Each code holds itscode, its uses_per_code (the most payments it accepts), and used, the number of payments that took it. batch_id names the batch that made the code, and created_at is when Yuno created it: all the codes of one batch share it. A disabled promotion lists its codes too.
A promotion that is not on the account answers 404 PROMOTION_NOT_FOUND. A promotion id that is not a UUID v4 answers 400 INVALID_PARAMETERS. Promotion Error Codes lists every answer.Authorizations
Headers
The account_id found in your Yuno Dashboard (UUID). Required. A promotion belongs to one account, and this header names it. Omitting it returns 400 INVALID_PARAMETERS ("x-account-code header is required.").