Skip to main content
POST
/
api
/
v3
/
store
/
orders
/
{order_id}
/
line_items
Spree SDK
import { createSpreeClient } from '@spree/sdk'

const client = createSpreeClient({
  baseUrl: 'https://your-store.com',
  publishableKey: '<api-key>',
})

const order = await client.store.orders.lineItems.create('or_abc123', {
  variant_id: 'variant_abc123',
  quantity: 2,
}, {
  bearerToken: '<token>',
})
{
  "id": "or_UkLWZg9DAJ",
  "number": "R504722406",
  "state": "cart",
  "token": "QSj7Zxy1tQHMsEGp3qjDqqxmrFPL1eELjZk",
  "email": "shaunna@mohrcarter.info",
  "special_instructions": null,
  "currency": "USD",
  "locale": "en",
  "item_count": 2,
  "state_lock_version": 1,
  "shipment_state": null,
  "payment_state": null,
  "item_total": "29.99",
  "display_item_total": "$29.99",
  "ship_total": "0.0",
  "display_ship_total": "$0.00",
  "adjustment_total": "0.0",
  "display_adjustment_total": "$0.00",
  "promo_total": "0.0",
  "display_promo_total": "$0.00",
  "tax_total": "0.0",
  "display_tax_total": "$0.00",
  "included_tax_total": "0.0",
  "display_included_tax_total": "$0.00",
  "additional_tax_total": "0.0",
  "display_additional_tax_total": "$0.00",
  "total": "29.99",
  "display_total": "$29.99",
  "completed_at": null,
  "created_at": "2026-03-05T10:13:14.118Z",
  "updated_at": "2026-03-05T10:13:14.248Z",
  "order_promotions": [],
  "line_items": [
    {
      "id": "li_UkLWZg9DAJ",
      "variant_id": "variant_UkLWZg9DAJ",
      "quantity": 1,
      "currency": "USD",
      "name": "Product 235990",
      "slug": "product-235990",
      "options_text": "",
      "price": "10.0",
      "display_price": "$10.00",
      "total": "10.0",
      "display_total": "$10.00",
      "adjustment_total": "0.0",
      "display_adjustment_total": "$0.00",
      "additional_tax_total": "0.0",
      "display_additional_tax_total": "$0.00",
      "included_tax_total": "0.0",
      "display_included_tax_total": "$0.00",
      "promo_total": "0.0",
      "display_promo_total": "$0.00",
      "pre_tax_amount": "10.0",
      "display_pre_tax_amount": "$10.00",
      "discounted_amount": "10.0",
      "display_discounted_amount": "$10.00",
      "display_compare_at_amount": "$0.00",
      "created_at": "2026-03-05T10:13:14.152Z",
      "updated_at": "2026-03-05T10:13:14.152Z",
      "compare_at_amount": null,
      "thumbnail_url": null,
      "option_values": [],
      "digital_links": []
    },
    {
      "id": "li_gbHJdmfrXB",
      "variant_id": "variant_gbHJdmfrXB",
      "quantity": 1,
      "currency": "USD",
      "name": "Product 24677",
      "slug": "product-24677",
      "options_text": "",
      "price": "19.99",
      "display_price": "$19.99",
      "total": "19.99",
      "display_total": "$19.99",
      "adjustment_total": "0.0",
      "display_adjustment_total": "$0.00",
      "additional_tax_total": "0.0",
      "display_additional_tax_total": "$0.00",
      "included_tax_total": "0.0",
      "display_included_tax_total": "$0.00",
      "promo_total": "0.0",
      "display_promo_total": "$0.00",
      "pre_tax_amount": "19.99",
      "display_pre_tax_amount": "$19.99",
      "discounted_amount": "19.99",
      "display_discounted_amount": "$19.99",
      "display_compare_at_amount": "$0.00",
      "created_at": "2026-03-05T10:13:14.216Z",
      "updated_at": "2026-03-05T10:13:14.216Z",
      "compare_at_amount": null,
      "thumbnail_url": null,
      "option_values": [],
      "digital_links": []
    }
  ],
  "shipments": [],
  "payments": [],
  "bill_address": {
    "id": "addr_EfhxLZ9ck8",
    "firstname": "John",
    "lastname": "Doe",
    "full_name": "John Doe",
    "address1": "136 Lovely Street",
    "address2": "Northwest",
    "city": "Herndon",
    "zipcode": "35005",
    "phone": "555-555-0199",
    "company": "Company",
    "country_name": "United States of America",
    "country_iso": "US",
    "state_text": "STATE_ABBR_136",
    "state_abbr": "STATE_ABBR_136",
    "quick_checkout": false,
    "state_name": "STATE_NAME_136"
  },
  "ship_address": null,
  "payment_methods": []
}

Authorizations

x-spree-api-key
string
header
required

Publishable API key for store access

Authorization
string
header
required

JWT token for authenticated customers

Headers

x-spree-api-key
string
required
Authorization
string

Bearer token for authenticated customers

x-spree-order-token
string

Order token for guest access

Idempotency-Key
string

Unique key for request idempotency. Duplicate requests with the same key return the cached response.

Path Parameters

order_id
string
required

Order ID or number

Body

application/json
variant_id
string
required

Variant ID to add

Example:

"variant_abc123"

quantity
integer

Quantity to add (default: 1)

Example:

2

metadata
object

Arbitrary key-value metadata (stored, not returned in responses)

Example:
{ "gift_message": "Happy Birthday!" }

Response

item added with metadata

id
string
required
number
string
required
state
string
required
token
string
required
email
string | null
required
special_instructions
string | null
required
currency
string
required
locale
string | null
required
item_count
number
required
state_lock_version
number
required
shipment_state
string | null
required
payment_state
string | null
required
item_total
string
required
display_item_total
string
required
ship_total
string
required
display_ship_total
string
required
adjustment_total
string
required
display_adjustment_total
string
required
promo_total
string
required
display_promo_total
string
required
tax_total
string
required
display_tax_total
string
required
included_tax_total
string
required
display_included_tax_total
string
required
additional_tax_total
string
required
display_additional_tax_total
string
required
total
string
required
display_total
string
required
completed_at
string | null
required
created_at
string
required
updated_at
string
required
order_promotions
object[]
required
line_items
object[]
required
shipments
object[]
required
payments
object[]
required
bill_address
object
required
ship_address
object
required
payment_methods
object[]
required