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

# Cancel order

> Cancels an order. Only available when `is_cancellation_allowed` is `true` on the order. Returns the updated `OrderDetail` object. Requires a `cancellation_reason` and `refund_mode`.



## OpenAPI

````yaml post /orders/{order_number}/cancel
openapi: 3.1.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: Analytics
    description: Analytics
  - name: Auth
    description: auth
  - name: Campaigns
    description: Campaigns
  - name: Carts
    description: Carts
  - name: Catalog
    description: Catalog
  - name: Common
    description: Common
  - name: Coupons & promotions
    description: Coupons & promotions
  - name: Customers
    description: Customers
  - name: Juspay
    description: Juspay Payments
  - name: KYC
    description: KYC
  - name: Marketplace
    description: Marketplace
  - name: Orders
    description: Orders
  - name: Others
    description: Others
  - name: Payments
    description: Payments
  - name: PayU
    description: PayU Payments
  - name: POS
    description: POS
  - name: Shipping
    description: Shipping
  - name: Store
    description: Store
  - name: Subscriptions
    description: Subscriptions
externalDocs:
  url: https://llm-docs.commercengine.io
  description: Commerce Engine API Reference Documentation
paths:
  /orders/{order_number}/cancel:
    post:
      tags:
        - Orders
      summary: Cancel order
      description: >-
        Cancels an order. Only available when `is_cancellation_allowed` is
        `true` on the order. Returns the updated `OrderDetail` object. Requires
        a `cancellation_reason` and `refund_mode`.
      operationId: cancel-order
      parameters:
        - name: order_number
          in: path
          description: order number
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - cancellation_reason
                - refund_mode
              properties:
                cancellation_reason:
                  type: string
                refund_mode:
                  type: string
                  enum:
                    - original-payment-mode
                    - bank-transfer
                bank_account_id:
                  description: verified bank account id if refund_mode = bank-transfer
                  type: string
                feedback:
                  description: feedback text
                  type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    default: order details
                    readOnly: true
                  success:
                    type: boolean
                    readOnly: true
                  content:
                    properties:
                      order:
                        $ref: '#/components/schemas/OrderDetail'
                    type: object
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - Authorization: []
      externalDocs:
        url: https://llm-docs.commercengine.io/storefront/operations/cancel-order
        description: API reference for the cancel-order operation
