Cart lifecycle
A cart moves through the following states:Creating a cart
Send aPOST request to /api/carts/{customerNumber}. The customer number goes in the URL path; the organizationId is injected automatically from your JWT.
Adding items
Append products to an existing cart withPOST /api/carts/{customerNumber}/{shoppingCartId}/items.
If the SKU you add already exists as a line item in the cart, Nymble Commerce increases the existing line’s quantity by the amount you specify rather than creating a second line for the same product.
Updating items
Change the quantity on an existing line item usingPUT /api/carts/{customerNumber}/{shoppingCartId}/items/{sku}:
DELETE /api/carts/{customerNumber}/{shoppingCartId}/items/{sku}:
204 No Content response confirms the item has been removed.
Retrieving a cart
Fetch a single cart by its ID:Shipping and PO number
Set the delivery address on the cart withPUT /api/carts/{customerNumber}/{shoppingCartId}/shipping:
PUT /api/carts/{customerNumber}/{shoppingCartId}/po-number:
Completing checkout
When the cart is ready, submit it for processing withPOST /api/carts/{customerNumber}/{shoppingCartId}/complete-checkout. Nymble Commerce creates an order in a single atomic operation.
orderNumber to look up the full order details via GET /api/orders/{orderNumber}.
After a successful checkout, the cart status is set to Complete. Any further PUT or POST requests against that cart return an error.