Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Gracefully handle cart completion in Carts API (#13772)

Damian Legawiec295c55866cec
diff --git a/docs/api-reference/store-api/errors.mdx b/docs/api-reference/store-api/errors.mdx
index aaf5bcff58..8d9908a426 100644
--- a/docs/api-reference/store-api/errors.mdx
+++ b/docs/api-reference/store-api/errors.mdx
@@ -85,7 +85,7 @@ Validation errors include an additional `details` field with per-field error mes
| Code | Status | Description |
|------|--------|-------------|
| `cart_not_found` | 404 | Cart doesn't exist or doesn't belong to the current user/guest |
-| `cart_already_completed` | 422 | Cannot modify a cart that has already been completed |
+| `cart_cannot_complete` | 422 | Cart cannot be completed (e.g., missing payment or address) |
| `cart_cannot_transition` | 422 | Internal state machine transition failed (e.g., completing a cart that isn't ready) |
| `cart_empty` | 422 | Cart has no line items |
| `cart_invalid_state` | 422 | Cart is in an invalid state for this operation |
@@ -254,10 +254,6 @@ try {
case 'variant_not_found':
showNotification('This product is no longer available');
break;
- case 'cart_already_completed':
- // Cart was already checked out — create a new one
- await createNewCart();
- break;
default:
showNotification(error.message);
}
diff --git a/docs/api-reference/store.yaml b/docs/api-reference/store.yaml
index 216adca1a4..c8f7771f3a 100644
--- a/docs/api-reference/store.yaml
+++ b/docs/api-reference/store.yaml
@@ -661,16 +661,16 @@ paths:
content:
application/json:
example:
- token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImp0aSI6Ijc5MjE2MDdmLTJiMzYtNGFhZi04MzM2LTBhMDExNDNhNDExNCIsImlzcyI6InNwcmVlIiwiYXVkIjoic3RvcmVfYXBpIiwiZXhwIjoxNzczNDAyODAxfQ.24eRQQE9XB_xMaY6aCQ5z6Dz95vMV6oOSLmed8bz2Ww
+ token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImp0aSI6IjAwNTcxZWNiLTYyYmQtNGQ3Ni1iNDUxLTk0MTJmYmU3NDZiZCIsImlzcyI6InNwcmVlIiwiYXVkIjoic3RvcmVfYXBpIiwiZXhwIjoxNzczNDExNjYzfQ.U0J-BFqzSLcYAN1TB-OXwLVV4tORyWxlmEYphCop3gA
user:
id: cus_UkLWZg9DAJ
- first_name: Cindie
- last_name: Lockman
+ first_name: Bridget
+ last_name: Monahan
phone:
accepts_email_marketing: false
- created_at: '2026-03-13T10:53:21.357Z'
- updated_at: '2026-03-13T10:53:21.357Z'
+ created_at: '2026-03-13T13:21:03.567Z'
+ updated_at: '2026-03-13T13:21:03.567Z'
addresses: []
default_billing_address:
default_shipping_address:
@@ -747,16 +747,16 @@ paths:
content:
application/json:
example:
- token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImp0aSI6IjBkMDllNThhLThmNGItNGE2ZC05MDY1LTVmMmNjNDhjYmIyNSIsImlzcyI6InNwcmVlIiwiYXVkIjoic3RvcmVfYXBpIiwiZXhwIjoxNzczNDAyODAyfQ.XfI6XfHYLtAKqqvOCV8Ig0CqhxoF-jm-l1Bb_pxCl-s
+ token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImp0aSI6ImNjY2EzYTVmLTEzZWMtNDk3Mi05MTU1LWEwOGVhZTQ3ZjAzMyIsImlzcyI6InNwcmVlIiwiYXVkIjoic3RvcmVfYXBpIiwiZXhwIjoxNzczNDExNjY0fQ.hoJNlCD_ZK4ILNfVUT441Gc2rdZtFRuAyzXXnGTnEhs
user:
id: cus_UkLWZg9DAJ
- first_name: Gerardo
- last_name: Lind
+ first_name: Tad
+ last_name: Oberbrunner
phone:
accepts_email_marketing: false
- created_at: '2026-03-13T10:53:22.724Z'
- updated_at: '2026-03-13T10:53:22.724Z'
+ created_at: '2026-03-13T13:21:04.921Z'
+ updated_at: '2026-03-13T13:21:04.921Z'
addresses: []
default_billing_address:
default_shipping_address:
@@ -814,9 +814,9 @@ paths:
example:
data:
- id: cart_gbHJdmfrXB
- number: R225562932
- token: GSFPkqUTWbf5b8qjoxsXRXAi6EDphCV4LQX
+ number: R194031828
+ token: sHscmM8PQHRueCo4JEYG1WPZpCyqcMnHvRt
special_instructions:
currency: USD
locale: en
@@ -837,8 +837,8 @@ paths:
display_additional_tax_total: "$0.00"
total: '110.0'
display_total: "$110.00"
- created_at: '2026-03-13T10:53:23.458Z'
- updated_at: '2026-03-13T10:53:23.511Z'
+ created_at: '2026-03-13T13:21:05.630Z'
+ updated_at: '2026-03-13T13:21:05.674Z'
current_step: address
completed_steps: []
requirements:
@@ -851,8 +851,8 @@ paths:
variant_id: variant_gbHJdmfrXB
quantity: 1
currency: USD
- name: Product 28768
- slug: product-28768
+ name: Product 24428
+ slug: product-24428
options_text: ''
price: '10.0'
display_price: "$10.00"
@@ -871,23 +871,23 @@ paths:
discounted_amount: '10.0'
display_discounted_amount: "$10.00"
display_compare_at_amount: "$0.00"
- created_at: '2026-03-13T10:53:23.489Z'
- updated_at: '2026-03-13T10:53:23.489Z'
+ created_at: '2026-03-13T13:21:05.656Z'
+ updated_at: '2026-03-13T13:21:05.656Z'
compare_at_amount:
thumbnail_url:
option_values: []
digital_links: []
shipments:
- id: ship_gbHJdmfrXB
- number: H00671914240
+ number: H10059463813
state: pending
tracking: U10000
tracking_url:
cost: '100.0'
display_cost: "$100.00"
shipped_at:
- created_at: '2026-03-13T10:53:23.497Z'
- updated_at: '2026-03-13T10:53:23.508Z'
+ created_at: '2026-03-13T13:21:05.663Z'
+ updated_at: '2026-03-13T13:21:05.672Z'
shipping_method:
id: shpm_gbHJdmfrXB
name: UPS Ground
@@ -895,7 +895,7 @@ paths:
stock_location:
id: sloc_UkLWZg9DAJ
state_abbr: STATE_ABBR_37
- name: Tonisha Buckridge
+ name: Lakendra Kuhic
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
@@ -950,9 +950,9 @@ paths:
state_name: STATE_NAME_42
payment_methods: []
- id: cart_UkLWZg9DAJ
- number: R729014327
- token: 7B3ktRBFwv9vxim3gcvp3GKr6ZAJquptw6d
+ number: R647029618
+ token: cNy8Chg1zgewJZJFgDnB7McHDs52ufsgquv
special_instructions:
currency: USD
locale: en
@@ -973,8 +973,8 @@ paths:
display_additional_tax_total: "$0.00"
total: '110.0'
display_total: "$110.00"
- created_at: '2026-03-13T10:53:23.311Z'
- updated_at: '2026-03-13T10:53:23.451Z'
+ created_at: '2026-03-13T13:21:05.477Z'
+ updated_at: '2026-03-13T13:21:05.625Z'
current_step: address
completed_steps: []
requirements:
@@ -987,8 +987,8 @@ paths:
variant_id: variant_UkLWZg9DAJ
quantity: 1
currency: USD
- name: Product 12324
- slug: product-12324
+ name: Product 12727
+ slug: product-12727
options_text: ''
price: '10.0'
display_price: "$10.00"
@@ -1007,23 +1007,23 @@ paths:
discounted_amount: '10.0'
display_discounted_amount: "$10.00"
display_compare_at_amount: "$0.00"
- created_at: '2026-03-13T10:53:23.380Z'
- updated_at: '2026-03-13T10:53:23.380Z'
+ created_at: '2026-03-13T13:21:05.567Z'
+ updated_at: '2026-03-13T13:21:05.567Z'
compare_at_amount:
thumbnail_url:
option_values: []
digital_links: []
shipments:
- id: ship_UkLWZg9DAJ
- number: H94118725017
+ number: H66582748732
state: pending
tracking: U10000
tracking_url:
cost: '100.0'
display_cost: "$100.00"
shipped_at:
- created_at: '2026-03-13T10:53:23.395Z'
- updated_at: '2026-03-13T10:53:23.446Z'
+ created_at: '2026-03-13T13:21:05.583Z'
+ updated_at: '2026-03-13T13:21:05.621Z'
shipping_method:
id: shpm_UkLWZg9DAJ
name: UPS Ground
@@ -1031,7 +1031,7 @@ paths:
stock_location:
id: sloc_UkLWZg9DAJ
state_abbr: STATE_ABBR_37
- name: Tonisha Buckridge
+ name: Lakendra Kuhic
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
@@ -1159,8 +1159,8 @@ paths:
application/json:
example:
id: cart_UkLWZg9DAJ
- number: R663575791
- token: kt8wusHEzcm2h6uhvRweV6Qc7xSsRN5sAcY
+ number: R150042985
+ token: RX5k4MQCQ3FWumvA3dYpKYWwPfWKowf2ndX
email:
special_instructions:
currency: USD
@@ -1182,8 +1182,8 @@ paths:
display_additional_tax_total: "$0.00"
total: '0.0'
display_total: "$0.00"
- created_at: '2026-03-13T10:53:23.970Z'
- updated_at: '2026-03-13T10:53:23.970Z'
+ created_at: '2026-03-13T13:21:06.188Z'
+ updated_at: '2026-03-13T13:21:06.188Z'
current_step: address
completed_steps: []
requirements:
@@ -1290,9 +1290,9 @@ paths:
application/json:
example:
id: cart_UkLWZg9DAJ
- number: R653795125
- token: rhmmHTrYL6tNkhbmFZqm3BNwtLF4fL7UeTr
+ number: R251834326
+ token: huGoDXVzxPrUnMbr1J71cmzYMtvbdarN2ag
special_instructions:
currency: USD
locale: en
@@ -1313,8 +1313,8 @@ paths:
display_additional_tax_total: "$0.00"
total: '110.0'
display_total: "$110.00"
- created_at: '2026-03-13T10:53:24.249Z'
- updated_at: '2026-03-13T10:53:24.305Z'
+ created_at: '2026-03-13T13:21:06.462Z'
+ updated_at: '2026-03-13T13:21:06.507Z'
current_step: address
completed_steps: []
requirements:
@@ -1327,8 +1327,8 @@ paths:
variant_id: variant_UkLWZg9DAJ
quantity: 1
currency: USD
- name: Product 52397
- slug: product-52397
+ name: Product 53889
+ slug: product-53889
options_text: ''
price: '10.0'
display_price: "$10.00"
@@ -1347,23 +1347,23 @@ paths:
discounted_amount: '10.0'
display_discounted_amount: "$10.00"
display_compare_at_amount: "$0.00"
- created_at: '2026-03-13T10:53:24.281Z'
- updated_at: '2026-03-13T10:53:24.281Z'
+ created_at: '2026-03-13T13:21:06.488Z'
+ updated_at: '2026-03-13T13:21:06.488Z'
compare_at_amount:
thumbnail_url:
option_values: []
digital_links: []
shipments:
- id: ship_UkLWZg9DAJ
- number: H01911063812
+ number: H34714733825
state: pending
tracking: U10000
tracking_url:
cost: '100.0'
display_cost: "$100.00"
shipped_at:
- created_at: '2026-03-13T10:53:24.287Z'
- updated_at: '2026-03-13T10:53:24.302Z'
+ created_at: '2026-03-13T13:21:06.493Z'
+ updated_at: '2026-03-13T13:21:06.505Z'
shipping_method:
id: shpm_UkLWZg9DAJ
name: UPS Ground
@@ -1371,7 +1371,7 @@ paths:
stock_location:
id: sloc_UkLWZg9DAJ
state_abbr: STATE_ABBR_47
- name: Mattie Goldner
+ name: Junko Hoppe
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
@@ -1506,9 +1506,9 @@ paths:
application/json:
example:
id: cart_UkLWZg9DAJ
- number: R649255363
- token: aMmhj5bJ8KU9u6tqre7iTPUGuNoUXXDXxwd
+ number: R682773628
+ token: syPcDnJ9wmzkHAMTfoyDPrVmJ2WfYDPKjJy
special_instructions: Leave at door
currency: USD
locale: en
@@ -1529,8 +1529,8 @@ paths:
display_additional_tax_total: "$0.00"
total: '29.99'
display_total: "$29.99"
- created_at: '2026-03-13T10:53:24.887Z'
- updated_at: '2026-03-13T10:53:25.037Z'
+ created_at: '2026-03-13T13:21:07.077Z'
+ updated_at: '2026-03-13T13:21:07.194Z'
current_step: payment
completed_steps:
- address
@@ -1545,8 +1545,8 @@ paths:
variant_id: variant_UkLWZg9DAJ
quantity: 1
currency: USD
- name: Product 69203
- slug: product-69203
+ name: Product 63492
+ slug: product-63492
options_text: ''
price: '19.99'
display_price: "$19.99"
@@ -1565,23 +1565,23 @@ paths:
discounted_amount: '19.99'
display_discounted_amount: "$19.99"
display_compare_at_amount: "$0.00"
- created_at: '2026-03-13T10:53:24.914Z'
- updated_at: '2026-03-13T10:53:24.984Z'
+ created_at: '2026-03-13T13:21:07.103Z'
+ updated_at: '2026-03-13T13:21:07.155Z'
compare_at_amount:
thumbnail_url:
option_values: []
digital_links: []
shipments:
- id: ship_gbHJdmfrXB
- number: H66584744530
+ number: H34187027622
state: pending
tracking:
tracking_url:
cost: '10.0'
display_cost: "$10.00"
shipped_at:
- created_at: '2026-03-13T10:53:25.005Z'
- updated_at: '2026-03-13T10:53:25.020Z'
+ created_at: '2026-03-13T13:21:07.170Z'
+ updated_at: '2026-03-13T13:21:07.181Z'
shipping_method:
id: shpm_UkLWZg9DAJ
name: UPS Ground
@@ -1589,7 +1589,7 @@ paths:
stock_location:
id: sloc_UkLWZg9DAJ
state_abbr: STATE_ABBR_49
- name: Charline Corkery
+ name: Reina Wyman
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
@@ -1811,9 +1811,9 @@ paths:
application/json:
example:
id: cart_UkLWZg9DAJ
- number: R380993870
- token: QePbYFDKav4JpkUPNqwz6eMvmMkgQhyQiZX
+ number: R578197857
+ token: fmJR2omwuHJsU73xbVa7KLQ3unN7K4nijox
special_instructions:
currency: USD
locale: en
@@ -1834,8 +1834,8 @@ paths:
display_additional_tax_total: "$0.00"
total: '110.0'
display_total: "$110.00"
- created_at: '2026-03-13T10:53:25.692Z'
- updated_at: '2026-03-13T10:53:25.750Z'
+ created_at: '2026-03-13T13:21:07.849Z'
+ updated_at: '2026-03-13T13:21:07.892Z'
current_step: address
completed_steps: []
requirements:
@@ -1848,8 +1848,8 @@ paths:
variant_id: variant_UkLWZg9DAJ
quantity: 1
currency: USD
- name: Product 85068
- slug: product-85068
+ name: Product 89039
+ slug: product-89039
options_text: ''
price: '10.0'
display_price: "$10.00"
@@ -1868,23 +1868,23 @@ paths:
discounted_amount: '10.0'
display_discounted_amount: "$10.00"
display_compare_at_amount: "$0.00"
- created_at: '2026-03-13T10:53:25.722Z'
- updated_at: '2026-03-13T10:53:25.722Z'
+ created_at: '2026-03-13T13:21:07.874Z'
+ updated_at: '2026-03-13T13:21:07.874Z'
compare_at_amount:
thumbnail_url:
option_values: []
digital_links: []
shipments:
- id: ship_UkLWZg9DAJ
- number: H27925173096
+ number: H25082741006
state: pending
tracking: U10000
tracking_url:
cost: '100.0'
display_cost: "$100.00"
shipped_at:
- created_at: '2026-03-13T10:53:25.727Z'
- updated_at: '2026-03-13T10:53:25.745Z'
+ created_at: '2026-03-13T13:21:07.879Z'
+ updated_at: '2026-03-13T13:21:07.890Z'
shipping_method:
id: shpm_UkLWZg9DAJ
name: UPS Ground
@@ -1892,7 +1892,7 @@ paths:
stock_location:
id: sloc_UkLWZg9DAJ
state_abbr: STATE_ABBR_57
- name: Cristy Deckow
+ name: Jonell Dibbert
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
@@ -2011,8 +2011,8 @@ paths:
application/json:
example:
id: or_UkLWZg9DAJ
- number: R549828527
+ number: R407488498
special_instructions:
currency: USD
locale: en
@@ -2035,17 +2035,17 @@ paths:
display_additional_tax_total: "$0.00"
total: '29.99'
display_total: "$29.99"
- completed_at: '2026-03-13T10:53:27.193Z'
- created_at: '2026-03-13T10:53:26.982Z'
- updated_at: '2026-03-13T10:53:27.193Z'
+ completed_at: '2026-03-13T13:21:09.257Z'
+ created_at: '2026-03-13T13:21:09.030Z'
+ updated_at: '2026-03-13T13:21:09.257Z'
promotions: []
items:
- id: li_UkLWZg9DAJ
variant_id: variant_UkLWZg9DAJ
quantity: 1
currency: USD
- name: Product 104377
- slug: product-104377
+ name: Product 105978
+ slug: product-105978
options_text: ''
price: '19.99'
display_price: "$19.99"
@@ -2064,23 +2064,23 @@ paths:
discounted_amount: '19.99'
display_discounted_amount: "$19.99"
display_compare_at_amount: "$0.00"
- created_at: '2026-03-13T10:53:27.014Z'
- updated_at: '2026-03-13T10:53:27.064Z'
+ created_at: '2026-03-13T13:21:09.055Z'
+ updated_at: '2026-03-13T13:21:09.097Z'
compare_at_amount:
thumbnail_url:
option_values: []
digital_links: []
shipments:
- id: ship_gbHJdmfrXB
- number: H93700831239
+ number: H92081014808
state: pending
tracking:
tracking_url:
cost: '10.0'
display_cost: "$10.00"
shipped_at:
- created_at: '2026-03-13T10:53:27.077Z'
- updated_at: '2026-03-13T10:53:27.187Z'
+ created_at: '2026-03-13T13:21:09.123Z'
+ updated_at: '2026-03-13T13:21:09.251Z'
shipping_method:
id: shpm_UkLWZg9DAJ
name: UPS Ground
@@ -2088,7 +2088,7 @@ paths:
stock_location:
id: sloc_UkLWZg9DAJ
state_abbr: STATE_ABBR_63
- name: Sommer Hilll
+ name: Chante Treutel
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
@@ -2111,11 +2111,11 @@ paths:
payment_method_id: pm_UkLWZg9DAJ
state: completed
response_code: '12345'
- number: PCTKFQCI
+ number: P934Q2WO
amount: '29.99'
display_amount: "$29.99"
- created_at: '2026-03-13T10:53:27.147Z'
- updated_at: '2026-03-13T10:53:27.174Z'
+ created_at: '2026-03-13T13:21:09.211Z'
+ updated_at: '2026-03-13T13:21:09.238Z'
source_type: credit_card
source_id: card_UkLWZg9DAJ
source:
@@ -2175,7 +2175,7 @@ paths:
application/json:
example:
error:
- code: cart_already_completed
+ code: cart_cannot_complete
message: No payment found
schema:
"$ref": "#/components/schemas/ErrorResponse"
@@ -2247,8 +2247,8 @@ paths:
meta_description:
meta_keywords:
children_count: 1
- created_at: '2026-03-13T10:53:27.924Z'
- updated_at: '2026-03-13T10:53:27.976Z'
+ created_at: '2026-03-13T13:21:09.944Z'
+ updated_at: '2026-03-13T13:21:09.998Z'
parent_id:
description: ''
description_html: ''
@@ -2266,8 +2266,8 @@ paths:
meta_description:
meta_keywords:
children_count: 1
- created_at: '2026-03-13T10:53:27.931Z'
- updated_at: '2026-03-13T10:53:27.975Z'
+ created_at: '2026-03-13T13:21:09.954Z'
+ updated_at: '2026-03-13T13:21:09.998Z'
parent_id: ctg_UkLWZg9DAJ
description: ''
description_html: ''
@@ -2285,8 +2285,8 @@ paths:
meta_description:
meta_keywords:
children_count: 0
- created_at: '2026-03-13T10:53:27.941Z'
- updated_at: '2026-03-13T10:53:27.948Z'
+ created_at: '2026-03-13T13:21:09.964Z'
+ updated_at: '2026-03-13T13:21:09.969Z'
parent_id: ctg_gbHJdmfrXB
description: ''
description_html: ''
@@ -2387,8 +2387,8 @@ paths:
meta_description:
meta_keywords:
children_count: 1
- created_at: '2026-03-13T10:53:28.311Z'
- updated_at: '2026-03-13T10:53:28.347Z'
+ created_at: '2026-03-13T13:21:10.352Z'
+ updated_at: '2026-03-13T13:21:10.384Z'
parent_id: ctg_UkLWZg9DAJ
description: ''
description_html: ''
@@ -2515,17 +2515,20 @@ paths:
example:
data:
- id: prod_UkLWZg9DAJ
- name: Product 194794
+ name: Product 196920
description: |-
- Rem dolor laboriosam vel repellendus cupiditate impedit. Corporis velit aspernatur temporibus ex. Dolores dicta deserunt beatae repellendus atque. Omnis debitis blanditiis cumque autem inventore distinctio. Ipsa earum sunt qui similique.
- Sint fuga iusto dicta non molestias repellat odit. Quia repellat quis veniam est fugit nihil. Quam nemo voluptates nostrum molestiae.
- slug: product-194794
+ Doloribus optio voluptas ratione veniam quisquam. Autem asperiores id itaque dolore. Iste rem officia fugiat corporis dolores libero architecto asperiores.
+ Quam placeat labore voluptatem inventore dignissimos atque adipisci fugiat. Doloribus autem quo neque exercitationem earum molestiae. Blanditiis modi dicta esse iusto cupiditate velit fuga exercitationem. Labore fugiat iusto in sequi dolorum nemo atque delectus. Incidunt sed adipisci nobis aliquid voluptas.
+ Accusantium distinctio nostrum harum ipsum quo eius corrupti. Sunt facere similique consequuntur officia dolorum. Itaque odio facere maiores provident asperiores. Minima iusto soluta aliquid quis velit blanditiis necessitatibus. Dolorum ipsa unde omnis quaerat.
+ Tenetur sapiente facere non quo doloremque animi suscipit. Fugit est ducimus esse accusamus excepturi sint expedita. Inventore fugit quos optio labore. Eum sit voluptatum quas veniam ut quaerat excepturi laudantium. Aperiam velit non enim soluta impedit.
+ Soluta dolorum possimus placeat asperiores. Eaque neque quod ipsum ducimus quaerat voluptate modi. Eius incidunt sit dignissimos mollitia.
+ slug: product-196920
meta_description:
meta_keywords:
variant_count: 0
- available_on: '2025-03-13T10:53:28.786Z'
- created_at: '2026-03-13T10:53:28.800Z'
- updated_at: '2026-03-13T10:53:28.815Z'
+ available_on: '2025-03-13T13:21:10.789Z'
+ created_at: '2026-03-13T13:21:10.804Z'
+ updated_at: '2026-03-13T13:21:10.817Z'
purchasable: true
in_stock: false
backorderable: true
@@ -2795,9 +2798,9 @@ paths:
application/json:
example:
id: cart_UkLWZg9DAJ
- number: R473422016
- token: f7SSah883rNjSyij3HF6JrGPBx4FuD5Gtid
+ number: R040292129
+ token: He9gx8vMbT5pV9ikJxSgZ5mAF8XgFNEvq1A
special_instructions:
currency: USD
locale: en
@@ -2818,8 +2821,8 @@ paths:
display_additional_tax_total: "$0.00"
total: '110.0'
display_total: "$110.00"
- created_at: '2026-03-13T10:53:30.644Z'
- updated_at: '2026-03-13T10:53:30.749Z'
+ created_at: '2026-03-13T13:21:12.564Z'
+ updated_at: '2026-03-13T13:21:12.654Z'
current_step: address
completed_steps: []
requirements: []
@@ -2829,8 +2832,8 @@ paths:
variant_id: variant_UkLWZg9DAJ
quantity: 1
currency: USD
- name: Product 239969
- slug: product-239969
+ name: Product 23937
+ slug: product-23937
options_text: ''
price: '10.0'
display_price: "$10.00"
@@ -2849,23 +2852,23 @@ paths:
discounted_amount: '10.0'
display_discounted_amount: "$10.00"
display_compare_at_amount: "$0.00"
- created_at: '2026-03-13T10:53:30.670Z'
- updated_at: '2026-03-13T10:53:30.670Z'
+ created_at: '2026-03-13T13:21:12.591Z'
+ updated_at: '2026-03-13T13:21:12.591Z'
compare_at_amount:
thumbnail_url:
option_values: []
digital_links: []
shipments:
- id: ship_UkLWZg9DAJ
- number: H43709142175
+ number: H38039362532
state: pending
tracking: U10000
tracking_url:
cost: '100.0'
display_cost: "$100.00"
shipped_at:
- created_at: '2026-03-13T10:53:30.675Z'
- updated_at: '2026-03-13T10:53:30.688Z'
+ created_at: '2026-03-13T13:21:12.596Z'
+ updated_at: '2026-03-13T13:21:12.608Z'
shipping_method:
id: shpm_UkLWZg9DAJ
name: UPS Ground
@@ -2873,7 +2876,7 @@ paths:
stock_location:
id: sloc_UkLWZg9DAJ
state_abbr: STATE_ABBR_85
- name: Mikel Cassin
+ name: Tari Kuhn
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
@@ -2895,12 +2898,12 @@ paths:
- id: py_UkLWZg9DAJ
payment_method_id: pm_UkLWZg9DAJ
state: checkout
- response_code: 1-SC-20260313105330740941
- number: PCRIEH05
+ response_code: 1-SC-20260313132112648182
+ number: PZEHJYWD
amount: '50.0'
display_amount: "$50.00"
- created_at: '2026-03-13T10:53:30.743Z'
- updated_at: '2026-03-13T10:53:30.743Z'
+ created_at: '2026-03-13T13:21:12.649Z'
+ updated_at: '2026-03-13T13:21:12.649Z'
source_type: store_credit
source_id: credit_UkLWZg9DAJ
source:
@@ -3043,9 +3046,9 @@ paths:
application/json:
example:
id: cart_UkLWZg9DAJ
- number: R152972004
- token: Zom2xk6V5brXSLW3PuW6wouEqZPRngtaM3x
+ number: R862449861
+ token: dETVM3kH24DZZpY3SUWSGxaREf2DFpHQhYj
special_instructions:
currency: USD
locale: en
@@ -3066,8 +3069,8 @@ paths:
display_additional_tax_total: "$0.00"
total: '110.0'
display_total: "$110.00"
- created_at: '2026-03-13T10:53:31.922Z'
- updated_at: '2026-03-13T10:53:32.029Z'
+ created_at: '2026-03-13T13:21:13.817Z'
+ updated_at: '2026-03-13T13:21:13.912Z'
current_step: address
completed_steps: []
requirements:
@@ -3080,8 +3083,8 @@ paths:
variant_id: variant_UkLWZg9DAJ
quantity: 1
currency: USD
- name: Product 257387
- slug: product-257387
+ name: Product 255306
+ slug: product-255306
options_text: ''
price: '10.0'
display_price: "$10.00"
@@ -3100,23 +3103,23 @@ paths:
discounted_amount: '10.0'
display_discounted_amount: "$10.00"
display_compare_at_amount: "$0.00"
- created_at: '2026-03-13T10:53:31.951Z'
- updated_at: '2026-03-13T10:53:32.023Z'
+ created_at: '2026-03-13T13:21:13.845Z'
+ updated_at: '2026-03-13T13:21:13.907Z'
compare_at_amount:
thumbnail_url:
option_values: []
digital_links: []
shipments:
- id: ship_UkLWZg9DAJ
- number: H91587073653
+ number: H42733531071
state: pending
tracking: U10000
tracking_url:
cost: '100.0'
display_cost: "$100.00"
shipped_at:
- created_at: '2026-03-13T10:53:31.957Z'
- updated_at: '2026-03-13T10:53:31.971Z'
+ created_at: '2026-03-13T13:21:13.849Z'
+ updated_at: '2026-03-13T13:21:13.861Z'
shipping_method:
id: shpm_UkLWZg9DAJ
name: UPS Ground
@@ -3124,7 +3127,7 @@ paths:
stock_location:
id: sloc_UkLWZg9DAJ
state_abbr: STATE_ABBR_93
- name: Evelyne Zulauf
+ name: Shante Parisian
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
@@ -3516,8 +3519,8 @@ paths:
example:
data:
- id: or_UkLWZg9DAJ
- number: R925925425
+ number: R076106998
special_instructions:
currency: USD
locale: en
@@ -3540,17 +3543,17 @@ paths:
display_additional_tax_total: "$0.00"
total: '110.0'
display_total: "$110.00"
- completed_at: '2026-03-13T10:53:36.696Z'
- created_at: '2026-03-13T10:53:36.596Z'
- updated_at: '2026-03-13T10:53:36.696Z'
+ completed_at: '2026-03-13T13:21:18.430Z'
+ created_at: '2026-03-13T13:21:18.386Z'
+ updated_at: '2026-03-13T13:21:18.430Z'
promotions: []
items:
- id: li_UkLWZg9DAJ
variant_id: variant_UkLWZg9DAJ
quantity: 1
currency: USD
- name: Product 2713
- slug: product-2713
+ name: Product 277849
+ slug: product-277849
options_text: ''
price: '10.0'
display_price: "$10.00"
@@ -3569,23 +3572,23 @@ paths:
discounted_amount: '10.0'
display_discounted_amount: "$10.00"
display_compare_at_amount: "$0.00"
- created_at: '2026-03-13T10:53:36.653Z'
- updated_at: '2026-03-13T10:53:36.653Z'
+ created_at: '2026-03-13T13:21:18.411Z'
+ updated_at: '2026-03-13T13:21:18.411Z'
compare_at_amount:
thumbnail_url:
option_values: []
digital_links: []
shipments:
- id: ship_UkLWZg9DAJ
- number: H77126100403
+ number: H34713708304
state: pending
tracking: U10000
tracking_url:
cost: '100.0'
display_cost: "$100.00"
shipped_at:
- created_at: '2026-03-13T10:53:36.664Z'
- updated_at: '2026-03-13T10:53:36.692Z'
+ created_at: '2026-03-13T13:21:18.416Z'
+ updated_at: '2026-03-13T13:21:18.428Z'
shipping_method:
id: shpm_UkLWZg9DAJ
name: UPS Ground
@@ -3593,7 +3596,7 @@ paths:
stock_location:
id: sloc_UkLWZg9DAJ
state_abbr: STATE_ABBR_113
- name: Patti Langworth
+ name: Verline Ziemann
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
@@ -3713,8 +3716,8 @@ paths:
application/json:
example:
id: or_UkLWZg9DAJ
- number: R085960061
+ number: R933833301
special_instructions:
currency: USD
locale: en
@@ -3737,17 +3740,17 @@ paths:
display_additional_tax_total: "$0.00"
total: '110.0'
display_total: "$110.00"
- completed_at: '2026-03-13T10:53:37.406Z'
- created_at: '2026-03-13T10:53:37.355Z'
- updated_at: '2026-03-13T10:53:37.406Z'
+ completed_at: '2026-03-13T13:21:19.106Z'
+ created_at: '2026-03-13T13:21:19.062Z'
+ updated_at: '2026-03-13T13:21:19.106Z'
promotions: []
items:
- id: li_UkLWZg9DAJ
variant_id: variant_UkLWZg9DAJ
quantity: 1
currency: USD
- name: Product 2943
- slug: product-2943
+ name: Product 294225
+ slug: product-294225
options_text: ''
price: '10.0'
display_price: "$10.00"
@@ -3766,23 +3769,23 @@ paths:
discounted_amount: '10.0'
display_discounted_amount: "$10.00"
display_compare_at_amount: "$0.00"
- created_at: '2026-03-13T10:53:37.384Z'
- updated_at: '2026-03-13T10:53:37.384Z'
+ created_at: '2026-03-13T13:21:19.088Z'
+ updated_at: '2026-03-13T13:21:19.088Z'
compare_at_amount:
thumbnail_url:
option_values: []
digital_links: []
shipments:
- id: ship_UkLWZg9DAJ
- number: H57096957541
+ number: H04363751482
state: pending
tracking: U10000
tracking_url:
cost: '100.0'
display_cost: "$100.00"
shipped_at:
- created_at: '2026-03-13T10:53:37.389Z'
- updated_at: '2026-03-13T10:53:37.404Z'
+ created_at: '2026-03-13T13:21:19.092Z'
+ updated_at: '2026-03-13T13:21:19.104Z'
shipping_method:
id: shpm_UkLWZg9DAJ
name: UPS Ground
@@ -3790,7 +3793,7 @@ paths:
stock_location:
id: sloc_UkLWZg9DAJ
state_abbr: STATE_ABBR_119
- name: Marvin Funk
+ name: Lisa Klein
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
@@ -3896,7 +3899,7 @@ paths:
content:
application/json:
example:
- token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImp0aSI6ImMwNTBkYWI4LWQxNGMtNGRjMi1hYzYyLWJjNTI5OTlmOTA1NyIsImlzcyI6InNwcmVlIiwiYXVkIjoic3RvcmVfYXBpIiwiZXhwIjoxNzczNDAyODE4fQ.La66qT4qQPNuswQDSRTfgVhpsJyBdO1gEHCd1pqM-n4
+ token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImp0aSI6IjAzZmJlMGNiLTdkYjktNDY3ZS04Y2Y2LTQxZDNlNmU1NjExNSIsImlzcyI6InNwcmVlIiwiYXVkIjoic3RvcmVfYXBpIiwiZXhwIjoxNzczNDExNjgwfQ.bFdiMDIP7T7Qrr2p2aELskwIO4lUfaTgqHBMYgDF7Ko
user:
id: cus_UkLWZg9DAJ
@@ -3904,8 +3907,8 @@ paths:
last_name: Doe
phone: "+1234567890"
accepts_email_marketing: true
- created_at: '2026-03-13T10:53:38.584Z'
- updated_at: '2026-03-13T10:53:38.584Z'
+ created_at: '2026-03-13T13:21:20.268Z'
+ updated_at: '2026-03-13T13:21:20.268Z'
addresses: []
default_billing_address:
default_shipping_address:
@@ -4009,13 +4012,13 @@ paths:
application/json:
example:
id: cus_UkLWZg9DAJ
- first_name: Albert
- last_name: Lynch
+ first_name: Darcey
+ last_name: Gleichner
phone: 555-555-0199
accepts_email_marketing: false
- created_at: '2026-03-13T10:53:39.128Z'
- updated_at: '2026-03-13T10:53:39.396Z'
+ created_at: '2026-03-13T13:21:20.819Z'
+ updated_at: '2026-03-13T13:21:21.085Z'
addresses:
- id: addr_gbHJdmfrXB
firstname: John
@@ -4139,13 +4142,13 @@ paths:
application/json:
example:
id: cus_UkLWZg9DAJ
first_name: Updated
last_name: Name
phone: 555-555-0199
accepts_email_marketing: false
- created_at: '2026-03-13T10:53:39.690Z'
- updated_at: '2026-03-13T10:53:39.972Z'
+ created_at: '2026-03-13T13:21:21.372Z'
+ updated_at: '2026-03-13T13:21:21.648Z'
addresses:
- id: addr_gbHJdmfrXB
firstname: John
@@ -4369,7 +4372,7 @@ paths:
example:
data:
- id: gc_UkLWZg9DAJ
- code: 741011ADA83424F9
+ code: 22365A5081A193DC
state: active
currency: USD
amount: '10.0'
@@ -4383,8 +4386,8 @@ paths:
redeemed_at:
expired: false
active: true
- created_at: '2026-03-13T10:53:43.044Z'
- updated_at: '2026-03-13T10:53:43.044Z'
+ created_at: '2026-03-13T13:21:24.650Z'
+ updated_at: '2026-03-13T13:21:24.650Z'
meta:
page: 1
limit: 25
@@ -4467,7 +4470,7 @@ paths:
application/json:
example:
id: gc_UkLWZg9DAJ
- code: 27A26F8AF471EDB4
+ code: A0FBB3022A8B673A
state: active
currency: USD
amount: '10.0'
@@ -4481,8 +4484,8 @@ paths:
redeemed_at:
expired: false
active: true
- created_at: '2026-03-13T10:53:44.126Z'
- updated_at: '2026-03-13T10:53:44.126Z'
+ created_at: '2026-03-13T13:21:25.764Z'
+ updated_at: '2026-03-13T13:21:25.764Z'
schema:
"$ref": "#/components/schemas/GiftCard"
'404':
@@ -4559,9 +4562,9 @@ paths:
application/json:
example:
id: cart_UkLWZg9DAJ
- number: R520651117
- token: ictwbFtBrVp7cKXFFFaWzhAc7gT8PioXv2z
+ number: R699842518
+ token: H5coEmtKEyoCkJEgUi1wSnRaHdebgLXeXhp
special_instructions:
currency: USD
locale: en
@@ -4582,8 +4585,8 @@ paths:
display_additional_tax_total: "$0.00"
total: '29.99'
display_total: "$29.99"
- created_at: '2026-03-13T10:53:45.870Z'
- updated_at: '2026-03-13T10:53:45.985Z'
+ created_at: '2026-03-13T13:21:27.529Z'
+ updated_at: '2026-03-13T13:21:27.622Z'
current_step: address
completed_steps: []
requirements:
@@ -4602,8 +4605,8 @@ paths:
variant_id: variant_UkLWZg9DAJ
quantity: 1
currency: USD
- name: Product 391667
- slug: product-391667
+ name: Product 398702
+ slug: product-398702
options_text: ''
price: '10.0'
display_price: "$10.00"
@@ -4622,8 +4625,8 @@ paths:
discounted_amount: '10.0'
display_discounted_amount: "$10.00"
display_compare_at_amount: "$0.00"
- created_at: '2026-03-13T10:53:45.910Z'
- updated_at: '2026-03-13T10:53:45.910Z'
+ created_at: '2026-03-13T13:21:27.561Z'
+ updated_at: '2026-03-13T13:21:27.561Z'
compare_at_amount:
thumbnail_url:
option_values: []
@@ -4632,8 +4635,8 @@ paths:
variant_id: variant_gbHJdmfrXB
quantity: 1
currency: USD
- name: Product 409634
- slug: product-409634
+ name: Product 409042
+ slug: product-409042
options_text: ''
price: '19.99'
display_price: "$19.99"
@@ -4652,8 +4655,8 @@ paths:
discounted_amount: '19.99'
display_discounted_amount: "$19.99"
display_compare_at_amount: "$0.00"
- created_at: '2026-03-13T10:53:45.959Z'
- updated_at: '2026-03-13T10:53:45.959Z'
+ created_at: '2026-03-13T13:21:27.602Z'
+ updated_at: '2026-03-13T13:21:27.602Z'
compare_at_amount:
thumbnail_url:
option_values: []
@@ -4773,9 +4776,9 @@ paths:
application/json:
example:
id: cart_UkLWZg9DAJ
- number: R355187117
- token: P96jb41bg7g6gRPrZ8wDntby1LKYEpNfznw
+ number: R024060063
+ token: RbvDoZVLo8Dupvhs2KiLHcsQLYijfBwMABG
special_instructions:
currency: USD
locale: en
@@ -4796,8 +4799,8 @@ paths:
display_additional_tax_total: "$0.00"
total: '0.0'
display_total: "$0.00"
- created_at: '2026-03-13T10:53:47.764Z'
- updated_at: '2026-03-13T10:53:47.798Z'
+ created_at: '2026-03-13T13:21:29.364Z'
+ updated_at: '2026-03-13T13:21:29.391Z'
current_step: address
completed_steps: []
requirements:
@@ -4813,8 +4816,8 @@ paths:
variant_id: variant_UkLWZg9DAJ
quantity: 1
currency: USD
- name: Product 433446
- slug: product-433446
+ name: Product 439289
+ slug: product-439289
options_text: ''
price: '10.0'
display_price: "$10.00"
@@ -4833,8 +4836,8 @@ paths:
discounted_amount: '10.0'
display_discounted_amount: "$10.00"
display_compare_at_amount: "$0.00"
- created_at: '2026-03-13T10:53:47.797Z'
- updated_at: '2026-03-13T10:53:47.815Z'
+ created_at: '2026-03-13T13:21:29.391Z'
+ updated_at: '2026-03-13T13:21:29.406Z'
compare_at_amount:
thumbnail_url:
option_values: []
@@ -4934,9 +4937,9 @@ paths:
application/json:
example:
id: cart_UkLWZg9DAJ
- number: R214734034
- token: RF2oMDC3BiH96UZyyQ6tGJpybkGN49AJBDS
+ number: R731372091
+ token: a4Cm7DywhFEdTBdH2VhbrieuR1AU5bQwTXb
special_instructions:
currency: USD
locale: en
@@ -4957,8 +4960,8 @@ paths:
display_additional_tax_total: "$0.00"
total: '0.0'
display_total: "$0.00"
- created_at: '2026-03-13T10:53:48.386Z'
- updated_at: '2026-03-13T10:53:48.451Z'
+ created_at: '2026-03-13T13:21:29.949Z'
+ updated_at: '2026-03-13T13:21:30.000Z'
current_step: address
completed_steps: []
requirements:
@@ -5510,7 +5513,7 @@ paths:
application/json:
example:
id: or_UkLWZg9DAJ
- number: R517298683
+ number: R677424154
special_instructions:
currency: USD
@@ -5534,17 +5537,17 @@ paths:
display_additional_tax_total: "$0.00"
total: '110.0'
display_total: "$110.00"
- completed_at: '2026-03-13T10:53:50.370Z'
- created_at: '2026-03-13T10:53:50.309Z'
- updated_at: '2026-03-13T10:53:50.370Z'
+ completed_at: '2026-03-13T13:21:31.708Z'
+ created_at: '2026-03-13T13:21:31.661Z'
+ updated_at: '2026-03-13T13:21:31.707Z'
promotions: []
items:
- id: li_UkLWZg9DAJ
variant_id: variant_UkLWZg9DAJ
quantity: 1
currency: USD
- name: Product 474977
- slug: product-474977
+ name: Product 476008
+ slug: product-476008
options_text: ''
price: '10.0'
display_price: "$10.00"
@@ -5563,23 +5566,23 @@ paths:
discounted_amount: '10.0'
display_discounted_amount: "$10.00"
display_compare_at_amount: "$0.00"
- created_at: '2026-03-13T10:53:50.346Z'
- updated_at: '2026-03-13T10:53:50.346Z'
+ created_at: '2026-03-13T13:21:31.689Z'
+ updated_at: '2026-03-13T13:21:31.689Z'
compare_at_amount:
thumbnail_url:
option_values: []
digital_links: []
shipments:
- id: ship_UkLWZg9DAJ
- number: H22253242565
+ number: H05832068772
state: pending
tracking: U10000
tracking_url:
cost: '100.0'
display_cost: "$100.00"
shipped_at:
- created_at: '2026-03-13T10:53:50.352Z'
- updated_at: '2026-03-13T10:53:50.368Z'
+ created_at: '2026-03-13T13:21:31.693Z'
+ updated_at: '2026-03-13T13:21:31.706Z'
shipping_method:
id: shpm_UkLWZg9DAJ
name: UPS Ground
@@ -5587,7 +5590,7 @@ paths:
stock_location:
id: sloc_UkLWZg9DAJ
state_abbr: STATE_ABBR_178
- name: Myesha Erdman
+ name: Kina Hilpert
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
@@ -5792,13 +5795,13 @@ paths:
id: ps_gbHJdmfrXB
status: pending
currency: USD
- external_id: bogus_c1526626d193bf755f2ef14e
+ external_id: bogus_d67b5c07bff7cdf650e215fd
external_data:
- client_secret: bogus_secret_0a06a81f9e706212
+ client_secret: bogus_secret_634d05a921d1ece1
customer_external_id:
expires_at:
- created_at: '2026-03-13T10:53:52.916Z'
- updated_at: '2026-03-13T10:53:52.916Z'
+ created_at: '2026-03-13T13:21:34.113Z'
+ updated_at: '2026-03-13T13:21:34.113Z'
amount: '110.0'
payment_method_id: pm_UkLWZg9DAJ
order_id: or_UkLWZg9DAJ
@@ -5893,13 +5896,13 @@ paths:
id: ps_UkLWZg9DAJ
status: pending
currency: USD
- external_id: bogus_6dbb9758c4b189b1d5c7ffe7
+ external_id: bogus_64576a8fec060ad0cc7411b3
external_data:
client_secret: secret_123
customer_external_id:
expires_at:
- created_at: '2026-03-13T10:53:53.546Z'
- updated_at: '2026-03-13T10:53:53.546Z'
+ created_at: '2026-03-13T13:21:34.708Z'
+ updated_at: '2026-03-13T13:21:34.708Z'
amount: '110.0'
payment_method_id: pm_UkLWZg9DAJ
order_id: or_UkLWZg9DAJ
@@ -5956,13 +5959,13 @@ paths:
id: ps_UkLWZg9DAJ
status: pending
currency: USD
- external_id: bogus_ee4d9dc3663d5385214c77fc
+ external_id: bogus_c1ef0c0f51eb4329b72d06ac
external_data:
client_secret: secret_123
customer_external_id:
expires_at:
- created_at: '2026-03-13T10:53:54.828Z'
- updated_at: '2026-03-13T10:53:54.843Z'
+ created_at: '2026-03-13T13:21:36.043Z'
+ updated_at: '2026-03-13T13:21:36.056Z'
amount: '50.0'
payment_method_id: pm_UkLWZg9DAJ
order_id: or_UkLWZg9DAJ
@@ -6059,13 +6062,13 @@ paths:
id: ps_UkLWZg9DAJ
status: completed
currency: USD
- external_id: bogus_90ce9dc0139afabe92818af3
+ external_id: bogus_963ea6aad5fc1e8e28cafc53
external_data:
client_secret: secret_123
customer_external_id:
expires_at:
- created_at: '2026-03-13T10:53:55.487Z'
- updated_at: '2026-03-13T10:53:55.502Z'
+ created_at: '2026-03-13T13:21:36.647Z'
+ updated_at: '2026-03-13T13:21:36.659Z'
amount: '110.0'
payment_method_id: pm_UkLWZg9DAJ
order_id: or_UkLWZg9DAJ
@@ -6145,11 +6148,11 @@ paths:
example:
id: pss_gbHJdmfrXB
status: pending
- external_id: bogus_seti_78ca1ac9bf6720645f9a7484
- external_client_secret: bogus_seti_secret_f902125b47dd802b
+ external_id: bogus_seti_037e7344b6c9d46b6fb1da78
+ external_client_secret: bogus_seti_secret_733e3a63a5c2f02e
external_data: {}
- created_at: '2026-03-13T10:53:56.726Z'
- updated_at: '2026-03-13T10:53:56.726Z'
+ created_at: '2026-03-13T13:21:37.880Z'
+ updated_at: '2026-03-13T13:21:37.880Z'
payment_method_id: pm_UkLWZg9DAJ
payment_source_id:
payment_source_type:
@@ -6246,12 +6249,12 @@ paths:
example:
id: pss_UkLWZg9DAJ
status: pending
- external_id: seti_test_85ffddc05333ec2cb73a4646
- external_client_secret: seti_secret_86eb6c07702ac25be489938e
+ external_id: seti_test_84a3c4192c8b459ac83ab5a0
+ external_client_secret: seti_secret_2f916dce76c86ac5b5fd0737
external_data:
client_secret: secret_123
- created_at: '2026-03-13T10:53:58.480Z'
- updated_at: '2026-03-13T10:53:58.480Z'
+ created_at: '2026-03-13T13:21:39.502Z'
+ updated_at: '2026-03-13T13:21:39.502Z'
payment_method_id: pm_UkLWZg9DAJ
payment_source_id:
payment_source_type:
@@ -6324,12 +6327,12 @@ paths:
example:
id: pss_UkLWZg9DAJ
status: completed
- external_id: seti_test_726b12d2d5ebd64957c77302
- external_client_secret: seti_secret_6d0f807178eb775a1bb28ff1
+ external_id: seti_test_bda76724663a5c773cefc43e
+ external_client_secret: seti_secret_df879275fcfcee1521b84767
external_data:
client_secret: secret_123
- created_at: '2026-03-13T10:53:59.661Z'
- updated_at: '2026-03-13T10:53:59.678Z'
+ created_at: '2026-03-13T13:21:40.600Z'
+ updated_at: '2026-03-13T13:21:40.616Z'
payment_method_id: pm_UkLWZg9DAJ
payment_source_id: card_UkLWZg9DAJ
payment_source_type: Spree::CreditCard
@@ -6417,11 +6420,11 @@ paths:
payment_method_id: pm_UkLWZg9DAJ
state: checkout
response_code: '12345'
- number: PAPIG76R
+ number: PEOHBCTD
amount: '110.0'
display_amount: "$110.00"
- created_at: '2026-03-13T10:54:00.902Z'
- updated_at: '2026-03-13T10:54:00.902Z'
+ created_at: '2026-03-13T13:21:41.769Z'
+ updated_at: '2026-03-13T13:21:41.769Z'
source_type: credit_card
source_id: card_UkLWZg9DAJ
source:
@@ -6508,11 +6511,11 @@ paths:
payment_method_id: pm_UkLWZg9DAJ
state: checkout
response_code:
- number: PDIN151Y
+ number: PNV26FB9
amount: '110.0'
display_amount: "$110.00"
- created_at: '2026-03-13T10:54:01.561Z'
- updated_at: '2026-03-13T10:54:01.561Z'
+ created_at: '2026-03-13T13:21:42.385Z'
+ updated_at: '2026-03-13T13:21:42.385Z'
source_type:
source_id:
source:
@@ -6669,18 +6672,20 @@ paths:
example:
data:
- id: prod_UkLWZg9DAJ
- name: Product 592545
+ name: Product 59677
description: |-
- Sint ratione neque velit numquam deleniti perspiciatis. Quis nesciunt ut consequuntur quam explicabo. Hic nulla cupiditate illo sint recusandae odio. Pariatur ducimus culpa debitis nihil impedit reprehenderit. Ad accusantium autem quibusdam possimus atque.
- Fugiat assumenda perferendis modi reiciendis velit dolorem. Architecto error fuga quia molestiae aspernatur. Aperiam tempora at fuga ea similique nobis sit doloremque.
- Officiis laborum et voluptas reiciendis dolor incidunt. Suscipit repudiandae quod quidem excepturi laborum voluptatem. Placeat corporis rem vitae non corrupti.
- slug: product-592545
+ Ipsam accusantium quae quibusdam expedita accusamus. Dolorum a vitae sapiente suscipit magni eveniet accusantium. Possimus veniam aperiam animi nisi nihil. Possimus sed velit sit sequi neque est.
+ Eius aliquid eaque dignissimos rem sed incidunt earum. Similique rerum voluptatem repellat rem. Possimus dignissimos at qui sequi.
+ Deserunt nam ut temporibus voluptatem odit eaque recusandae. Pariatur nemo molestias atque maxime debitis quia inventore deserunt. Reiciendis similique illum laborum animi repellendus accusantium. Occaecati consectetur magnam quo cumque quibusdam. Quisquam facere esse voluptas unde ipsam saepe.
+ Aliquid porro quidem tempore omnis corrupti. Possimus dignissimos maxime ipsam deleniti quisquam delectus similique illum. Velit quasi dignissimos optio qui laudantium. Consequatur vero deleniti doloremque magnam repellat repellendus expedita.
+ Alias commodi natus eum non eligendi dolor. Perspiciatis atque iste amet consectetur. Sit natus quo ex vero illum provident error nesciunt.
+ slug: product-59677
meta_description:
meta_keywords:
variant_count: 1
- available_on: '2025-03-13T10:54:02.259Z'
- created_at: '2026-03-13T10:54:02.275Z'
- updated_at: '2026-03-13T10:54:02.324Z'
+ available_on: '2025-03-13T13:21:43.204Z'
+ created_at: '2026-03-13T13:21:43.218Z'
+ updated_at: '2026-03-13T13:21:43.267Z'
purchasable: true
in_stock: false
backorderable: true
@@ -6700,20 +6705,18 @@ paths:
price_list_id:
original_price:
- id: prod_gbHJdmfrXB
- name: Product 602680
+ name: Product 602460
description: |-
- Incidunt asperiores voluptate vero non. Voluptate ipsum laborum fuga culpa dolor. Nobis eos cum vel suscipit. Exercitationem enim sint adipisci dicta tempora maxime quod aliquid.
- Libero magni illum facilis nesciunt. Temporibus repellendus nihil quos ratione. Quia temporibus facilis saepe nobis minima. Fugit facilis debitis ex ipsam pariatur. Eligendi sed tempore sint itaque.
- Quaerat ex possimus molestias voluptatibus culpa odio sapiente. Sunt ab natus consequatur possimus quaerat quod. A dignissimos ipsa quasi libero culpa. Magni numquam itaque delectus ipsam. Quam omnis rerum aspernatur neque quos accusantium at.
- Asperiores qui modi dicta sint magni amet sequi. Voluptas aperiam autem aliquam iusto provident. Iste vero hic explicabo culpa. Totam molestiae veniam quam qui labore ipsam odio dicta.
- Voluptatibus iure sunt fugit natus. Distinctio error perferendis totam qui nesciunt ipsum modi facere. Voluptas sapiente nihil earum facilis.
- slug: product-602680
+ Repellendus enim sunt rerum pariatur laboriosam ducimus harum nihil. Officiis ratione nisi dolorem cum dicta neque. Nulla itaque maxime eum voluptate.
+ Porro quis quisquam dolorum fugiat iusto possimus neque. Sit deserunt iste veritatis corporis. Alias tempora quas repellendus libero aliquam odit.
+ Quisquam vel ullam molestias optio dolores illum. Necessitatibus ex est beatae quibusdam. Laudantium odio commodi culpa quisquam quam incidunt. Magni accusantium atque architecto rem ut sit nobis ipsa. Maiores doloremque tenetur totam cumque.
+ slug: product-602460
meta_description:
meta_keywords:
variant_count: 0
- available_on: '2025-03-13T10:54:02.330Z'
- created_at: '2026-03-13T10:54:02.341Z'
- updated_at: '2026-03-13T10:54:02.355Z'
+ available_on: '2025-03-13T13:21:43.274Z'
+ created_at: '2026-03-13T13:21:43.285Z'
+ updated_at: '2026-03-13T13:21:43.300Z'
purchasable: true
in_stock: false
backorderable: true
@@ -6819,19 +6822,18 @@ paths:
application/json:
example:
id: prod_UkLWZg9DAJ
- name: Product 717882
- description: |-
- Voluptatibus quas eos accusamus eveniet saepe consectetur explicabo. Ad fugit illo perspiciatis molestiae cum. Laborum rem nam doloribus sequi dolorum voluptates ratione. Nobis quia delectus saepe blanditiis. Sequi nam omnis doloremque ipsam.
- Reiciendis fuga ab voluptatum incidunt sit. Vel maiores beatae dicta ipsa sit rem. Dicta odit temporibus atque vero ratione. Ipsum rem praesentium nihil iure totam veniam doloribus.
- Qui repellat accusamus voluptatibus perferendis quod maxime sed. Tempore soluta molestiae modi quidem. Iure ea distinctio ratione ullam quas facilis rerum.
- Error nulla architecto quaerat possimus. Iusto nemo harum itaque corporis. Velit eligendi praesentium accusamus ducimus a atque occaecati.
- slug: product-717882
+ name: Product 712884
+ description: Tenetur nam neque possimus est. Atque saepe sapiente
+ architecto explicabo placeat magnam. Expedita eveniet neque suscipit
+ id pariatur maxime facere. Consequatur quo explicabo nostrum possimus
+ laborum dignissimos nulla minus. Minus debitis provident quasi impedit.
+ slug: product-712884
meta_description:
meta_keywords:
variant_count: 1
- available_on: '2025-03-13T10:54:02.986Z'
- created_at: '2026-03-13T10:54:03.004Z'
- updated_at: '2026-03-13T10:54:03.045Z'
+ available_on: '2025-03-13T13:21:43.932Z'
+ created_at: '2026-03-13T13:21:43.951Z'
+ updated_at: '2026-03-13T13:21:43.998Z'
purchasable: true
in_stock: false
backorderable: true
@@ -7049,15 +7051,15 @@ paths:
example:
data:
- id: ship_UkLWZg9DAJ
- number: H10511607162
+ number: H89258927496
state: pending
tracking: U10000
tracking_url:
cost: '100.0'
display_cost: "$100.00"
shipped_at:
- created_at: '2026-03-13T10:54:05.142Z'
- updated_at: '2026-03-13T10:54:05.158Z'
+ created_at: '2026-03-13T13:21:46.270Z'
+ updated_at: '2026-03-13T13:21:46.292Z'
shipping_method:
id: shpm_UkLWZg9DAJ
name: UPS Ground
@@ -7065,7 +7067,7 @@ paths:
stock_location:
id: sloc_UkLWZg9DAJ
state_abbr: STATE_ABBR_250
- name: Kyla Lueilwitz
+ name: Renna Steuber
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
@@ -7147,9 +7149,9 @@ paths:
application/json:
example:
id: cart_UkLWZg9DAJ
- number: R569739782
- token: 9eYJphx4nGx8ghFa2Yk146RJjC4zvUsijps
+ number: R568091676
+ token: H9vBXxvGZLrW62oFGDiNxcPDhVVmSvG6war
special_instructions:
currency: USD
locale: en
@@ -7170,8 +7172,8 @@ paths:
display_additional_tax_total: "$0.00"
total: '110.0'
display_total: "$110.00"
- created_at: '2026-03-13T10:54:05.740Z'
- updated_at: '2026-03-13T10:54:05.831Z'
+ created_at: '2026-03-13T13:21:46.898Z'
+ updated_at: '2026-03-13T13:21:46.992Z'
current_step: payment
completed_steps:
- address
@@ -7186,8 +7188,8 @@ paths:
variant_id: variant_UkLWZg9DAJ
quantity: 1
currency: USD
- name: Product 1004535
- slug: product-1004535
+ name: Product 1002307
+ slug: product-1002307
options_text: ''
price: '10.0'
display_price: "$10.00"
@@ -7206,23 +7208,23 @@ paths:
discounted_amount: '10.0'
display_discounted_amount: "$10.00"
display_compare_at_amount: "$0.00"
- created_at: '2026-03-13T10:54:05.772Z'
- updated_at: '2026-03-13T10:54:05.772Z'
+ created_at: '2026-03-13T13:21:46.930Z'
+ updated_at: '2026-03-13T13:21:46.930Z'
compare_at_amount:
thumbnail_url:
option_values: []
digital_links: []
shipments:
- id: ship_UkLWZg9DAJ
- number: H91093012769
+ number: H79690374982
state: pending
tracking: U10000
tracking_url:
cost: '100.0'
display_cost: "$100.00"
shipped_at:
- created_at: '2026-03-13T10:54:05.777Z'
- updated_at: '2026-03-13T10:54:05.816Z'
+ created_at: '2026-03-13T13:21:46.936Z'
+ updated_at: '2026-03-13T13:21:46.974Z'
shipping_method:
id: shpm_UkLWZg9DAJ
name: UPS Ground
@@ -7230,7 +7232,7 @@ paths:
stock_location:
id: sloc_UkLWZg9DAJ
state_abbr: STATE_ABBR_254
- name: Roscoe Hayes
+ name: Michal Towne
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
@@ -7366,9 +7368,9 @@ paths:
application/json:
example:
id: cart_UkLWZg9DAJ
- number: R801224178
- token: 9or7Ht7uVnx4tpYMY6piZ5HYtgpJHTE6Y6D
+ number: R891292364
+ token: 2mrYZVbiiG82arRbRZSxDpjmcgrftSc3iQ8
special_instructions:
currency: USD
locale: en
@@ -7389,8 +7391,8 @@ paths:
display_additional_tax_total: "$0.00"
total: '110.0'
display_total: "$110.00"
- created_at: '2026-03-13T10:54:07.091Z'
- updated_at: '2026-03-13T10:54:07.150Z'
+ created_at: '2026-03-13T13:21:48.144Z'
+ updated_at: '2026-03-13T13:21:48.194Z'
current_step: address
completed_steps: []
requirements: []
@@ -7400,8 +7402,8 @@ paths:
variant_id: variant_UkLWZg9DAJ
quantity: 1
currency: USD
- name: Product 1029948
- slug: product-1029948
+ name: Product 1021030
+ slug: product-1021030
options_text: ''
price: '10.0'
display_price: "$10.00"
@@ -7420,23 +7422,23 @@ paths:
discounted_amount: '10.0'
display_discounted_amount: "$10.00"
display_compare_at_amount: "$0.00"
- created_at: '2026-03-13T10:54:07.124Z'
- updated_at: '2026-03-13T10:54:07.124Z'
+ created_at: '2026-03-13T13:21:48.175Z'
+ updated_at: '2026-03-13T13:21:48.175Z'
compare_at_amount:
thumbnail_url:
option_values: []
digital_links: []
shipments:
- id: ship_UkLWZg9DAJ
- number: H76641019615
+ number: H91139349253
state: pending
tracking: U10000
tracking_url:
cost: '100.0'
display_cost: "$100.00"
shipped_at:
- created_at: '2026-03-13T10:54:07.129Z'
- updated_at: '2026-03-13T10:54:07.147Z'
+ created_at: '2026-03-13T13:21:48.180Z'
+ updated_at: '2026-03-13T13:21:48.192Z'
shipping_method:
id: shpm_UkLWZg9DAJ
name: UPS Ground
@@ -7444,7 +7446,7 @@ paths:
stock_location:
id: sloc_UkLWZg9DAJ
state_abbr: STATE_ABBR_262
- name: Oma Hane
+ name: Concetta Reilly
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
@@ -7466,12 +7468,12 @@ paths:
- id: py_UkLWZg9DAJ
payment_method_id: pm_UkLWZg9DAJ
state: checkout
- response_code: 1-SC-20260313105407469474
- number: PYVG22DW
+ response_code: 1-SC-20260313132148499600
+ number: PIO7TOSZ
amount: '10.0'
display_amount: "$10.00"
- created_at: '2026-03-13T10:54:07.473Z'
- updated_at: '2026-03-13T10:54:07.473Z'
+ created_at: '2026-03-13T13:21:48.503Z'
+ updated_at: '2026-03-13T13:21:48.503Z'
source_type: store_credit
source_id: credit_UkLWZg9DAJ
source:
@@ -7602,9 +7604,9 @@ paths:
application/json:
example:
id: cart_UkLWZg9DAJ
- number: R233424337
- token: R51cNj2Wvug82tXAQMdXipv15yizmJBUW9B
+ number: R870356661
+ token: xsDmHKcwqxzvb3hf4ymM3cE3d5fxLehbhDf
special_instructions:
currency: USD
locale: en
@@ -7625,8 +7627,8 @@ paths:
display_additional_tax_total: "$0.00"
total: '110.0'
display_total: "$110.00"
- created_at: '2026-03-13T10:54:08.719Z'
- updated_at: '2026-03-13T10:54:08.791Z'
+ created_at: '2026-03-13T13:21:49.718Z'
+ updated_at: '2026-03-13T13:21:49.781Z'
current_step: address
completed_steps: []
requirements:
@@ -7639,8 +7641,8 @@ paths:
variant_id: variant_UkLWZg9DAJ
quantity: 1
currency: USD
- name: Product 1043422
- slug: product-1043422
+ name: Product 1043142
+ slug: product-1043142
options_text: ''
price: '10.0'
display_price: "$10.00"
@@ -7659,23 +7661,23 @@ paths:
discounted_amount: '10.0'
display_discounted_amount: "$10.00"
display_compare_at_amount: "$0.00"
- created_at: '2026-03-13T10:54:08.764Z'
- updated_at: '2026-03-13T10:54:08.764Z'
+ created_at: '2026-03-13T13:21:49.753Z'
+ updated_at: '2026-03-13T13:21:49.753Z'
compare_at_amount:
thumbnail_url:
option_values: []
digital_links: []
shipments:
- id: ship_UkLWZg9DAJ
- number: H52897976695
+ number: H59385608469
state: pending
tracking: U10000
tracking_url:
cost: '100.0'
display_cost: "$100.00"
shipped_at:
- created_at: '2026-03-13T10:54:08.771Z'
- updated_at: '2026-03-13T10:54:08.788Z'
+ created_at: '2026-03-13T13:21:49.760Z'
+ updated_at: '2026-03-13T13:21:49.778Z'
shipping_method:
id: shpm_UkLWZg9DAJ
name: UPS Ground
@@ -7683,7 +7685,7 @@ paths:
stock_location:
id: sloc_UkLWZg9DAJ
state_abbr: STATE_ABBR_270
- name: Elinore Muller
+ name: Viva Schinner
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
@@ -7799,9 +7801,9 @@ paths:
data:
- id: wl_UkLWZg9DAJ
name: My Wishlist
- token: dfZRsbA8CQBhPSgciUXH2V4M
- created_at: '2026-03-13T10:54:09.381Z'
- updated_at: '2026-03-13T10:54:09.381Z'
+ token: NGD91Ra2KyTGmH4ugDqQdrEE
+ created_at: '2026-03-13T13:21:50.379Z'
+ updated_at: '2026-03-13T13:21:50.379Z'
is_default: false
is_private: true
meta:
@@ -7877,9 +7879,9 @@ paths:
example:
id: wl_gbHJdmfrXB
name: Birthday Ideas
- token: ZpFcCBmGzxdnK5vgSZCsQWL6
- created_at: '2026-03-13T10:54:10.574Z'
- updated_at: '2026-03-13T10:54:10.574Z'
+ token: d1hkbCQ7oTRkKxJ9UaeMTJpY
+ created_at: '2026-03-13T13:21:51.592Z'
+ updated_at: '2026-03-13T13:21:51.592Z'
is_default: false
is_private: true
schema:
@@ -7975,9 +7977,9 @@ paths:
example:
id: wl_UkLWZg9DAJ
name: My Wishlist
- token: YHyiAmJrueiWnhefKidp1C7h
- created_at: '2026-03-13T10:54:11.683Z'
- updated_at: '2026-03-13T10:54:11.683Z'
+ token: MGENAcmuamfV8pjBDbqDx3xb
+ created_at: '2026-03-13T13:21:52.711Z'
+ updated_at: '2026-03-13T13:21:52.711Z'
is_default: false
is_private: true
schema:
@@ -8039,9 +8041,9 @@ paths:
example:
id: wl_UkLWZg9DAJ
name: Updated Name
- token: iTCxuYLNQwKBGCiHQaAaQxg7
- created_at: '2026-03-13T10:54:12.839Z'
- updated_at: '2026-03-13T10:54:12.878Z'
+ token: MsvKUK8GJMVjYsMoPknvqTXu
+ created_at: '2026-03-13T13:21:53.853Z'
+ updated_at: '2026-03-13T13:21:53.896Z'
is_default: false
is_private: true
schema:
@@ -8153,8 +8155,8 @@ paths:
variant_id: variant_gbHJdmfrXB
wishlist_id: wl_UkLWZg9DAJ
quantity: 1
- created_at: '2026-03-13T10:54:14.063Z'
- updated_at: '2026-03-13T10:54:14.063Z'
+ created_at: '2026-03-13T13:21:55.101Z'
+ updated_at: '2026-03-13T13:21:55.101Z'
variant:
id: variant_gbHJdmfrXB
product_id: prod_gbHJdmfrXB
@@ -8163,8 +8165,8 @@ paths:
options_text: ''
track_inventory: true
image_count: 0
- created_at: '2026-03-13T10:54:14.041Z'
- updated_at: '2026-03-13T10:54:14.049Z'
+ created_at: '2026-03-13T13:21:55.073Z'
+ updated_at: '2026-03-13T13:21:55.083Z'
thumbnail:
purchasable: true
in_stock: false
diff --git a/spree/api/app/controllers/concerns/spree/api/v3/error_handler.rb b/spree/api/app/controllers/concerns/spree/api/v3/error_handler.rb
index d4c54ae31f..31bc536fb4 100644
--- a/spree/api/app/controllers/concerns/spree/api/v3/error_handler.rb
+++ b/spree/api/app/controllers/concerns/spree/api/v3/error_handler.rb
@@ -20,11 +20,11 @@ module Spree
# Cart errors
cart_not_found: 'cart_not_found',
- cart_already_completed: 'cart_already_completed',
cart_cannot_transition: 'cart_cannot_transition',
cart_empty: 'cart_empty',
cart_invalid_state: 'cart_invalid_state',
cart_already_updated: 'cart_already_updated',
+ cart_cannot_complete: 'cart_cannot_complete',
# Order errors
order_not_found: 'order_not_found',
diff --git a/spree/api/app/controllers/spree/api/v3/store/carts_controller.rb b/spree/api/app/controllers/spree/api/v3/store/carts_controller.rb
index 98d01ac521..f2313c45bf 100644
--- a/spree/api/app/controllers/spree/api/v3/store/carts_controller.rb
+++ b/spree/api/app/controllers/spree/api/v3/store/carts_controller.rb
@@ -97,19 +97,32 @@ module Spree
end
# POST /api/v3/store/carts/:id/complete
- # Completes the checkout — returns Order (not Cart)
+ # Completes the checkout — returns Order (not Cart).
+ # Idempotent: if the gateway already completed the order, find_cart!
+ # will 404 (carts scope is incomplete-only), so we fall back to the
+ # orders scope and return the completed order.
+ # this is temporary hack until Spree 6 when Cart and Order will be separate models
def complete
find_cart!
with_order_lock do
- result = Spree.checkout_complete_service.call(order: @cart)
+ Spree.checkout_complete_service.call(order: @cart)
+ @cart.reload
- if result.success?
+ if @cart.complete?
render_order
else
- render_service_error(result.error, code: ERROR_CODES[:cart_already_completed])
+ render_service_error(
+ @cart.errors.full_messages.to_sentence.presence || 'Could not complete checkout',
+ code: ERROR_CODES[:cart_cannot_complete]
+ )
end
end
+ rescue ActiveRecord::RecordNotFound
+ @cart = current_store.orders.complete.find_by_prefix_id!(params[:id])
+ authorize!(:show, @cart, cart_token)
+
+ render_order
end
protected
diff --git a/spree/api/spec/controllers/spree/api/v3/store/carts_controller_spec.rb b/spree/api/spec/controllers/spree/api/v3/store/carts_controller_spec.rb
index 024e41be35..94537412c8 100644
--- a/spree/api/spec/controllers/spree/api/v3/store/carts_controller_spec.rb
+++ b/spree/api/spec/controllers/spree/api/v3/store/carts_controller_spec.rb
@@ -611,10 +611,61 @@ RSpec.describe Spree::Api::V3::Store::CartsController, type: :controller do
context 'when order cannot be completed' do
let(:incomplete_order) { create(:order_with_line_items, user: user, store: store, state: 'address') }
- it 'returns unprocessable entity' do
+ it 'returns unprocessable entity with cart_cannot_complete code' do
post :complete, params: { id: incomplete_order.prefixed_id }
expect(response).to have_http_status(:unprocessable_content)
+ expect(json_response['error']['code']).to eq('cart_cannot_complete')
+ end
+ end
+
+ context 'when order was already completed by the gateway' do
+ let(:completed_order) { create(:completed_order_with_totals, user: user, store: store) }
+
+ it 'returns the completed order via JWT' do
+ post :complete, params: { id: completed_order.prefixed_id }
+
+ expect(response).to have_http_status(:ok)
+ expect(json_response['number']).to eq(completed_order.number)
+ end
+
+ it 'returns the completed order via spree token' do
+ request.headers['Authorization'] = nil
+ request.headers['x-spree-token'] = completed_order.token
+
+ post :complete, params: { id: completed_order.prefixed_id }
+
+ expect(response).to have_http_status(:ok)
+ expect(json_response['number']).to eq(completed_order.number)
+ end
+
+ it 'returns forbidden without valid authentication' do
+ request.headers['Authorization'] = nil
+
+ post :complete, params: { id: completed_order.prefixed_id }
+
+ expect(response).to have_http_status(:forbidden)
+ end
+ end
+
+ context 'with guest cart token' do
+ let(:guest_order) do
+ order = create(:order_with_line_items, user: nil, store: store, email: '[email protected]')
+ order.update_column(:state, 'confirm')
+ order
+ end
+
+ it 'completes via spree token' do
+ request.headers['Authorization'] = nil
+ request.headers['x-spree-token'] = guest_order.token
+
+ create(:payment, order: guest_order, amount: guest_order.total, state: 'checkout')
+ guest_order.shipments.each { |s| s.update_column(:state, 'ready') }
+
+ post :complete, params: { id: guest_order.prefixed_id }
+
+ expect(response).to have_http_status(:ok)
+ expect(guest_order.reload.state).to eq('complete')
end
end
end