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

# Create Cart

> Create a new cart. Returns cart ID for subsequent operations.



## OpenAPI

````yaml /api-reference/openapi.json post /api/storefront/cart
openapi: 3.1.0
info:
  title: Agentic Commerce API
  description: |2-

        Agentic Commerce API - E-commerce Backend

        ## APIs

        ### Dashboard API (`/api/dashboard`)
        Authenticated endpoints for merchant management:
        - Products, Variants, Options
        - Inventory management
        - Orders and fulfillment
        - Customers
        - Collections

        ### Storefront API (`/api/storefront`)
        Public endpoints for client websites:
        - Product catalog
        - Collections
        - Cart management
        - Checkout

        ### Sync API (`/api/sync`)
        Integration endpoints for zunkiree-search:
        - Product sync
        - Availability checks
        - Order creation from AI widget
        
  version: 1.0.0
servers: []
security: []
paths:
  /api/storefront/cart:
    post:
      tags:
        - Storefront
        - Cart
      summary: Create Cart
      description: Create a new cart. Returns cart ID for subsequent operations.
      operationId: create_cart_api_storefront_cart_post
      parameters:
        - name: X-Site-ID
          in: header
          required: true
          schema:
            type: string
            title: X-Site-Id
        - name: X-Stella-Token
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Stella-Token
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CartResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    CartResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        items:
          items:
            $ref: '#/components/schemas/CartItemResponse'
          type: array
          title: Items
        subtotal:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Subtotal
        items_count:
          type: integer
          title: Items Count
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - id
        - items
        - subtotal
        - items_count
        - created_at
        - updated_at
      title: CartResponse
      description: Schema for cart response.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CartItemResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        variant_id:
          type: string
          format: uuid
          title: Variant Id
        product_id:
          type: string
          format: uuid
          title: Product Id
        product_name:
          type: string
          title: Product Name
        variant_name:
          type: string
          title: Variant Name
        sku:
          anyOf:
            - type: string
            - type: 'null'
          title: Sku
        image_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Image Url
        price:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Price
        quantity:
          type: integer
          title: Quantity
        total:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Total
      type: object
      required:
        - id
        - variant_id
        - product_id
        - product_name
        - variant_name
        - sku
        - image_url
        - price
        - quantity
        - total
      title: CartItemResponse
      description: Schema for cart item in response.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````