POST
Check a discount code
Company space For: Cashier and seller, Manager · Permission: discount_campaigns.validatecode Conditions
  • The code must be provided, and the customer, when given, must be one of the company’s customers.
  • Every line needs a 27-character stockable_id and stockable_unit_id, a base_quantity of at least 1 and a gross_ht_amount that is not negative and respects the currency decimals.
  • An unknown code is not an error: the answer is 200 with eligible false and the reason code_unknown.
Part of Run discount campaigns.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
code
string
required

Discount code to check, up to 64 characters. Required. The comparison ignores capitals and surrounding spaces.

Maximum string length: 64
customer_id
string | null

Customer the basket is for (27-character KSUID string), used for access, exclusion and per-customer limits. Must be a customer of the company. Optional.

lines
object[] | null

Lines of the basket to price. Optional; without lines, only the campaign rules that do not depend on amounts are checked.

Response

eligible
boolean
required
reasons
string
required
would_be
object | null
required