> ## Documentation Index
> Fetch the complete documentation index at: https://docs.salesive.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Clear cart

> Remove all items from the authenticated shopper's cart.

## Request

```http theme={null}
DELETE /cart
Authorization: Bearer {{token}}
x-shop-id: {{shopId}}
```

## Headers

| Header          | Type   | Description                                   |
| --------------- | ------ | --------------------------------------------- |
| `Authorization` | string | Provide the customer token as `Bearer <jwt>`. |
| `x-shop-id`     | string | Identify the shop that owns the cart.         |

## Successful response

```json theme={null}
{
    "status": 200,
    "success": true,
    "message": "Cart cleared",
    "data": {
        "_id": "693606ada7a8f7dc8ae32d80",
        "items": [],
        "totalPrice": 0,
        "id": "693606ada7a8f7dc8ae32d80"
    }
}
```

## Error response

```json theme={null}
{
  "status": 401,
  "success": false,
  "message": "Unauthorized",
  "data": {}
}
```


## OpenAPI

````yaml DELETE /cart
openapi: 3.1.0
info:
  title: Salesive Store API
  description: >-
    REST interface for querying products, categories, and merchandising banners
    exposed by Salesive storefronts.
  version: 1.0.0
servers:
  - description: Production
    url: https://store.salesive.com/api/v1
security:
  - BearerAuth: []
    ShopIdHeader: []
paths:
  /cart:
    delete:
      summary: Clear cart
      description: Remove every item from the shopper's cart.
      parameters:
        - $ref: '#/components/parameters/XShopIdHeader'
      responses:
        '200':
          description: Cart cleared successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CartResponse'
        '401':
          description: Unauthorized.
components:
  parameters:
    XShopIdHeader:
      name: x-shop-id
      in: header
      description: >-
        Optional identifier that scopes responses to a specific storefront when
        the referer cannot be inferred.
      required: false
      schema:
        type: string
  schemas:
    CartResponse:
      type: object
      required:
        - status
        - success
        - message
        - data
      properties:
        status:
          type: integer
          description: HTTP status code returned by the API.
        success:
          type: boolean
          description: Indicates whether the request succeeded.
        message:
          type: string
          description: Human-readable response message.
        data:
          $ref: '#/components/schemas/Cart'
    Cart:
      type: object
      required:
        - _id
        - items
        - totalPrice
      properties:
        _id:
          type: string
          description: Cart identifier.
        user:
          type: string
          description: Identifier of the shopper who owns the cart.
        shop:
          type: string
          description: Identifier of the shop associated with the cart.
        items:
          type: array
          items:
            $ref: '#/components/schemas/CartItem'
        totalPrice:
          type: number
          description: Total price of all items in the cart.
        createdAt:
          type: string
          format: date-time
          description: Timestamp when the cart was created.
        updatedAt:
          type: string
          format: date-time
          description: Timestamp when the cart was last updated.
    CartItem:
      type: object
      required:
        - itemType
        - name
        - image
        - price
        - quantity
      properties:
        _id:
          type: string
        itemType:
          type: string
          enum:
            - product
            - food
            - service
        product:
          type: object
          description: Product or variant metadata for the cart item.
          properties:
            _id:
              type: string
            id:
              type: string
            name:
              type: string
            images:
              type: array
              items:
                type: string
                format: uri
            price:
              type: number
            promoPrice:
              type: number
              nullable: true
            sku:
              type: string
            parentProductId:
              type: string
            variantAttributes:
              type: object
              additionalProperties:
                type: string
        food:
          type: object
          description: Food metadata for a food line item.
          properties:
            _id:
              type: string
            id:
              type: string
            name:
              type: string
            images:
              type: array
              items:
                type: string
                format: uri
            price:
              type: number
            promoPrice:
              type:
                - number
                - 'null'
        foodId:
          type: string
          description: Identifier of the food item when `itemType` is `food`.
        variant:
          type: string
          description: Identifier of the variant if the line item is variant-based.
        name:
          type: string
          description: Display name of the line item.
        image:
          type: string
          format: uri
          description: Primary image for the line item.
        price:
          type: number
          description: Unit price of the line item.
        sku:
          type: string
          description: SKU of the line item, if applicable.
        variantAttributes:
          type: object
          description: Attributes for the selected variant.
          additionalProperties:
            type: string
        quantity:
          type: integer
          minimum: 1
          description: Quantity of the line item in the cart.
        selectedAddons:
          type: array
          items:
            $ref: '#/components/schemas/SelectedAddon'
          description: Snapshot of selected add-ons for food items.
    SelectedAddon:
      type: object
      required:
        - addonId
        - name
        - price
        - quantity
      properties:
        addonId:
          type: string
        name:
          type: string
        description:
          type: string
        price:
          type: number
        quantity:
          type: integer
          minimum: 1
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT issued by the Salesive Store API for authenticated shoppers.
    ShopIdHeader:
      type: apiKey
      in: header
      name: x-shop-id
      description: >-
        Optional storefront identifier sent as a header to scope responses to a
        specific shop. Try It requests remember this value once provided.

````