coupons
query · in the family Coupon
What it does
The coupon list — each entry is a coupon — a code a customer presents for a reduction.
The Coupons your organization group holds today. Doomed records leave the listing but stay readable by id; inactive ones stay listed.
Before you call
A bearer session from an API key (see Authentication and key hygiene) or a signed-in user.
Capability area: Reading your records — Looking up and listing the records of your organization.
Roles that may call it:
- Owner
- System Administrator
- Manager
- Associate Manager
- Warehouse Associate
- Sales Associate
- An API key whose scope allows
api:coupons
What happens
Reads only — changes nothing.
Returns
Coupon [Coupon!]! — A Coupon — the code-gated entry to the discount engines: a normalized code (trim+uppercase, stored normalized-only, immutable at birth — re-code = a new coupon) that either unlocks a couponGated Promotion (trigger flavor — the reduction is source=promo at position 3) or carries its own simple effect (discount flavor — source=coupon at position 2, before promotions). Attach to an open order via applyOrderCoupon; redemption counts per order in the place transaction — a capped-out coupon refuses CONFLICT/COUPON_EXHAUSTED. Named deferrals: CouponBatch (unique single-use child codes) · per-customer caps.
Example request
query ExampleCoupons {
coupons {
id
sysId
type
caption
status
parentId
rootId
createdAt
updatedAt
revisionNum
revision
flavor
code
promotionId
startAt
endAt
totalUsesCap
}
}Example response
{
"data": {
"coupons": [
{
"id": "01900000-0000-7000-8000-d554478b0000",
"sysId": "CP-EXMP-0000-000F",
"type": "Coupon",
"caption": "Blue jeans",
"status": "active",
"parentId": "01900000-0000-7000-8000-eacdfcfd0000",
"rootId": "01900000-0000-7000-8000-a1295a650000",
"createdAt": "2027-01-31T00:00:00.000Z",
"updatedAt": "2027-01-31T00:00:00.000Z",
"revisionNum": 1,
"revision": "01900000-0000-7000-8000-53c6eea90000",
"flavor": "trigger",
"code": "BJ-001",
"promotionId": "01900000-0000-7000-8000-3b80190a0000",
"startAt": "2027-01-31T00:00:00.000Z",
"endAt": "2027-01-31T00:00:00.000Z",
"totalUsesCap": 1
}
]
},
"extensions": {
"at": {
"callId": "01EXAMPLE-CALL-ID",
"version": {
"requested": null,
"serviced": {
"name": "genesis",
"number": 0
}
}
}
}
}Errors this call can answer
VALIDATION/INVALID— Something in the request is not valid. Retry: no. (VALIDATION)AUTHN/REQUIRED— Sign in to do this. Retry: no. (AUTHN)AUTHZ/FORBIDDEN— Your role does not allow this action. Retry: no. (AUTHZ)RATE_LIMIT/THROTTLED— Too many requests in a short time. Retry: yes. (RATE_LIMIT)