Skip to main content
Nymble Commerce’s cart API lets you build persistent shopping carts that can be retrieved, updated, and converted to orders at checkout. Carts survive across sessions — a customer can start a cart on one device and complete it on another.

Cart lifecycle

A cart moves through the following states:
Once a cart is checked out it is marked Complete and can no longer be modified. Any subsequent changes must go through the resulting order.

Creating a cart

Send a POST request to /api/carts/{customerNumber}. The customer number goes in the URL path; the organizationId is injected automatically from your JWT.
Response
Nymble Commerce allows only one active cart per customer at a time. Always call GET /api/carts/customer/{customerNumber} to check for an existing active cart before creating a new one — creating duplicate active carts can lead to confusing checkout experiences.

Adding items

Append products to an existing cart with POST /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 using PUT /api/carts/{customerNumber}/{shoppingCartId}/items/{sku}:
Remove a line item entirely using DELETE /api/carts/{customerNumber}/{shoppingCartId}/items/{sku}:
A 204 No Content response confirms the item has been removed.

Retrieving a cart

Fetch a single cart by its ID:
To find all carts for a specific customer, use the customer carts endpoint:
To list all carts across your organization (admin access required), use the list endpoint:

Shipping and PO number

Set the delivery address on the cart with PUT /api/carts/{customerNumber}/{shoppingCartId}/shipping:
Attach the customer’s purchase order number with PUT /api/carts/{customerNumber}/{shoppingCartId}/po-number:

Completing checkout

When the cart is ready, submit it for processing with POST /api/carts/{customerNumber}/{shoppingCartId}/complete-checkout. Nymble Commerce creates an order in a single atomic operation.
Response
Use 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.