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

# Clear cart

> Remove all lines from a cart.



## OpenAPI

````yaml openapi.json DELETE /v1/cart/{cartId}
openapi: 3.0.3
info:
  title: Quickshops Headless API
  version: 1.0.0
  description: >
    Headless commerce API for Quickshops custom storefronts and @quickshops/sdk.


    ## Versioning


    All routes are prefixed with `/v1`. The current version is also sent as
    `X-API-Version: v1`. Breaking changes ship under `/v2`. `v1` remains
    available during a deprecation window.


    ## Deprecation


    Deprecated operations are marked `deprecated: true`. When a version or
    operation is scheduled for removal, responses include RFC 8594 `Deprecation`
    and `Sunset` headers at least 90 days before removal.


    ## Errors


    4xx and 5xx bodies are JSON `{ "error": string, "code": string }`. `code` is
    machine-readable; `error` is human-readable.


    ## Rate limits


    Authenticated routes are limited per API key. Responses include IETF
    `RateLimit-Limit`, `RateLimit-Remaining`, `RateLimit-Reset`, and combined
    `RateLimit` headers. HTTP 429 also includes `Retry-After`.


    Per-minute limits: global 120; product reads 240; cart writes 60; checkout
    30; billing portal 30.
  contact:
    name: Quickshops
    email: valtteri@quickshops.app
    url: https://quickshops.app/developers
servers:
  - url: https://api.quickshops.app
    description: Production. Paths include the /v1 prefix.
security:
  - BearerAuth: []
