For AI agents: visit https://developers.deliverect.com/v3.0-ordering-experience/llms.txt for an index of all pages formatted in Markdown and endpoints in OpenAPI. Append .md to any documentation page URL to get its markdown version.
Validate one or more coupon codes for an order in a single request.
Format
To validate coupon eligibility and discount amounts, these are computed against the order content provided in the request, any changed content can be re-validated to confirm eligibility.
Each coupon code is validated independently, so any invalid or ineligible codes will not fail the whole request
There are two scenarios where validating coupons is reccomended;
When a customer enters a coupon code - check for eligibility and confirm the discount to apply to the order.
Whenever an order changes - with items added, removed, quantities updated, coupons need revalidated with the updated content.
Path Parameters
Path parameter
Type
Description
accountId
string
The Deliverect account id.
channelLinkId
string
The channel link id the order belongs to. The account, location and channel used for validation are all derived from this channel link.
Revalidating after the order changes
Whenever the customer's order mutates, re-validate by sending all the codes relevant to the order in codes — both any code the customer just entered and any code(s) already applied to the order from a previous validation — in a single call against the current order state. Then, for each result:
applicable: false → the code is no longer eligible for the current order (e.g. a PLU-scoped discount whose matching item was removed, or a minimum-spend coupon that no longer qualifies after items were removed). Un-apply it from the order and surface validationErrors to the customer.
applicable: true → re-apply the returned discounts as-is, replacing whatever was previously applied for that code. Don't reuse a previously computed amount: a percent_off discount's effective amount depends on the order total and an item-scoped discount's depend on which basket items are currently present — both can change even when the code itself remains valid.
Reconcile the order's totals using the fresh discount amounts from the latest call, not the amounts from any earlier validation. This keeps the customer from checking out with a stale discount amount, or one that no longer applies at all, after the order has changed since it was last validated.
Request body
Field
Type
Required
Description
sessionId
string
Yes
Client/session identifier for the checkout session the coupons are being validated for.
A fixed amount off, in the smallest currency unit.
percent_off
value (integer), maxAmount (integer)
A percentage off, in basis points (e.g. 2500 = 25%), capped at maxAmount.
Scope types
Discriminated by scope.type:
type
Fields
Description
order
—
The discount applies to the whole order.
item
itemIds (array of string)
The discount applies only to the specific basket item(s) matching this coupon's configured PLU(s), identified by the ids you passed in the request's order.items.
ValidationError object
Field
Type
Description
code
string
Machine-readable error code. See table below.
message
string
Human-readable explanation.
code
Meaning
coupon_not_found
No coupon exists for this code on the account.
max_uses_per_coupon_exceeded
The coupon has reached its maximum number of uses.
coupon_not_available_for_location
The coupon isn't configured for the order's location.
not_eligible_fulfillment_type
The coupon doesn't support the order's fulfillment type (delivery/pickup/eat-in).
coupon_not_valid_for_channel
The coupon isn't configured for the order's channel.
coupon_not_valid_for_channel_link
The coupon isn't configured for this specific channel link.