Skip to content
You are reading the pinned copy of v1.0, which is also the latest release. Read the latest.

Cart (storefront API)

Storefront and customer routes of the cart module. Send Accept-Language (or X-Locale from a browser) on every call; a customer route needs the session cookie.

Clear shopping cart

Responses:

  • 204: Cart cleared.

Get shopping cart

Responses:

  • 200: Cart retrieved.

Remove coupon from cart

Responses:

  • 200: Coupon removed.

Apply coupon code

Request body: ApplyCouponDto.

Responses:

  • 200: Coupon applied.
  • 400: Invalid coupon.

Estimate shipping cost

Parameters:

  • country in query (string, pattern ^[A-Z]{2}$, min length 2, max length 2, required).
  • postalCode in query (string, min length 3, max length 10, optional).

Responses:

  • 200: Shipping estimate retrieved.
  • 400: Invalid input.

Remove gift card from cart

Responses:

  • 204: Gift card removed.

Apply gift card

Request body: ApplyGiftCardDto.

Responses:

  • 200: Gift card applied; returns the updated cart.
  • 400: Invalid gift card.

Add item to cart

Request body: AddItemDto.

Responses:

  • 200: Item added.
  • 400: Invalid input.
  • 404: Variant not found.

Remove cart item

Parameters:

  • itemId in path (string, required).

Responses:

  • 200: Item removed.
  • 404: Item not found.

Update cart item

Parameters:

  • itemId in path (string, required).

Request body: UpdateItemDto.

Responses:

  • 200: Item updated.
  • 400: Invalid input.
  • 404: Item not found.

POST /v1/cart/items/{itemId}/save-for-later

Section titled “POST /v1/cart/items/{itemId}/save-for-later”

Save item for later

Parameters:

  • itemId in path (string, required).

Responses:

  • 200: Item saved.
  • 401: Unauthorized.
  • 404: Item not found.

Merge the anonymous cart into the signed-in cart

Responses:

  • 200: Merged cart returned.
  • 401: Unauthorized.
  • variantId (string, required).
  • quantity (number, min 1, required).
  • code (string, pattern ^[A-Z0-9_-]+$, max length 50, required).
  • code (string, pattern ^[A-Z0-9]+$, min length 8, max length 20, required).
  • quantity (number, min 1, required).
As seen on Open Source Alternatives The Merchant Engine badge