Validate discount code
Check a discount code against the current cart.
Cart
/api/v1/scent/cart/{customerRef}/discount-codes/validateRead-only — never consumes a use or changes any usage count. Resolves the cart identified
by the required customerRef path segment and reports whether the code currently applies
to it, plus the computed 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).
Path parameters
customerRefstringRequiredThe per-customer cart/registration selector this endpoint operates on (max 128 chars, URL-encoded) — every cart/wishlist/stock-notification endpoint carries it in the path (API Docs Review effort, Phase F/G, D29/R-CUSTOMERREF). Also the value a per-customer redemption cap, if any, is checked against.
Body parameters
codestringRequiredCase-insensitive.
Response
validbooleanreasonstring (enum)One machine-readable reason when valid is false — see the Discount Codes guide for what each means. Null when valid is true.
totals.originalTotalnumber (decimal)Your cart’s current goods value including VAT — excludes the order-level shipping fee. Populated even when invalid.
totals.discountAmountnumber (decimal)Null when invalid.
totals.discountedTotalnumber (decimal)originalTotal minus discountAmount. Null when invalid.
totals.displayobjectPresent only when you requested a supported non-SAR display currency via X-Partner-Currency (the same additive display-currency pattern used everywhere else in the API) — omitted otherwise.
Other responses
401No bearer token (UNAUTHORIZED_MISSING_TOKEN), an invalid token (UNAUTHORIZED_INVALID_TOKEN) or an expired one (UNAUTHORIZED_TOKEN_EXPIRED — mint a new token). UPSTREAM_AUTH_FAILED is different: a dependent service refused the Gateway itself. That is a server-side fault — retry later and do NOT re-mint your token. See the Errors guide.403The route is not available to your credential (FORBIDDEN).404No API route matches this path (NOT_FOUND_ROUTE). A missing resource on a real route returns that service’s own NOT_FOUND_* code instead.415The request body is not sent as application/json (UNSUPPORTED_MEDIA_TYPE).429Too many requests — see the Rate limits guide. Retry after the Retry-After header (seconds).502A dependent service returned an invalid response (BAD_GATEWAY). Retry with backoff.503The service is temporarily unavailable (SERVICE_UNAVAILABLE). Retry with backoff.504A dependent service did not respond in time (GATEWAY_TIMEOUT). Retry with backoff.curl --request POST \ --url https://api-omni.linra.net/api/v1/scent/cart/value/discount-codes/validate \ --header 'Authorization: Bearer $TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "code": "string" }'const res = await fetch('https://api-omni.linra.net/api/v1/scent/cart/value/discount-codes/validate', { method: 'POST', headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ code: 'string' }),});const { payload } = await res.json();var response = await httpClient.PostAsJsonAsync( "https://api-omni.linra.net/api/v1/scent/cart/value/discount-codes/validate", new { code = "string" });
var envelope = await response.Content.ReadFromJsonAsync<ApiResponse<DiscountCodeValidationResponse>>();Response
{ "state": "SUCCESS", "payload": { "valid": true, "reason": "EMPTY_CART", "totals": { "originalTotal": 0, "discountAmount": 0, "discountedTotal": 0, "display": { "originalTotal": 0, "discountAmount": 0, "discountedTotal": 0 } } }, "details": null}
