Campaign Detail Endpoint
Returns one campaign together with the coupons the current user can act on. Each entry in coupons
carries one concrete coupon code, so the list is what you render as the campaign's coupon cards.
- Endpoint:
/api/v1/campaigns/{slug} - Method:
GETorPOST
Headers
| Header | Value | Required | Description |
|---|---|---|---|
Partner-Access-Token | Base64 String | Yes | Your encrypted AES-256 time-sensitive token. |
Authorization | Bearer <token> | Optional | Sanctum token of the signed-in user. See the note below. |
Content-Type | application/json | Yes | |
Accept | application/json | Yes | |
X-Currency | e.g. THB | Optional | Currency for all money fields. Defaults to THB. |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
slug | String | Yes | Campaign slug from the Campaign List response. |
Payload Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
page | Integer | Optional | Accepted for compatibility. Coupons are returned unpaginated. |
limit | Integer | Optional | Accepted for compatibility. Coupons are returned unpaginated. |
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": [
"https://api.dev.onlynx.co.th/storage/campaigns/songkran-banner.jpg"
]
},
"coupons": [
{
"id": 96,
"currency": "THB",
"coupon_id": 5821,
"code": "SONGKRAN10",
"status": "not_issued",
"discount_type": "percentage",
"discount_value": 10,
"min_purchase_amount": 1000,
"max_discount_amount": 500,
"is_same_code": true,
"coupon_expiry": "2026-05-31T23:59:59.000000Z",
"claim_expiry": "2026-04-03T09:00:00.000000Z",
"rules": [
"Save up to THB 500",
"Min. spend THB 1000"
],
"applicable_for": "Valid for <strong>Hotel</strong> in <strong>Thailand</strong>",
"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": []
}
}
]
}
}
Coupon Field Reference
| Field | Type | Description |
|---|---|---|
id | Integer | Coupon (discount setting) ID. Use it in the Coupon Codes endpoint. |
coupon_id | Integer | Coupon code row ID. Use it in the Delete Claimed Coupon endpoint. |
code | String | The code the user claims and later applies. |
currency | String | Currency of every money field below. |
status | String | not_issued, claimed, redeemed, expired, fully redeemed, reserved. |
discount_type | String | percentage or fixed. |
discount_value | Number | Percent when percentage; converted money amount when fixed. |
min_purchase_amount | Number | Minimum cart total required. 0 means no minimum. |
max_discount_amount | Number | Discount cap for percentage coupons. 0 means uncapped. |
is_same_code | Boolean | true when every user shares one code, false for unique per-user codes. |
coupon_expiry | DateTime | null | When the code stops working. |
claim_expiry | DateTime | null | Deadline to use the code after claiming it. null until claimed. |
rules | Array<String> | Ready-to-render bullet points built from the amounts above. |
applicable_for | String | Human readable restriction summary, contains <strong> tags. |
campaign | Object | The parent campaign, same shape as data.campaign. |
Notes
Send the user token. This route sits outside the authenticated group, so the bearer token is optional — but without it the response only contains unclaimed codes. With it, the coupons the user already claimed come back with
status: "claimed"in the same list, and the number of cards stays stable before and after a claim.
- One coupon may appear several times, once per code the user is still entitled to. The number of
entries per coupon is capped by that coupon's
usage_limit_per_user. - Coupons with no code left for this partner are omitted entirely.
- A slug that is missing, inactive, out of its timeline, or fully redeemed returns:
{
"result": 0,
"message": "Campaign not found or inactive"
}
with HTTP status 404.