Skip to content

Check a discount code against the current cart

POST
/api/v1/scent/cart/discount-code/validate
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).

customerRef
string
<= 128 characters

Optional per-customer cart selector (max 128 chars) — omit for the bare partner-level cart.

Media typeapplication/json
object
code
required

Case-insensitive.

string
<= 64 characters
customerRef

Same value as the cart’s own customerRef — also the value a per-customer cap (if any) is checked against.

string
nullable <= 128 characters
Examplegenerated
{
"code": "example",
"customerRef": "example"
}

The validation result (always 200 — an invalid code is reported via valid:false, not an error status).

Media typeapplication/json
object
state
required
string
payload
required
details
object
payload
required
object
valid
boolean
reason

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).

string
nullable
originalTotal

Your cart’s current VAT-inclusive total — populated even when invalid.

number format: decimal
discountAmount

Null when invalid.

number format: decimal
nullable
discountedTotal

Null when invalid.

number format: decimal
nullable
originalTotalDisplay
number
nullable
discountAmountDisplay

Null when invalid — same gating as discountAmount.

number
nullable
discountedTotalDisplay

Null when invalid — same gating as discountedTotal.

number
nullable
Example
{
"state": "SUCCESS"
}

Too many requests — see the Rate limits guide. Retry after the Retry-After header (seconds).

Media typeapplication/json

The envelope every /api/v1 ERROR response uses. state carries the machine-readable error code (see the Errors guide).

object
state
required
string
payload
required

Always null on an error response.

object
details
object
Example
{
"state": "NOT_FOUND_ORDER",
"payload": null
}
Retry-After
integer

Seconds to wait before retrying.