Required scopes: campaigns_read
Arguments
Forward pagination cursor — returns items after it. Pass an edges[].cursor or pageInfo.endCursor from a previous page.
Backward pagination cursor — returns items before it. Pass an edges[].cursor or pageInfo.startCursor from a previous page.
Only include the discount with this checkout code. Matching is case-insensitive.
Forward pagination: returns the first N items (max 100, default 25). Use with after; mutually exclusive with last/before.
Only include discounts with this code-generation strategy.
Only include amount-off, free-shipping, buy-X-get-Y, or dynamic-range discounts.
Backward pagination: returns the last N items (max 100, default 25). Use with before; mutually exclusive with first/after.
Which key to sort by (defaults to the first key, newest-first). Combine with reverse to flip direction.
Only include discounts hosted on this platform.
Case-insensitive substring match on the discount title or checkout code. At most 200 characters.
Reverses the sort direction selected by orderBy (or its default).
Returns
A paginated list of DiscountCode items.
The list of edges (each a node plus its pagination cursor).
Opaque cursor for this item; pass to after/before to page from here.
The item at this edge.
The code customers enter at checkout.
When the discount was created.
A short human-readable summary of what the code does.
When this code stops working.
The platform’s id for this discount (a Shopify GID or a BigCommerce promotion id).
Whether this is one fixed code or a unique code per customer.
The id of this discount code.
How the discount reduces the order. Null when the config has no settings type.
The discount’s legacy Mongo ObjectId (24-char hex) from before the CockroachDB migration.
The commerce platform that hosts this code.
How the discount reduces the order.
The merchant-facing name of the discount.
When the discount was last edited.
The nodes in this page, without the edge/cursor wrapper — a convenience over edges.
The code customers enter at checkout.
When the discount was created.
A short human-readable summary of what the code does.
When this code stops working.
The expiry instant when type is ON_DATE.
Days after creation when type is AFTER_DAYS.
Whether the code never expires, expires on a date, after a number of days, or on delivery.
The platform’s id for this discount (a Shopify GID or a BigCommerce promotion id).
Whether this is one fixed code or a unique code per customer.
The id of this discount code.
How the discount reduces the order. Null when the config has no settings type.
The discount’s legacy Mongo ObjectId (24-char hex) from before the CockroachDB migration.
The commerce platform that hosts this code.
How the discount reduces the order.
The merchant-facing name of the discount.
When the discount was last edited.
Pagination metadata for the current page.
Cursor of the last edge in this page; pass to after to page forward.
Whether more items exist after this page (drives forward pagination with first/after).
Whether more items exist before this page (drives backward pagination with last/before).
Cursor of the first edge in this page; pass to before to page backward.
Example