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

# Delete cart

> delete all items from the cart.



## OpenAPI

````yaml https://openapi.commercengine.io/ce-pos.json delete /pos/carts/{id}
openapi: 3.2.0
info:
  title: CE POS APIs
  description: >-
    The consolidated Point of Sale surface. Every operation is served under the
    storefront base URL; the POS backend proxies some of them to the admin
    service.
  version: '1.0'
servers:
  - url: https://staging.api.commercengine.io/api/v1/{store_id}/storefront
    description: Staging Server
    variables:
      store_id:
        description: Store ID
        default: store_id
    x-speakeasy-server-id: staging
  - url: https://prod.api.commercengine.io/api/v1/{store_id}/storefront
    description: Prod Server
    variables:
      store_id:
        description: Store ID
        default: store_id
    x-speakeasy-server-id: prod
security:
  - Authorization: []
tags:
  - name: section-identity
    summary: Identity
    kind: nav
  - name: Devices
    description: >-
      Set up the till: pair a device with the store using its pairing code, list
      the store's `PosLocation`s and `PosDevice`s, and claim a device for the
      signed-in user or release it.
    summary: Devices
    kind: nav
    parent: section-identity
  - name: Authentication
    description: >-
      Sign a staff member in on a paired device with a one-time password over
      SMS, WhatsApp or email, then refresh the access token or log out.
    summary: Authentication
    kind: nav
    parent: section-identity
  - name: Users
    description: >-
      The staff member signed in on the till, as a `PosUser` with their
      location, device and roles.
    summary: Users
    kind: nav
    parent: section-identity
  - name: section-customers
    summary: Customers
    kind: nav
  - name: Customers
    description: >-
      Look up the shopper at the till: list customers (`CustomerListItem`) and
      read one's full `CustomerDetail`.
    summary: Customers
    kind: nav
    parent: section-customers
  - name: Addresses
    description: >-
      A customer's saved addresses, as `Address` objects: list, add, update and
      remove them.
    summary: Addresses
    kind: nav
    parent: section-customers
  - name: section-catalog
    summary: Catalog
    kind: nav
  - name: Products
    description: >-
      Browse and search the catalog at the till: list `Product`s and SKUs, read
      a product and its variants, and show similar, up-sell and cross-sell
      items.
    summary: Products
    kind: nav
    parent: section-catalog
  - name: Reviews
    description: Read product reviews at the till.
    summary: Reviews
    kind: nav
    parent: section-catalog
  - name: Categories
    description: >-
      The store's categories, as `ProductCategory` objects with their child
      categories.
    summary: Categories
    kind: nav
    parent: section-catalog
  - name: Inventory
    description: >-
      Stock at the store's locations: list it by item, read an item's
      `InventoryDetail`, and follow the `InventoryActivity` that moved it.
    summary: Inventory
    kind: nav
    parent: section-catalog
  - name: section-shopping
    summary: Shopping
    kind: nav
  - name: Carts
    description: >-
      The till's `Cart`: create it, add, update or remove items, link the
      customer, set the address, and apply loyalty points or credit balance.
      Each update returns the full, updated `Cart`.
    summary: Carts
    kind: nav
    parent: section-shopping
  - name: Coupons & promotions
    description: >-
      The coupons and promotions a cart can use: list what the store offers, see
      which apply to a cart and why the rest don't, and apply or remove a
      coupon.
    summary: Coupons & promotions
    kind: nav
    parent: section-shopping
  - name: Fulfillment
    description: >-
      List the delivery and collect-in-store options for a cart, and save the
      cart's choice.
    summary: Fulfillment
    kind: nav
    parent: section-shopping
  - name: section-orders
    summary: Orders
    kind: nav
  - name: Orders
    description: >-
      Place an order from the till's cart and follow it: list orders, read an
      `OrderDetail` and its activity, check stock before it ships, and get its
      invoice, receipt and shipments.
    summary: Orders
    kind: nav
    parent: section-orders
  - name: Order payments
    description: >-
      Collect payment for an order: add payments toward what is left to pay,
      across one or more methods, poll the payment status, and retry a failed or
      expired payment.
    summary: Order payments
    kind: nav
    parent: section-orders
  - name: Shipments
    description: >-
      The shipments that fulfill orders: list them, read a `ShipmentDetail` with
      its activity and invoice, approve, reject or update one, send a
      replacement, and refund a shortfall.
    summary: Shipments
    kind: nav
    parent: section-orders
  - name: section-payments
    summary: Payments
    kind: nav
  - name: Payments
    description: >-
      The payment methods the till accepts and the checks around paying with
      them: card BIN details, VPA verification, and authenticating a payment
      with a direct OTP.
    summary: Payments
    kind: nav
    parent: section-payments
  - name: section-store
    summary: Store
    kind: nav
  - name: Locations
    description: States and pincodes for address forms.
    summary: Locations
    kind: nav
    parent: section-store
