Validate a coupon against a basket, per line (public)
Storefront cart entry. Every line is RE-PRICED server-side with the same rule as checkout — the client never sends a price — then the coupon is evaluated: scope (all / vendor / category incl. sub-categories / brand), minimum on the in-scope subtotal, percent with optional cap or fixed amount, global and per-shopper uses, channel pin, phone reservation. The discount is split per line in millimes. Nothing is reserved: POST /checkout with couponCode re-evaluates and consumes the use atomically.
Errors are HTTP 422 with a readable error.code: not_found (unknown, disabled, or reserved to another phone — no existence leak), expired, min_not_reached, not_applicable (out of scope, not yet active, other channel), already_used (global or per-shopper cap), phone_required (a once-per-shopper code with neither a customer token nor a phone), line_unavailable. The channel is resolved server-side like checkout (wildkard on the default marketplace), never from the body.
The marketplace is resolved from the host, never the body. A customer token (optional) counts the per-customer cap on that customer.
Auth: Public (customer Bearer JWT optional).
Authorizations
Jeton client obtenu par POST /auth/login (ou /auth/register), renouvelé par POST /auth/refresh.
Request Body
Responses
The code applies — per-line quote