Skip to main content

Coupon Codes Endpoint

Pages through the unclaimed codes of one coupon inside a campaign. Use it when a coupon issues unique codes and you want to show or hand out more than the single code returned by the Campaign Detail endpoint.

  • Endpoint: /api/v1/campaigns/{slug}/coupons/{id}/codes
  • Method: GET or POST

Headers

HeaderValueRequiredDescription
Partner-Access-TokenBase64 StringYesYour encrypted AES-256 time-sensitive token.
Content-Typeapplication/jsonYes
Acceptapplication/jsonYes
X-Currencye.g. THBOptionalCurrency for all money fields. Defaults to THB.

Path Parameters

ParameterTypeRequiredDescription
slugStringYesCampaign slug.
idIntegerYesCoupon ID — the id field of an entry in the Campaign Detail coupons array.

Payload Parameters

ParameterTypeRequiredDescription
pageIntegerOptionalPage number. Minimum 1. Defaults to 1.
limitIntegerOptionalRecords per page. Between 1 and 100. Defaults to 10.

Sample Response

{
"result": 1,
"message": "success",
"data": {
"campaign": {
"id": 41,
"name": "Songkran Hotel Sale",
"slug": "songkran-hotel-sale",
"status": "running",
"promotion_type": "coupon",
"start_at": "2026-04-01T00:00:00.000000Z",
"end_at": "2026-04-30T23:59:59.000000Z",
"coupon_expiry": "2026-05-31T23:59:59.000000Z",
"description": "Save on hotel stays across Thailand.",
"term_and_conditions": "<p>One coupon per booking.</p>",
"images": []
},
"coupons": {
"meta": {
"current_page": 1,
"last_page": 12,
"per_page": 10,
"total": 116
},
"data": [
{
"id": 9821,
"code": "SONGKRAN-4F7QK2",
"currency": "THB",
"status": "not_issued",
"discount_type": "percentage",
"discount_value": 10,
"min_purchase_amount": 1000,
"max_discount_amount": 500,
"coupon_expiry": "2026-05-31T23:59:59.000000Z",
"claim_expiry": null,
"reward": "TourMind Hotel",
"reward_destinations": [
{
"id": 12,
"name": "Thailand"
}
],
"reward_variations": [],
"rules": [
"Save up to THB 500",
"Min. spend THB 1000"
],
"applicable_for": "Valid for <strong>Hotel</strong> in <strong>Thailand</strong>"
}
]
}
}
}

Field Reference

FieldTypeDescription
idIntegerCoupon code row ID.
codeStringThe code to claim or use at checkout.
statusStringnot_issued here, since only unclaimed codes are returned.
rewardString | nullProduct category the coupon targets, e.g. TourMind Hotel. null when valid for everything.
reward_destinationsArrayDestinations (or airlines for pd9) the coupon is limited to.
reward_variationsArraySpecific products (hotels, tours, packages) the coupon is limited to.
discount_amountNumberOnly present when the coupon was resolved against a real cart — see Applicable Coupons.

All other fields match the coupon fields documented in Campaign Detail.

Notes

  • Only codes with status = not_issued and no owner are returned. Claimed codes never appear here.
  • Under equal_coupon_distribution the list is automatically restricted to the codes allocated to your partner account.
  • Unlike the Campaign Detail endpoint, this one ignores the campaign type filter: it is meant for campaigns you already resolved by slug.
  • An unknown or inactive slug returns Campaign not found or inactive with HTTP 404.