Promotions
Create Promotion
Create a new promotion for a merchant
POST
Scope required:
promos.writeCode Pools
How you supply codes at creation determines the pool that is created:static_code— creates amulti_usepool containing a single shared code that can be redeemed multiple times (a “universal” code). The pool is marked complete immediately.code_count— creates asingle_usepool and enqueues asynchronous generation of that many unique one-time codes. Poll Get Promotion untilcode_generation_statusiscomplete, then fetch the codes with List Promotion Codes. Additional single-use codes can later be generated with Generate Promotion Codes.- Neither — the promotion is created without any codes.
static_code and code_count are mutually exclusive.
Parameters
Merchant ID
Promotion name
Type of discount:
amount, percent, or itemDiscount amount. Interpreted according to
discount_type (for example, a
percentage for percent or a currency amount for amount).Minimum spend required to redeem
Maximum discount that can be applied (where supported by the discount type)
Terms and conditions
Redemption instructions shown to the customer
Where the promotion can be redeemed:
all, instore, or online.
Defaults to instore.When the promotion becomes active (ISO8601)
When the promotion ends (ISO8601). Must be after
starts_at.A single shared code to create as a
multi_use pool. Mutually exclusive
with code_count.Number of unique one-time codes to generate as a
single_use pool
(1–4,000,000). Generation runs asynchronously. Mutually exclusive with
static_code.Initial state:
active or draft. Defaults to active. Draft promotions
are managed in the Thanx dashboard — the read endpoints
(List Promotions,
Get Promotion) return only active
promotions.Optional day-of-week and time-of-day restrictions on when the promotion can
be redeemed. Write-only: these are applied at creation and viewed or edited
in the Thanx dashboard; they are not returned by the read endpoints.
Response
Returns201 Created with the newly created promotion. The response uses the
same shape as Get Promotion.
Promotion ID
Promotion name
Promotion state (
active or draft)Type of discount the promotion applies:
percent, item, or amountDiscount amount, as a string. Null if not set.
Minimum spend required to redeem, as a string. Null if not set.
Maximum discount that can be applied, as a string. Null if not set.
Terms and conditions
Where the promotion can be redeemed
Promotion start timestamp (ISO8601). Null if not set.
Promotion end timestamp (ISO8601). Null if not set.
How the pool’s codes are generated:
multi_use or single_use. Null if no
pool was created.Number of times codes in the active pool have been redeemed
Total number of codes in the active pool
Status of asynchronous code generation for the active pool:
none (no codes
requested), in_progress, complete, or failed