Skip to main content
GET
List Promotion Codes
Promotions is enabled per organizationThis endpoint works only after Yuno enables Promotions for your organization. Until then it answers 404 PROMOTION_NOT_FOUND. Ask your Technical Account Manager or Key Account Manager. See Promotions.
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, by created_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 its code, 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

public-api-key
string
header
default:<Your public-api-key>
required
private-secret-key
string
header
default:<Your private-secret-key>
required

Headers

X-Account-Code
string
required

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.").

Path Parameters

promotion_id
string<uuid>
required

The promotion id (UUID v4). The promotion must belong to the account of X-Account-Code. A promotion with no codes, such as an AUTOMATIC promotion, answers 200 with an empty codes list. An id that is not a UUID v4 answers 400 INVALID_PARAMETERS.

Query Parameters

limit
integer
default:100

How many codes to return, from 1 to 500. Default 100. A value outside that range answers 400 INVALID_REQUEST with limit: RANGE; a value with a character that is not a digit, or with more than three digits, answers limit: FORMAT.

Required range: 1 <= x <= 500
cursor
string

The next_cursor of the previous page. A cursor that is not valid answers 400 INVALID_REQUEST with cursor: FORMAT.

Response

  1. One page of the codes, oldest first. next_cursor is null on the last page.
codes
object[]
next_cursor
string | null

Pass it as cursor to read the next page. null on the last page.