> ## 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.

# Retrieve cart by user ID

> Retrieves the active `Cart` for this user. Returns `cart: null` when no active cart exists. Refresh failures return 500 rather than cart:null.



## OpenAPI

````yaml https://openapi.commercengine.io/ce-storefront.json get /carts/users/{user_id}
openapi: 3.2.0
info:
  version: '1.0'
  title: CE Storefront APIs
  summary: Customer-facing e-commerce API for building exceptional shopping experiences
  description: >-
    Public-facing API for Commerce Engine storefronts, enabling seamless
    shopping experiences with product browsing, cart management, checkout
    processing, user accounts, and order tracking. Perfect for building web,
    mobile, and headless commerce applications.
  contact:
    name: Support
    email: support@commercengine.io
    url: https://www.commercengine.io/contact-us
  license:
    url: https://www.commercengine.io/contact-us
    name: All Rights Reserved
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: []
tags:
  - name: section-identity
    summary: Identity
    kind: nav
  - name: Authentication
    description: >-
      Start an anonymous session for each visitor, then sign them in or register
      them with a one-time password over SMS, WhatsApp or email, or with a
      password. Every flow ends in the access and refresh tokens your app sends
      with each request.
    summary: Authentication
    kind: nav
    parent: section-identity
  - name: Account recovery
    description: >-
      Get a shopper back into their account: reset a forgotten password, or find
      the account by its KYC document numbers and sign in with the one-time code
      sent to it.
    summary: Account recovery
    kind: nav
    parent: section-identity
  - name: Users
    description: >-
      The signed-in shopper's `User`: read and update the profile, manage the
      profile image, change the password, check whether the email and phone are
      verified, and deactivate or delete the account.
    summary: Users
    kind: nav
    parent: section-identity
  - name: Customer attributes
    description: >-
      The store's customer attributes (`StorefrontAttribute`) and the shopper's
      values for them (`UserAttributeValue`), for building profile forms.
    summary: Customer attributes
    kind: nav
    parent: section-identity
  - name: section-customers
    summary: Customers
    kind: nav
  - name: Addresses
    description: >-
      The customer's saved addresses, as `CustomerAddress` objects, to offer at
      checkout and manage on the account page.
    summary: Addresses
    kind: nav
    parent: section-customers
  - name: Bank accounts
    description: >-
      The customer's bank accounts, as `CustomerBankAccount` objects: add,
      update, verify and remove them.
    summary: Bank accounts
    kind: nav
    parent: section-customers
  - name: KYC documents
    description: >-
      The KYC documents the store requires (`KycDocumentConfig`) and the ones
      the customer has added (`Document`). Verify a document number before
      saving it.
    summary: KYC documents
    kind: nav
    parent: section-customers
  - name: Saved payment methods
    description: >-
      The cards, UPI IDs and wallets the customer has saved, to offer at
      checkout.
    summary: Saved payment methods
    kind: nav
    parent: section-customers
  - name: Mandates
    description: >-
      Recurring-payment mandates the customer authorizes (`CustomerMandate`):
      create, update, pause, resume or revoke them, and list the debits
      scheduled against them (`MandateDebitSchedule`).
    summary: Mandates
    kind: nav
    parent: section-customers
  - name: Loyalty
    description: >-
      The store's `LoyaltyProgram` and the customer's standing in it: their
      `CustomerLoyalty` and `LoyaltyPointActivity`. Redeem points on a cart
      under Carts.
    summary: Loyalty
    kind: nav
    parent: section-customers
  - name: Credit
    description: >-
      What the customer can spend on credit: their bank-transfer
      `CustomerCreditBalance` and their credit line
      (`CustomerCreditLineBalance`). Apply the credit balance to a cart under
      Carts.
    summary: Credit
    kind: nav
    parent: section-customers
  - name: section-catalog
    summary: Catalog
    kind: nav
  - name: Products
    description: >-
      Browse and search the store's catalog: 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: Categories
    description: >-
      The store's categories, as `ProductCategory` objects with their child
      categories, for navigation and filtering.
    summary: Categories
    kind: nav
    parent: section-catalog
  - name: Reviews
    description: >-
      Reviews of products and sellers: show them, let a shopper review a
      product, and list what the customer has reviewed or can review next.
    summary: Reviews
    kind: nav
    parent: section-catalog
  - name: Marketplace catalog
    description: >-
      A marketplace's catalog as shoppers browse it: `MarketplaceProduct`s with
      their seller, variants, SKUs, categories and reviews, plus search and
      recommendations.
    summary: Marketplace catalog
    kind: nav
    parent: section-catalog
  - name: section-shopping
    summary: Shopping
    kind: nav
  - name: Carts
    description: >-
      The shopper's `Cart`: create it, add, update or remove items, 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 shopper 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: >-
      How an order reaches the shopper: check that a pincode is serviceable,
      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: Wishlist
    description: Products the shopper saved for later, as `Item` objects.
    summary: Wishlist
    kind: nav
    parent: section-shopping
  - name: section-orders
    summary: Orders
    kind: nav
  - name: Orders
    description: >-
      Place an order from the cart and follow it afterwards: list orders, read
      an `OrderDetail`, cancel it, list its shipments, and offer past items
      again.
    summary: Orders
    kind: nav
    parent: section-orders
  - name: Order payments
    description: >-
      Pay for an order after checkout: poll its payment status, retry or cancel
      a payment request, and list its `OrderPayment`s and refunds.
    summary: Order payments
    kind: nav
    parent: section-orders
  - name: Returns
    description: >-
      Return delivered items: create an `OrderReturn`, add attachments, follow
      it, and cancel it.
    summary: Returns
    kind: nav
    parent: section-orders
  - name: section-payments
    summary: Payments
    kind: nav
  - name: Payments
    description: >-
      The payment methods the store accepts and the checks around paying with
      them: card BIN details, VPA and IFSC lookups, and authenticating a payment
      with a direct OTP.
    summary: Payments
    kind: nav
    parent: section-payments
  - name: PayU
    description: >-
      Generate the hash PayU requires on the requests your app sends it, such as
      validating a UPI ID or saving and retrieving cards.
    summary: PayU
    kind: nav
    parent: section-payments
  - name: section-store
    summary: Store
    kind: nav
  - name: Store
    description: >-
      The store your app runs on: check that it exists and read its
      `StoreConfig`, from brand and currency to KYC, customer groups and payment
      providers.
    summary: Store
    kind: nav
    parent: section-store
  - name: Sellers
    description: >-
      A marketplace's sellers: a seller's profile (`SellerDetail`) and the
      sellers authorized for a customer (`SellerInfo`).
    summary: Sellers
    kind: nav
    parent: section-store
  - name: Locations
    description: Countries, states and pincodes for address forms.
    summary: Locations
    kind: nav
    parent: section-store
  - name: Newsletter
    description: Sign a shopper up for the store's newsletter.
    summary: Newsletter
    kind: nav
    parent: section-store
