Skip to main content

Add item to cart for a specific store

POST 

/api/v1/sdk/cart/store/:storeId/item

This endpoint adds a product variant to the customer's cart. If the item already exists, the quantity is incremented.

Authentication: Requires customer authentication (JWT token with verified phone). Optional API key for additional store validation.

Behavior:

  • If item exists in cart: Quantity is incremented by the specified amount
    • If item is new: Item is added with the specified quantity
    • Inventory availability is checked before adding
    • Price is calculated at current product price

Use Cases:

  • Adding products from product listing pages
    • Quick add from product detail pages
    • Re-ordering previous purchases
    • Assisted checkout workflows

Error Scenarios:

  • 404 NOT FOUND - Product variant or store doesn't exist (Error code: VARIANT_NOT_FOUND or STORE_NOT_FOUND)
    • 400 BAD REQUEST - Invalid quantity, out of stock, or validation errors (Error code: INVALID_QUANTITY or OUT_OF_STOCK)
    • 401 UNAUTHORIZED - Customer not authenticated (Error code: UNAUTHORIZED)
    • 403 FORBIDDEN - API key doesn't have access to this store (Error code: NO_STORE_ACCESS)

Request​

Responses​

Item added to cart successfully