Skip to main content

Carts

Endpoint reference: ✅ Verified live against production on 10 May 2026. Carts are per-client. Each client has at most one active cart. Adding items to a cart doesn’t reserve inventory — items are only committed when an order is placed via POST /dapp/orders.

Conceptual surprise: the API exposes “clients-with-carts”, not “carts directly”

⚠️ Read this before building cart UI. GET /dapp/carts returns a paginated list of clients, each with their clientCart[] and cartItems[] embedded. The top-level field is clients, not carts. This is a small but real footgun — your UI code expecting data.carts will silently render nothing.
If your store has a “carts in progress” view (for the holder, showing all customers who’ve started a cart), this endpoint feeds it. If you’re rendering a single customer’s cart, fetch GET /dapp/clients/{clientId} instead — clientCart[] is included in the detail response.

Endpoints


POST /dapp/carts — add items

Adds one or more strain items to a client’s cart. Creates the cart on first call.

Request body

The shape is CreateCartItemsDto per the live OpenAPI spec — full schema not formally declared, but the working pattern is:

Canonical payload (for signing)

JSON.stringify(body) — compact, no whitespace. Send the same exact string as the request body.

Response

201 Created with the cart’s id.

Idempotency

POST /dapp/carts is not idempotent server-side. Calling it twice with the same payload will add the items twice. If the customer hits the “Add to cart” button rapidly, debounce client-side. There’s no Idempotency-Key header support yet (see 04-errors.md § Idempotency).

Errors


GET /dapp/carts — clients with carts

Returns a paginated list of clients who have an active cart, with the cart and items embedded.

Query parameters

Canonical payload

urlencode(query) if any present, else "{}".

Response shape (verified)

🪲 clientCart is an array even though each client has at most one active cart. Take [0] and treat the rest defensively.
🪲 Cart items have no id in the embedded list — only quantity, createdAt, and the embedded strain. To remove a single item, you delete the whole cart and recreate. There’s no “remove item from cart” endpoint in the current API. 🔒

Worked example (Python)


DELETE /dapp/carts/{cartId} — delete a cart

Removes a cart and all its items. Used when the customer abandons or chooses to start over.

Path parameters

Canonical payload

{}

Response

200 OK with data: null or a confirmation id.

Errors


Common patterns

Resolve a single client’s cart

Replace cart contents (since there’s no “remove item”)

Cart-to-order

When the customer checks out, you call POST /dapp/orders with the cart’s contents. The order endpoint takes the same shape as the cart contents, with the addition of shipping and payment details. The cart itself isn’t automatically cleared on order — clean it up with DELETE if you want a fresh slate.

Caching guidance

Don’t cache cart responses. Carts are mutable and customers expect immediate feedback after add/remove operations. Always read fresh.

See also

  • Strains — pricing and strain IDs to populate the cart
  • Clients — client detail also includes clientCart[]
  • Orders — converting a cart into an order