externalDocs:
  url: https://llm-docs.commercengine.io
  description: Commerce Engine API Reference Documentation
paths:
  /carts/users/{user_id}:
    parameters:
      - name: user_id
        in: path
        description: User ID
        required: true
        schema:
          type: string
    get:
      tags:
        - Carts
      summary: Retrieve cart by user ID
      description: >-
        Retrieves the active `Cart` for this user. Returns `cart: null` when no
        active cart exists. Refresh failures return 500 rather than cart:null.
      operationId: get-user-cart
      parameters:
        - name: user_id
          in: path
          description: User ID
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                  - success
                  - content
                properties:
                  message:
                    type: string
                    examples:
                      - cart details
                    readOnly: true
                  success:
                    type: boolean
                    readOnly: true
                  content:
                    properties:
                      cart:
                        anyOf:
                          - $ref: '#/components/schemas/CartRead'
                          - type: 'null'
                    required:
                      - cart
                    type: object
          links:
            AddItemToUserCart:
              operationId: update-cart
              parameters:
                id: $response.body#/content/cart/id
              description: Add items to the user's cart.
            SetUserCartAddress:
              operationId: create-cart-address
              parameters:
                id: $response.body#/content/cart/id
              description: Set billing and shipping address on the user's cart.
            SetUserCartFulfillment:
              operationId: update-fulfillment-preference
              parameters:
                id: $response.body#/content/cart/id
              description: Set the fulfillment preference on the user's cart.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '504':
          $ref: '#/components/responses/GatewayTimeout'
      security:
        - Authorization: []
      externalDocs:
        url: https://llm-docs.commercengine.io/storefront/operations/get-user-cart
        description: API reference for the get-user-cart operation
