Skip to main content

Clear all items from a store's cart

DELETE 

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

This endpoint removes all items from the customer's cart for the specified store. The cart itself remains but becomes empty.

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

Use Cases:

  • Starting fresh checkout flow
    • Implementing "Clear Cart" functionality
    • Cart reset after successful order or cancellation
    • Bulk cart cleanup operations

Behavior:

  • All cart items are removed
    • Cart totals reset to zero
    • Cart entity remains (not deleted)
    • This operation cannot be undone

Important Notes:

  • This operation is immediate and cannot be reversed
    • Consider confirming with user before calling this endpoint
    • Does NOT trigger order cancellation webhooks

Error Scenarios:

  • 404 NOT FOUND - Store or cart not found (Error code: STORE_NOT_FOUND or CART_NOT_FOUND)
    • 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​

Cart cleared successfully - all items removed