components:
  schemas:
    OrderDetail:
      title: OrderDetail
      externalDocs:
        url: https://llm-docs.commercengine.io/storefront/schemas/OrderDetail
        description: API reference for the OrderDetail schema
      allOf:
        - $ref: '#/components/schemas/Order'
        - type: object
          properties:
            payments:
              type: array
              items:
                $ref: '#/components/schemas/OrderPayment'
            shipments:
              type: array
              items:
                $ref: '#/components/schemas/OrderShipment'
    Order:
      title: Order
      type: object
      externalDocs:
        url: https://llm-docs.commercengine.io/storefront/schemas/Order
        description: API reference for the Order schema
      required:
        - applied_promotions
        - applied_coupons
      properties:
        order_number:
          description: >-
            Unique, human-readable order identifier used across all order
            endpoints.
          type: string
        order_date:
          type: string
          format: date-time
        status:
          description: >-
            Current fulfillment status of the order. Progresses from `confirmed`
            through shipping stages to `complete`.
          type: string
          enum:
            - draft
            - awaiting_approval
            - confirmed
            - partially_scheduled
            - awaiting_shipment
            - shipped
            - partially_shipped
            - undelivered
            - partially_undelivered
            - return_to_origin
            - partially_return_to_origin
            - complete
            - partially_delivered
            - cancelled
            - pending
        payment_status:
          description: >-
            Current payment status. Poll `/orders/{order_number}/payment-status`
            after a payment attempt until this is `success` or `failed`.
          type: string
          enum:
            - pending
            - success
            - failed
            - partially_paid
        payment_success_date:
          type:
            - string
            - 'null'
        customer_note:
          type:
            - string
            - 'null'
        is_promotion_applied:
          type: boolean
        promotion_discount_amount:
          type: number
          format: double
        promotion_discount_percent:
          type: number
          format: double
        is_coupon_applied:
          type: boolean
        coupon_code:
          type:
            - string
            - 'null'
        coupon_discount_amount:
          type: number
          format: double
        coupon_discount_percent:
          type: number
          format: double
        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'
        promotion_savings:
          description: Total savings from auto-applied promotions.
          type: number
          format: float
          minimum: 0
        coupon_savings:
          description: Total savings from the applied coupon code.
          type: number
          format: float
          minimum: 0
        other_savings:
          description: >-
            Total savings from loyalty points, credit balance, and other
            non-promotion/coupon discounts.
          type: number
          format: float
          minimum: 0
        total_savings:
          description: Combined savings across promotions, coupons, and other discounts.
          type: number
          format: float
          minimum: 0
        on_subscription:
          type: boolean
        subtotal:
          type: number
          format: double
        item_total_tax:
          type: number
          format: double
        subtotal_including_tax:
          type: number
          format: double
        shipping_estimated_cost:
          type: number
          format: double
          minimum: 0
        shipping_discount_amount:
          type: number
          format: double
          minimum: 0
        shipping_amount:
          type: number
          format: double
        shipping_tax_rate:
          type: number
          format: double
          minimum: 0
        shipping_tax_amount:
          type: number
          format: double
          minimum: 0
        shipping_amount_including_tax:
          type: number
          format: double
          minimum: 0
        fulfillment_preference:
          $ref: '#/components/schemas/FulfillmentPreference'
        estimated_delivery_days:
          type:
            - integer
            - 'null'
        handling_charge_excluding_tax:
          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:
          type: number
          format: double
        grand_total:
          type: number
          format: double
        loyalty_points_earned:
          type: integer
          minimum: 0
        loyalty_points_redeemed:
          type: integer
          minimum: 0
        credit_balance_used:
          type: integer
        to_be_paid:
          type: number
          format: double
        order_items_count:
          type: integer
        order_items:
          type: array
          items:
            $ref: '#/components/schemas/OrderItem'
        billing_address:
          $ref: '#/components/schemas/CustomerAddress'
        shipping_address:
          $ref: '#/components/schemas/CustomerAddress'
        currency:
          type: object
          properties:
            name:
              type: string
            code:
              type: string
            symbol:
              type: string
        metadata:
          description: Additional metadata associated with the order.
          type:
            - object
            - 'null'
          additionalProperties:
            type: string
        is_cancellation_allowed:
          description: >-
            Whether the order is eligible for cancellation. Only show the cancel
            action in your UI when this is `true`.
          type: boolean
        cancellation_refund_details:
          description: >-
            Breakdown of the refund the customer would receive upon
            cancellation. Only populated when `is_cancellation_allowed` is
            `true`.
          type: object
          properties:
            loyalty_point:
              description: >-
                loyalty point redeemed will be rollbacked and credited to user
                account.
              type: integer
            refundable_amount:
              description: amount that will be refunded to customer.
              type: number
            cancellation_charges:
              description: amount deducted from paid amount.
              type: number
            cancellation_charges_reason:
              description: reason for cancellation charges.
              type: string
            payment_mode:
              description: payment mode for refund.
              type: string
              enum:
                - original-payment-mode
                - bank-transfer
                - nach-mandate
        feedback:
          type:
            - string
            - 'null'
    OrderPayment:
      title: OrderPayment
      description: Order Payment
      externalDocs:
        url: https://llm-docs.commercengine.io/storefront/schemas/OrderPayment
        description: API reference for the OrderPayment schema
      oneOf:
        - $ref: '#/components/schemas/CardPayment'
        - $ref: '#/components/schemas/NetbankingPayment'
        - $ref: '#/components/schemas/UpiPayment'
        - $ref: '#/components/schemas/WalletPayment'
        - $ref: '#/components/schemas/BankTransfer'
        - $ref: '#/components/schemas/NachPayment'
    OrderShipment:
      title: OrderShipment
      description: Order shipment model
      type: object
      externalDocs:
        url: https://llm-docs.commercengine.io/storefront/schemas/OrderShipment
        description: API reference for the OrderShipment schema
      properties:
        reference_number:
          type: string
        status:
          $ref: '#/components/schemas/ShipmentStatus'
        total_weight:
          type: number
        total_boxes:
          type: integer
        shipment_items_count:
          type: integer
        shipment_items:
          type: array
          items:
            $ref: '#/components/schemas/ShipmentItem'
        shipping_amount:
          type: number
          format: double
        shipping_tax_amount:
          type: number
          format: double
        shipping_amount_including_tax:
          type: number
          format: double
        courier_company_name:
          type: string
        shipping_label_url:
          type: string
        awb_no:
          type: string
        tracking_url:
          type: string
        eta_delivery:
          type: string
        shipped_date:
          type: string
          format: date-time
        delivered_date:
          type: string
          format: date-time
        cancellation_reason:
          type: string
        created_at:
          type: string
          format: date-time
        modified_at:
          type: string
          format: date-time
        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'
    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
        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
        scope:
          type: string
    AppliedCoupon:
      title: AppliedPromotion
      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
        savings:
          type: number
        product_id:
          type:
            - string
            - 'null'
        variant_id:
          type:
            - string
            - 'null'
        product_name:
          type:
            - string
            - 'null'
        variant_name:
          type:
            - string
            - 'null'
    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:
            $ref: '#/components/schemas/CollectInStoreFulfillment'
          delivery:
            $ref: '#/components/schemas/DeliveryFulfillment'
          partial-collect-and-delivery:
            $ref: '#/components/schemas/PartialCollectAndDelivery'
      oneOf:
        - $ref: '#/components/schemas/CollectInStoreFulfillment'
        - $ref: '#/components/schemas/DeliveryFulfillment'
        - $ref: '#/components/schemas/PartialCollectAndDelivery'
      x-tags:
        - Carts
    OrderItem:
      type: object
      externalDocs:
        url: https://llm-docs.commercengine.io/storefront/schemas/OrderItem
        description: API reference for the OrderItem schema
      required:
        - product_id
        - product_name
        - product_image_url
        - product_type
        - sku
        - slug
        - variant_id
        - variant_name
        - backorder
        - on_promotion
        - on_subscription
        - subscription_plan
        - subscription_interval
        - subscription_frequency
        - quantity
        - free_quantity
        - is_free_item
        - price_including_tax
        - selling_price
        - listing_price
        - selling_price_excluding_tax
        - promotion_discount_amount
        - coupon_discount_amount
        - tax_type
        - tax_rate
        - tax_amount
        - handling_charge_excluding_tax
        - handling_charge_tax_rate
        - handling_charge_including_tax
      properties:
        product_id:
          type: string
        product_name:
          type: string
        product_image_url:
          type:
            - string
            - 'null'
        product_type:
          enum:
            - physical
            - digital
            - bundle
        sku:
          type: string
        slug:
          type: string
        variant_id:
          type:
            - string
            - 'null'
        variant_name:
          type:
            - string
            - 'null'
        backorder:
          description: >-
            backorder


            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_promotion:
          type: boolean
        on_subscription:
          type: boolean
        subscription_plan:
          type:
            - string
            - 'null'
        subscription_interval:
          type:
            - integer
            - 'null'
        subscription_frequency:
          type:
            - string
            - 'null'
        quantity:
          type: integer
          minimum: 0
        free_quantity:
          type: integer
          minimum: 0
        is_free_item:
          type: boolean
        price_including_tax:
          type: boolean
        selling_price:
          type: number
          format: double
          minimum: 0
        listing_price:
          type: number
          format: double
          minimum: 0
        selling_price_excluding_tax:
          type: number
          format: double
          minimum: 0
        promotion_discount_amount:
          type: number
          format: double
          minimum: 0
        coupon_discount_amount:
          type: number
          format: double
          minimum: 0
        tax_type:
          type: string
          default: GST
          const: GST
          examples:
            - GST
        tax_rate:
          type: number
          format: double
          minimum: 0
        tax_amount:
          type: number
          format: double
          minimum: 0
        handling_charge_excluding_tax:
          type: number
          format: double
          minimum: 0
        handling_charge_tax_rate:
          type: number
          format: double
          minimum: 0
        handling_charge_including_tax:
          type: number
          format: double
          minimum: 0
        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:
          type: array
          items:
            $ref: '#/components/schemas/ProductAttribute'
        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'
    CustomerAddress:
      title: CustomerAddress
      type:
        - object
        - 'null'
      externalDocs:
        url: https://llm-docs.commercengine.io/storefront/schemas/CustomerAddress
        description: API reference for the CustomerAddress schema
      required:
        - first_name
        - last_name
        - country_code
        - phone
        - email
        - address_line1
        - address_line2
        - landmark
        - pincode
        - city
        - state
        - country
        - tax_identification_number
        - business_name
        - is_phone_verified
        - is_email_verified
      properties:
        id:
          type:
            - string
            - 'null'
          pattern: ^[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$
          readOnly: true
        first_name:
          type: string
        last_name:
          type:
            - string
            - 'null'
        country_code:
          description: "Two-letter code begin with a plus sign prefix that identifies different countries. By default it will be +91 if not provided.\r\n"
          type: string
        phone:
          description: 10 digit phone number without country code.
          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:
          type: string
          const: India
        tax_identification_number:
          description: Tax Identification Number specific to the country of operation.
          type:
            - string
            - 'null'
          examples: []
        business_name:
          description: Use in billing & shipping details only.
          type:
            - string
            - 'null'
        is_default_billing:
          description: >-
            Indicates if the address is the default billing address for the
            customer.
          type: boolean
        is_default_shipping:
          description: >-
            Indicates if the address is the default shipping address for the
            customer.
          type: boolean
        is_phone_verified:
          type: boolean
          readOnly: true
        is_email_verified:
          type: boolean
          readOnly: true
        nickname:
          description: Nickname for the address.
          type:
            - string
            - 'null'
          default: null
      examples: []
    CardPayment:
      title: CardPayment
      description: Payments using credit card, debit card
      externalDocs:
        url: https://llm-docs.commercengine.io/storefront/schemas/CardPayment
        description: API reference for the CardPayment schema
      allOf:
        - $ref: '#/components/schemas/PaymentInfo'
        - type: object
          properties:
            card_number:
              description: "masked card number\r\ne.g. ************1111"
              type: string
            card_type:
              type: string
              enum:
                - Visa
                - Master Card
                - Rupay
                - American Express
    NetbankingPayment:
      title: NetbankingPayment
      description: Payments using payment gateway netbanking option.
      externalDocs:
        url: https://llm-docs.commercengine.io/storefront/schemas/NetbankingPayment
        description: API reference for the NetbankingPayment schema
      allOf:
        - $ref: '#/components/schemas/PaymentInfo'
        - type: object
          properties:
            bank_name:
              type: string
    UpiPayment:
      title: UpiPayment
      description: UPI Payment
      externalDocs:
        url: https://llm-docs.commercengine.io/storefront/schemas/UpiPayment
        description: API reference for the UpiPayment schema
      allOf:
        - $ref: '#/components/schemas/PaymentInfo'
        - type: object
          properties:
            upi_id:
              type: string
    WalletPayment:
      title: WalletPayment
      externalDocs:
        url: https://llm-docs.commercengine.io/storefront/schemas/WalletPayment
        description: API reference for the WalletPayment schema
      allOf:
        - $ref: '#/components/schemas/PaymentInfo'
        - type: object
          properties:
            wallet_name:
              type: string
    BankTransfer:
      title: BankTransfer
      description: Bank transfer payment - IMPS, NEFT, RTGS
      externalDocs:
        url: https://llm-docs.commercengine.io/storefront/schemas/BankTransfer
        description: API reference for the BankTransfer schema
      allOf:
        - $ref: '#/components/schemas/PaymentInfo'
        - type: object
          properties:
            bank_account_number:
              description: "masked account number\r\ne.g. ************1234"
              type: string
            bank_name:
              type: string
    NachPayment:
      title: NachPayment
      description: NACH mandate payment via LotusPay.
      externalDocs:
        url: https://llm-docs.commercengine.io/storefront/schemas/NachPayment
        description: API reference for the NachPayment schema
      allOf:
        - $ref: '#/components/schemas/PaymentInfo'
    ShipmentStatus:
      externalDocs:
        url: https://llm-docs.commercengine.io/storefront/schemas/ShipmentStatus
        description: API reference for the ShipmentStatus schema
      enum:
        - unscheduled
        - schedule_requested
        - scheduled
        - packed
        - shipped
        - in_transit
        - out_for_delivery
        - delivery_attempted
        - undelivered
        - return_to_origin
        - delivered
        - cancelled
        - lost
    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
        product_image_url:
          type:
            - string
            - 'null'
        variant_id:
          type: string
        variant_name:
          type: string
        sku:
          type: string
        quantity:
          type: integer
        free_quantity:
          type: integer
        is_free_item:
          type: boolean
    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
      examples: []
    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
      properties:
        fulfillment_type:
          type: string
          const: collect-in-store
        preference_type:
          type: string
          enum:
            - user
            - auto
          readOnly: true
        pickup_location_id:
          type: string
        pickup_location_name:
          type: string
          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
      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
    PartialCollectAndDelivery:
      title: PartialCollectAndDelivery
      type: object
      externalDocs:
        url: >-
          https://llm-docs.commercengine.io/storefront/schemas/PartialCollectAndDelivery
        description: API reference for the PartialCollectAndDelivery schema
      required:
        - fulfillment_type
        - collect-in-store
        - delivery
      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
            pickup_location_name:
              type: string
              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:
            $ref: '#/components/schemas/ColorAttribute'
          single-select:
            $ref: '#/components/schemas/SingleSelectAttribute'
          multi-select:
            $ref: '#/components/schemas/MultiSelectAttribute'
          text:
            $ref: '#/components/schemas/TextAttribute'
          date:
            $ref: '#/components/schemas/DateAttribute'
          number:
            $ref: '#/components/schemas/NumberAttribute'
          boolean:
            $ref: '#/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
    PaymentInfo:
      title: PaymentInfo
      description: Common fields in all types of payments.
      type: object
      externalDocs:
        url: https://llm-docs.commercengine.io/storefront/schemas/PaymentInfo
        description: API reference for the PaymentInfo schema
      properties:
        transaction_type:
          type: string
          enum:
            - payment
            - refund
        request_number:
          type: string
        amount:
          type: number
          format: double
        payment_status:
          type: string
          enum:
            - pending
            - success
            - failed
            - partially_paid
            - refund_initiated
        payment_date:
          type: string
          format: date-time
        payment_reference_number:
          type:
            - string
            - 'null'
        payment_method:
          type:
            - string
            - 'null'
        icon_url:
          type:
            - string
            - 'null'
    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
    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
        value:
          type: array
          items:
            type: object
            required:
              - name
              - hexcode
            properties:
              name:
                type: string
              hexcode:
                description: 'The hex code of the color (e.g., #000000).'
                type: string
                format: color-hex
                pattern: ^#(?:[0-9a-fA-F]{3}){1,2}$
    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
        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
        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
        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
        value:
          description: For date attributes
          type: string
          format: date-time
    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
        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
        value:
          description: For boolean attributes
          type: boolean
  responses:
    Unauthorized:
      description: Not authorized for given operation on the Resource
      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
    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
  securitySchemes:
    Authorization:
      type: http
      description: Access token
      scheme: bearer

````