Check a discount code against the current cart
const url = 'https://api-omni.linra.net/api/v1/scent/cart/discount-code/validate';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"code":"example","customerRef":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api-omni.linra.net/api/v1/scent/cart/discount-code/validate \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "code": "example", "customerRef": "example" }'Read-only — never consumes a use. Reports whether the code currently applies, plus the original/discount/discounted totals for display. This never changes what you are charged at order-create — codes are a pure display/reporting overlay on top of the price Linra computes (see the Discount Codes guide’s “how charging works” section).
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Optional per-customer cart selector (max 128 chars) — omit for the bare partner-level cart.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Case-insensitive.
Same value as the cart’s own customerRef — also the value a per-customer cap (if any) is checked against.
Examplegenerated
{ "code": "example", "customerRef": "example"}Responses
Section titled “Responses”The validation result (always 200 — an invalid code is reported via valid:false, not an error status).
object
object
object
One machine-readable reason when valid is false — see the Discount Codes guide for the full list (NOT_FOUND, INACTIVE, EXPIRED, CAP_REACHED, and others).
Your cart’s current VAT-inclusive total — populated even when invalid.
Null when invalid.
Null when invalid.
Null when invalid — same gating as discountAmount.
Null when invalid — same gating as discountedTotal.
Example
{ "state": "SUCCESS"}Too many requests — see the Rate limits guide. Retry after the Retry-After header (seconds).
The envelope every /api/v1 ERROR response uses. state carries the machine-readable error code (see the Errors guide).
object
Always null on an error response.
object
object
Example
{ "state": "NOT_FOUND_ORDER", "payload": null}Headers
Section titled “Headers”Seconds to wait before retrying.