paths:
  /v1/cart/{cartId}:
    delete:
      tags:
        - cart
      summary: Clear cart
      description: Removes every line from the cart.
      operationId: cart.clear
      parameters:
        - name: cartId
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Response for status 200
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - id
                      - storeId
                      - lines
                      - totals
                    properties:
                      id:
                        type: string
                      storeId:
                        type: string
                      lines:
                        type: array
                        items:
                          type: object
                          required:
                            - productId
                            - quantity
                          properties:
                            productId:
                              type: string
                            quantity:
                              type: number
                            product:
                              type: object
                              required:
                                - _id
                                - storeId
                                - name
                                - description
                                - priceInCents
                                - currency
                                - type
                                - billingInterval
                                - imageUrl
                                - isActive
                                - category
                                - details
                              properties:
                                _id:
                                  type: string
                                storeId:
                                  type: string
                                name:
                                  type: string
                                description:
                                  nullable: true
                                  type: string
                                priceInCents:
                                  type: number
                                currency:
                                  type: string
                                type:
                                  type: string
                                  enum:
                                    - digital
                                    - subscription
                                    - physical
                                billingInterval:
                                  nullable: true
                                  type: string
                                  enum:
                                    - month
                                    - year
                                imageUrl:
                                  nullable: true
                                  type: string
                                isActive:
                                  type: boolean
                                category:
                                  nullable: true
                                  type: string
                                details:
                                  nullable: true
                                  type: array
                                  items:
                                    type: string
                      totals:
                        type: object
                        required:
                          - subtotal
                          - total
                          - currency
                        properties:
                          subtotal:
                            type: number
                          total:
                            type: number
                          currency:
                            type: string
          headers:
            RateLimit-Limit:
              schema:
                type: integer
              description: Maximum requests allowed in the current window.
            RateLimit-Remaining:
              schema:
                type: integer
              description: Requests remaining in the current window.
            RateLimit-Reset:
              schema:
                type: integer
              description: Seconds until the current window resets.
            RateLimit:
              schema:
                type: string
              description: >-
                Combined RateLimit header, for example `limit=120,
                remaining=119, reset=60`.
            X-API-Version:
              schema:
                type: string
                enum:
                  - v1
              description: API version that served this response.
        '400':
          description: Response for status 400
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                  - code
                properties:
                  error:
                    type: string
                    description: Human-readable error message.
                  code:
                    type: string
                    enum:
                      - UNAUTHORIZED
                      - FORBIDDEN
                      - PRO_PLAN_REQUIRED
                      - NOT_FOUND
                      - VALIDATION_ERROR
                      - RATE_LIMITED
                      - CONFLICT
                      - INTERNAL_ERROR
          headers:
            RateLimit-Limit:
              schema:
                type: integer
              description: Maximum requests allowed in the current window.
            RateLimit-Remaining:
              schema:
                type: integer
              description: Requests remaining in the current window.
            RateLimit-Reset:
              schema:
                type: integer
              description: Seconds until the current window resets.
            RateLimit:
              schema:
                type: string
              description: >-
                Combined RateLimit header, for example `limit=120,
                remaining=119, reset=60`.
            X-API-Version:
              schema:
                type: string
                enum:
                  - v1
              description: API version that served this response.
        '401':
          description: Response for status 401
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                  - code
                properties:
                  error:
                    type: string
                    description: Human-readable error message.
                  code:
                    type: string
                    enum:
                      - UNAUTHORIZED
                      - FORBIDDEN
                      - PRO_PLAN_REQUIRED
                      - NOT_FOUND
                      - VALIDATION_ERROR
                      - RATE_LIMITED
                      - CONFLICT
                      - INTERNAL_ERROR
          headers:
            RateLimit-Limit:
              schema:
                type: integer
              description: Maximum requests allowed in the current window.
            RateLimit-Remaining:
              schema:
                type: integer
              description: Requests remaining in the current window.
            RateLimit-Reset:
              schema:
                type: integer
              description: Seconds until the current window resets.
            RateLimit:
              schema:
                type: string
              description: >-
                Combined RateLimit header, for example `limit=120,
                remaining=119, reset=60`.
            X-API-Version:
              schema:
                type: string
                enum:
                  - v1
              description: API version that served this response.
        '403':
          description: Response for status 403
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                  - code
                properties:
                  error:
                    type: string
                    description: Human-readable error message.
                  code:
                    type: string
                    enum:
                      - UNAUTHORIZED
                      - FORBIDDEN
                      - PRO_PLAN_REQUIRED
                      - NOT_FOUND
                      - VALIDATION_ERROR
                      - RATE_LIMITED
                      - CONFLICT
                      - INTERNAL_ERROR
          headers:
            RateLimit-Limit:
              schema:
                type: integer
              description: Maximum requests allowed in the current window.
            RateLimit-Remaining:
              schema:
                type: integer
              description: Requests remaining in the current window.
            RateLimit-Reset:
              schema:
                type: integer
              description: Seconds until the current window resets.
            RateLimit:
              schema:
                type: string
              description: >-
                Combined RateLimit header, for example `limit=120,
                remaining=119, reset=60`.
            X-API-Version:
              schema:
                type: string
                enum:
                  - v1
              description: API version that served this response.
        '404':
          description: Resource not found.
          headers:
            RateLimit-Limit:
              schema:
                type: integer
              description: Maximum requests allowed in the current window.
            RateLimit-Remaining:
              schema:
                type: integer
              description: Requests remaining in the current window.
            RateLimit-Reset:
              schema:
                type: integer
              description: Seconds until the current window resets.
            RateLimit:
              schema:
                type: string
              description: >-
                Combined RateLimit header, for example `limit=120,
                remaining=119, reset=60`.
            X-API-Version:
              schema:
                type: string
                enum:
                  - v1
              description: API version that served this response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '409':
          description: Response for status 409
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                  - code
                properties:
                  error:
                    type: string
                    description: Human-readable error message.
                  code:
                    type: string
                    enum:
                      - UNAUTHORIZED
                      - FORBIDDEN
                      - PRO_PLAN_REQUIRED
                      - NOT_FOUND
                      - VALIDATION_ERROR
                      - RATE_LIMITED
                      - CONFLICT
                      - INTERNAL_ERROR
          headers:
            RateLimit-Limit:
              schema:
                type: integer
              description: Maximum requests allowed in the current window.
            RateLimit-Remaining:
              schema:
                type: integer
              description: Requests remaining in the current window.
            RateLimit-Reset:
              schema:
                type: integer
              description: Seconds until the current window resets.
            RateLimit:
              schema:
                type: string
              description: >-
                Combined RateLimit header, for example `limit=120,
                remaining=119, reset=60`.
            X-API-Version:
              schema:
                type: string
                enum:
                  - v1
              description: API version that served this response.
        '429':
          description: Response for status 429
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                  - code
                properties:
                  error:
                    type: string
                    description: Human-readable error message.
                  code:
                    type: string
                    enum:
                      - UNAUTHORIZED
                      - FORBIDDEN
                      - PRO_PLAN_REQUIRED
                      - NOT_FOUND
                      - VALIDATION_ERROR
                      - RATE_LIMITED
                      - CONFLICT
                      - INTERNAL_ERROR
          headers:
            RateLimit-Limit:
              schema:
                type: integer
              description: Maximum requests allowed in the current window.
            RateLimit-Remaining:
              schema:
                type: integer
              description: Requests remaining in the current window.
            RateLimit-Reset:
              schema:
                type: integer
              description: Seconds until the current window resets.
            RateLimit:
              schema:
                type: string
              description: >-
                Combined RateLimit header, for example `limit=120,
                remaining=119, reset=60`.
            X-API-Version:
              schema:
                type: string
                enum:
                  - v1
              description: API version that served this response.
            Retry-After:
              schema:
                type: integer
              description: Seconds to wait before retrying.
        '500':
          description: Internal error.
          headers:
            RateLimit-Limit:
              schema:
                type: integer
              description: Maximum requests allowed in the current window.
            RateLimit-Remaining:
              schema:
                type: integer
              description: Requests remaining in the current window.
            RateLimit-Reset:
              schema:
                type: integer
              description: Seconds until the current window resets.
            RateLimit:
              schema:
                type: string
              description: >-
                Combined RateLimit header, for example `limit=120,
                remaining=119, reset=60`.
            X-API-Version:
              schema:
                type: string
                enum:
                  - v1
              description: API version that served this response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
components:
  schemas:
    ApiError:
      type: object
      required:
        - error
        - code
      properties:
        error:
          type: string
          description: Human-readable error message.
        code:
          type: string
          description: Machine-readable error code.
          enum:
            - UNAUTHORIZED
            - FORBIDDEN
            - PRO_PLAN_REQUIRED
            - NOT_FOUND
            - VALIDATION_ERROR
            - RATE_LIMITED
            - CONFLICT
            - INTERNAL_ERROR
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Headless API key (qk_...). Pro plan required.

````