Skip to main content
POST
Spree Admin SDK

Authorizations

x-spree-api-key
string
header
required

Secret API key for admin access

Authorization
string
header
required

JWT token for admin user authentication

Headers

x-spree-api-key
string
required
Authorization
string
required

Path Parameters

order_id
string
required

Order prefixed ID

Body

application/json
label
string
required
Example:

"Customer appeasement"

value
string<decimal>
required

An amount in the order currency for a flat discount, or a percentage for a percent one.

Pattern: ^-?\d+(\.\d+)?$
Example:

"10.00"

value_type
enum<string>

Defaults to flat.

Available options:
flat,
percent
line_item_id
string | null

The line item the discount applies to. Omitted, the value is distributed across the line items.

Response

discount created