Advances the order through all possible checkout states
import { createSpreeClient } from '@spree/sdk'
const client = createSpreeClient({
baseUrl: 'https://your-store.com',
publishableKey: '<api-key>',
})
const order = await client.store.orders.advance('or_abc123', {
bearerToken: '<token>',
}){
"id": "or_gbHJdmfrXB",
"number": "R123256863",
"state": "payment",
"checkout_steps": [
"address",
"delivery",
"payment",
"complete"
],
"token": "oaWv5PydqvEmHBMjEADN1R2CDMKcQKWC8WA",
"email": "mozella.will@bernhard.name",
"special_instructions": null,
"currency": "USD",
"locale": "en",
"item_count": 1,
"state_lock_version": 1,
"shipment_state": "backorder",
"payment_state": "balance_due",
"item_total": "19.99",
"display_item_total": "$19.99",
"ship_total": "10.0",
"display_ship_total": "$10.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-05T20:52:22.498Z",
"updated_at": "2026-03-05T20:52:22.735Z",
"order_promotions": [],
"line_items": [
{
"id": "li_gbHJdmfrXB",
"variant_id": "variant_gbHJdmfrXB",
"quantity": 1,
"currency": "USD",
"name": "Product 446300",
"slug": "product-446300",
"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-05T20:52:22.541Z",
"updated_at": "2026-03-05T20:52:22.661Z",
"compare_at_amount": null,
"thumbnail_url": null,
"option_values": [],
"digital_links": []
}
],
"shipments": [
{
"id": "ship_EfhxLZ9ck8",
"number": "H88829223762",
"state": "pending",
"tracking": null,
"tracking_url": null,
"cost": "10.0",
"display_cost": "$10.00",
"shipped_at": null,
"created_at": "2026-03-05T20:52:22.686Z",
"updated_at": "2026-03-05T20:52:22.703Z",
"shipping_method": {
"id": "shpm_UkLWZg9DAJ",
"name": "UPS Ground",
"code": "UPS_GROUND"
},
"stock_location": {
"id": "sloc_UkLWZg9DAJ",
"state_abbr": "STATE_ABBR_198",
"name": "Luz Howell",
"address1": "1600 Pennsylvania Ave NW",
"city": "Washington",
"zipcode": "20500",
"country_iso": "US",
"country_name": "United States of America",
"state_text": "STATE_ABBR_198"
},
"shipping_rates": [
{
"id": "shpr_EfhxLZ9ck8",
"shipping_method_id": "shpm_UkLWZg9DAJ",
"name": "UPS Ground",
"selected": true,
"cost": "10.0",
"display_cost": "$10.00",
"shipping_method": {
"id": "shpm_UkLWZg9DAJ",
"name": "UPS Ground",
"code": "UPS_GROUND"
}
},
{
"id": "shpr_VqXmZF31wY",
"shipping_method_id": "shpm_gbHJdmfrXB",
"name": "UPS Ground",
"selected": false,
"cost": "10.0",
"display_cost": "$10.00",
"shipping_method": {
"id": "shpm_gbHJdmfrXB",
"name": "UPS Ground",
"code": "UPS_GROUND"
}
}
]
}
],
"payments": [],
"bill_address": {
"id": "addr_uw2YK1rnl0",
"firstname": "John",
"lastname": "Doe",
"full_name": "John Doe",
"address1": "202 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_202",
"state_abbr": "STATE_ABBR_202",
"quick_checkout": false,
"state_name": "STATE_NAME_202"
},
"ship_address": {
"id": "addr_OIJLhNcSbf",
"firstname": "John",
"lastname": "Doe",
"full_name": "John Doe",
"address1": "203 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_203",
"state_abbr": "STATE_ABBR_203",
"quick_checkout": false,
"state_name": "STATE_NAME_203"
},
"payment_methods": []
}Publishable API key for store access
JWT token for authenticated customers
Unique key for request idempotency. Duplicate requests with the same key return the cached response.
order advanced
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?
import { createSpreeClient } from '@spree/sdk'
const client = createSpreeClient({
baseUrl: 'https://your-store.com',
publishableKey: '<api-key>',
})
const order = await client.store.orders.advance('or_abc123', {
bearerToken: '<token>',
}){
"id": "or_gbHJdmfrXB",
"number": "R123256863",
"state": "payment",
"checkout_steps": [
"address",
"delivery",
"payment",
"complete"
],
"token": "oaWv5PydqvEmHBMjEADN1R2CDMKcQKWC8WA",
"email": "mozella.will@bernhard.name",
"special_instructions": null,
"currency": "USD",
"locale": "en",
"item_count": 1,
"state_lock_version": 1,
"shipment_state": "backorder",
"payment_state": "balance_due",
"item_total": "19.99",
"display_item_total": "$19.99",
"ship_total": "10.0",
"display_ship_total": "$10.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-05T20:52:22.498Z",
"updated_at": "2026-03-05T20:52:22.735Z",
"order_promotions": [],
"line_items": [
{
"id": "li_gbHJdmfrXB",
"variant_id": "variant_gbHJdmfrXB",
"quantity": 1,
"currency": "USD",
"name": "Product 446300",
"slug": "product-446300",
"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-05T20:52:22.541Z",
"updated_at": "2026-03-05T20:52:22.661Z",
"compare_at_amount": null,
"thumbnail_url": null,
"option_values": [],
"digital_links": []
}
],
"shipments": [
{
"id": "ship_EfhxLZ9ck8",
"number": "H88829223762",
"state": "pending",
"tracking": null,
"tracking_url": null,
"cost": "10.0",
"display_cost": "$10.00",
"shipped_at": null,
"created_at": "2026-03-05T20:52:22.686Z",
"updated_at": "2026-03-05T20:52:22.703Z",
"shipping_method": {
"id": "shpm_UkLWZg9DAJ",
"name": "UPS Ground",
"code": "UPS_GROUND"
},
"stock_location": {
"id": "sloc_UkLWZg9DAJ",
"state_abbr": "STATE_ABBR_198",
"name": "Luz Howell",
"address1": "1600 Pennsylvania Ave NW",
"city": "Washington",
"zipcode": "20500",
"country_iso": "US",
"country_name": "United States of America",
"state_text": "STATE_ABBR_198"
},
"shipping_rates": [
{
"id": "shpr_EfhxLZ9ck8",
"shipping_method_id": "shpm_UkLWZg9DAJ",
"name": "UPS Ground",
"selected": true,
"cost": "10.0",
"display_cost": "$10.00",
"shipping_method": {
"id": "shpm_UkLWZg9DAJ",
"name": "UPS Ground",
"code": "UPS_GROUND"
}
},
{
"id": "shpr_VqXmZF31wY",
"shipping_method_id": "shpm_gbHJdmfrXB",
"name": "UPS Ground",
"selected": false,
"cost": "10.0",
"display_cost": "$10.00",
"shipping_method": {
"id": "shpm_gbHJdmfrXB",
"name": "UPS Ground",
"code": "UPS_GROUND"
}
}
]
}
],
"payments": [],
"bill_address": {
"id": "addr_uw2YK1rnl0",
"firstname": "John",
"lastname": "Doe",
"full_name": "John Doe",
"address1": "202 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_202",
"state_abbr": "STATE_ABBR_202",
"quick_checkout": false,
"state_name": "STATE_NAME_202"
},
"ship_address": {
"id": "addr_OIJLhNcSbf",
"firstname": "John",
"lastname": "Doe",
"full_name": "John Doe",
"address1": "203 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_203",
"state_abbr": "STATE_ABBR_203",
"quick_checkout": false,
"state_name": "STATE_NAME_203"
},
"payment_methods": []
}