Skip to main content
POST
/
api
/
storefront
/
cart
/
{cart_id}
/
discounts
Apply Discount
curl --request POST \
  --url https://api.example.com/api/storefront/cart/{cart_id}/discounts \
  --header 'Content-Type: application/json' \
  --header 'X-Site-ID: <x-site-id>' \
  --data '
{
  "code": "<string>"
}
'
{
  "code": "<string>",
  "kind": "<string>",
  "amount_off": "<string>",
  "currency": "<string>",
  "allocations": [
    {
      "line_item_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "amount_off": "<string>"
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://docs.stella-commerce.com/llms.txt

Use this file to discover all available pages before exploring further.

Headers

X-Site-ID
string
required
X-Stella-Token
string | null

Path Parameters

cart_id
string<uuid>
required

Body

application/json
code
string
required
Required string length: 1 - 64

Response

Successful Response

Returned after a successful apply.

code
string
required
kind
string
required
amount_off
string
required
Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
currency
string
required
allocations
CartDiscountAllocation · object[]
required