Spree SDK
import { createClient } from '@spree/sdk'
const client = createClient({
baseUrl: 'https://your-store.com',
publishableKey: '<api-key>',
})
const order = await client.carts.complete('cart_abc123', {
token: '<token>',
})curl --request POST \
--url http://{defaultHost}/api/v3/store/carts/{id}/complete \
--header 'Authorization: Bearer <token>' \
--header 'x-spree-api-key: <api-key>'{
"id": "or_UkLWZg9DAJ",
"market_id": "mkt_UkLWZg9DAJ",
"withdrawal_period_ends_at": null,
"within_withdrawal_period": true,
"cart_id": "cart_UkLWZg9DAJ",
"channel_id": "ch_UkLWZg9DAJ",
"company_id": null,
"company_name": null,
"po_document_filename": null,
"po_document_byte_size": null,
"number": "R1001",
"email": "marvel@bruen.com",
"customer_note": null,
"po_number": null,
"currency": "USD",
"locale": "en",
"total_quantity": 1,
"coupon_code": null,
"fulfillment_status": "backorder",
"payment_status": "paid",
"completed_at": "2026-01-15T12:00:00.000Z",
"item_total": "10.0",
"display_item_total": "$10.00",
"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": "20.0",
"display_total": "$20.00",
"gift_card_total": "0.0",
"display_gift_card_total": "$0.00",
"amount_due": "20.0",
"display_amount_due": "$20.00",
"delivery_total": "10.0",
"display_delivery_total": "$10.00",
"fee_total": "0.0",
"display_fee_total": "$0.00",
"store_credit_total": "0.0",
"display_store_credit_total": "$0.00",
"covered_by_store_credit": false,
"discounts": [],
"fees": [],
"items": [
{
"id": "li_gbHJdmfrXB",
"variant_id": "variant_UkLWZg9DAJ",
"seller_id": null,
"preorder": false,
"preorder_ships_at": null,
"quantity": 1,
"currency": "USD",
"name": "Product 2364794",
"slug": "product-2364794",
"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",
"discount_total": "0.0",
"display_discount_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",
"compare_at_amount": null,
"thumbnail_url": null,
"option_values": [],
"digital_links": []
}
],
"fulfillments": [
{
"id": "ful_gbHJdmfrXB",
"number": "R1001-F1",
"tracking": null,
"tracking_url": null,
"pickup_point_data": null,
"selected_delivery_rate_id": "dr_gbHJdmfrXB",
"unpriced": false,
"cost": "10.0",
"display_cost": "$10.00",
"total": "10.0",
"display_total": "$10.00",
"discount_total": "0.0",
"display_discount_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",
"tax_total": "0.0",
"display_tax_total": "$0.00",
"status": "unfulfilled",
"fulfillment_type": "shipping",
"fulfilled_at": null,
"delivered_at": null,
"items": [
{
"item_id": "li_gbHJdmfrXB",
"variant_id": "variant_UkLWZg9DAJ",
"quantity": 1
}
],
"deliveries": [],
"delivery_method": {
"id": "dm_UkLWZg9DAJ",
"name": "UPS Ground 113",
"code": "UPS_GROUND_130",
"estimated_transit_business_days_min": null,
"estimated_transit_business_days_max": null,
"digital": false,
"pickup": false,
"pickup_point": false
},
"stock_location": {
"id": "sloc_UkLWZg9DAJ",
"name": "Deangelo Prosacco",
"address1": "1600 Pennsylvania Ave NW",
"city": "Washington",
"zipcode": "20500",
"country_code": "US",
"country_name": "United States",
"state_code": "AL",
"state_text": "AL",
"pickup_ready_in_minutes": null,
"pickup_instructions": null
},
"delivery_rates": [
{
"id": "dr_gbHJdmfrXB",
"delivery_method_id": "dm_UkLWZg9DAJ",
"name": "UPS Ground 113",
"selected": true,
"cost": "10.0",
"total": "10.0",
"additional_tax_total": "0.0",
"included_tax_total": "0.0",
"tax_total": "0.0",
"carrier": null,
"service_level": null,
"estimated_delivery_date": null,
"unpriced": false,
"freight_summary": null,
"display_cost": "$10.00",
"display_total": "$10.00",
"display_additional_tax_total": "$0.00",
"display_included_tax_total": "$0.00",
"display_tax_total": "$0.00",
"delivery_method": {
"id": "dm_UkLWZg9DAJ",
"name": "UPS Ground 113",
"code": "UPS_GROUND_130",
"estimated_transit_business_days_min": null,
"estimated_transit_business_days_max": null,
"digital": false,
"pickup": false,
"pickup_point": false
}
}
]
}
],
"payments": [
{
"id": "py_UkLWZg9DAJ",
"payment_method_id": "pm_UkLWZg9DAJ",
"response_code": "BGS-518d4ef9738e",
"number": "R1001-P1",
"status": "completed",
"amount": "20.0",
"display_amount": "$20.00",
"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 5",
"description": null,
"type": "check",
"session_required": false,
"source_required": false
}
}
],
"billing_address": {
"id": "addr_uw2YK1rnl0",
"label": null,
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"address1": "260 Lovely Street",
"address2": "Northwest",
"postal_code": "10118",
"city": "New York",
"phone": "555-555-0199",
"company": "Company",
"country_name": "United States",
"country_code": "US",
"state_text": "NY",
"state_code": "NY",
"quick_checkout": false,
"is_default_billing": false,
"is_default_shipping": false,
"state_abbr": "NY",
"country_iso": "US",
"state_name": "New York"
},
"shipping_address": {
"id": "addr_OIJLhNcSbf",
"label": null,
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"address1": "259 Lovely Street",
"address2": "Northwest",
"postal_code": "10118",
"city": "New York",
"phone": "555-555-0199",
"company": "Company",
"country_name": "United States",
"country_code": "US",
"state_text": "NY",
"state_code": "NY",
"quick_checkout": false,
"is_default_billing": false,
"is_default_shipping": false,
"state_abbr": "NY",
"country_iso": "US",
"state_name": "New York"
},
"gift_card": null,
"market": {
"id": "mkt_UkLWZg9DAJ",
"name": "United States",
"currency": "USD",
"default_locale": "en",
"tax_inclusive": false,
"default": true,
"country_codes": [
"US"
],
"country_isos": [
"US"
],
"supported_locales": [
"en"
]
}
}{
"error": {
"code": "cart_cannot_complete",
"message": "{code: \"validation_failed\", errors: [{code: \"email_required\", step: \"address\", field: \"email\", message: \"Email address is required\"}, {code: \"delivery_method_required\", step: \"delivery\", field: \"delivery_method\", message: \"Select a delivery method for all fulfillments\"}, {code: \"payment_required\", step: \"payment\", field: \"payment\", message: \"Add a payment method\"}]}"
}
}Complete cart
Completes the cart and finalizes the purchase. Returns an Order (not Cart).
POST
/
api
/
v3
/
store
/
carts
/
{id}
/
complete
Spree SDK
import { createClient } from '@spree/sdk'
const client = createClient({
baseUrl: 'https://your-store.com',
publishableKey: '<api-key>',
})
const order = await client.carts.complete('cart_abc123', {
token: '<token>',
})curl --request POST \
--url http://{defaultHost}/api/v3/store/carts/{id}/complete \
--header 'Authorization: Bearer <token>' \
--header 'x-spree-api-key: <api-key>'{
"id": "or_UkLWZg9DAJ",
"market_id": "mkt_UkLWZg9DAJ",
"withdrawal_period_ends_at": null,
"within_withdrawal_period": true,
"cart_id": "cart_UkLWZg9DAJ",
"channel_id": "ch_UkLWZg9DAJ",
"company_id": null,
"company_name": null,
"po_document_filename": null,
"po_document_byte_size": null,
"number": "R1001",
"email": "marvel@bruen.com",
"customer_note": null,
"po_number": null,
"currency": "USD",
"locale": "en",
"total_quantity": 1,
"coupon_code": null,
"fulfillment_status": "backorder",
"payment_status": "paid",
"completed_at": "2026-01-15T12:00:00.000Z",
"item_total": "10.0",
"display_item_total": "$10.00",
"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": "20.0",
"display_total": "$20.00",
"gift_card_total": "0.0",
"display_gift_card_total": "$0.00",
"amount_due": "20.0",
"display_amount_due": "$20.00",
"delivery_total": "10.0",
"display_delivery_total": "$10.00",
"fee_total": "0.0",
"display_fee_total": "$0.00",
"store_credit_total": "0.0",
"display_store_credit_total": "$0.00",
"covered_by_store_credit": false,
"discounts": [],
"fees": [],
"items": [
{
"id": "li_gbHJdmfrXB",
"variant_id": "variant_UkLWZg9DAJ",
"seller_id": null,
"preorder": false,
"preorder_ships_at": null,
"quantity": 1,
"currency": "USD",
"name": "Product 2364794",
"slug": "product-2364794",
"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",
"discount_total": "0.0",
"display_discount_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",
"compare_at_amount": null,
"thumbnail_url": null,
"option_values": [],
"digital_links": []
}
],
"fulfillments": [
{
"id": "ful_gbHJdmfrXB",
"number": "R1001-F1",
"tracking": null,
"tracking_url": null,
"pickup_point_data": null,
"selected_delivery_rate_id": "dr_gbHJdmfrXB",
"unpriced": false,
"cost": "10.0",
"display_cost": "$10.00",
"total": "10.0",
"display_total": "$10.00",
"discount_total": "0.0",
"display_discount_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",
"tax_total": "0.0",
"display_tax_total": "$0.00",
"status": "unfulfilled",
"fulfillment_type": "shipping",
"fulfilled_at": null,
"delivered_at": null,
"items": [
{
"item_id": "li_gbHJdmfrXB",
"variant_id": "variant_UkLWZg9DAJ",
"quantity": 1
}
],
"deliveries": [],
"delivery_method": {
"id": "dm_UkLWZg9DAJ",
"name": "UPS Ground 113",
"code": "UPS_GROUND_130",
"estimated_transit_business_days_min": null,
"estimated_transit_business_days_max": null,
"digital": false,
"pickup": false,
"pickup_point": false
},
"stock_location": {
"id": "sloc_UkLWZg9DAJ",
"name": "Deangelo Prosacco",
"address1": "1600 Pennsylvania Ave NW",
"city": "Washington",
"zipcode": "20500",
"country_code": "US",
"country_name": "United States",
"state_code": "AL",
"state_text": "AL",
"pickup_ready_in_minutes": null,
"pickup_instructions": null
},
"delivery_rates": [
{
"id": "dr_gbHJdmfrXB",
"delivery_method_id": "dm_UkLWZg9DAJ",
"name": "UPS Ground 113",
"selected": true,
"cost": "10.0",
"total": "10.0",
"additional_tax_total": "0.0",
"included_tax_total": "0.0",
"tax_total": "0.0",
"carrier": null,
"service_level": null,
"estimated_delivery_date": null,
"unpriced": false,
"freight_summary": null,
"display_cost": "$10.00",
"display_total": "$10.00",
"display_additional_tax_total": "$0.00",
"display_included_tax_total": "$0.00",
"display_tax_total": "$0.00",
"delivery_method": {
"id": "dm_UkLWZg9DAJ",
"name": "UPS Ground 113",
"code": "UPS_GROUND_130",
"estimated_transit_business_days_min": null,
"estimated_transit_business_days_max": null,
"digital": false,
"pickup": false,
"pickup_point": false
}
}
]
}
],
"payments": [
{
"id": "py_UkLWZg9DAJ",
"payment_method_id": "pm_UkLWZg9DAJ",
"response_code": "BGS-518d4ef9738e",
"number": "R1001-P1",
"status": "completed",
"amount": "20.0",
"display_amount": "$20.00",
"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 5",
"description": null,
"type": "check",
"session_required": false,
"source_required": false
}
}
],
"billing_address": {
"id": "addr_uw2YK1rnl0",
"label": null,
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"address1": "260 Lovely Street",
"address2": "Northwest",
"postal_code": "10118",
"city": "New York",
"phone": "555-555-0199",
"company": "Company",
"country_name": "United States",
"country_code": "US",
"state_text": "NY",
"state_code": "NY",
"quick_checkout": false,
"is_default_billing": false,
"is_default_shipping": false,
"state_abbr": "NY",
"country_iso": "US",
"state_name": "New York"
},
"shipping_address": {
"id": "addr_OIJLhNcSbf",
"label": null,
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"address1": "259 Lovely Street",
"address2": "Northwest",
"postal_code": "10118",
"city": "New York",
"phone": "555-555-0199",
"company": "Company",
"country_name": "United States",
"country_code": "US",
"state_text": "NY",
"state_code": "NY",
"quick_checkout": false,
"is_default_billing": false,
"is_default_shipping": false,
"state_abbr": "NY",
"country_iso": "US",
"state_name": "New York"
},
"gift_card": null,
"market": {
"id": "mkt_UkLWZg9DAJ",
"name": "United States",
"currency": "USD",
"default_locale": "en",
"tax_inclusive": false,
"default": true,
"country_codes": [
"US"
],
"country_isos": [
"US"
],
"supported_locales": [
"en"
]
}
}{
"error": {
"code": "cart_cannot_complete",
"message": "{code: \"validation_failed\", errors: [{code: \"email_required\", step: \"address\", field: \"email\", message: \"Email address is required\"}, {code: \"delivery_method_required\", step: \"delivery\", field: \"delivery_method\", message: \"Select a delivery method for all fulfillments\"}, {code: \"payment_required\", step: \"payment\", field: \"payment\", message: \"Add a payment method\"}]}"
}
}Authorizations
Publishable API key for store access
JWT token for authenticated customers
Path Parameters
Cart prefixed ID
Response
cart completed
Available options:
backorder, canceled, partial, unfulfilled, fulfilled, delivered, pending, ready, shipped Available options:
none, authorized, partially_paid, paid, partially_refunded, refunded, overcharged, voided Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
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?
⌘I

