Skip to main content

Campaign List Endpoint

Returns the running campaigns your partner account is allowed to show, newest first.

  • Endpoint: /api/v1/campaigns
  • 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.
Accept-Languagee.g. enOptionalLanguage for translated campaign content.

Payload Parameters

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

Sample Payload

{
"page": 1,
"limit": 10
}

Sample Response

{
"result": 1,
"message": "success",
"data": {
"meta": {
"current_page": 1,
"last_page": 3,
"per_page": 10,
"total": 24
},
"campaigns": [
{
"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"
],
"applicable_for": "Valid for <strong>Hotel</strong> in <strong>Thailand</strong>"
}
]
}
}

Field Reference

FieldTypeDescription
idIntegerCampaign ID.
nameStringCampaign title.
slugStringUse this in the Campaign Detail endpoint.
statusStringAlways running for listed campaigns.
promotion_typeStringpromo_code or coupon. voucher campaigns are never listed.
start_at / end_atDateTime | nullCampaign timeline in UTC. null means open ended.
coupon_expiryDateTime | nullLatest moment a coupon from this campaign can be used.
descriptionString | nullPlain or HTML description.
term_and_conditionsString | nullHTML terms. Render as HTML.
imagesArrayFull image URLs. May be empty.
applicable_forStringHuman readable restriction summary. Contains <strong> tags.

Notes

  • A campaign appears only when it still has coupon codes left for the requesting partner. Campaigns whose coupons are all claimed or fully redeemed drop out of the list automatically.
  • Sign up and birthday campaigns are excluded — their coupons are delivered to the user by email.
  • This endpoint does not require a user token. Prices in the campaign payload are informational; the actual amounts live on each coupon in the Campaign Detail response.