Skip to main content

Get Promotion Codes

Retrieve a list of promotion codes from your store.

Promotion codes are returned newest first. Narrow the list with the optional filters below — for example status=archived to surface archived codes (hidden by default), or discount_type=percent_off to return only percentage discounts. All filters combine with AND.

Request

GET /promotion-codes

Query Parameters

ParameterTypeRequiredDefaultDescription
pageintegerNo1Page number for pagination
statusstringNoFilter by status. One of active, inactive, expired, archived. Archived codes are excluded from the default list — pass status=archived to surface them.
discount_typestringNoFilter by discount type. One of amount_off, percent_off.
querystringNoPartial (case-insensitive) match on code OR name.
product_idstringNoProduct UUID. Returns product-scoped codes for that product plus all global codes — the natural answer to "which promotion codes apply to product X?".
created_fromstringNoOnly promotion codes created on or after this date (inclusive), YYYY-MM-DD.
created_tostringNoOnly promotion codes created on or before this date (inclusive), YYYY-MM-DD.

Omitting a filter or passing it empty means "no filter on that field". Passing a non-empty but unparseable value — an unknown status / discount_type, a malformed date, or a non-UUID product_id — returns a 400 (see Bad Request).

Example Request

curl -X GET "https://cart.easy.tools/api/v1/promotion-codes?status=active&discount_type=percent_off&page=1" \
-H "Authorization: Bearer YOUR_API_TOKEN"

Response

Success Response (200)

Returns a paginated list of promotion codes.

{
"items": [
{
"id": "550e8400-e29b-41d4-a716-446655440030",
"code": "BLACKFRIDAY20",
"name": "Black Friday 2026",
"discount_type": "percent_off",
"amount_off": null,
"percent_off": 20,
"currency": null,
"duration": "once",
"duration_in_months": null,
"max_redemptions": 100,
"times_redeemed": 14,
"expires_at": "2026-12-31T23:59:59+00:00",
"first_time_transaction": false,
"minimum_amount": null,
"minimum_amount_currency": null,
"scope": {
"type": "global"
},
"status": "active",
"created_at": "2026-05-27T10:16:00+00:00",
"updated_at": "2026-05-27T10:16:00+00:00"
},
{
"id": "550e8400-e29b-41d4-a716-446655440031",
"code": "LAUNCH10",
"name": null,
"discount_type": "amount_off",
"amount_off": 1000,
"percent_off": null,
"currency": "pln",
"duration": "once",
"duration_in_months": null,
"max_redemptions": null,
"times_redeemed": 3,
"expires_at": null,
"first_time_transaction": true,
"minimum_amount": 5000,
"minimum_amount_currency": "pln",
"scope": {
"type": "product",
"product_id": "550e8400-e29b-41d4-a716-446655440000",
"price_ids": [
"550e8400-e29b-41d4-a716-446655440001"
]
},
"status": "active",
"created_at": "2026-05-20T09:00:00+00:00",
"updated_at": "2026-05-21T11:30:00+00:00"
}
],
"pagination": {
"current_page": 1,
"total_pages": 3
}
}

Response Fields

FieldTypeNullableDescription
idstringNoUnique identifier for the promotion code (UUID)
codestringNoThe redemption string customers type at checkout
namestringYesOptional internal name shown in dashboards
discount_typestringNoamount_off (fixed amount) or percent_off (percentage)
amount_offintegerYesFixed discount in minor units (e.g. cents/grosze). Set when discount_type=amount_off.
percent_offnumberYesPercentage discount (1–100). Set when discount_type=percent_off.
currencystringYesLowercase ISO currency code. Set for amount_off codes and for global codes that carry minimum_amount.
durationstringNoHow long the discount applies: once, repeating, or forever.
duration_in_monthsintegerYesNumber of months the discount applies. Set when duration=repeating.
max_redemptionsintegerYesMaximum total redemptions across all customers
times_redeemedintegerNoHow many times the code has already been redeemed
expires_atstringYesWhen the code stops being redeemable (ISO 8601 format)
first_time_transactionbooleanNoWhether the code is restricted to a customer's first purchase
minimum_amountintegerYesMinimum transaction amount in minor units required for redemption
minimum_amount_currencystringYesLowercase ISO currency code for minimum_amount
scopeobjectNoEither { "type": "global" } or { "type": "product", "product_id": "…", "price_ids": [ … ] }
statusstringNoDerived status: active, inactive, expired, or archived
created_atstringNoWhen the promotion code was created (ISO 8601 format)
updated_atstringNoWhen the promotion code was last updated (ISO 8601 format)

Error Responses

Bad Request (400)

Returned when a filter has a non-empty but unparseable value. The message names the offending field and the value received.

{
"message": "Invalid value for 'discount_type': 'percentage'"
}

Unauthorized (401)

{
"message": "Unauthenticated."
}