Completes the cart and finalizes the purchase. Returns an Order (not Cart).
import { createClient } from '@spree/sdk'
const client = createClient({
baseUrl: 'https://your-store.com',
publishableKey: '<api-key>',
})
const order = await client.carts.complete('cart_abc123', {
bearerToken: '<token>',
}){
"id": "or_UkLWZg9DAJ",
"number": "R148635323",
"email": "glenn@langosh.us",
"customer_note": null,
"currency": "USD",
"locale": "en",
"total_quantity": 1,
"item_total": "19.99",
"display_item_total": "$19.99",
"adjustment_total": "0.0",
"display_adjustment_total": "$0.00",
"discount_total": "0.0",
"display_discount_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",
"gift_card_total": "0.0",
"display_gift_card_total": "$0.00",
"amount_due": "0.0",
"display_amount_due": "$0.00",
"delivery_total": "10.0",
"display_delivery_total": "$10.00",
"fulfillment_status": "backorder",
"payment_status": "paid",
"completed_at": "2026-03-28T11:44:16.110Z",
"created_at": "2026-03-28T11:44:15.917Z",
"updated_at": "2026-03-28T11:44:16.110Z",
"store_credit_total": "0.0",
"display_store_credit_total": "$0.00",
"covered_by_store_credit": false,
"discounts": [],
"items": [
{
"id": "li_UkLWZg9DAJ",
"variant_id": "variant_UkLWZg9DAJ",
"quantity": 1,
"currency": "USD",
"name": "Product 113740",
"slug": "product-113740",
"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",
"discount_total": "0.0",
"display_discount_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",
"compare_at_amount": null,
"thumbnail_url": null,
"option_values": [],
"digital_links": []
}
],
"fulfillments": [
{
"id": "ful_gbHJdmfrXB",
"number": "H64114133913",
"tracking": null,
"tracking_url": null,
"cost": "10.0",
"display_cost": "$10.00",
"status": "pending",
"fulfillment_type": "shipping",
"fulfilled_at": null,
"items": [
{
"item_id": "li_UkLWZg9DAJ",
"variant_id": "variant_UkLWZg9DAJ",
"quantity": 1
}
],
"delivery_method": {
"id": "dm_UkLWZg9DAJ",
"name": "UPS Ground",
"code": "UPS_GROUND"
},
"stock_location": {
"id": "sloc_UkLWZg9DAJ",
"state_abbr": "STATE_ABBR_60",
"name": "Christa Jacobson",
"address1": "1600 Pennsylvania Ave NW",
"city": "Washington",
"zipcode": "20500",
"country_iso": "US",
"country_name": "United States of America",
"state_text": "STATE_ABBR_60"
},
"delivery_rates": [
{
"id": "dr_gbHJdmfrXB",
"delivery_method_id": "dm_UkLWZg9DAJ",
"name": "UPS Ground",
"selected": true,
"cost": "10.0",
"display_cost": "$10.00",
"delivery_method": {
"id": "dm_UkLWZg9DAJ",
"name": "UPS Ground",
"code": "UPS_GROUND"
}
}
]
}
],
"payments": [
{
"id": "py_UkLWZg9DAJ",
"payment_method_id": "pm_UkLWZg9DAJ",
"response_code": "12345",
"number": "P0S8EZON",
"amount": "29.99",
"display_amount": "$29.99",
"status": "completed",
"source_type": "credit_card",
"source_id": "card_UkLWZg9DAJ",
"source": {
"id": "card_UkLWZg9DAJ",
"brand": "visa",
"last4": "1111",
"month": 12,
"year": 2027,
"name": "Spree Commerce",
"default": false,
"gateway_payment_profile_id": null
},
"payment_method": {
"id": "pm_UkLWZg9DAJ",
"name": "Check",
"description": null,
"type": "Spree::PaymentMethod::Check",
"session_required": false
}
}
],
"billing_address": {
"id": "addr_EfhxLZ9ck8",
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"address1": "62 Lovely Street",
"address2": "Northwest",
"postal_code": "35005",
"city": "Herndon",
"phone": "555-555-0199",
"company": "Company",
"country_name": "United States of America",
"country_iso": "US",
"state_text": "STATE_ABBR_62",
"state_abbr": "STATE_ABBR_62",
"quick_checkout": false,
"is_default_billing": false,
"is_default_shipping": false,
"state_name": "STATE_NAME_62"
},
"shipping_address": {
"id": "addr_VqXmZF31wY",
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"address1": "63 Lovely Street",
"address2": "Northwest",
"postal_code": "35005",
"city": "Herndon",
"phone": "555-555-0199",
"company": "Company",
"country_name": "United States of America",
"country_iso": "US",
"state_text": "STATE_ABBR_63",
"state_abbr": "STATE_ABBR_63",
"quick_checkout": false,
"is_default_billing": false,
"is_default_shipping": false,
"state_name": "STATE_NAME_63"
},
"gift_card": null
}Publishable API key for store access
JWT token for authenticated customers
Cart prefixed ID
cart completed
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 { createClient } from '@spree/sdk'
const client = createClient({
baseUrl: 'https://your-store.com',
publishableKey: '<api-key>',
})
const order = await client.carts.complete('cart_abc123', {
bearerToken: '<token>',
}){
"id": "or_UkLWZg9DAJ",
"number": "R148635323",
"email": "glenn@langosh.us",
"customer_note": null,
"currency": "USD",
"locale": "en",
"total_quantity": 1,
"item_total": "19.99",
"display_item_total": "$19.99",
"adjustment_total": "0.0",
"display_adjustment_total": "$0.00",
"discount_total": "0.0",
"display_discount_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",
"gift_card_total": "0.0",
"display_gift_card_total": "$0.00",
"amount_due": "0.0",
"display_amount_due": "$0.00",
"delivery_total": "10.0",
"display_delivery_total": "$10.00",
"fulfillment_status": "backorder",
"payment_status": "paid",
"completed_at": "2026-03-28T11:44:16.110Z",
"created_at": "2026-03-28T11:44:15.917Z",
"updated_at": "2026-03-28T11:44:16.110Z",
"store_credit_total": "0.0",
"display_store_credit_total": "$0.00",
"covered_by_store_credit": false,
"discounts": [],
"items": [
{
"id": "li_UkLWZg9DAJ",
"variant_id": "variant_UkLWZg9DAJ",
"quantity": 1,
"currency": "USD",
"name": "Product 113740",
"slug": "product-113740",
"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",
"discount_total": "0.0",
"display_discount_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",
"compare_at_amount": null,
"thumbnail_url": null,
"option_values": [],
"digital_links": []
}
],
"fulfillments": [
{
"id": "ful_gbHJdmfrXB",
"number": "H64114133913",
"tracking": null,
"tracking_url": null,
"cost": "10.0",
"display_cost": "$10.00",
"status": "pending",
"fulfillment_type": "shipping",
"fulfilled_at": null,
"items": [
{
"item_id": "li_UkLWZg9DAJ",
"variant_id": "variant_UkLWZg9DAJ",
"quantity": 1
}
],
"delivery_method": {
"id": "dm_UkLWZg9DAJ",
"name": "UPS Ground",
"code": "UPS_GROUND"
},
"stock_location": {
"id": "sloc_UkLWZg9DAJ",
"state_abbr": "STATE_ABBR_60",
"name": "Christa Jacobson",
"address1": "1600 Pennsylvania Ave NW",
"city": "Washington",
"zipcode": "20500",
"country_iso": "US",
"country_name": "United States of America",
"state_text": "STATE_ABBR_60"
},
"delivery_rates": [
{
"id": "dr_gbHJdmfrXB",
"delivery_method_id": "dm_UkLWZg9DAJ",
"name": "UPS Ground",
"selected": true,
"cost": "10.0",
"display_cost": "$10.00",
"delivery_method": {
"id": "dm_UkLWZg9DAJ",
"name": "UPS Ground",
"code": "UPS_GROUND"
}
}
]
}
],
"payments": [
{
"id": "py_UkLWZg9DAJ",
"payment_method_id": "pm_UkLWZg9DAJ",
"response_code": "12345",
"number": "P0S8EZON",
"amount": "29.99",
"display_amount": "$29.99",
"status": "completed",
"source_type": "credit_card",
"source_id": "card_UkLWZg9DAJ",
"source": {
"id": "card_UkLWZg9DAJ",
"brand": "visa",
"last4": "1111",
"month": 12,
"year": 2027,
"name": "Spree Commerce",
"default": false,
"gateway_payment_profile_id": null
},
"payment_method": {
"id": "pm_UkLWZg9DAJ",
"name": "Check",
"description": null,
"type": "Spree::PaymentMethod::Check",
"session_required": false
}
}
],
"billing_address": {
"id": "addr_EfhxLZ9ck8",
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"address1": "62 Lovely Street",
"address2": "Northwest",
"postal_code": "35005",
"city": "Herndon",
"phone": "555-555-0199",
"company": "Company",
"country_name": "United States of America",
"country_iso": "US",
"state_text": "STATE_ABBR_62",
"state_abbr": "STATE_ABBR_62",
"quick_checkout": false,
"is_default_billing": false,
"is_default_shipping": false,
"state_name": "STATE_NAME_62"
},
"shipping_address": {
"id": "addr_VqXmZF31wY",
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"address1": "63 Lovely Street",
"address2": "Northwest",
"postal_code": "35005",
"city": "Herndon",
"phone": "555-555-0199",
"company": "Company",
"country_name": "United States of America",
"country_iso": "US",
"state_text": "STATE_ABBR_63",
"state_abbr": "STATE_ABBR_63",
"quick_checkout": false,
"is_default_billing": false,
"is_default_shipping": false,
"state_name": "STATE_NAME_63"
},
"gift_card": null
}