components:
  schemas:
    CartRead:
      title: CartRead
      externalDocs:
        url: https://llm-docs.commercengine.io/storefront/schemas/CartRead
        description: API reference for the CartRead schema
      allOf:
        - $ref: '#/components/schemas/Cart'
        - type: object
          required:
            - promotion_discount_percent
            - coupon_id
            - fulfillment_preference
            - shipping_provider_name
            - courier_company_name
          properties:
            sales_channel:
              type: object
              required:
                - id
                - name
                - type
            cart_items:
              type: array
              items:
                $ref: '#/components/schemas/CartItemRead'
    Cart:
      title: Cart
      description: >-
        This cart model is structured to capture a wide range of details,
        facilitating accurate representation and management of user shopping
        carts in an e-commerce platform.
      type: object
      externalDocs:
        url: https://llm-docs.commercengine.io/storefront/schemas/Cart
        description: API reference for the Cart schema
      required:
        - id
        - user_id
        - customer_id
        - active
        - customer_note
        - is_promotion_applied
        - is_coupon_applied
        - coupon_code
        - coupon_discount_amount
        - coupon_discount_percent
        - promotion_discount_amount
        - subtotal
        - items_tax_amount
        - subtotal_including_tax
        - shipping_estimated_cost
        - shipping_discount_amount
        - shipping_amount
        - shipping_tax_rate
        - shipping_tax_amount
        - shipping_amount_including_tax
        - estimated_delivery_days
        - handling_charge_excluding_tax
        - handling_charge_tax_amount
        - handling_charge_including_tax
        - total_tax
        - grand_total
        - credit_balance_used
        - to_be_paid
        - loyalty_points_redeemed
        - loyalty_points_earned
        - cart_items_count
        - cart_items
        - billing_address
        - shipping_address
        - currency
        - metadata
        - expires_at
        - applied_promotions
        - applied_coupons
        - shipments
        - promotion_savings
        - coupon_savings
        - other_savings
        - total_savings
        - free_shipping_threshold
        - status
        - status_error_message
        - on_subscription
        - sales_channel
        - created_at
        - modified_at
        - cart_value
        - loyalty_point_eligible_amount
        - promotion_discount_percent
        - fulfillment_preference
        - coupon_id
        - shipping_provider_name
        - courier_company_name
      properties:
        id:
          description: Unique identifier for the cart.
          type: string
          pattern: ^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$
        user_id:
          description: >-
            The user who owns the cart. Can differ from `customer_id`, for
            example when several users belong to one business customer. For a
            POS cart, identifies the operator recorded as `pos_user_id` in
            `metadata`.
          type: string
        customer_id:
          description: >-
            The unique ID of the customer the cart is for. `null` until a
            customer is linked. The cart never embeds customer details — fetch
            them from the customer endpoints so they are always current.
          type:
            - string
            - 'null'
        active:
          description: Indicates whether the cart is currently active or inactive.
          type: boolean
        customer_note:
          description: customer note for shipping or product customization.
          type:
            - string
            - 'null'
        is_promotion_applied:
          description: Indicates if a promotion is applied or not.
          type: boolean
        is_coupon_applied:
          description: Indicates if a coupon is applied or not.
          type: boolean
        coupon_code:
          description: Code of the applied coupon.
          type:
            - string
            - 'null'
        coupon_discount_amount:
          description: Discount amount due to the coupon.
          type: number
          format: double
          minimum: 0
        coupon_discount_percent:
          description: >-
            Discount percentage of the applied coupon. `null` if no coupon has
            been applied to the cart yet.
          type:
            - number
            - 'null'
          format: double
          minimum: 0
        promotion_discount_amount:
          description: Discount amount due to promotions(If Applied).
          type: number
          format: double
          minimum: 0
        promotion_discount_percent:
          description: Discount amount due to promotions(If Applied).
          type: number
          format: double
          minimum: 0
        subtotal:
          description: Subtotal amount for items in the cart.
          type: number
          format: double
          minimum: 0
        items_tax_amount:
          description: Total tax amount for items.
          type: number
          format: double
          minimum: 0
        subtotal_including_tax:
          description: Subtotal including tax.
          type: number
          format: double
          minimum: 0
        shipping_estimated_cost:
          description: Estimated cost of shipping.
          type:
            - number
            - 'null'
        shipping_discount_amount:
          description: Discount applied on estimated shipping cost.
          type:
            - number
            - 'null'
        shipping_amount:
          description: Shipping amount chargable to customer.
          type:
            - number
            - 'null'
        shipping_tax_rate:
          description: Shipping tax rate applied on shipping amount.
          type:
            - number
            - 'null'
        shipping_tax_amount:
          description: Tax applied on shipping_amount.
          type:
            - number
            - 'null'
        shipping_amount_including_tax:
          description: Shipping amount including shipping tax.
          type:
            - number
            - 'null'
        fulfillment_preference:
          $ref: '#/components/schemas/FulfillmentPreference'
        estimated_delivery_days:
          description: >-
            Estimated delivery time across the cart's shipments, as a range of
            days `"<min>-<max>"` (e.g. `"2-5"`). `null` until the shipments have
            a delivery estimate.
          type:
            - string
            - 'null'
        handling_charge_excluding_tax:
          description: >-
            The additional charge applied to cover the costs associated with
            processing, packaging, and handling an order. This fee is separate
            from shipping charges and may include materials, or special handling
            requirements.
          type: number
          format: double
          minimum: 0
        handling_charge_tax_amount:
          type: number
          format: double
          minimum: 0
        handling_charge_including_tax:
          type: number
          format: double
          minimum: 0
        total_tax:
          description: Total tax amount for the entire cart.
          type: number
          format: double
          minimum: 0
        grand_total:
          description: Grand total amount for the cart.
          type: number
          format: double
          minimum: 0
        credit_balance_used:
          description: Amount of credit balance used.
          type: number
          format: double
          minimum: 0
        to_be_paid:
          description: >-
            Amount to be paid by the customer: `grand_total` less the applied
            credit balance, rounded down to a whole currency unit. Negative when
            the applied credit exceeds the cart total, for example after items
            are removed; reduce the credit before checkout.
          type: number
          format: double
        loyalty_points_redeemed:
          description: Number of loyalty points redeemed.
          type: number
          minimum: 0
        loyalty_points_earned:
          description: Number of loyalty points earned.
          type: number
          minimum: 0
        cart_items_count:
          description: Number of items in the cart.
          type: integer
          minimum: 0
        cart_items:
          description: 'List containing detailed information about each item in the cart. '
          type: array
          items:
            $ref: '#/components/schemas/CartItem'
        billing_address:
          $ref: '#/components/schemas/CartAddress'
          description: Details of the billing address.
        shipping_address:
          $ref: '#/components/schemas/CartAddress'
          description: Details of the shipping address.
        currency:
          $ref: '#/components/schemas/Currency'
          description: >-
            Details about the currency being used, including `name`, `code`, and
            `symbol`.
        metadata:
          description: >-
            Session-derived POS attribution plus custom scalar text/null values.
            Numbers are returned as strings; reserved keys and unsafe stored
            nested values are excluded.
          type:
            - object
            - 'null'
          additionalProperties:
            type:
              - string
              - 'null'
          properties:
            pos_user_id:
              description: >-
                POS operator who created the cart. `null` for a cart not created
                at a POS.
              type:
                - string
                - 'null'
            pos_device_id:
              description: >-
                POS device the cart was created on. `null` for a cart not
                created at a POS.
              type:
                - string
                - 'null'
            origin_location_id:
              description: Store location the cart was created at, when given.
              type:
                - string
                - 'null'
        expires_at:
          description: >-
            ISO 8601 expiry time. Active carts can be refreshed and renewed by
            cart updates, including loyalty-point and credit-balance redemption.
            Checkout rejects an expired cart.
          type:
            - string
            - 'null'
          format: date-time
        applied_promotions:
          description: >-
            Information about the promotional offers that have been applied to
            the cart.
          type: array
          items:
            $ref: '#/components/schemas/AppliedPromotion'
        applied_coupons:
          description: >-
            This key provides details about the savings in cart after coupon
            have been applied to the cart.
          type: array
          items:
            $ref: '#/components/schemas/AppliedCoupon'
        shipments:
          description: >-
            List containing detailed information about each shipment in the
            cart.
          type: array
          items:
            $ref: '#/components/schemas/CartShipment'
        promotion_savings:
          description: Monetary promotion savings; bonus loyalty points are excluded.
          type: number
          minimum: 0
        coupon_savings:
          description: Monetary coupon savings; bonus loyalty points are excluded.
          type: number
          minimum: 0
        other_savings:
          description: >-
            Nonnegative markdown savings between listing price and original
            selling price, across positive-quantity items.
          type: number
          minimum: 0
        total_savings:
          description: >-
            Combined savings across promotions, coupons, and other discounts
            (`promotion_savings` + `coupon_savings` + `other_savings`).
          type: number
          minimum: 0
        free_shipping_threshold:
          description: Free shipping threshold of the cart
          type:
            - number
            - 'null'
        status:
          description: >-
            Checkout readiness of the cart. Collection carts are ready when they
            have items. Other carts also need a shipping address, and delivery
            carts need shipments. This status does not confirm that a pickup
            preference has been selected. Use `status_error_message` for the
            reason when `not-ready-for-payment`.
          type: string
          default: not-ready-for-payment
          enum:
            - not-ready-for-payment
            - ready-for-payment
        status_error_message:
          description: >-
            Human-readable reason why the cart is not ready for payment. `null`
            when `status` is `ready-for-payment`.
          type:
            - string
            - 'null'
        coupon_id:
          description: ID of the applied coupon. `null` when no coupon is applied.
          type:
            - string
            - 'null'
          readOnly: true
        on_subscription:
          description: Whether the cart is a subscription cart.
          type: boolean
        sales_channel:
          description: The sales channel the cart belongs to.
          type: object
          properties:
            id:
              type:
                - string
                - 'null'
            name:
              type:
                - string
                - 'null'
            type:
              type:
                - string
                - 'null'
          required:
            - id
            - name
            - type
        loyalty_point_eligible_amount:
          description: Order amount eligible for loyalty-point earning.
          type: number
        cart_value:
          description: Calculated cart value used for coupon/promotion order-value checks.
          type: number
        shipping_provider_name:
          description: >-
            Cart-level shipping provider name. Currently always `null` (resolved
            per shipment under `shipments[]`).
          type:
            - string
            - 'null'
        courier_company_name:
          description: >-
            Cart-level courier company name. Currently always `null` (resolved
            per shipment under `shipments[]`).
          type:
            - string
            - 'null'
        created_at:
          description: Creation timestamp (ISO-8601).
          type: string
          format: date-time
          readOnly: true
        modified_at:
          description: Last-modification timestamp (ISO-8601).
          type: string
          format: date-time
          readOnly: true
      examples: []
    CartItemRead:
      title: CartItemRead
      externalDocs:
        url: https://llm-docs.commercengine.io/storefront/schemas/CartItemRead
        description: API reference for the CartItemRead schema
      allOf:
        - $ref: '#/components/schemas/CartItem'
        - type: object
          required:
            - original_selling_price
            - discount_amount
            - subscription_plan
            - subscription_interval
            - subscription_frequency
            - subscription_eligibility
            - available_subscription_plans
            - seller_id
            - seller_product_id
            - seller_variant_id
            - seller_detail
    FulfillmentPreference:
      title: FulfillmentPreference
      description: >-
        How the customer wants to receive their order. Discriminated by
        `fulfillment_type`: `delivery` for home delivery, `collect-in-store` for
        in-store pickup, or `partial-collect-and-delivery` for a mix of both.
      externalDocs:
        url: >-
          https://llm-docs.commercengine.io/storefront/schemas/FulfillmentPreference
        description: API reference for the FulfillmentPreference schema
      discriminator:
        propertyName: fulfillment_type
        mapping:
          collect-in-store: '#/components/schemas/CollectInStoreFulfillment'
          delivery: '#/components/schemas/DeliveryFulfillment'
          partial-collect-and-delivery: '#/components/schemas/PartialCollectAndDelivery'
      oneOf:
        - $ref: '#/components/schemas/CollectInStoreFulfillment'
        - $ref: '#/components/schemas/DeliveryFulfillment'
        - $ref: '#/components/schemas/PartialCollectAndDelivery'
      x-tags:
        - Carts
    CartItem:
      title: CartItem
      description: >-
        This Cart Item model captures the attributes of a cart item, including
        product details, pricing information, subscription details, and other
        relevant information related to Cart Item.
      type: object
      externalDocs:
        url: https://llm-docs.commercengine.io/storefront/schemas/CartItem
        description: API reference for the CartItem schema
      required:
        - product_id
        - variant_id
        - sku
        - product_slug
        - variant_slug
        - product_name
        - variant_name
        - product_type
        - product_image_url
        - stock_available
        - backorder
        - on_subscription
        - on_promotion
        - quantity
        - is_free_item
        - free_quantity
        - promotion_discount_amount
        - coupon_discount_amount
        - price_including_tax
        - listing_price
        - selling_price
        - selling_price_excluding_tax
        - min_order_quantity
        - max_order_quantity
        - incremental_quantity
        - handling_charge_excluding_tax
        - handling_charge_tax_rate
        - handling_charge_including_tax
        - tax_type
        - tax_rate
        - tax_amount
        - associated_options
        - attributes
        - subscriptions
        - discount_amount
        - subscription_plan
        - subscription_interval
        - subscription_frequency
        - subscription_eligibility
        - available_subscription_plans
        - seller_id
        - seller_product_id
        - seller_variant_id
        - seller_detail
      properties:
        product_id:
          description: Unique identifier for the product.
          type: string
          pattern: ^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$
        variant_id:
          description: >-
            The product variant identifier. `null` if the product has no
            variants.
          type:
            - string
            - 'null'
          pattern: ^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$
        sku:
          description: >-
            Stock Keeping Unit, a unique identifier for the product within
            inventory.
          type:
            - string
            - 'null'
          examples:
            - SKU1254
        product_name:
          description: Name of the product.
          type: string
        variant_name:
          description: Name of the variant.
          type:
            - string
            - 'null'
        product_slug:
          type:
            - string
            - 'null'
        variant_slug:
          type:
            - string
            - 'null'
        product_type:
          type: string
          enum:
            - physical
            - digital
            - bundle
          examples:
            - physical
        product_image_url:
          description: >-
            URL pointing to the product image. `null` when the product has no
            images.
          type:
            - string
            - 'null'
        stock_available:
          description: Indicates whether the product is currently in stock.
          type: boolean
        backorder:
          description: >-
            Indicates whether the item is being fulfilled as a backorder. When
            true, the item is not currently in stock and will ship later once
            inventory is available. This may result in the order being split
            into multiple shipments, with delays for the backordered portion.
          type: boolean
        on_subscription:
          description: Indicates whether the product is currently on a subscription.
          type: boolean
        on_promotion:
          description: Indicates whether the product is part of a promotion.
          type: boolean
        quantity:
          description: The quantity of the product in the cart.
          type: integer
        is_free_item:
          description: Indicates if the product is offered for free.
          type: boolean
        free_quantity:
          description: Quantity of the product that is free.
          type: integer
        promotion_discount_amount:
          description: Discount amount due to promotions.
          type: number
          format: double
        coupon_discount_amount:
          description: Discount amount due to applied coupons.
          type: number
          format: double
        price_including_tax:
          description: Indicates whether the item price is inclusive of taxes.
          type: boolean
          examples:
            - false
        listing_price:
          type: number
          format: double
          example: 200
        selling_price:
          type: number
          format: double
          example: 199
        selling_price_excluding_tax:
          type: number
          format: double
        min_order_quantity:
          type: integer
          default: 1
        max_order_quantity:
          type:
            - integer
            - 'null'
        incremental_quantity:
          type: integer
          default: 1
        handling_charge_excluding_tax:
          description: Additional cost for shipping associated with the product.
          type: number
          minimum: 0
          readOnly: true
        handling_charge_tax_rate:
          description: Additional cost for shipping associated with the product.
          type: number
          minimum: 0
          readOnly: true
        handling_charge_including_tax:
          description: Additional cost for shipping associated with the product.
          type: number
          minimum: 0
          readOnly: true
        tax_type:
          description: Type of tax applied (e.g., GST).
          type: string
          default: GST
          enum:
            - GST
            - VAT
            - ECO
        tax_rate:
          description: The rate of tax applied to the product.
          type: number
          format: double
        tax_amount:
          description: The total tax amount for the product.
          type: number
          format: double
        associated_options:
          oneOf:
            - $ref: '#/components/schemas/AssociatedOption'
              description: Used when `variant_id` is not null.
            - type: 'null'
              description: Null when `variant_id` is null.
        attributes:
          description: The product's attributes. `null` or empty when the product has none.
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/ProductAttribute'
        subscriptions:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/ProductSubscription'
        seller_id:
          description: >-
            Seller ID. This field is relevant for marketplace type stores only.
            Will return null for b2b and b2c type stores.
          type:
            - string
            - 'null'
        seller_detail:
          description: >-
            Seller detail information. This field is relevant for marketplace
            type stores only. Will return null for b2b and b2c type stores.
          oneOf:
            - $ref: '#/components/schemas/SellerInfo'
            - type: 'null'
        original_selling_price:
          description: Selling price before item-level discounts.
          type: number
        discount_amount:
          description: Total discount amount applied to the line.
          type: number
        subscription_plan:
          type:
            - string
            - 'null'
        subscription_interval:
          description: >-
            Interval of the line's subscription plan. `null` when the line is
            not on a subscription.
          type:
            - integer
            - 'null'
        subscription_frequency:
          type:
            - string
            - 'null'
        subscription_eligibility:
          type: boolean
        available_subscription_plans:
          description: >-
            Available subscription plans for the line (same data as
            `subscriptions`).
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/ProductSubscription'
        seller_product_id:
          description: >-
            Seller's product ID. Relevant for marketplace stores; `null`
            otherwise.
          type:
            - string
            - 'null'
        seller_variant_id:
          description: >-
            Seller's variant ID. Relevant for marketplace stores; `null`
            otherwise.
          type:
            - string
            - 'null'
      examples: []
    CartAddress:
      title: CartAddress
      description: >-
        A billing or shipping address set on a cart. `null` until an address is
        set.
      type:
        - object
        - 'null'
      externalDocs:
        url: https://llm-docs.commercengine.io/storefront/schemas/CartAddress
        description: API reference for the CartAddress schema
      required:
        - id
        - first_name
        - last_name
        - business_name
        - phone
        - country_code
        - email
        - address_line1
        - address_line2
        - landmark
        - pincode
        - city
        - state
        - country
        - gstin
        - tax_identification_number
        - is_email_verified
        - is_phone_verified
      properties:
        id:
          type:
            - string
            - 'null'
        first_name:
          type: string
        last_name:
          type:
            - string
            - 'null'
        business_name:
          type:
            - string
            - 'null'
        phone:
          description: 10 digit phone number without country code.
          type: string
        country_code:
          description: Phone country code with a plus sign prefix, e.g. `+91`.
          type: string
        email:
          type: string
        address_line1:
          type: string
        address_line2:
          type:
            - string
            - 'null'
        landmark:
          type:
            - string
            - 'null'
        pincode:
          type: string
        city:
          type: string
        state:
          type: string
        country:
          description: '`null` when the saved address it was set from has no country.'
          type:
            - string
            - 'null'
        gstin:
          description: >-
            GST identification number of the buyer's business, when one was
            given with the address.
          type:
            - string
            - 'null'
        tax_identification_number:
          description: Tax Identification Number specific to the country of operation.
          type:
            - string
            - 'null'
        is_email_verified:
          type: boolean
        is_phone_verified:
          type: boolean
    Currency:
      type: object
      externalDocs:
        url: https://llm-docs.commercengine.io/storefront/schemas/Currency
        description: API reference for the Currency schema
      required:
        - name
        - code
        - symbol
      properties:
        name:
          type: string
          examples:
            - Indian Rupee
        code:
          type: string
          examples:
            - INR
          maxLength: 3
          minLength: 3
        symbol:
          type: string
          examples:
            - ₹
    AppliedPromotion:
      title: AppliedPromotion
      description: Details about an active promotion applied to a cart/order
      type: object
      externalDocs:
        url: https://llm-docs.commercengine.io/storefront/schemas/AppliedPromotion
        description: API reference for the AppliedPromotion schema
      required:
        - promotion_id
        - promotion_type
        - savings
        - product_id
        - variant_id
        - product_name
        - variant_name
        - applied_sequence
        - scope
      properties:
        promotion_id:
          type: string
        promotion_type:
          enum:
            - discount
            - free-goods
            - free-shipping
            - buy-x-get-y
            - volume-based
            - fixed-price
        savings:
          type: number
        product_id:
          type:
            - string
            - 'null'
        variant_id:
          type:
            - string
            - 'null'
        product_name:
          type:
            - string
            - 'null'
        variant_name:
          type:
            - string
            - 'null'
        applied_sequence:
          type:
            - number
            - 'null'
        scope:
          type:
            - string
            - 'null'
    AppliedCoupon:
      title: AppliedCoupon
      description: Details about an active coupon applied to a cart/order
      type: object
      externalDocs:
        url: https://llm-docs.commercengine.io/storefront/schemas/AppliedCoupon
        description: API reference for the AppliedCoupon schema
      required:
        - coupon_id
        - coupon_type
        - savings
        - product_id
        - variant_id
        - product_name
        - variant_name
      properties:
        coupon_id:
          type: string
        coupon_type:
          enum:
            - discount
            - free-goods
            - fixed-price
            - free-shipping
            - buy-x-get-y
            - volume-based
            - accelerated-rewards
            - tiered-discount
        savings:
          type: number
        product_id:
          type:
            - string
            - 'null'
        variant_id:
          type:
            - string
            - 'null'
        product_name:
          type:
            - string
            - 'null'
        variant_name:
          type:
            - string
            - 'null'
    CartShipment:
      title: CartShipment
      description: Cart shipment model
      type: object
      externalDocs:
        url: https://llm-docs.commercengine.io/storefront/schemas/CartShipment
        description: API reference for the CartShipment schema
      required:
        - id
        - shipping_provider_id
        - shipping_provider_name
        - courier_company_id
        - courier_company_name
        - shipping_amount
        - shipping_tax_amount
        - shipping_amount_including_tax
        - shipment_items_count
        - items
      properties:
        id:
          type: string
        shipping_provider_id:
          type:
            - string
            - 'null'
        shipping_provider_name:
          type:
            - string
            - 'null'
        courier_company_id:
          type:
            - string
            - 'null'
        courier_company_name:
          type:
            - string
            - 'null'
        shipping_amount:
          type: number
          format: double
        shipping_tax_amount:
          type: number
          format: double
        shipping_amount_including_tax:
          type: number
          format: double
        shipment_items_count:
          type: integer
        items:
          type: array
          items:
            $ref: '#/components/schemas/CartShipmentItem'
    CollectInStoreFulfillment:
      title: CollectInStoreFulfillment
      type: object
      externalDocs:
        url: >-
          https://llm-docs.commercengine.io/storefront/schemas/CollectInStoreFulfillment
        description: API reference for the CollectInStoreFulfillment schema
      required:
        - fulfillment_type
        - pickup_location_id
        - preference_type
      properties:
        fulfillment_type:
          type: string
          const: collect-in-store
        preference_type:
          type: string
          enum:
            - user
            - auto
          readOnly: true
        pickup_location_id:
          type:
            - string
            - 'null'
        pickup_location_name:
          type:
            - string
            - 'null'
          readOnly: true
    DeliveryFulfillment:
      title: DeliveryFulfillment
      type: object
      externalDocs:
        url: >-
          https://llm-docs.commercengine.io/storefront/schemas/DeliveryFulfillment
        description: API reference for the DeliveryFulfillment schema
      required:
        - fulfillment_type
        - shipments
        - preference_type
      properties:
        fulfillment_type:
          type: string
          const: delivery
        preference_type:
          type: string
          enum:
            - user
            - auto
          readOnly: true
        shipments:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              shipping_provider_id:
                type:
                  - string
              shipping_provider_name:
                type:
                  - string
                  - 'null'
                readOnly: true
              courier_company_id:
                type:
                  - string
                  - 'null'
              courier_company_name:
                type:
                  - string
                  - 'null'
                readOnly: true
            required:
              - id
              - shipping_provider_id
              - shipping_provider_name
              - courier_company_name
    PartialCollectAndDelivery:
      title: PartialCollectAndDelivery
      description: >-
        Automatic preferences can omit `collect_in_store` and `delivery`.
        Provide both for a user-selected preference.
      type: object
      externalDocs:
        url: >-
          https://llm-docs.commercengine.io/storefront/schemas/PartialCollectAndDelivery
        description: API reference for the PartialCollectAndDelivery schema
      required:
        - fulfillment_type
        - preference_type
      properties:
        fulfillment_type:
          type: string
          const: partial-collect-and-delivery
        preference_type:
          type: string
          enum:
            - user
            - auto
          readOnly: true
        collect_in_store:
          type: object
          properties:
            pickup_location_id:
              type:
                - string
                - 'null'
            pickup_location_name:
              type:
                - string
                - 'null'
              readOnly: true
            items:
              type: array
              items:
                $ref: '#/components/schemas/FulfillmentItem'
          required:
            - items
            - pickup_location_id
        delivery:
          type: object
          properties:
            shipping_provider_id:
              type: string
            shipping_provider_name:
              type:
                - string
                - 'null'
              readOnly: true
            courier_company_id:
              type:
                - string
                - 'null'
            courier_company_name:
              type:
                - string
                - 'null'
              readOnly: true
            items:
              type: array
              items:
                $ref: '#/components/schemas/FulfillmentItem'
          required:
            - shipping_provider_id
            - items
    AssociatedOption:
      title: AssociatedOption
      description: >-
        An object where each key is an option name, and the value describes the
        option details.
      type: object
      externalDocs:
        url: https://llm-docs.commercengine.io/storefront/schemas/AssociatedOption
        description: API reference for the AssociatedOption schema
      additionalProperties:
        oneOf:
          - $ref: '#/components/schemas/ColorOption'
          - $ref: '#/components/schemas/SingleSelectOption'
      examples:
        - background_color:
            name: Background Color
            value:
              name: Blue
              hexcode: '#0000FF'
            type: color
          size:
            name: Size
            value: Large
            type: single-select
    ProductAttribute:
      externalDocs:
        url: https://llm-docs.commercengine.io/storefront/schemas/ProductAttribute
        description: API reference for the ProductAttribute schema
      discriminator:
        propertyName: type
        mapping:
          color: '#/components/schemas/ColorAttribute'
          single-select: '#/components/schemas/SingleSelectAttribute'
          multi-select: '#/components/schemas/MultiSelectAttribute'
          text: '#/components/schemas/TextAttribute'
          date: '#/components/schemas/DateAttribute'
          number: '#/components/schemas/NumberAttribute'
          boolean: '#/components/schemas/BooleanAttribute'
      oneOf:
        - $ref: '#/components/schemas/ColorAttribute'
          type: object
        - $ref: '#/components/schemas/SingleSelectAttribute'
          type: object
        - $ref: '#/components/schemas/MultiSelectAttribute'
          type: object
        - $ref: '#/components/schemas/TextAttribute'
          type: object
        - $ref: '#/components/schemas/DateAttribute'
          type: object
        - $ref: '#/components/schemas/NumberAttribute'
          type: object
        - $ref: '#/components/schemas/BooleanAttribute'
          type: object
    ProductSubscription:
      title: ProductSubscription
      type: object
      externalDocs:
        url: >-
          https://llm-docs.commercengine.io/storefront/schemas/ProductSubscription
        description: API reference for the ProductSubscription schema
      required:
        - subscription_plan_id
        - subscription_plan
        - subscription_price
        - billing_interval
        - billing_frequency
        - billing_limit
        - fulfill_separately
        - order_interval
        - order_frequency
        - order_limit
        - minimum_quantity
        - billing_trial_days
      properties:
        subscription_plan_id:
          description: >-
            Stored subscription plan ID; null for older search entries without
            one.
          type:
            - string
            - 'null'
        subscription_plan:
          type: string
        subscription_price:
          type: number
          format: double
        billing_interval:
          description: >-
            Billing interval determines the frequency for which the customer is
            charged for the subscription itself.
          type: integer
        billing_frequency:
          type: string
          enum:
            - Weekly
            - Bimonthly
            - Monthly
            - Quarterly
            - Semiannually
            - Annually
          examples:
            - Monthly
        billing_limit:
          description: '`null` means unlimited billing cycles.'
          type:
            - integer
            - 'null'
        fulfill_separately:
          type: boolean
          default: false
        order_interval:
          description: >-
            order interval defines the frequency of when the subscription sends
            customers the product
          type:
            - integer
            - 'null'
        order_frequency:
          type:
            - string
            - 'null'
          enum:
            - Weekly
            - Bimonthly
            - Monthly
            - Quarterly
            - Semiannually
            - Annually
            - null
          examples:
            - Monthly
        order_limit:
          description: '`null` means unlimited fulfillment cycles.'
          type:
            - integer
            - 'null'
        minimum_quantity:
          description: The quantity of the plan to which the customer should be subscribed
          type: integer
        billing_trial_days:
          description: Use in digital product only for trial period
          type: integer
      examples: []
    SellerInfo:
      title: SellerInfo
      type: object
      externalDocs:
        url: https://llm-docs.commercengine.io/storefront/schemas/SellerInfo
        description: API reference for the SellerInfo schema
      required:
        - id
        - trade_name
        - legal_name
        - business_type
        - tax_identification_number
      properties:
        id:
          type: string
        trade_name:
          type: string
        legal_name:
          type: string
        business_type:
          type: string
        tax_identification_number:
          type:
            - string
            - 'null'
      examples: []
    CartShipmentItem:
      title: CartShipmentItem
      description: An item in a cart shipment.
      externalDocs:
        url: https://llm-docs.commercengine.io/storefront/schemas/CartShipmentItem
        description: API reference for the CartShipmentItem schema
      required:
        - product_id
        - product_name
        - product_image_url
        - variant_id
        - variant_name
        - sku
        - quantity
        - free_quantity
        - is_free_item
      allOf:
        - $ref: '#/components/schemas/ShipmentItem'
    FulfillmentItem:
      title: FulfillmentItem
      type: object
      externalDocs:
        url: https://llm-docs.commercengine.io/storefront/schemas/FulfillmentItem
        description: API reference for the FulfillmentItem schema
      required:
        - product_id
        - product_name
        - variant_id
        - variant_name
        - quantity
      properties:
        product_id:
          type: string
        product_name:
          type: string
          readOnly: true
        variant_id:
          type:
            - string
            - 'null'
        variant_name:
          type:
            - string
            - 'null'
          readOnly: true
        quantity:
          type: integer
          minimum: 1
    ColorOption:
      title: ColorOption
      type: object
      externalDocs:
        url: https://llm-docs.commercengine.io/storefront/schemas/ColorOption
        description: API reference for the ColorOption schema
      required:
        - name
        - type
        - value
      properties:
        name:
          description: The name of the associated option.
          type: string
        type:
          description: The type of the associated option.
          const: color
        value:
          type: object
          properties:
            hexcode:
              description: 'The hex code of the color (e.g., #000000).'
              type: string
              format: color-hex
              pattern: ^#(?:[0-9a-fA-F]{3}){1,2}$
            name:
              type: string
              description: The name of the color.
          required:
            - name
            - hexcode
    SingleSelectOption:
      title: SingleSelectOption
      type: object
      externalDocs:
        url: >-
          https://llm-docs.commercengine.io/storefront/schemas/SingleSelectOption
        description: API reference for the SingleSelectOption schema
      required:
        - name
        - type
        - value
      properties:
        name:
          description: The name of the associated option.
          type: string
        type:
          description: The type of the associated option.
          const: single-select
        value:
          description: The value of the associated option
          type: string
    ColorAttribute:
      title: ColorAttribute
      description: Attribute for colors
      type: object
      readOnly: true
      externalDocs:
        url: https://llm-docs.commercengine.io/storefront/schemas/ColorAttribute
        description: API reference for the ColorAttribute schema
      required:
        - id
        - name
        - key
        - type
        - value
      properties:
        id:
          type: string
        name:
          type: string
        key:
          description: >-
            A lookup safe version of the name that is lowercased and spaces are
            replaced with underscores. For instance, if name is `Product Type`,
            key will be `product_type`
          type: string
        type:
          type: string
          example: color
          const: color
        value:
          type: object
          properties:
            hexcode:
              description: 'The hex code of the color (e.g., #000000).'
              type: string
              format: color-hex
              pattern: ^#(?:[0-9a-fA-F]{3}){1,2}$
            name:
              type: string
          required:
            - name
            - hexcode
    SingleSelectAttribute:
      title: SingleSelectAttribute
      description: Attribute for single-select values
      type: object
      readOnly: true
      externalDocs:
        url: >-
          https://llm-docs.commercengine.io/storefront/schemas/SingleSelectAttribute
        description: API reference for the SingleSelectAttribute schema
      required:
        - id
        - name
        - key
        - type
        - value
      properties:
        id:
          type: string
        name:
          type: string
        key:
          description: >-
            A lookup safe version of the name that is lowercased and spaces are
            replaced with underscores. For instance, if name is `Product Type`,
            key will be `product_type`
          type: string
        type:
          type: string
          example: single-select
          const: single-select
        value:
          description: For single-select attributes
          type: string
    MultiSelectAttribute:
      title: MultiSelectAttribute
      description: Attribute for multi-select values
      type: object
      readOnly: true
      externalDocs:
        url: >-
          https://llm-docs.commercengine.io/storefront/schemas/MultiSelectAttribute
        description: API reference for the MultiSelectAttribute schema
      required:
        - id
        - name
        - key
        - type
        - value
      properties:
        id:
          type: string
        name:
          type: string
        key:
          description: >-
            A lookup safe version of the name that is lowercased and spaces are
            replaced with underscores. For instance, if name is `Product Type`,
            key will be `product_type`
          type: string
        type:
          type: string
          example: multi-select
          const: multi-select
        value:
          description: For multi-select attributes
          type: array
          items:
            type: string
    TextAttribute:
      title: TextAttribute
      description: Attribute for text values
      type: object
      readOnly: true
      externalDocs:
        url: https://llm-docs.commercengine.io/storefront/schemas/TextAttribute
        description: API reference for the TextAttribute schema
      required:
        - id
        - name
        - key
        - type
        - value
      properties:
        id:
          type: string
        name:
          type: string
        key:
          description: >-
            A lookup safe version of the name that is lowercased and spaces are
            replaced with underscores. For instance, if name is `Product Type`,
            key will be `product_type`
          type: string
        type:
          type: string
          example: text
          const: text
        value:
          description: For text attributes
          type: string
    DateAttribute:
      title: DateAttribute
      description: Attribute for date values
      type: object
      readOnly: true
      externalDocs:
        url: https://llm-docs.commercengine.io/storefront/schemas/DateAttribute
        description: API reference for the DateAttribute schema
      required:
        - id
        - name
        - key
        - type
        - value
      properties:
        id:
          type: string
        name:
          type: string
        key:
          description: >-
            A lookup safe version of the name that is lowercased and spaces are
            replaced with underscores. For instance, if name is `Product Type`,
            key will be `product_type`
          type: string
        type:
          type: string
          example: date
          const: date
        value:
          description: >-
            `YYYY-MM-DD`, optionally followed by ` HH:MM`, ` HH:MM:SS`, or `
            HH:MM:SS.ffffff`.
          type: string
    NumberAttribute:
      title: NumberAttribute
      description: Attribute for numeric values
      type: object
      readOnly: true
      externalDocs:
        url: https://llm-docs.commercengine.io/storefront/schemas/NumberAttribute
        description: API reference for the NumberAttribute schema
      required:
        - id
        - name
        - key
        - type
        - value
      properties:
        id:
          type: string
        name:
          type: string
        key:
          description: >-
            A lookup safe version of the name that is lowercased and spaces are
            replaced with underscores. For instance, if name is `Product Type`,
            key will be `product_type`
          type: string
        type:
          type: string
          example: number
          const: number
        value:
          description: For numeric attributes
          type: number
    BooleanAttribute:
      title: BooleanAttribute
      description: Attribute for boolean values
      type: object
      readOnly: true
      externalDocs:
        url: https://llm-docs.commercengine.io/storefront/schemas/BooleanAttribute
        description: API reference for the BooleanAttribute schema
      required:
        - id
        - name
        - key
        - type
        - value
      properties:
        id:
          type: string
        name:
          type: string
        key:
          description: >-
            A lookup safe version of the name that is lowercased and spaces are
            replaced with underscores. For instance, if name is `Product Type`,
            key will be `product_type`
          type: string
        type:
          type: string
          example: boolean
          const: boolean
        value:
          description: For boolean attributes
          type: boolean
    ShipmentItem:
      title: ShipmentItem
      description: Shipment item model
      type: object
      externalDocs:
        url: https://llm-docs.commercengine.io/storefront/schemas/ShipmentItem
        description: API reference for the ShipmentItem schema
      properties:
        product_id:
          type: string
        product_name:
          type:
            - string
            - 'null'
        product_image_url:
          type:
            - string
            - 'null'
        variant_id:
          type:
            - string
            - 'null'
        variant_name:
          type:
            - string
            - 'null'
        sku:
          description: Present on cart shipment items; omitted from order shipment items.
          type:
            - string
            - 'null'
        quantity:
          type: integer
        free_quantity:
          type: integer
        is_free_item:
          type: boolean
  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
    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.