paths:
  /pos/carts/{id}:
    delete:
      tags:
        - Carts
      summary: Delete cart
      description: delete all items from the cart.
      operationId: pos-delete-cart
      parameters:
        - name: id
          in: path
          description: Cart ID
          required: true
          schema:
            type: string
            maxLength: 128
            minLength: 1
            pattern: ^[A-Za-z0-9_-]{1,128}$
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                  - success
                  - events
                properties:
                  message:
                    type: string
                    examples:
                      - All cart items are removed.
                    readOnly: true
                  success:
                    type: boolean
                    readOnly: true
                  events:
                    description: >-
                      Analytics events to emit for the change this request made,
                      each with a server-issued `event_id`. Replay them to your
                      analytics destinations so your client-side and server-side
                      copies of the same action dedupe. Empty when the request
                      produced no analytics event.
                    type: array
                    items:
                      $ref: '#/components/schemas/StorefrontResponseEvent'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '408':
          $ref: '#/components/responses/RequestTimeout'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '504':
          $ref: '#/components/responses/GatewayTimeout'
      security:
        - Authorization: []
      externalDocs:
        url: https://llm-docs.commercengine.io/admin-pos/operations/pos-delete-cart
components:
  schemas:
    StorefrontResponseEvent:
      title: StorefrontResponseEvent
      description: >-
        A single analytics event to emit for a mutation you just made, returned
        in a response's `events` array. Each entry pairs a human-readable
        `event` name with a server-issued `event_id` (ULID): forward that id
        with your own client-side copy (pixel, tag, SDK) so both copies of the
        same action dedupe to one and downstream destinations count it once.
        `event` is the discriminator; the keys beside `event` and `event_id`
        identify the entity the event is about.
      externalDocs:
        url: >-
          https://llm-docs.commercengine.io/admin-pos/schemas/StorefrontResponseEvent
      discriminator:
        propertyName: event
        mapping:
          Cart Created: '#/components/schemas/CartLifecycleEvent'
          Cart Deleted: '#/components/schemas/CartLifecycleEvent'
          Checkout Started: '#/components/schemas/CartLifecycleEvent'
          Product Added: '#/components/schemas/CartLineChangeEvent'
          Product Removed: '#/components/schemas/CartLineChangeEvent'
          Coupon Applied: '#/components/schemas/CartCouponEvent'
          Coupon Removed: '#/components/schemas/CartCouponEvent'
          Order Created: '#/components/schemas/OrderCreatedEvent'
          Order Cancelled: '#/components/schemas/OrderCancelledEvent'
          Product Added to Wishlist: '#/components/schemas/WishlistChangeEvent'
          Product Removed from Wishlist: '#/components/schemas/WishlistChangeEvent'
      oneOf:
        - $ref: '#/components/schemas/CartLifecycleEvent'
        - $ref: '#/components/schemas/CartLineChangeEvent'
        - $ref: '#/components/schemas/CartCouponEvent'
        - $ref: '#/components/schemas/OrderCreatedEvent'
        - $ref: '#/components/schemas/OrderCancelledEvent'
        - $ref: '#/components/schemas/WishlistChangeEvent'
    CartLifecycleEvent:
      title: CartLifecycleEvent
      description: >-
        Emitted when a cart is created or deleted, or when checkout begins.
        `Checkout Started` is sent each time an address is set on the cart, even
        an unchanged one, matching Commerce Engine's own server-side copy.
      type: object
      externalDocs:
        url: https://llm-docs.commercengine.io/admin-pos/schemas/CartLifecycleEvent
      required:
        - event
        - event_id
        - cart_id
      properties:
        event:
          type: string
          enum:
            - Cart Created
            - Cart Deleted
            - Checkout Started
        event_id:
          description: >-
            Server-issued event id (ULID). Send it with your client-side copy of
            this event so both copies dedupe.
          type: string
          pattern: ^[0-7][0-9A-HJKMNP-TV-Z]{25}$
        cart_id:
          description: The `Cart` this event is about.
          type: string
    CartLineChangeEvent:
      title: CartLineChangeEvent
      description: >-
        Emitted when a cart line's quantity changes. `Product Added` carries the
        units added and `Product Removed` the units removed, relative to the
        line's previous quantity. A change that nets to zero produces no event.
      type: object
      externalDocs:
        url: >-
          https://llm-docs.commercengine.io/admin-pos/schemas/CartLineChangeEvent
      required:
        - event
        - event_id
        - cart_id
        - product_id
        - variant_id
        - quantity
      properties:
        event:
          type: string
          enum:
            - Product Added
            - Product Removed
        event_id:
          description: >-
            Server-issued event id (ULID). Send it with your client-side copy of
            this event so both copies dedupe.
          type: string
          pattern: ^[0-7][0-9A-HJKMNP-TV-Z]{25}$
        cart_id:
          description: The `Cart` the line belongs to.
          type: string
        product_id:
          description: The product whose line changed.
          type: string
        variant_id:
          description: The product variant, or `null` when the product has no variants.
          type:
            - string
            - 'null'
        quantity:
          description: Units added (`Product Added`) or removed (`Product Removed`).
          type: integer
          minimum: 1
    CartCouponEvent:
      title: CartCouponEvent
      description: >-
        Emitted when a coupon is applied to or removed from a cart. Removing a
        coupon when none is applied emits nothing.
      type: object
      externalDocs:
        url: https://llm-docs.commercengine.io/admin-pos/schemas/CartCouponEvent
      required:
        - event
        - event_id
        - cart_id
        - coupon_code
      properties:
        event:
          type: string
          enum:
            - Coupon Applied
            - Coupon Removed
        event_id:
          description: >-
            Server-issued event id (ULID). Send it with your client-side copy of
            this event so both copies dedupe.
          type: string
          pattern: ^[0-7][0-9A-HJKMNP-TV-Z]{25}$
        cart_id:
          description: The `Cart` the coupon change applies to.
          type: string
        coupon_code:
          description: The coupon code applied or removed.
          type: string
    OrderCreatedEvent:
      title: OrderCreatedEvent
      description: Emitted when an order is placed, on every channel including POS.
      type: object
      externalDocs:
        url: https://llm-docs.commercengine.io/admin-pos/schemas/OrderCreatedEvent
      required:
        - event
        - event_id
        - order_number
        - cart_id
      properties:
        event:
          type: string
          const: Order Created
        event_id:
          description: >-
            Server-issued event id (ULID). Send it with your client-side copy of
            this event so both copies dedupe.
          type: string
          pattern: ^[0-7][0-9A-HJKMNP-TV-Z]{25}$
        order_number:
          description: The `Order` that was created.
          type: string
        cart_id:
          description: >-
            The cart the order was created from, or `null` when it did not
            originate from a cart.
          type:
            - string
            - 'null'
    OrderCancelledEvent:
      title: OrderCancelledEvent
      description: >-
        Emitted when an order transitions to `cancelled`. A cancel that does not
        change the status emits nothing.
      type: object
      externalDocs:
        url: >-
          https://llm-docs.commercengine.io/admin-pos/schemas/OrderCancelledEvent
      required:
        - event
        - event_id
        - order_number
      properties:
        event:
          type: string
          const: Order Cancelled
        event_id:
          description: >-
            Server-issued event id (ULID). Send it with your client-side copy of
            this event so both copies dedupe.
          type: string
          pattern: ^[0-7][0-9A-HJKMNP-TV-Z]{25}$
        order_number:
          description: The `Order` that was cancelled.
          type: string
    WishlistChangeEvent:
      title: WishlistChangeEvent
      description: >-
        Emitted when a product is added to or removed from the shopper's
        wishlist.
      type: object
      externalDocs:
        url: >-
          https://llm-docs.commercengine.io/admin-pos/schemas/WishlistChangeEvent
      required:
        - event
        - event_id
        - product_id
        - variant_id
      properties:
        event:
          type: string
          enum:
            - Product Added to Wishlist
            - Product Removed from Wishlist
        event_id:
          description: >-
            Server-issued event id (ULID). Send it with your client-side copy of
            this event so both copies dedupe.
          type: string
          pattern: ^[0-7][0-9A-HJKMNP-TV-Z]{25}$
        product_id:
          description: The product added to or removed from the wishlist.
          type: string
        variant_id:
          description: The product variant, or `null` when the product has no variants.
          type:
            - string
            - 'null'
  responses:
    Unauthorized:
      description: >-
        Authentication failed. Codes include `token-required`, `token-expired`
        and `token_not_valid` for an invalid or expired token.
      content:
        application/json:
          schema:
            type: object
            required:
              - message
              - success
              - code
            properties:
              message:
                type: string
                examples:
                  - Not authorized for given operation on the Resource.
                x-speakeasy-error-message: true
              success:
                type: boolean
                default: false
              code:
                type: string
                examples:
                  - unauthorized
              details:
                type: string
    Forbidden:
      description: >-
        Access denied. `token-required` requires an authenticated session;
        `permission-denied` means the caller cannot access this resource. On
        POS, `session-expired` requires signing in again.
      content:
        application/json:
          schema:
            type: object
            required:
              - code
              - message
              - success
            properties:
              code:
                type: string
              message:
                type: string
                x-speakeasy-error-message: true
              success:
                type: boolean
              details:
                type: string
    NotFound:
      description: Requested resource not found
      content:
        application/json:
          schema:
            type: object
            required:
              - message
              - success
              - code
            properties:
              message:
                type: string
                x-speakeasy-error-message: true
              success:
                type: boolean
              code:
                type: string
              details:
                type: string
    RequestTimeout:
      description: The request timed out.
      content:
        application/json:
          schema:
            type: object
            required:
              - code
              - message
              - success
            properties:
              code:
                type: string
              message:
                type: string
                x-speakeasy-error-message: true
              success:
                type: boolean
              details:
                type: string
    InternalServerError:
      description: The request failed because of an unexpected error.
      content:
        application/json:
          schema:
            type: object
            required:
              - code
              - message
              - success
            properties:
              code:
                type: string
              message:
                type: string
                x-speakeasy-error-message: true
              success:
                type: boolean
              details:
                type: string
    GatewayTimeout:
      description: The request timed out.
      content:
        application/json:
          schema:
            type: object
            required:
              - code
              - message
              - success
            properties:
              code:
                type: string
              message:
                type: string
                x-speakeasy-error-message: true
              success:
                type: boolean
              details:
                type: string
  securitySchemes:
    Authorization:
      type: http
      description: Access token
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.