Guides
Markdown
Working with Carts
💡

Diddo’s API lets you build and manage carts that span multiple stores, enabling a single, unified checkout experience. Whether you’re working on a client-side app or integrating via backend, this section covers the key endpoints and patterns you'll need. Full request/response schemas are available in the API reference

This section covers:

  • Retrieving an existing cart
  • Adding to a Cart and Creating one
  • Updating item quantities
  • Removing items from the cart

🔍 Retrieving an existing Cart

Fetch the current contents of a cart using its cart_id

Endpoint: GET /cart/:id

javascript

➕ Adding to a Cart and Creating one

Adds a product variant to the cart. If the cart doesn't exist, a new one is created and returned.

Endpoint: POST /cart/add

json

JavaScript Example:

javascript

View Sandbox Example →


✏️ Update Item quantities

Update the quantity of a specific item in the cart. If the item doesn’t exist in the cart, no changes will be made.

Endpoint: POST /cart/update

json

View Sandbox Example →


❌ Removing Items from the Cart

Remove an item from the cart using its variant_id.

Endpoint: DELETE /cart/items

json

View Sandbox Example →


🔴

Error Handling: All cart endpoints return standardized error objects with helpful messages and status codes. See Error Handling for recommended handling patterns.


👉 Next: Customer Information & Shipping →