openapi: 3.0.1
info:
  title: Cart API
  description: >-
    fabric's Cart APIs let you add, update, and remove items from your
    Storefront cart, either as a guest user or as a logged-in user. It also
    provides functionality to merge carts when you switch from guest user to
    logged-in user, to apply coupon codes and other attributes (for example,
    gift wrapping) to the cart items. Additionally, it supports more advanced
    use cases such as using multiple carts within a B2B organization and sharing
    of carts, as well as supporting a unified cart experience for multi-region
    and multi-brand businesses. <br /><br />These APIs provide high performance,
    scalability, multi-tenancy, and configurability to the end-to-end order
    processing actions that start from an item being added to the cart, through
    the pre-checkout stage that includes billing, shipping, and payment details,
    to the checkout stage where the order is processed and confirmed by the
    fabric Order Management System (OMS) or alternatively an Order Draft can be
    created. An order draft can be used to coordinate the creation of an order
    in any other downstream systems.
  contact:
    name: Cart Support
    email: support.cnc@fabric.inc
  license:
    name: fabric API License
    url: https://fabric.inc/api-license
  version: 2.0.0
servers:
  - url: https://prod.cart.fabric.inc
tags:
  - name: Cart
    description: >-
      Cart endpoints let you do basic cart operations, such as create a cart,
      add item to the cart, update items, remove items, delete cart, update
      status of the cart, and more.
  - name: Attribute
    description: >-
      Attribute endpoints let you add, update, and remove different types of
      attributes to and from the cart, and items in the cart.
  - name: Shipping
    description: >-
      Shipping endpoints let you do shipping related activities, such as create
      or update shipping details ID, add shipping information to all items of
      the cart, add different shipping details for different items, and more.
  - name: Order Draft
    description: >-
      Order drafts are the final state of a cart, containing all the required
      information needed to create an order. All these information undergoes
      validations before being generated and stored as order drafts. Once an
      order draft is created, it cannot be changed.The following endpoints let
      you create and manage such order drafts.
  - name: Adjustments
    description: >-
      Using these endpoints, you can make adjustments to a cart or to the line
      items within a cart.
paths:
  /v2/carts:
    get:
      tags:
        - Cart
      summary: Get all carts
      description: >-
        Get all carts belonging to the user or to a merchant by authorization
        token
      operationId: getCarts
      parameters:
        - $ref: '#/components/parameters/x-site-context'
        - $ref: '#/components/parameters/x-api-key'
        - $ref: '#/components/parameters/authorization'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CartResponse'
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'
    post:
      tags:
        - Cart
      summary: Create an empty cart
      description: Create an empty cart with optional customer or configuration parameters
      operationId: createCart
      parameters:
        - $ref: '#/components/parameters/x-site-context'
        - $ref: '#/components/parameters/x-api-key'
        - $ref: '#/components/parameters/authorization'
      requestBody:
        description: Request body for creating an empty cart
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/createCartPayload'
        required: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CartResponse'
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'
  /v2/carts/items:
    post:
      tags:
        - Cart
      summary: Add items to cart
      description: Add items to cart, or create a new cart if cart does not exist
      operationId: addItem
      parameters:
        - $ref: '#/components/parameters/x-site-context'
        - $ref: '#/components/parameters/x-api-key'
        - $ref: '#/components/parameters/authorization'
      requestBody:
        description: Request body for adding items to, or updating items in the cart
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddItemPayload'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CartResponse'
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'
  /v2/carts/search:
    post:
      tags:
        - Cart
      summary: Search for carts
      description: >-
        Search for carts meeting specified criteria, including creation date,
        status, user, approver, and purchase order
      operationId: searchCarts
      parameters:
        - $ref: '#/components/parameters/x-site-context'
        - $ref: '#/components/parameters/x-api-key'
        - $ref: '#/components/parameters/authorization'
      requestBody:
        description: Request body for search cart
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchCartPayload'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchCartResponse'
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'
  /v2/carts/{cartId}:
    get:
      tags:
        - Cart
      summary: Get specific cart
      description: Get cart for specified cart ID
      operationId: getCartById
      parameters:
        - $ref: '#/components/parameters/x-site-context'
        - name: cartId
          in: path
          description: Cart ID
          required: true
          schema:
            type: string
            example: d7e78a21-bee3-4448-bf1c-d5b5461dbda2
        - $ref: '#/components/parameters/x-api-key'
        - $ref: '#/components/parameters/authorization'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CartResponse'
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'
    delete:
      tags:
        - Cart
      summary: Delete cart items
      description: >-
        Deletes cart information after purchase of cart items is complete. This
        is a soft delete that sets the status of the cart to *deleted* after the
        cart items are purchased and the order moves to shipping. The cart ID is
        not deleted.
      operationId: deleteCart
      parameters:
        - $ref: '#/components/parameters/x-site-context'
        - $ref: '#/components/parameters/x-api-key'
        - $ref: '#/components/parameters/authorization'
        - name: cartId
          in: path
          description: ID of cart to be deleted
          required: true
          schema:
            type: string
            example: d7e78a21-bee3-4448-bf1c-d5b5461dbda2
        - name: orderNumber
          in: header
          required: false
          schema:
            type: string
            example: 2947-5955-82579
            nullable: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CartResponse'
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'
  /v2/carts/{cartId}/soft-reserve:
    post:
      tags:
        - Cart
      summary: Soft reserve cart items
      description: >-
        Using this endpoint, you can reserve items, that are added to a specific
        cart, in inventory. Additionally, you can update the reservation
        information if such information is already available for the items of
        the cart.
      operationId: softReserveCart
      parameters:
        - $ref: '#/components/parameters/x-site-context'
        - $ref: '#/components/parameters/authorization'
        - $ref: '#/components/parameters/cartId'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CartResponse'
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'
  /v2/carts/{cartId}/attributes:
    patch:
      tags:
        - Attribute
      summary: Add or update cart attributes
      description: Add or update attributes for a specified cart
      operationId: updateCartAttribute
      parameters:
        - $ref: '#/components/parameters/x-site-context'
        - name: cartId
          in: path
          description: ID of cart for which attributes will be added or updated
          required: true
          schema:
            type: string
            example: d7e78a21-bee3-4448-bf1c-d5b5461dbda2
        - $ref: '#/components/parameters/x-api-key'
        - $ref: '#/components/parameters/authorization'
      requestBody:
        description: Cart attribute information to be added or updated
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCartAttributePayload'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CartResponse'
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'
  /v2/carts/{cartId}/attributes/{attributeId}:
    delete:
      tags:
        - Attribute
      summary: Delete specific cart attribute
      description: Deletes a specified attribute and metadata from a specified cart
      operationId: deleteCartAttribute
      parameters:
        - $ref: '#/components/parameters/x-site-context'
        - $ref: '#/components/parameters/x-api-key'
        - $ref: '#/components/parameters/authorization'
        - name: cartId
          in: path
          description: ID of cart for which attribute is to be deleted
          required: true
          schema:
            type: string
            example: d7e78a21-bee3-4448-bf1c-d5b5461dbda2
        - name: attributeId
          in: path
          description: ID of attribute to be deleted
          required: true
          schema:
            type: string
            example: 60c2a368eb2ec30008ae70a2
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CartResponse'
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'
  /v2/carts/{cartId}/attributes/fees:
    delete:
      tags:
        - Attribute
      summary: Delete specific cart fee
      description: Delete a specific fee associated with the given cart.
      operationId: deleteCartFees
      parameters:
        - $ref: '#/components/parameters/x-site-context'
        - $ref: '#/components/parameters/x-api-key'
        - $ref: '#/components/parameters/authorization'
        - $ref: '#/components/parameters/cartId'
        - $ref: '#/components/parameters/feeId'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CartResponse'
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'
  /v2/carts/{cartId}/item/attribute:
    patch:
      tags:
        - Attribute
      summary: Add or update specific item attribute
      description: Add or update specified cart item attribute
      deprecated: true
      operationId: updateCartItemAttribute
      parameters:
        - $ref: '#/components/parameters/x-site-context'
        - name: cartId
          in: path
          description: ID of cart for which item attribute needs to be updated
          required: true
          schema:
            type: string
            example: d7e78a21-bee3-4448-bf1c-d5b5461dbda2
        - $ref: '#/components/parameters/x-api-key'
        - $ref: '#/components/parameters/authorization'
      requestBody:
        description: Request body containing item attribute information to be updated
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/PricedItemAttributeIdValue'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CartResponse'
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'
  /v2/carts/{cartId}/item/{lineItemId}/attribute:
    patch:
      tags:
        - Attribute
      summary: Add or update item attributes and fees
      description: >-
        Add or update attributes and fees associated with a specific line item
        in a given cart.
      operationId: updateCreateCartItemAttribute
      parameters:
        - $ref: '#/components/parameters/x-site-context'
        - $ref: '#/components/parameters/x-api-key'
        - $ref: '#/components/parameters/authorization'
        - $ref: '#/components/parameters/cartId'
        - $ref: '#/components/parameters/lineItemId'
      requestBody:
        description: >-
          Request body containing item attribute and fees information to be
          updated
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/UpdateCreateCartItemAttributePayload'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CartResponse'
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'
  /v2/carts/{cartId}/item/attribute/{attributeId}/{lineItemId}:
    delete:
      tags:
        - Attribute
      summary: Delete a specific item attribute
      description: Deletes a specified attribute from a specified item in a specified cart
      operationId: deleteCartItemAttribute
      parameters:
        - $ref: '#/components/parameters/x-site-context'
        - name: cartId
          in: path
          description: ID of cart containing item whose attribute is to be deleted
          required: true
          schema:
            type: string
            example: d7e78a21-bee3-4448-bf1c-d5b5461dbda2
        - name: attributeId
          in: path
          description: ID of attribute to be deleted
          required: true
          schema:
            type: string
            example: 60c2a368eb2ec30008ae70a2
        - name: lineItemId
          in: path
          description: >-
            Cart item sequence number (starts at 1) of item whose attribute is
            to be deleted
          required: true
          schema:
            type: integer
            format: int32
        - $ref: '#/components/parameters/x-api-key'
        - $ref: '#/components/parameters/authorization'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CartResponse'
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'
  /v2/carts/{cartId}/item/attribute/fees/{lineItemId}:
    delete:
      tags:
        - Attribute
      summary: Delete item fees
      description: >-
        Delete a specific fee associated with an individual line item of the
        specified cart.
      operationId: deleteCartItemFees
      parameters:
        - $ref: '#/components/parameters/x-site-context'
        - $ref: '#/components/parameters/x-api-key'
        - $ref: '#/components/parameters/authorization'
        - $ref: '#/components/parameters/cartId'
        - $ref: '#/components/parameters/lineItemId'
        - $ref: '#/components/parameters/feeId'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CartResponse'
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'
  /v2/carts/{cartId}/items:
    delete:
      tags:
        - Cart
      summary: Delete items from specific cart
      description: Removes all items from specified cart
      operationId: removeItems
      parameters:
        - $ref: '#/components/parameters/x-site-context'
        - name: cartId
          in: path
          description: ID of cart for which all the items need to be removed
          required: true
          schema:
            type: string
            example: d7e78a21-bee3-4448-bf1c-d5b5461dbda2
        - $ref: '#/components/parameters/x-api-key'
        - $ref: '#/components/parameters/authorization'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CartResponse'
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'
    patch:
      tags:
        - Cart
      summary: Update items in specific cart
      description: >-
        Updates item information, such as quantity, price, attributes, in a
        specified cart
      operationId: updateItems
      parameters:
        - $ref: '#/components/parameters/x-site-context'
        - name: cartId
          in: path
          description: ID of cart for which items need to be updated
          required: true
          schema:
            type: string
            example: d7e78a21-bee3-4448-bf1c-d5b5461dbda2
        - $ref: '#/components/parameters/x-api-key'
        - $ref: '#/components/parameters/authorization'
      requestBody:
        description: Request body containing item information to be updated
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ModifyItemPayload'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CartResponse'
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'
  /v2/carts/{cartId}/lineItems/actions/split:
    post:
      tags:
        - Cart
      summary: Split the cart item by quantity
      description: >-
        Split a specific line item into multiple line items by given quantity.
        This allows adding different attributes (for example, different shipping
        locations) to each split line item. Each split line item is assigned a
        unique line item ID after the split.
      operationId: splitLineItems
      parameters:
        - $ref: '#/components/parameters/x-site-context'
        - $ref: '#/components/parameters/x-api-key'
        - $ref: '#/components/parameters/authorization'
        - name: cartId
          in: path
          description: ID of the cart for which line items are to be split
          required: true
          schema:
            type: string
            example: d7e78a21-bee3-4448-bf1c-d5b5461dbda2
      requestBody:
        description: Request body containing split items details
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SplitLineItemRequestPayload'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CartResponse'
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'
  /v2/carts/{cartId}/adjustments:
    post:
      tags:
        - Adjustments
      summary: Adjust prices for a specific cart
      description: Adjust prices for a specific cart's total amount.
      operationId: addCartPriceAdjustments
      parameters:
        - $ref: '#/components/parameters/x-site-context'
        - name: cartId
          in: path
          description: Cart ID to adjust price for the cart's total amount
          required: true
          schema:
            type: string
            example: d7e78a21-bee3-4448-bf1c-d5b5461dbda2
        - $ref: '#/components/parameters/x-api-key'
        - $ref: '#/components/parameters/authorization'
      requestBody:
        description: Sample request containing price adjustment details
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/PriceAdjustmentPayload'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CartResponse'
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'
    get:
      tags:
        - Adjustments
      summary: Get all price adjustment details for a specific cart
      description: Get all the price adjustments made to a specific cart.
      operationId: getCartPriceAdjustments
      parameters:
        - $ref: '#/components/parameters/x-site-context'
        - name: cartId
          in: path
          description: Cart ID to retrieve all the price adjustments made to the cart
          required: true
          schema:
            type: string
            example: d7e78a21-bee3-4448-bf1c-d5b5461dbda2
        - $ref: '#/components/parameters/x-api-key'
        - $ref: '#/components/parameters/authorization'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PriceAdjustmentResponse'
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'
  /v2/carts/{cartId}/adjustments/{adjustmentId}:
    delete:
      tags:
        - Adjustments
      summary: Delete a specific price adjustment information from a given cart
      description: >-
        Delete a specific price adjustment entity from the list of price
        adjustments made to the specified cart's total amount. A price
        adjustment entity is a single object in the price adjustments array.
      operationId: removeCartPriceAdjustment
      parameters:
        - $ref: '#/components/parameters/x-site-context'
        - name: cartId
          in: path
          description: >-
            Cart ID to delete a specific price adjustment information from the
            cart
          required: true
          schema:
            type: string
            example: d7e78a21-bee3-4448-bf1c-d5b5461dbda2
        - name: adjustmentId
          in: path
          description: >-
            Price adjustment ID; it identifies a single price adjustment object
            from the list of price adjustments for the specified `cartId`.
          required: true
          schema:
            type: string
            example: d7e78a21-bee3-4448-bf1c-d5b5461dbda2
        - $ref: '#/components/parameters/x-api-key'
        - $ref: '#/components/parameters/authorization'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CartResponse'
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'
    put:
      tags:
        - Adjustments
      summary: Update a specific price adjustment information for a given cart
      description: >-
        Update a specific price adjustment entity from the list of price
        adjustments made to the specified cart's total amount. A price
        adjustment entity is a single object in the price adjustments array.
      operationId: updateCartPriceAdjustment
      parameters:
        - $ref: '#/components/parameters/x-site-context'
        - name: cartId
          in: path
          description: >-
            Cart ID to update a specific price adjustment information within the
            cart
          required: true
          schema:
            type: string
            example: d7e78a21-bee3-4448-bf1c-d5b5461dbda2
        - name: adjustmentId
          in: path
          description: >-
            Price adjustment ID; it identifies a single price adjustment object
            from the list of price adjustments, added for the specified
            `cartId`.
          required: true
          schema:
            type: string
            example: d7e78a21-bee3-4448-bf1c-d5b5461dbda2
        - $ref: '#/components/parameters/x-api-key'
        - $ref: '#/components/parameters/authorization'
      requestBody:
        description: Sample request containing price adjustment details
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PriceAdjustmentPayload'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CartResponse'
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'
  /v2/carts/{cartId}/items/{lineItemId}/adjustments:
    post:
      tags:
        - Adjustments
      summary: Adjust prices for a cart item
      description: Adjust prices for a specific line item within the specified cart.
      operationId: addItemPriceAdjustments
      parameters:
        - $ref: '#/components/parameters/x-site-context'
        - name: cartId
          in: path
          description: Cart ID to adjust prices of a specific line item within the cart
          required: true
          schema:
            type: string
            example: d7e78a21-bee3-4448-bf1c-d5b5461dbda2
        - name: lineItemId
          in: path
          description: Cart item's sequence number (starts at 1) to adjust price
          required: true
          schema:
            type: integer
            format: int32
            example: 2
        - $ref: '#/components/parameters/x-api-key'
        - $ref: '#/components/parameters/authorization'
      requestBody:
        description: Sample request containing price adjustment details
        content:
          application/json:
            schema:
              type: array
              description: >-
                List of price adjustment details by which the original total of
                the line item will be adjusted.
              items:
                $ref: '#/components/schemas/PriceAdjustmentPayload'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CartResponse'
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'
    get:
      tags:
        - Adjustments
      summary: Get all price adjustments for a cart item
      description: >-
        Get all the price adjustments made to a specific line item within the
        given cart.
      operationId: getItemPriceAdjustments
      parameters:
        - $ref: '#/components/parameters/x-site-context'
        - name: cartId
          in: path
          description: >-
            Cart ID to retrieve price adjustment details of a `lineItemId`
            within the cart
          required: true
          schema:
            type: string
            example: d7e78a21-bee3-4448-bf1c-d5b5461dbda2
        - name: lineItemId
          in: path
          description: >-
            Cart item's sequence number (starts at 1) for which price adjustment
            details are to be retrieved
          required: true
          schema:
            type: integer
            format: int32
            example: 3
        - $ref: '#/components/parameters/x-api-key'
        - $ref: '#/components/parameters/authorization'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PriceAdjustmentResponse'
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'
  /v2/carts/{cartId}/items/{lineItemId}/adjustments/{adjustmentId}:
    delete:
      tags:
        - Adjustments
      summary: Delete a specific price adjustment information for a cart item
      description: >-
        Delete a specific price adjustment entity from the list of price
        adjustments made to a particular line item in a given cart. A price
        adjustment entity is a single object in the price adjustments array.
      operationId: removeItemPriceAdjustments
      parameters:
        - $ref: '#/components/parameters/x-site-context'
        - name: cartId
          in: path
          description: Cart ID to delete a specific price adjustment data within the cart
          required: true
          schema:
            type: string
            example: d7e78a21-bee3-4448-bf1c-d5b5461dbda2
        - name: lineItemId
          in: path
          description: >-
            Cart item's sequence number (starts at 1) for which a price
            adjustment is to be deleted
          required: true
          schema:
            type: integer
            format: int32
            example: 3
        - name: adjustmentId
          in: path
          description: >-
            Price adjustment ID; it identifies a particular price adjustment
            object from the list of price adjustments, added for the specified
            `lineItemId`.
          required: true
          schema:
            type: string
            example: d7e78a21-bee3-4448-bf1c-d5b5461dbda2
        - $ref: '#/components/parameters/x-api-key'
        - $ref: '#/components/parameters/authorization'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CartResponse'
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'
    put:
      tags:
        - Adjustments
      summary: Update a specific price adjustment information for a cart item
      description: >-
        Update a specific price adjustment entity from the list of price
        adjustments made to a particular line item in a given cart. A price
        adjustment entity is a single object in the price adjustments array.
      operationId: updatePriceAdjustments
      parameters:
        - $ref: '#/components/parameters/x-site-context'
        - name: cartId
          in: path
          description: >-
            Cart ID to update a specific price adjustment data for a given
            `lineItemId` within the cart.
          required: true
          schema:
            type: string
            example: d7e78a21-bee3-4448-bf1c-d5b5461dbda2
        - name: lineItemId
          in: path
          description: >-
            Cart item's sequence number (starts at 1) for which price adjustment
            information is to be updated within the cart.
          required: true
          schema:
            type: integer
            format: int32
            example: 1
        - name: adjustmentId
          in: path
          description: >-
            Price adjustment ID; it identifies a single price adjustment object
            from the list of price adjustments for the specified `lineItemId`.
          required: true
          schema:
            type: string
            example: d7e78a21-bee3-4448-bf1c-d5b5461dbda2
        - $ref: '#/components/parameters/x-api-key'
        - $ref: '#/components/parameters/authorization'
      requestBody:
        description: Sample request containing price adjustment details to be updated.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PriceAdjustmentPayload'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CartResponse'
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'
  /v2/carts/{cartId}/shipping-details:
    post:
      tags:
        - Shipping
      summary: Create shipping details for all items specific cart
      description: >-
        Create shipping details for all items in a specified cart. Shipping
        details are identified by a unique `shippingDetailsId`, and include the
        shipment's delivery address, shipment method, pickup persons' details,
        warehouse ID, store ID, and more.
      operationId: createShipTo
      parameters:
        - $ref: '#/components/parameters/x-site-context'
        - name: cartId
          in: path
          description: ID of cart for which shipping data is being created
          required: true
          schema:
            type: string
            example: d7e78a21-bee3-4448-bf1c-d5b5461dbda2
        - $ref: '#/components/parameters/x-api-key'
        - $ref: '#/components/parameters/authorization'
      requestBody:
        description: Request body containing shipping details to be created
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateShipToPayload'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShipResponse'
        '400':
          description: Bad Request
        '404':
          description: Not found
        '500':
          description: Internal server error
    patch:
      tags:
        - Shipping
      summary: Update shipping details for all items in a specific cart
      description: >-
        Update shipping details for all items in a specified cart. Shipping
        details include the shipment's delivery address, shipment method, pickup
        persons' details, warehouse ID, store ID, and more.
      operationId: updateShipTo
      parameters:
        - $ref: '#/components/parameters/x-site-context'
        - name: cartId
          in: path
          description: ID of cart for which shipping data is being updated
          required: true
          schema:
            type: string
            example: d7e78a21-bee3-4448-bf1c-d5b5461dbda2
        - $ref: '#/components/parameters/x-api-key'
        - $ref: '#/components/parameters/authorization'
      requestBody:
        description: Request body containing shipping details to be updated
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateShipToPayload'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShipResponse'
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'
  /v2/carts/{cartId}/items/shipping-details:
    patch:
      tags:
        - Shipping
      summary: Create shipping details for specific items in specific cart
      description: >-
        Create shipping details for specified items in a specified cart.
        Shipping details are identified by a unique `shippingDetailsId`, and
        include the shipment's delivery address, shipment method, pickup
        persons' details, warehouse ID, store ID, and more.
      operationId: addShipToCart
      parameters:
        - $ref: '#/components/parameters/x-site-context'
        - name: cartId
          in: path
          description: Cart ID for which shipping details are being created
          required: true
          schema:
            type: string
            example: d7e78a21-bee3-4448-bf1c-d5b5461dbda2
        - $ref: '#/components/parameters/x-api-key'
        - $ref: '#/components/parameters/authorization'
      requestBody:
        description: >-
          Request body for adding shipping details to specified items in the
          specified cart
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddShipToLineItems'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CartResponse'
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'
    delete:
      tags:
        - Shipping
      summary: Remove `shippingDetailsId` from cart items
      description: Remove `shippingDetailsId` from cart items
      operationId: removeShipToFromCartItem
      parameters:
        - $ref: '#/components/parameters/x-site-context'
        - $ref: '#/components/parameters/x-api-key'
        - $ref: '#/components/parameters/authorization'
        - name: cartId
          in: path
          description: Cart Id for which shipping details are being removed
          required: true
          schema:
            type: string
            example: d7e78a21-bee3-4448-bf1c-d5b5461dbda2
      requestBody:
        description: >-
          Request body for removing shipping details to specified items in the
          specified cart.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RemoveShipToItemsPayload'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CartResponse'
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'
  /v2/carts/{cartId}/items/{lineItemId}:
    delete:
      tags:
        - Cart
      summary: Remove an item from the cart
      description: Deletes a specified item from a specified cart
      operationId: removeItem
      parameters:
        - $ref: '#/components/parameters/x-site-context'
        - name: cartId
          in: path
          description: ID of cart for which the specified item needs to be removed
          required: true
          schema:
            type: string
            example: d7e78a21-bee3-4448-bf1c-d5b5461dbda2
        - name: lineItemId
          in: path
          description: >-
            Cart item sequence number (starts at 1) of item to be removed from
            cart
          required: true
          schema:
            type: integer
            format: int32
        - $ref: '#/components/parameters/x-api-key'
        - $ref: '#/components/parameters/authorization'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CartResponse'
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'
  /v2/carts/{cartId}/merge:
    put:
      tags:
        - Cart
      summary: Merge Carts
      description: Merge guest cart and user cart, CSR cart to user cart and vice versa
      operationId: mergeCartV2
      parameters:
        - $ref: '#/components/parameters/x-site-context'
        - $ref: '#/components/parameters/x-api-key'
        - $ref: '#/components/parameters/authorization'
        - name: cartId
          in: path
          description: Primary cart ID
          required: true
          schema:
            type: string
            example: d7e78a21-bee3-4448-bf1c-d5b5461dbda2
      requestBody:
        description: Configurations for merging two carts
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MergeCartsPayload'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CartResponse'
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'
    patch:
      tags:
        - Cart
      summary: Merge carts
      description: Merges guest cart and logged-in user cart
      operationId: mergeCart
      deprecated: true
      parameters:
        - $ref: '#/components/parameters/x-site-context'
        - name: cartId
          in: path
          description: ID of guest cart which is to be merged
          required: true
          schema:
            type: string
            example: d7e78a21-bee3-4448-bf1c-d5b5461dbda2
        - $ref: '#/components/parameters/x-api-key'
        - $ref: '#/components/parameters/authorization'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CartResponse'
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'
  /v2/carts/{cartId}/customer:
    put:
      tags:
        - Cart
      summary: Replaces customer context in cart
      description: Create or replace customer context in the cart.
      operationId: updateCustomerContext
      parameters:
        - $ref: '#/components/parameters/x-site-context'
        - name: cartId
          in: path
          description: Cart ID
          required: true
          schema:
            type: string
            example: d7e78a21-bee3-4448-bf1c-d5b5461dbda2
        - $ref: '#/components/parameters/x-api-key'
        - $ref: '#/components/parameters/authorization'
      requestBody:
        description: Request body for updating customer context
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/customerContext'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CartResponse'
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'
  /v2/carts/{cartId}/promo/{promoCode}:
    delete:
      tags:
        - Cart
      summary: Remove an individual promotion from all items in a specific cart
      description: Removes a specified promotion from all items in specified cart
      operationId: removePromo
      parameters:
        - $ref: '#/components/parameters/x-site-context'
        - name: cartId
          in: path
          description: ID of cart ID from which promotion needs to be removed
          required: true
          schema:
            type: string
            example: d7e78a21-bee3-4448-bf1c-d5b5461dbda2
        - name: promoCode
          in: path
          description: Code of promotion to be removed
          required: true
          schema:
            type: string
        - $ref: '#/components/parameters/x-api-key'
        - $ref: '#/components/parameters/authorization'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CartResponse'
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'
  /v2/carts/{cartId}/promos/{promoCode}:
    post:
      tags:
        - Cart
      summary: Apply a specific promotion to all items in a specific cart
      description: Apply a specified promotion or coupon to all items of a specific cart
      operationId: applyPromo
      parameters:
        - $ref: '#/components/parameters/x-site-context'
        - name: cartId
          in: path
          description: ID of cart ID to which promotion needs to be applied
          required: true
          schema:
            type: string
            example: d7e78a21-bee3-4448-bf1c-d5b5461dbda2
        - name: promoCode
          in: path
          description: Code of promotion to be applied
          required: true
          schema:
            type: string
        - $ref: '#/components/parameters/x-api-key'
        - $ref: '#/components/parameters/authorization'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CartResponse'
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'
  /v2/carts/{cartId}/shipping-details/{shippingDetailsId}:
    get:
      tags:
        - Shipping
      summary: Get specific shipping details for a specific cart
      description: Get specified shipping details of items in a specified cart
      operationId: getShipTo
      parameters:
        - $ref: '#/components/parameters/x-site-context'
        - name: shippingDetailsId
          in: path
          description: ID of shipping details that are being retrieved
          required: true
          schema:
            type: string
        - name: cartId
          in: path
          description: ID of cart whose shipping details are being retrieved
          required: true
          schema:
            type: string
            example: d7e78a21-bee3-4448-bf1c-d5b5461dbda2
        - $ref: '#/components/parameters/x-api-key'
        - $ref: '#/components/parameters/authorization'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShipResponse'
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'
  /v2/carts/{cartId}/status/{cartStatus}:
    patch:
      tags:
        - Cart
      summary: Update status of specific cart
      description: Update status of specified cart
      operationId: updateCartStatus
      parameters:
        - $ref: '#/components/parameters/x-site-context'
        - name: cartId
          in: path
          description: ID for cart whose status is to be updated
          required: true
          schema:
            type: string
            example: d7e78a21-bee3-4448-bf1c-d5b5461dbda2
        - name: cartStatus
          in: path
          description: New cart status
          required: true
          schema:
            $ref: '#/components/schemas/CartState'
        - $ref: '#/components/parameters/x-api-key'
        - $ref: '#/components/parameters/authorization'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CartResponse'
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'
  /v2/carts/{cartId}/order-drafts:
    post:
      tags:
        - Order Draft
      summary: Create order draft
      description: >-
        Create an order draft for a given cart. During the order draft creation
        process, payment details are validated before generating the draft.
        Additionally, it triggers an event if the "ORDER_DRAFT" webhook event is
        subscribed.
      operationId: orderDraft
      parameters:
        - $ref: '#/components/parameters/x-site-context'
        - name: cartId
          in: path
          description: ID of the cart for which order draft will be generated
          required: true
          schema:
            type: string
            example: d7e78a21-bee3-4448-bf1c-d5b5461dbda2
      requestBody:
        description: Request body to create order draft
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderDraftPayload'
        required: true
      responses:
        '201':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderDraftResponse'
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/NotFoundError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'
  /v2/order-drafts:
    get:
      tags:
        - Order Draft
      summary: Get all order drafts by filter parameters
      description: >-
        Get a paginated list of all order drafts by tenantId (`account`).
        Optionally, you can provide customer ID to get list of order drafts.
      operationId: listOrderDrafts
      parameters:
        - $ref: '#/components/parameters/x-site-context'
        - name: customerId
          in: query
          schema:
            type: string
            description: Customer ID to get order draft details
            nullable: true
            example: 2342131232
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderDraftPaginatedResponse'
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'
  /v2/order-drafts/order-number/{orderNumber}:
    get:
      tags:
        - Order Draft
      summary: Get order draft by order number
      description: Get all the generated order drafts by order number.
      operationId: listOrderDraftsByOrderNumber
      parameters:
        - $ref: '#/components/parameters/x-site-context'
        - name: orderNumber
          in: path
          required: true
          schema:
            description: Order number to get order draft details
            $ref: '#/components/schemas/OrderNumber'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderDraftResponse'
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'
  /v2/order-drafts/{id}:
    get:
      tags:
        - Order Draft
      summary: Get order draft by ID
      description: Get order draft details by order draft ID.
      operationId: getOrderDraft
      parameters:
        - $ref: '#/components/parameters/x-site-context'
        - name: id
          in: path
          description: Order draft ID
          required: true
          schema:
            type: string
            example: d7e78a21-bee3-4448-bf1c-d5b5461dbda2
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderDraftResponse'
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/orderDraftNotFound'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'
components:
  parameters:
    x-api-key:
      name: x-api-key
      in: header
      description: API Key for Gateway
      required: false
      schema:
        type: string
        example: zaCELgL.0imfnc8mVLWwsAawjYr4Rx-Af50DDqtlx
    x-site-context:
      name: x-site-context
      in: header
      description: >-
        The `x-site-context` header is a JSON object that contains information
        about the source you wish to pull from. The mandatory `account` is the
        24 character identifier found in Copilot. The `channel` (Sales channel
        ID), `stage` (environment name), and `date` attributes can be used to
        further narrow the scope of your data source.
      required: true
      schema:
        type: string
        example: >-
          {"date": "2023-01-01T00:00:00.000Z", "channel": 12, "account":
          "1234abcd5678efgh9ijklmno","stage":"production"}
    authorization:
      name: Authorization
      in: header
      description: Authorization token for the user
      required: true
      schema:
        type: string
        example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYxZjIyMTU4...
    cartId:
      name: cartId
      in: path
      description: Cart ID
      required: true
      schema:
        type: string
        example: d7e78a21-bee3-4448-bf1c-d5b5461dbda2
    lineItemId:
      name: lineItemId
      in: path
      description: Cart item sequence number (starts at 1)
      required: true
      schema:
        type: integer
        example: 1
    feeId:
      name: feeId
      in: query
      description: Fee ID to delete the fee details
      required: true
      schema:
        type: string
        example: asdw4234-bee3-4448-bf1c-d5b5461dbda2
  schemas:
    AddItemPayload:
      description: Items (with details) to add to cart
      required:
        - items
      type: object
      properties:
        cartId:
          type: string
          description: Existing cart ID, or NULL for new cart
          nullable: true
          example: d7e78a21-bee3-4448-bf1c-d5b5461dbda2
        items:
          description: Items to add to cart
          minItems: 1
          type: array
          items:
            $ref: '#/components/schemas/CartItemPayload'
        name:
          type: string
          description: Name for the cart
          nullable: true
          example: cart_it
        description:
          type: string
          description: Description for the cart
          nullable: true
          example: cart for the IT department
        networkCode:
          type: string
          description: >-
            networkCode for the cart. Required when using inventoryV2 with
            CartV2
          nullable: true
          example: ShipToHome
          items:
            type: object
            additionalProperties:
              type: array
              items:
                type: string
    AddShipToLineItems:
      description: Ship-to line items (with details) to add to cart
      required:
        - items
      type: object
      properties:
        cartId:
          description: Cart ID
          type: string
          nullable: true
          example: d7e78a21-bee3-4448-bf1c-d5b5461dbda2
        items:
          description: Ship-to line items to add to cart
          minItems: 1
          type: array
          items:
            $ref: '#/components/schemas/ShipToItem'
        channel:
          type: integer
          description: Channel ID
          format: int32
          nullable: true
          example: 12
          default: 12
    RemoveShipToItemsPayload:
      description: Cart line items from which to remove shipping
      required:
        - items
      type: object
      properties:
        items:
          description: Cart line items from which to remove shipping
          minItems: 1
          type: array
          items:
            $ref: '#/components/schemas/RemoveShipToItem'
    Address:
      description: Shipping address details
      type: object
      properties:
        attention:
          type: string
          description: Address recipient
          nullable: true
          example: Billing manager
        street1:
          type: string
          description: Address line 1
          nullable: true
          example: 100 NE 100th St.
        street2:
          type: string
          description: Address line 2
          nullable: true
          example: Suite 710
        street3:
          type: string
          description: Address line 3
          nullable: true
          example: Seventh floor
        street4:
          type: string
          description: Address line 4
          nullable: true
          example: 'Attention: Pat E. Kake'
        city:
          type: string
          description: City name
          nullable: true
          example: Seattle
        state:
          type: string
          description: State name
          nullable: true
          example: Washington
        country:
          type: string
          description: Country name
          nullable: true
          example: USA
        zipCode:
          type: string
          description: Zip code
          nullable: true
          example: '98125'
        email:
          type: string
          description: Receiver's email address
          nullable: true
          example: test@mail.com
        kind:
          type: string
          description: Address type
          nullable: true
          example: shipping
        name:
          description: Recipient's name
          allOf:
            - $ref: '#/components/schemas/Name'
            - nullable: true
        phone:
          description: address details for the shipping
          nullable: true
          allOf:
            - $ref: '#/components/schemas/Phone'
            - nullable: true
    cartConfiguration:
      description: Cart configurations
      type: object
      properties:
        allowAnonymousUser:
          type: boolean
          default: true
          example: true
          description: >-
            true: Allows a cart to be guest cart. Shoppers can modify the cart
            without logging in.<br/> false: Allows cart modification only if the
            shopper is logged in.
        orderNumberSource:
          type: string
          default: CART_ID
          description: >-
            Specifies how an order number is created. The options are:<br/>1.
            `CART_ID`: Cart ID is used as the order number. In this case,
            fabric's Cart service uses the specified cart ID and assigns it as
            the order numebr.<br/>2. `EXTERNAL`: Merchant provides the order
            number during chekout.<br/>3. `FABRIC`: fabric generates the order
            number based on cart configuration details, and assigns it to the
            cart.<br/>4. `NONE`: Merchants have the flexibility to not provide
            an order number during the creation of an order draft. Instead, they
            can provide the order number when generating final orders based on
            the previously created order draft.
          enum:
            - CART_ID
            - EXTERNAL
            - FABRIC
            - NONE
        softReserve:
          type: boolean
          default: false
          example: true
          description: >-
            Specifies whether items in cart should be soft reserved. The options
            are:<br />`true`: Soft reservation is enabled; the items added to
            cart are reserved in the inventory.<br />`false`: Soft reservation
            is disabled; the items added to cart are not reserved in the
            inventory.
        addItemBySkuEnabled:
          type: boolean
          default: false
          example: true
          description: >-
            true: Item can be added to a cart by SKU; `itemId` is not mandatory
            to add an item to a cart.<br />false: `itemId` is mandatory to add
            an item to a cart
    CartError:
      description: Cart error object
      required:
        - inventory
        - price
        - promo
      type: object
      properties:
        price:
          description: Offers
          type: array
          items:
            $ref: '#/components/schemas/Offers'
        promo:
          description: Promo exception details
          type: array
          items:
            $ref: '#/components/schemas/ExceptionDetail'
        inventory:
          description: Inventory exception details
          type: array
          items:
            $ref: '#/components/schemas/ExceptionDetail'
    CartItem:
      description: Cart item details
      required:
        - quantity
        - sku
      type: object
      properties:
        items:
          type: array
          description: List of items in a cart
          allOf:
            - $ref: '#/components/schemas/CartItem'
            - nullable: true
        cartItemId:
          type: string
          description: Cart item ID
          nullable: true
          example: 12gved0f-7645-40cb-y7b0-167f8bggdb3z
        itemId:
          type: string
          description: Item ID
          nullable: true
          example: '1730902008'
        title:
          type: string
          description: Item name
          nullable: true
          example: Light Cover
        sku:
          type: string
          description: Item SKU
          example: 13B9CL6WT2SLW
        attributes:
          description: Additional item options
          type: array
          nullable: true
          items:
            $ref: '#/components/schemas/ProductAttributes'
        createdAt:
          type: string
          description: Item creation time
          format: date-time
          nullable: true
          example: '2022-02-18T15:12:40.974580'
        updatedAt:
          type: string
          description: Last time item was updated
          format: date-time
          nullable: true
          example: '2022-02-18T15:12:40.974580'
        quantity:
          type: integer
          format: int32
          description: total quantity of the line item
          example: 15
        type:
          type: string
          description: >-
            ItemType(WEB_SHIP/WEB_PICKUP/WEB_SDD/INTERNATIONAL/POS/POS_SHIP/POS_PICKUP)
          nullable: true
          example: WEB_SHIP
        subType:
          type: string
          description: ItemSubType(For International type, provide subType as Border-free)
          nullable: true
          example: Border-free
        priceListId:
          type: string
          description: Item price list ID
          nullable: true
          example: '108674'
        lineItemId:
          minimum: 1
          type: integer
          description: Cart item sequence number (starts at 1)
          format: int32
          example: 1
        isActive:
          description: true = Item is active<br />false = Item is not active
          type: boolean
          nullable: false
          example: true
          default: true
        unitPrice:
          description: Individual item price
          allOf:
            - $ref: '#/components/schemas/CartPrice'
            - nullable: true
        totalPrice:
          description: Total price for the full quantity of this item
          allOf:
            - $ref: '#/components/schemas/CartPrice'
            - nullable: true
        attributeTotalPrice:
          type: number
          description: Total price of item attributes
          format: double
          nullable: true
          example: 10
        group:
          type: array
          nullable: true
          items:
            type: string
            description: Group or Category ID to which item belongs
            example: 61d38e117162b7dba69c3d6d
        extra:
          type: object
          additionalProperties: true
          description: Extra metadata passed by caller
          nullable: true
          example:
            productFamily: Laptop computers
        channel:
          description: Sales channel
          type: number
          example: 12
        isPickup:
          description: 'true: Item is set for pickup<br />false: Item is set for delivery'
          type: boolean
          example: true
        warehouseId:
          type: string
          description: Warehouse ID
          nullable: true
          example: XYZ-1234
        shipToId:
          type: string
          description: Shipping ID
          nullable: true
          example: fef78121-bee3-4448-bf1c-d5b5461dbda2
        shipTo:
          description: Shipment details
          allOf:
            - $ref: '#/components/schemas/ShipObject'
            - nullable: true
        fulfillment:
          description: Item details for order fulfillment
          allOf:
            - $ref: '#/components/schemas/Fulfillment'
            - nullable: false
    CartItemModifyPayload:
      description: Item information to be updated
      required:
        - itemId
        - lineItemId
        - quantity
      type: object
      properties:
        lineItemId:
          minimum: 1
          type: integer
          description: Cart item sequence number (starts at 1)
          format: int32
          example: 1
        sku:
          type: string
          description: Item SKU
          nullable: true
          example: 13B9CL6WT2SLW
        quantity:
          type: integer
          description: Updated number of items in cart
          format: int32
          example: 2
        itemId:
          type: string
          description: Item ID
          example: '1000000006'
        priceListId:
          type: string
          description: Item price list ID
          nullable: true
          example: '100000'
        price:
          description: Price of all items in the cart
          allOf:
            - $ref: '#/components/schemas/CartPrice'
            - nullable: true
        attributes:
          description: Additional item options
          type: array
          nullable: true
          items:
            $ref: '#/components/schemas/ProductAttributes'
        fulfillment:
          type: object
          description: Item fulfillment details for order completion
          nullable: true
          $ref: '#/components/schemas/FulfillmentPayload'
    PriceAdjustmentPayload:
      description: Price adjustment details
      required:
        - amount
        - reason
      type: object
      properties:
        amount:
          type: number
          description: >-
            Amount to be adjusted with the specified line item's total amount or
            with a specified cart's total amount
          format: double
          example: 60.5
        reason:
          type: string
          description: Price adjustment reason
          nullable: false
          example: compensation for delay
        attributes:
          type: object
          additionalProperties: true
          description: Placeholder for additional information
          nullable: true
          example:
            goldMember:
              - false
    FulfillmentPayload:
      description: Details for the order fulfillment of an item
      type: object
      properties:
        type:
          type: string
          description: Type of order fulfillment
          nullable: true
          example: WEB_SHIP
        networkCode:
          type: string
          description: Specifies the network of inventory for item
          nullable: true
          example: ShipToCNC
        channelId:
          type: string
          description: Specifies the channel of inventory for item
          nullable: true
          example: '12'
    CartItemPayload:
      description: Payload data of items to add to cart
      required:
        - itemId
        - price
        - quantity
      type: object
      properties:
        sku:
          type: string
          description: Item SKU
          nullable: true
          example: 16B2GS8LD5FDS
        itemId:
          type: string
          description: Item ID
          example: '1000000001'
        quantity:
          type: integer
          description: Number of items in cart
          format: int32
          example: 1
        priceListId:
          type: string
          description: Item price list ID
          nullable: true
          example: '100000'
        type:
          type: string
          description: ItemType
          nullable: true
          example: WEB_SHIP
          enum:
            - WEB_SHIP
            - WEB_PICKUP
            - WEB_SDD
            - INTERNATIONAL
            - POS
            - POS_SHIP
            - POS_PICKUP
        subType:
          type: string
          description: ItemSubType(For International type, provide subType as Border-free)
          nullable: true
          example: Border-free
        price:
          $ref: '#/components/schemas/CartPrice'
        extra:
          type: object
          additionalProperties: true
          description: Extra metadata passed by the caller
          nullable: true
          example:
            productFamily: Laptop computers
        fulfillment:
          type: object
          description: Item fulfillment details for order completion
          nullable: true
          $ref: '#/components/schemas/FulfillmentPayload'
        group:
          type: array
          nullable: true
          items:
            type: string
            description: Group or Category ID which item belongs to
            example: 61d38e117162b7dba69c3d6d
    CartItemResponse:
      description: Cart item details
      required:
        - quantity
        - sku
        - items
        - isPickup
      type: object
      properties:
        cartItemId:
          type: string
          description: Cart item ID
          nullable: true
          example: 88cded0f-1439-40eb-a7a0-167e8bffdb3b
        itemId:
          type: string
          description: Item ID
          nullable: true
          example: '1000000001'
        title:
          type: string
          description: Item name
          nullable: true
          example: Varnet Garden Light Kit
        sku:
          type: string
          description: Item SKU
          example: 16B2GS8LD5FDS
        items:
          type: array
          description: Cart item details
          items:
            $ref: '#/components/schemas/CartItem'
        attributeTotalPrice:
          type: number
          description: Total price of attributes
          format: double
          nullable: true
          example: 10
        createdAt:
          type: string
          description: Item creation time
          format: date-time
          nullable: true
          example: '2022-02-18T15:12:40.974580'
        updatedAt:
          type: string
          description: Last time item was updated
          format: date-time
          nullable: true
          example: '2022-02-18T15:12:40.974580'
        quantity:
          type: integer
          description: Number of items in cart
          format: int32
          example: 1
        priceListId:
          type: string
          description: Item price list ID
          nullable: true
          example: '100000'
        lineItemId:
          minimum: 1
          type: integer
          description: Cart item sequence number (starts at 1)
          format: int32
          nullable: true
          example: 1
        isActive:
          description: true = Item is active<br />false = Item is not active
          type: boolean
          nullable: true
          example: true
        unitPrice:
          description: Individual item price
          allOf:
            - $ref: '#/components/schemas/CartPrice'
            - nullable: true
        totalPrice:
          description: Total price for the full quantity of this item
          allOf:
            - $ref: '#/components/schemas/CartPrice'
            - nullable: true
        attributes:
          description: Additional item options
          type: array
          nullable: true
          items:
            $ref: '#/components/schemas/ProductAttributes'
        priceAdjustments:
          description: List of price adjustments for the line item
          type: array
          nullable: true
          items:
            $ref: '#/components/schemas/CartItemPriceAdjustment'
        isPickup:
          description: 'true: Item is set for pickup<br />false: Item is set for delivery'
          type: boolean
          example: true
        warehouseId:
          type: string
          description: Warehouse ID
          nullable: true
          example: XYZ-1234
        shipTo:
          description: Shipment details
          allOf:
            - $ref: '#/components/schemas/ShipObject'
            - nullable: true
        channel:
          description: Sales channel
          type: number
          example: 12
          nullable: true
        group:
          type: array
          nullable: true
          items:
            type: string
            description: Group or Category ID to which item belongs
            example: 61d38e117162b7dba69c3d6d
        fees:
          type: array
          description: >-
            Fees associated with a specific cart or an individual line item of a
            cart
          nullable: true
          items:
            $ref: '#/components/schemas/fees'
    CartPrice:
      description: Price of all items in the cart
      required:
        - amount
        - currency
        - discount
      type: object
      properties:
        currency:
          type: string
          description: Currency type
          example: USD
          default: USD
        amount:
          type: number
          description: Price before discount
          format: double
          example: 100
        sale:
          type: number
          description: Price after discount
          format: double
          nullable: true
          example: 80
        discount:
          description: >-
            Offer discount details. Empty list {} should be passed in case of no
            discount.
          allOf:
            - $ref: '#/components/schemas/OfferDiscount'
    CartPromo:
      description: Promotions or coupons for cart items
      required:
        - promoId
      type: object
      properties:
        promoId:
          type: string
          description: Unique promotion/coupon ID
          example: fza065tdr787
        promoCode:
          type: string
          description: General promotion/coupon code
          nullable: true
          example: coupon123
        value:
          type: string
          description: Promotion/coupon code discount value
          nullable: true
          example: '20'
        unit:
          type: string
          description: Promotion/coupon code discount unit
          nullable: true
          example: '%OFF'
    CartResponse:
      description: Cart details
      required:
        - allPromosApplied
        - currency
        - error
        - items
        - sharedUserIds
        - metadata
      type: object
      properties:
        cartId:
          type: string
          description: Cart ID
          nullable: true
          example: d7e78a21-bee3-4448-bf1c-d5b5461dbda2
        items:
          description: Items in cart
          type: array
          items:
            $ref: '#/components/schemas/CartItemResponse'
        createdAt:
          type: string
          description: Cart creation time
          nullable: true
          example: '2022-02-11T14:09:40.836703'
        updatedAt:
          type: string
          description: Last time cart was updated
          format: date-time
          nullable: true
          example: '2022-02-22T22:36:40.194293'
        totalItems:
          type: integer
          description: Number of items in the cart
          format: int32
          nullable: true
          example: 3
        totalUniqueItems:
          type: integer
          description: Number of unique items in the cart based on line item ID
          format: int32
          nullable: true
          example: 2
        cartState:
          description: Cart status
          allOf:
            - $ref: '#/components/schemas/CartState'
            - nullable: true
        tenantId:
          type: string
          description: Merchant ID
          nullable: true
          example: 5f689caa4216e7000750d1ef
        accountId:
          type: string
          description: Customer account ID
          nullable: true
          example: 5f689caa4216e7000750d1ef
        userId:
          type: string
          description: User ID
          nullable: true
          example: 61b8e921d0cf2e000882b09f
        configuration:
          type: object
          description: Cart configurations
          nullable: true
          allOf:
            - $ref: '#/components/schemas/cartConfiguration'
        customer:
          type: object
          description: Customer context
          nullable: true
          allOf:
            - $ref: '#/components/schemas/customerContext'
        totalAmount:
          type: number
          description: >-
            Total price of cart items after discount including Shipping and
            Shipping Discount
          format: double
          nullable: true
          example: 95
        subTotal:
          type: number
          description: Total price of cart items including Shipping without any discount
          format: double
          nullable: true
          example: 120
        totalDiscount:
          type: number
          description: Total discount applied to cart
          format: double
          nullable: true
          example: 25
        totalFees:
          type: number
          description: Total fees applied to cart
          format: double
          nullable: true
          example: 25
        currency:
          type: string
          description: Currency type
          example: USD
          default: USD
        attributes:
          description: Additional item options
          type: array
          nullable: true
          items:
            $ref: '#/components/schemas/ProductAttributes'
        metadata:
          type: object
          additionalProperties: true
          description: Metadata for this cart
          example:
            approver: 620d8896058edb0009385311
        allPromosApplied:
          description: All promotions or coupons for items in this cart
          type: array
          items:
            $ref: '#/components/schemas/CartPromo'
        sharedUserIds:
          type: array
          nullable: true
          items:
            type: string
            description: UserIds of the users who share the cart
            example: '["*"] or [userId1,userId2]'
        fees:
          type: array
          description: >-
            Fees associated with a specific cart or an individual line item of a
            cart
          nullable: true
          items:
            $ref: '#/components/schemas/fees'
        suggestedProducts:
          type: array
          description: >-
            List of recommended products that are available for purchase along
            with the item added to the cart
          nullable: true
          items:
            $ref: '#/components/schemas/suggestedProduct'
        error:
          description: Errors in this cart
          $ref: '#/components/schemas/CartError'
    CartState:
      type: string
      description: Cart status
      example: PENDING
      enum:
        - ACTIVE
        - PENDING
        - PENDING_APPROVAL
        - APPROVED
        - SUBMITTED
        - DELETED
        - REJECTED
    createCartPayload:
      description: Details to add to an empty cart
      type: object
      properties:
        name:
          type: string
          description: Cart name
          nullable: true
          example: cart_it
        description:
          type: string
          description: Cart description
          nullable: true
          example: cart for the IT department
        configuration:
          type: object
          description: Cart configurations
          allOf:
            - $ref: '#/components/schemas/cartConfiguration'
            - nullable: true
        customer:
          type: object
          description: Customer context
          allOf:
            - $ref: '#/components/schemas/customerContext'
            - nullable: true
    SplitLineItemRequestPayload:
      description: Sample request to split line items
      required:
        - lineItemId
        - quantities
      type: object
      properties:
        lineItemId:
          minimum: 1
          type: integer
          description: Cart item sequence number (starts at 1)
          format: int32
          example: 1
        quantities:
          description: >-
            Line item quantities for each split line item, meaning quantities
            assigned to each individual line item after the original line item
            (by lineItemId) is split into multiple line items.
          type: array
          items:
            description: Quantity for each split line item
            example: 1
            type: integer
    CreateShipToPayload:
      description: Request body used to create shipping details for a cart
      required:
        - cartId
        - shipToType
      type: object
      properties:
        shipMethod:
          description: Shipping method
          allOf:
            - $ref: '#/components/schemas/ShipMethod'
            - nullable: true
        address:
          description: Shipping address
          allOf:
            - $ref: '#/components/schemas/Address'
            - nullable: true
        shipToType:
          type: string
          description: Shipping type
          example: SHIP_TO_ADDRESS
        taxCode:
          type: string
          description: Shipping tax code
          nullable: true
          example: FR1000
        isPickup:
          description: 'true: Item is set for pickup<br />false: Item is set for delivery'
          type: boolean
          example: true
        altPickupPerson:
          description: Alternative pickup person
          allOf:
            - $ref: '#/components/schemas/Address'
            - nullable: true
        pickupPerson:
          description: Designated pickup person
          allOf:
            - $ref: '#/components/schemas/PickupPerson'
            - nullable: true
        warehouseId:
          type: string
          description: Warehouse ID
          nullable: true
          example: XYZ-1234
        storeId:
          type: string
          description: Store ID
          nullable: true
          example: ABC-123
        estimatedShipDate:
          type: string
          description: Estimated date for shipping
          format: date-time
          nullable: true
          example: '2022-02-18T15:12:40.974580'
        estimatedDeliveryDate:
          type: string
          description: Estimated date for delivery
          format: date-time
          nullable: true
          example: '2022-02-18T15:12:40.974580'
        shipmentInstructions:
          type: string
          description: Store ID
          nullable: true
          example: Additional user instructions for shipping
    customerContext:
      description: Customer context of a cart
      type: object
      properties:
        id:
          type: string
          description: Identifies a customer
          example: d7e78a21-bee3-4448-bf1c-d5b5461dbda2
          nullable: true
        type:
          type: string
          description: Customer type
          example: EMPLOYEE
          nullable: true
        attributes:
          type: object
          additionalProperties: true
          description: Customer attributes
          nullable: true
          example:
            goldMember:
              - false
        segments:
          type: object
          additionalProperties: true
          description: Customer segments
          nullable: true
          example:
            age: 23
            gender: female
    customerSearchObject:
      description: Customer object for search
      type: object
      properties:
        id:
          type: string
          description: Customer ID of carts to be returned
          example: d7e78a21-bee3-4448-bf1c-d5b5461dbda2
          nullable: true
    Discount:
      description: Promotion or coupon applied to an item
      required:
        - promoId
      type: object
      properties:
        promoId:
          type: string
          description: Unique promotion/coupon ID
          example: fza065tdr787
        promoCode:
          type: string
          description: General promotion/coupon code
          nullable: true
          example: coupon123
        promoTitle:
          type: string
          description: Promotion name
          nullable: true
          example: New Year discount
        quantity:
          type: integer
          description: Quantity of this item in the cart
          format: int32
          nullable: true
          example: 1
        amount:
          type: number
          description: Total amount of discount applied
          format: double
          nullable: true
          example: 20
        value:
          type: number
          description: Promotion value
          format: double
          nullable: true
          example: 20
        groupId:
          type: string
          description: Promotion group ID
          nullable: true
          example: new-items
        promotionType:
          type: string
          description: Promotion type
          nullable: true
          example: PROMOTION
        priority:
          type: integer
          description: Promotion priority
          format: int32
          nullable: true
          example: 1
        stackable:
          type: boolean
          description: >-
            true = This promotion is stackable with other promotions<br />false
            = This promotion cannot be stacked with other promotions
          nullable: true
          example: false
        sku:
          type: string
          description: Item SKU to which promotion is applied
          nullable: true
          example: 16B2GS8LD5FDS
        itemId:
          type: string
          description: ID of item to which promotion is applied
          nullable: true
          example: '1000000001'
        itemKey:
          type: string
          description: Key of item to which promotion is applied
          nullable: true
          example: Key1234
        message:
          type: string
          description: Coupon code description
          nullable: true
          example: New Year Promotion
        unit:
          type: string
          description: Discount unit
          nullable: true
          example: '%OFF'
        proratedQuantity:
          type: integer
          description: >-
            The `proratedQuantity` is used in conjunction with `proratedAmount`
            to determine the discount portion allocated to the respective units
            of BuyGet promotions. This is applicable in partial return
            scenarios.
          format: int32
          nullable: true
          example: 1
        proratedAmount:
          type: number
          description: The prorated discount amount.
          format: double
          nullable: true
          example: 3.33
    MergeCartsPayload:
      description: Configurations for merging two carts
      type: object
      required:
        - secondaryCartId
      properties:
        secondaryCartId:
          type: string
          description: Secondary Cart ID, which is to be merged with primary cart ID
          example: 12gved0f-7645-40cb-y7b0-167f8bggdb3z
        config:
          type: object
          description: Configuration for merging two carts
          properties:
            attributesMergeBehavior:
              description: >-
                Merge Behavior configuration for properties within cart
                attributes
              $ref: '#/components/schemas/MergeBehavior'
            cartConfigMergeBehavior:
              description: Merge Behavior configuration for cart configuration
              $ref: '#/components/schemas/MergeBehavior'
            customerMergeConfig:
              description: Merge configuration for customer context
              type: object
              properties:
                mergeBehavior:
                  description: >-
                    Merge Behavior for all properties within customer context
                    except `attributes`
                  $ref: '#/components/schemas/MergeBehavior'
                attributesMergeBehavior:
                  description: Merge Behavior for `attributes` within customer context
                  $ref: '#/components/schemas/MergeBehavior'
            defaultMergeBehavior:
              description: Default behavior to be applied when no configuration is provided
              $ref: '#/components/schemas/MergeBehavior'
            extraMergeBehavior:
              description: >-
                Merge Behavior configuration for extra properties within cart
                metadata
              $ref: '#/components/schemas/MergeBehavior'
            itemsMergeConfig:
              description: Merge configuration for cart configuration
              type: object
              properties:
                mergeOn:
                  description: >-
                    Item fields on which items will be merged. Allowed values
                    `itemId`, `sku`, `priceListId`, `extra`,
                    `fulfillment`,`shipTo.shipToType`,`shipTo.locationNum`,`shipTo.shipMethod.shipMethodId`
                  type: array
                  items:
                    type: string
                    example: sku
                  example:
                    - itemId
                    - sku
                mergeBehavior:
                  description: Merge Behavior configuration to merge items
                  $ref: '#/components/schemas/MergeBehavior'
                quantity:
                  type: string
                  enum:
                    - SUM
                    - MAX
                  example: SUM
            sharedUserIdsMergeBehavior:
              description: Merge Behavior configuration for sharedUserIds property
              $ref: '#/components/schemas/MergeBehavior'
            sharedCartIdsMergeBehavior:
              description: Merge Behavior configuration for sharedCartIds property
              $ref: '#/components/schemas/MergeBehavior'
            feesMergeBehavior:
              description: Merge behavior configuration to merge fees
              $ref: '#/components/schemas/MergeBehavior'
    SearchCartPayload:
      description: >-
        Cart search parameters and response pagination details /// Search for
        carts meeting specified criteria, including creation date, status, user,
        approver, and purchase order
      required:
        - filter
        - limit
        - offset
      type: object
      properties:
        offset:
          type: integer
          description: Pagination offset (starts with zero)
          format: int32
          example: 0
        limit:
          type: integer
          description: Number of cart responses per page
          format: int32
          example: 10
        filter:
          description: Cart search parameters
          $ref: '#/components/schemas/CartFilter'
    SearchCartResponse:
      description: Cart search response object
      type: object
      properties:
        offset:
          type: integer
          description: Pagination offset (starts with zero)
          format: int32
          example: 0
        limit:
          type: integer
          description: Number of cart responses per page
          format: int32
          example: 10
        count:
          type: integer
          description: Number of available carts meeting search criteria
          format: int32
          example: 10
        carts:
          description: Details for carts meeting search criteria
          type: array
          nullable: true
          items:
            $ref: '#/components/schemas/CartResponse'
    PriceAdjustmentResponse:
      description: Sample response containing price adjustment details
      type: object
      properties:
        priceAdjustments:
          description: >-
            List of price adjustment details for the specified line item or the
            specified cart
          type: array
          nullable: true
          items:
            $ref: '#/components/schemas/CartItemPriceAdjustment'
    CartItemPriceAdjustment:
      description: Price adjustment details
      required:
        - id
        - reason
        - amount
      type: object
      properties:
        id:
          type: string
          description: >-
            Price adjustment ID; it identifies a single price adjustment object
            from the list of price adjustments.
          nullable: false
          example: d7e78a21-bee3-4448-bf1c-d5b5461dbda2
        reason:
          type: string
          description: Price adjustment reason
          nullable: false
          example: compensation for delay
        amount:
          type: number
          description: >-
            Amount by which the line item's total amount or the specified cart's
            total amount is adjusted
          format: double
          example: 20
          minimum: 0
        attributes:
          type: object
          additionalProperties: true
          description: Placeholder for additional information
          nullable: true
          example:
            goldMember:
              - false
    CartFilter:
      description: Parameters used to search for carts
      type: object
      properties:
        date:
          description: Creation date range of carts to be returned
          allOf:
            - $ref: '#/components/schemas/CartDateRange'
            - nullable: true
        status:
          description: Status of carts to be returned
          type: array
          nullable: true
          items:
            $ref: '#/components/schemas/CartState'
        userId:
          type: string
          description: User ID of carts to be returned
          nullable: true
          example: 61b8e921d0cf2e000882b09f
        customer:
          description: Customer information to filter by
          allOf:
            - $ref: '#/components/schemas/customerSearchObject'
            - nullable: true
        approver:
          type: string
          description: Either approver ID or approver name of carts to be returned
          nullable: true
          example: '100000'
        purchaseOrder:
          type: string
          description: Purchase order number of carts to be returned
          nullable: true
          example: '10000023243'
        account:
          type: string
          description: Account id metadata
          nullable: true
          example: sub-account-id
        company:
          type: string
          description: Company name for the cart
          nullable: true
          example: fabric Inc
        name:
          type: string
          description: Name for the cart
          nullable: true
          example: cart_it
        description:
          type: string
          description: Description for the cart
          nullable: true
          example: Cart for the IT department
        sharedCarts:
          type: boolean
          description: Get all shared carts within account
          nullable: true
          example: true
        attributes:
          type: object
          additionalProperties: true
          description: Custom Search attributes within extra Block of Cart
          nullable: true
          example:
            requestId: 620d8896058edb0009385311
    CartDateRange:
      description: Date range filter used to search for carts
      type: object
      properties:
        start:
          type: string
          description: Earliest cart creation time for carts to be returned
          format: date-time
          nullable: true
          example: '2022-02-24T15:12:40.974'
        end:
          type: string
          description: Latest cart creation time for carts to be returned
          format: date-time
          nullable: true
          example: '2022-03-02T15:12:40.974'
    MergeBehavior:
      description: Merge Behaviors for merge cart
      type: string
      default: MERGE
      enum:
        - MERGE
        - PRIMARY
        - SECONDARY
        - PURGE
    ErrorEnum:
      description: List of error codes
      type: string
      enum:
        - UNKNOWN_ERROR
        - BAD_REQUEST
        - INVALID_TOKEN
        - ACCOUNT_ID_NOT_CONFIGURED
        - ACCOUNT_ID_ALREADY_EXISTS
        - DEPLOYMENT_IN_PROGRESS
        - INVALID_CART_ID
        - CART_NOT_FOUND
        - ITEM_NOT_FOUND
        - UNABLE_TO_GET_CART
        - UNABLE_TO_GET_INVENTORY
        - ITEM_OUT_OF_STOCK
        - UPDATE_CART_ERROR
        - DELETE_CART_ATTRIBUTE_ERROR
        - EMPTY_CART_ERROR
        - UNABLE_TO_GET_PRICE
        - UNABLE_TO_GET_PROMO
        - UNABLE_TO_GET_ITEM
        - PROMO_ALREADY_APPLIED_ERROR
        - CART_ALREADY_SHARED_ERROR
        - PROMO_NOT_FOUND_ERROR
        - PROMO_NOT_APPLICABLE_ERROR
        - USER_NOT_FOUND
        - ATTRIBUTE_NOT_FOUND
        - INCORRECT_ATTRIBUTE_LEVEL
        - INCORRECT_ATTRIBUTE_VALUE
        - ITEM_ATTRIBUTE_ALREADY_EXIST
        - LINE_ITEM_ID_NOT_FOUND
        - ITEM_ID_NOT_APPLICABLE
        - CART_STATUS_NOT_FOUND
        - CART_STATUS_CANNOT_BE_UPDATED
        - GUEST_CART_STATUS_CANNOT_BE_UPDATED
        - CART_STATUS_ALREADY_ASSIGNED
        - TOKEN_INTROSPECT_ERROR
        - MAX_CARTS_LIMIT_REACHED
        - UNAUTHORIZED_USER_ERROR
        - API_PERMISSION_UNDEFINED
        - INVALID_DATE_RANGE
        - INVALID_DATE_FORMAT
        - INVALID_SEARCH_ATTRIBUTE
        - ITEM_SERVICE_NOT_CONFIGURED
        - ATTRIBUTE_SERVICE_NOT_CONFIGURED
        - SHIP_ID_NOT_FOUND
        - NEGATIVE_SHIPPING_COST
        - REQUEST_DENIED
        - BAD_CONFIGURATION
        - SERVICE_NOT_ENABLED
    fees:
      type: object
      properties:
        feeId:
          type: string
          description: >-
            System-generated fee ID, in UUID format. While creating a cart or
            line item with fee, fabric generates this ID for the specified fee.
          example: 73bc09d0-874a-4c3d-84d0-df1670d03578
        name:
          type: string
          description: Attribute for which fee is applied
          nullable: true
          example: gift
        type:
          type: string
          description: Fee type
          nullable: true
          example: gift_wrap
        amount:
          type: number
          format: double
          description: Fee amount
          default: 0
          example: 10.5
        attributes:
          type: object
          additionalProperties: true
          description: Placeholder for additional information in `key:value` pairs
          nullable: true
          example: '{''from'': ''sam'', ''to'': ''david'' }'
    ExceptionDetail:
      description: Exception details
      required:
        - code
        - detail
      type: object
      properties:
        itemId:
          description: ID of item to which exception applies
          type: string
          nullable: true
          example: '1000000001'
        sku:
          type: string
          description: SKU of item to which exception applies
          nullable: true
          example: 16B2GS8LD5FDS
        code:
          description: Error code
          $ref: '#/components/schemas/ErrorEnum'
        detail:
          description: Error detail
          type: string
          example: Item is out of stock
        lineItemId:
          minimum: 1
          type: integer
          description: Cart item sequence number (starts at 1)
          format: int32
          example: 1
    ModifyItemPayload:
      description: Cart and item information to be updated
      required:
        - items
      type: object
      properties:
        cartId:
          type: string
          description: Cart ID
          nullable: true
          example: d7e78a21-bee3-4448-bf1c-d5b5461dbda2
        items:
          description: Items to be updated
          minItems: 1
          type: array
          items:
            $ref: '#/components/schemas/CartItemModifyPayload'
    Name:
      description: Person's name
      type: object
      properties:
        first:
          type: string
          description: Individual's first name
          nullable: true
          example: Pat
        middle:
          type: string
          description: Individual's middle name or initial
          nullable: true
          example: E
        last:
          type: string
          description: Individual's last name
          nullable: true
          example: Kake
    OfferDiscount:
      description: Offer discount details
      required:
        - discounts
        - price
        - promosApplied
      type: object
      properties:
        price:
          type: number
          description: Discounted price of the item
          format: double
          minimum: 0
          example: 80
        discountAmount:
          type: number
          description: Discounted percentage amount of the item
          format: double
          example: 20
          minimum: 0
        promosApplied:
          type: array
          items:
            $ref: '#/components/schemas/CartPromo'
        discounts:
          description: List of discounts applied
          type: array
          items:
            $ref: '#/components/schemas/Discount'
    Offers:
      description: Offer details for cart error response
      required:
        - channel
        - price
      type: object
      properties:
        price:
          description: Item or discount price details
          $ref: '#/components/schemas/Price'
        kind:
          description: Offer type
          type: string
          nullable: true
          example: PROMOTION
        channel:
          description: Offer channel
          type: integer
          format: int32
          example: 12
        lineItemId:
          minimum: 1
          type: integer
          description: Cart item sequence number (starts at 1)
          format: int32
          example: 1
        discounts:
          description: List of discounts
          type: array
          nullable: true
          items:
            $ref: '#/components/schemas/Discount'
    Phone:
      description: Phone number details
      required:
        - number
      type: object
      properties:
        number:
          type: string
          description: Phone number
          example: 123-456-7899
        kind:
          type: string
          description: Phone number type
          nullable: true
          example: MOBILE
          enum:
            - MOBILE
            - HOME
            - BUSINESS
    PickupPerson:
      description: >-
        Details of the designated or alternative person who will pick up the
        cart items
      type: object
      properties:
        name:
          description: Name of pickup person
          allOf:
            - $ref: '#/components/schemas/Name'
            - nullable: true
        phone:
          description: Number of pickup person
          allOf:
            - $ref: '#/components/schemas/Phone'
            - nullable: true
        email:
          type: string
          description: Receiver's email address
          nullable: true
          example: test@mail.com
    Price:
      description: Item price details
      required:
        - base
      type: object
      properties:
        sale:
          description: Item's sale price
          type: number
          format: double
          nullable: true
          example: 10
        cost:
          description: Item's full price
          type: number
          format: double
          nullable: true
          example: 20
        base:
          description: Item's base price
          type: number
          format: double
          example: 20
        currency:
          type: string
          description: Currency type
          example: USD
          nullable: true
        finalPrice:
          description: Price after the increments have been added over base
          type: number
          format: double
          nullable: true
          example: 10
        totalPrice:
          description: Price for all units of this item, including discounts
          type: number
          format: double
          nullable: true
          example: 20
        kind:
          description: Price type
          type: string
          nullable: true
          example: Promotion
        discount:
          description: Discount amount
          type: number
          format: double
          nullable: true
          example: 5.5
    PricedAttributeIdValue:
      description: Cart-level attribute ID and value
      required:
        - attributeId
        - attributeValue
      type: object
      properties:
        attributeId:
          type: string
          description: attribute ID
          example: 60c2a368eb2ec30008ae70a2
        attributeValue:
          type: string
          description: Attribute applicability
          example: 'true'
    PricedItemAttributeIdValue:
      description: Item-level attribute ID and value
      required:
        - attributeId
        - attributeValue
        - lineItemId
      type: object
      properties:
        lineItemId:
          minimum: 1
          type: integer
          description: Cart item sequence number (starts at 1)
          format: int32
          example: 1
        attributeId:
          type: string
          description: Attribute ID
          example: 60c2a368eb2ec30008ae70a2
        attributeValue:
          type: string
          description: Attribute applicability
          example: 'true'
    UpdateCreateCartItemAttributePayload:
      description: Details to add or update item attributes and fees
      type: object
      properties:
        extra:
          type: object
          additionalProperties: true
          description: Extra metadata passed by the caller
          example:
            productFamily: Laptop computers
        fees:
          type: array
          description: >-
            Fees associated with a specific cart or an individual line item of a
            cart
          items:
            $ref: '#/components/schemas/fees'
    suggestedProduct:
      type: object
      properties:
        promotionId:
          type: string
          description: Promotion ID
          example: fef78121-bee3-4448-bf1c-d5b5461dbda2
        promotionTitle:
          type: string
          description: Promotion title
          example: Buy one get one free
        itemId:
          type: string
          description: Suggested item ID
          nullable: true
          example: 19
        itemIds:
          type: array
          description: IDs of the items for which this promotion is applicable
          nullable: true
          items:
            type: string
            description: Suggested item ID
            example: 19
        eligiblePriceLists:
          type: array
          description: Price lists to which the promotion is applicable
          nullable: true
          items:
            type: string
            description: A unique identifier of the priceList event. The price list ID.
            example: 1000000001
        quantity:
          minimum: 1
          type: integer
          description: Suggested quantity of items
          format: int32
          example: 1
        promotionQuantity:
          minimum: 1
          type: integer
          description: Maximum quantity of items allowed as part of the promotion
          format: int32
          example: 1
        free:
          type: boolean
          description: >-
            Indicates if the suggested item is a free item. The options are:<br
            />**true:** The suggested item is provided for free.<br />**false:**
            The suggested item is not offered for free.
          example: true
        discountType:
          type: string
          description: Discount type, such as %OFF, AMOUNT_OFF, and FIXED_PRICE
          example: AMOUNT_OFF
        amount:
          type: number
          description: Discount amount
          format: double
          example: 10
    ProductAttributes:
      description: Additional item options
      required:
        - attributeId
        - name
        - price
        - type
      type: object
      properties:
        attributeId:
          type: string
          description: Attribute ID
          example: 60c2a358eb2ec30008ae70a1
        name:
          type: string
          description: Attribute name
          example: gift wrapping (small)
        description:
          type: string
          description: Attribute description
          nullable: true
          example: Gift wrapping for a small package
        mapping:
          type: string
          description: 'ITEM: Item-level attribute<br />ORDER: Cart-level attribute'
          nullable: true
          example: ITEM
        type:
          type: string
          description: Attribute type
          example: GIFT
        value:
          type: string
          description: Attribute applicability
          nullable: true
          example: 'true'
        price:
          type: number
          description: Attribute price
          format: float
          example: 10
        level:
          type: string
          description: Attribute level
          nullable: true
          example: order
        items:
          type: array
          nullable: true
          items:
            type: string
            description: Discount object
            example: '1000000001'
    ShipCost:
      description: Shipping cost and details
      required:
        - amount
      type: object
      properties:
        amount:
          type: number
          description: Shipping cost
          format: double
          example: 10
        currency:
          type: string
          description: Currency type
          example: USD
          nullable: true
        discount:
          description: Shipping discount
          type: number
          format: double
          nullable: true
          example: 5
    ShipMethod:
      description: Shipping method and details
      type: object
      properties:
        cost:
          description: Shipping cost
          allOf:
            - $ref: '#/components/schemas/ShipCost'
            - nullable: true
        shipMethodId:
          type: string
          description: Shipping method ID
          example: '1234'
        shipmentCarrier:
          type: string
          description: Shipment carrier
          nullable: true
          example: FedEx
        shipmentMethod:
          type: string
          description: Shipment method type
          nullable: true
          example: Next Day
    Fulfillment:
      description: Item details for order fulfillment
      type: object
      properties:
        type:
          type: string
          description: Type of order fulfillment
          nullable: true
          example: WEB_SHIP
        networkCode:
          type: string
          description: Specifies the network of inventory for item
          nullable: true
          example: ShipToCNC
        channelId:
          type: string
          description: Specifies the channel of inventory for item
          nullable: true
          example: '12'
        inventoryType:
          type: string
          description: Specifies the type of inventory for item
          nullable: true
          example: availablePreorder
        inventory:
          type: object
          description: Inventory details of the cart item
          allOf:
            - $ref: '#/components/schemas/InventoryV2'
            - nullable: true
    InventoryV2:
      description: Inventory details of the cart item
      type: object
      properties:
        virtualCounters:
          description: >-
            View quantity of inventory, based on pre configured value. For
            example, 'availableToPurchase' can be a custom attribute configured
            by merchants.
          type: object
          example:
            availableToPurchase: 10
        id:
          description: Inventory ID
          type: string
          example: 62272e917b12209e68751d94
        sku:
          description: SKU of  the item
          type: string
          example: SKU00025
        itemId:
          description: Item ID for which inventory is updated
          type: integer
          format: int64
          example: 4225678911
        locationNum:
          description: >-
            Location number is used to identify the warehouse or location where
            the inventory is kept
          type: integer
          format: int32
          example: 473746
        channelId:
          description: >-
            Sales channel ID. This field is used to identify where the business
            operations are being held.
          type: string
          example: 12
        vendorId:
          description: Vendor ID
          type: string
          example: vendor123
        leadTime:
          description: >-
            The amount of time between when a purchase order is placed to
            replenish products and when the order is received in the warehouse
          type: string
          example: 1234
        inventoryType:
          description: Type of inventory
          type: string
          example: Safety stock
        infiniteInventory:
          description: >-
            Infinite inventory flag.<br /> `true` indicates that the inventory
            can be consumed any number of times as per need<br />`false`
            indicates that the inventory cannot be used infinitely, and has a
            limit to be consumed
          type: boolean
          example: true
        counters:
          description: >-
            Inventory counter (also known as inventory position) configured by
            the merchant
          type: object
          example:
            on-hand: 10
        attributes:
          description: Custom inventory attributes configured by the merchant
          type: object
          example:
            buy online, pick up in-store (bopis): true
        backOrderDate:
          type: string
          description: Inventory restock date
          format: date-time
          example: '2022-08-08T00:00:00.000Z'
        preOrderDate:
          type: string
          description: First ship date of inventory
          format: date-time
          example: '2022-08-08T00:00:00.000Z'
        backOrderLimit:
          type: integer
          description: Maximum restock inventory quantity
          format: int32
          example: 100
        preOrderLimit:
          type: integer
          description: Maximum quanity of inventory for first-ship
          format: int32
          example: 100
        safetyStock:
          type: integer
          description: Reserved inventory quantity at the location
          format: int32
          example: 10
        lowStock:
          type: integer
          description: Inventory quantity to mark as low stock at the location
          format: int32
          example: 10
        segment:
          type: string
          description: Inventory segment
          example: Clothing
        region:
          type: string
          description: Region where inventory is managed
          example: US
    ShipObject:
      description: Cart shipping details
      type: object
      properties:
        shipToId:
          type: string
          description: Shipping details ID
          nullable: true
          example: fef78121-bee3-4448-bf1c-d5b5461dbda2
        cartId:
          type: string
          description: Cart ID
          nullable: true
          example: d7e78a21-bee3-4448-bf1c-d5b5461dbda2
        createdAt:
          type: string
          description: Shipping details creation time
          format: date-time
          nullable: true
          example: '2022-02-18T15:12:40.974580'
        updatedAt:
          type: string
          description: Last time shipping details were updated
          format: date-time
          nullable: true
          example: '2022-02-18T15:12:40.974580'
        shipMethod:
          description: Shipping method and details
          allOf:
            - $ref: '#/components/schemas/ShipMethod'
            - nullable: true
        address:
          description: Shipping address
          allOf:
            - $ref: '#/components/schemas/Address'
            - nullable: true
        shipToType:
          type: string
          description: Shipping type
          nullable: true
          example: SHIP_TO_ADDRESS
        taxCode:
          type: string
          description: Shipping tax code
          nullable: true
          example: FR1000
        isPickup:
          description: true = Item is set for pickup<br />false = Item is set for delivery
          type: boolean
          example: true
        altPickupPerson:
          description: Alternative pickup person
          allOf:
            - $ref: '#/components/schemas/PickupPerson'
            - nullable: true
        pickupPerson:
          description: Designated pickup person
          allOf:
            - $ref: '#/components/schemas/PickupPerson'
            - nullable: true
        warehouseId:
          type: string
          description: Warehouse ID
          nullable: true
          example: XYZ-1234
        storeId:
          type: string
          description: Store ID
          nullable: true
          example: ABC-123
    ShipResponse:
      description: Shipping response body
      type: object
      properties:
        shipToId:
          type: string
          description: Shipping details ID
          nullable: true
          example: fef78121-bee3-4448-bf1c-d5b5461dbda2
        cartId:
          type: string
          description: Cart ID
          nullable: true
          example: d7e78a21-bee3-4448-bf1c-d5b5461dbda2
        createdAt:
          type: string
          description: Shipping details creation time
          format: date-time
          nullable: true
          example: '2022-02-18T15:12:40.974580'
        updatedAt:
          type: string
          description: Last time shipping details were updated
          format: date-time
          nullable: true
          example: '2022-02-18T15:12:40.974580'
        shipMethod:
          description: Shipping method and details
          allOf:
            - $ref: '#/components/schemas/ShipMethod'
            - nullable: true
        address:
          description: Shipping address
          allOf:
            - $ref: '#/components/schemas/Address'
            - nullable: true
        shipToType:
          type: string
          description: Shipping type
          nullable: true
          example: SHIP_TO_ADDRESS
        taxCode:
          type: string
          description: Shipping tax code
          nullable: true
          example: FR1000
        isPickup:
          description: 'true: Item is set for pickup<br />false: Item is set for delivery'
          type: boolean
          example: true
        altPickupPerson:
          description: Alternative pickup person
          allOf:
            - $ref: '#/components/schemas/PickupPerson'
            - nullable: true
        pickupPerson:
          description: Designated pickup person
          allOf:
            - $ref: '#/components/schemas/PickupPerson'
            - nullable: true
        warehouseId:
          type: string
          description: Warehouse ID
          nullable: true
          example: XYZ-1234
        storeId:
          type: string
          description: Store ID
          nullable: true
          example: ABC-123
        estimatedShipDate:
          type: string
          description: Estimated date for shipping
          format: date-time
          nullable: true
          example: '2022-02-18T15:12:40.974580'
        estimatedDeliveryDate:
          type: string
          description: Estimated date for delivery
          format: date-time
          nullable: true
          example: '2022-02-18T15:12:40.974580'
        shipmentInstructions:
          type: string
          description: Store ID
          nullable: true
          example: Additional user instructions for shipping
    ShipToItem:
      description: Ship-to line items
      type: object
      required:
        - lineItemId
        - shippingDetailsId
      properties:
        itemId:
          type: string
          description: Item ID
          nullable: true
          example: '1000000005'
        lineItemId:
          minimum: 1
          type: integer
          description: Cart item sequence number (starts at 1)
          format: int32
          example: 1
        shipToId:
          type: string
          description: Shipping details ID
          nullable: true
          example: fef78121-bee3-4448-bf1c-d5b5461dbda2
    RemoveShipToItem:
      description: Remove shipping from line items
      type: object
      required:
        - lineItemId
      properties:
        lineItemId:
          minimum: 1
          type: integer
          description: Cart item sequence number (starts at 1)
          format: int32
          example: 1
    UpdateCartAttributePayload:
      description: Cart attribute information
      type: object
      properties:
        account:
          type: string
          description: Cart account ID
          nullable: true
          example: 61b8e921d0cf2e000882b09f
        approver:
          type: string
          description: Cart approver ID
          nullable: true
          example: 620d8896058edb0009385311
        purchaseOrder:
          type: string
          description: Cart purchase order
          nullable: true
          example: 112-2624363-4906652
        pricedAttributes:
          description: Attributes added at the cart level
          type: array
          nullable: true
          items:
            $ref: '#/components/schemas/PricedAttributeIdValue'
        name:
          type: string
          description: Name for the cart
          nullable: true
          example: cart-sales
        description:
          type: string
          description: Description for the cart
          nullable: true
          example: cart for sales team
        company:
          type: string
          description: Company name for the cart
          nullable: true
          example: fabric Inc
        sharedUserIds:
          type: array
          nullable: true
          items:
            type: string
            description: UserIds that represents the users who share the cart
            example: '["*"] or [userId1,userId2]'
        extra:
          type: object
          additionalProperties: true
          nullable: true
          description: Extra metadata for the cart
          example:
            productFamily: Laptop computers
          items:
            type: object
            additionalProperties:
              type: array
              items:
                type: string
        fees:
          type: array
          description: >-
            Fees associated with a specific cart or an individual line item of a
            cart
          nullable: true
          items:
            $ref: '#/components/schemas/fees'
    UpdateShipToPayload:
      description: Shipping details to be updated
      required:
        - cartId
        - shippingDetailsId
      type: object
      properties:
        cartId:
          type: string
          description: Cart ID
          example: d7e78a21-bee3-4448-bf1c-d5b5461dbda2
        shipToId:
          type: string
          description: Shipping details ID
          example: fef78121-bee3-4448-bf1c-d5b5461dbda2
        shipMethod:
          description: Shipping method and details
          allOf:
            - $ref: '#/components/schemas/ShipMethod'
            - nullable: true
        address:
          description: Shipping address
          allOf:
            - $ref: '#/components/schemas/Address'
            - nullable: true
        shipToType:
          type: string
          description: Shipping type
          nullable: true
          example: SHIP_TO_ADDRESS
        taxCode:
          type: string
          description: Shipping tax code
          nullable: true
          example: FR1000
        isPickup:
          description: 'true: Item is set for pickup<br />false: Item is set for delivery'
          type: boolean
          example: true
          nullable: true
        altPickupPerson:
          description: Alternative pickup person
          allOf:
            - $ref: '#/components/schemas/PickupPerson'
            - nullable: true
        pickupPerson:
          description: Designated pickup person
          allOf:
            - $ref: '#/components/schemas/PickupPerson'
            - nullable: true
        warehouseId:
          type: string
          description: Warehouse ID
          nullable: true
          example: XYZ-1234
        storeId:
          type: string
          description: Store ID
          nullable: true
          example: ABC-123
        estimatedShipDate:
          type: string
          description: Estimated date for shipping
          format: date-time
          nullable: true
          example: '2022-02-18T15:12:40.974580'
        estimatedDeliveryDate:
          type: string
          description: Estimated date for delivery
          format: date-time
          nullable: true
          example: '2022-02-18T15:12:40.974580'
        shipmentInstructions:
          type: string
          description: Store ID
          nullable: true
          example: Additional user instructions for shipping
    ClientError:
      description: Client error details
      type: object
      properties:
        code:
          description: Error code, meant for machine consumption
          type: string
          example: Bad Request
        message:
          description: Human-readable error description
          type: string
          example: User ID or Cart ID does not exist
    UnauthorizedError:
      description: Unauthorized error details
      type: object
      properties:
        code:
          description: Error code, meant for machine consumption
          type: string
          example: UNAUTHORIZED
        message:
          description: Human-readable error description
          type: string
          example: Unauthorized User
    ServerError:
      description: Server error details
      type: object
      properties:
        code:
          description: Error code, meant for machine consumption
          type: string
          example: Internal Server Error
        message:
          description: Human-readable error description
          type: string
          example: >-
            An internal error occurred. If the issue persists please contact
            support@fabric.inc.
    NotFoundError:
      description: Not-found error details
      type: object
      properties:
        code:
          description: Error code, meant for machine consumption
          type: string
          example: Cart or item not found
        message:
          description: Human-readable error description
          type: string
          example: If the issue persists please contact support@fabric.inc.
    orderDraftNotFound:
      type: object
      description: Order draft not found error
      properties:
        type:
          description: Error code
          type: string
          example: NOT_FOUND
        message:
          description: Error description
          type: string
          example: Order draft not found
    currency:
      type: string
      description: Currency code
      example: USD
    currencyConversion:
      type: number
      description: Currency Conversion (For USD = 1, For Non-USD = conversion ratio to USD)
      format: double
      default: 1
      example: 0.5
    baseAmount:
      type: number
      format: double
      description: Amount
      nullable: true
      example: 10.5
    shippingDetailId:
      type: string
      description: Shipping detail identifier
      example: a1b26d22-cad2-6242-a2b4-e3c4282bad4
    cartId:
      type: string
      description: Cart ID
      example: b8a64b52-dab4-8137-8d6a-f2c2337abc1
    OrderPaymentStatus:
      type: string
      enum:
        - AUTHORIZED
        - FAILED
        - SETTLED
        - NOT_COMPLETED
    OrderStatus:
      required:
        - paymentStatus
      type: object
      properties:
        ready:
          type: boolean
          description: >-
            true: Order draft is ready to generate the final order.<br />false:
            Order draft is not ready.
          default: false
          example: true
        paymentStatus:
          allOf:
            - $ref: '#/components/schemas/OrderPaymentStatus'
            - type: object
              description: Payment status
              example: AUTHORIZED
    OrderNumber:
      type: string
      description: Order number
      nullable: true
      example: 123123123
    OrderType:
      type: string
      description: Order type (WEB, CSC, MOBILE_APP, POS)
      nullable: true
      example: WEB
    OrderSubType:
      type: string
      description: Order sub type (Android/IOS/International)
      nullable: true
      example: Android
    OrderTotal:
      type: number
      description: Total amount for the order
      format: double
      example: 60
    OrderSubTotal:
      type: number
      description: Total amount for the order without discounts
      format: double
      example: 60
    OrderTaxTotal:
      type: number
      description: Total tax applied on the order
      format: double
      example: 60
    OrderDiscount:
      type: number
      description: Total discount applied on the order
      format: double
      example: 60
    OrderTotalFees:
      type: number
      description: Total fees applied on the order
      format: double
      nullable: true
      example: 60
    OrderSequence:
      description: Order sequence details
      required:
        - sequenceName
      type: object
      properties:
        sequenceName:
          type: string
          description: Sequence module name
          example: ORDER_NUMBER_SEQUENCE
        sequenceKey:
          type: string
          description: Sequence format or variant
          nullable: true
          example: WHBM
    Customer:
      type: object
      properties:
        id:
          type: string
          description: Customer ID
          nullable: true
          example: 8fb78749
        type:
          type: string
          description: Customer type
          nullable: true
          example: employee
        segments:
          type: string
          description: Customer segments
          nullable: true
          example: '{subscription: [''premium'']}'
        attributes:
          type: string
          description: Customer attributes
          nullable: true
          example: '{email: John.doe@foo.com}'
    BillToAddress:
      description: Billing address details
      required:
        - city
        - country
        - customerId
        - postalCode
        - state
        - street1
      type: object
      properties:
        name:
          description: Recipient's name
          allOf:
            - $ref: '#/components/schemas/Name'
            - nullable: true
        phone:
          description: Recipient's phone number details
          nullable: true
          allOf:
            - $ref: '#/components/schemas/Phone'
            - nullable: true
        email:
          type: string
          description: Receiver's email address
          nullable: true
          example: test@mail.com
        street1:
          type: string
          description: Address line 1
          example: 100 NE 100th St.
        street2:
          type: string
          description: Address line 2
          nullable: true
          example: Suite 710
        street3:
          type: string
          description: Address line 3
          nullable: true
          example: Seventh floor
        street4:
          type: string
          description: Address line 4
          nullable: true
          example: 'Attention: Pat E. Kake'
        city:
          type: string
          description: City name
          example: Seattle
        state:
          type: string
          description: State name
          example: Washington
        country:
          type: string
          description: Country name
          example: USA
        postalCode:
          type: string
          description: Postal code
          example: '98125'
        customerId:
          type: string
          description: Customer ID created for payment instruction
          example: 98121
        type:
          type: string
          description: Address type
          nullable: true
          example: Residence
        latitude:
          type: number
          description: Latitude
          nullable: true
          example: 35.294952
        longitude:
          type: number
          description: Longitude
          nullable: true
          example: 32.294952
    PaymentDetailsRequest:
      required:
        - amount
        - billToAddress
        - connectorName
        - currency
        - conversion
        - paymentToken
      type: object
      properties:
        connectorName:
          type: string
          description: Payment connector name
          example: Authorizenet
        paymentMethod:
          type: string
          description: Payment method
          nullable: true
          example: card
        paymentMethodType:
          type: string
          description: Payment method type
          nullable: true
          example: tamara or tabby
        paymentToken:
          type: string
          description: Payment token identifier
          example: 534234543
        amount:
          description: Payment amount
          $ref: '#/components/schemas/baseAmount'
        currency:
          $ref: '#/components/schemas/currency'
        conversion:
          $ref: '#/components/schemas/currencyConversion'
        billToAddress:
          allOf:
            - $ref: '#/components/schemas/BillToAddress'
            - type: object
              description: Billing address for the order
        attributes:
          type: object
          additionalProperties: true
          description: Payment Attributes
          nullable: true
          example:
            Attribute1: 620d8896058edb0009385311
    Tax:
      type: object
      properties:
        type:
          type: string
          description: Tax type
          nullable: true
          example: state_tax
        amount:
          type: number
          description: Tax amount
          format: double
          nullable: true
          example: 2.5
        rateType:
          type: string
          description: Rate type
          nullable: true
          example: rateType
        rate:
          type: number
          description: Rate
          format: double
          nullable: true
          example: 10
    ShippingTaxes:
      type: object
      required:
        - shipToId
      allOf:
        - $ref: '#/components/schemas/Tax'
      properties:
        shipToId:
          $ref: '#/components/schemas/shippingDetailId'
    ItemsTaxes:
      type: object
      allOf:
        - $ref: '#/components/schemas/Tax'
      properties:
        lineItemId:
          type: integer
          description: Line item position (starts at 1)
          format: int32
          nullable: true
          example: 1
    FeeTaxes:
      required:
        - feeId
      type: object
      allOf:
        - $ref: '#/components/schemas/Tax'
      properties:
        feeId:
          type: string
          description: Fee tax unique identifier
          example: fef78121-bee3-4448-bf1c-d5b5461dbda2
    EstimatedTax:
      required:
        - itemsTaxes
        - shipToTaxes
      type: object
      properties:
        itemsTaxes:
          type: array
          items:
            $ref: '#/components/schemas/ItemsTaxes'
        shipToTaxes:
          type: array
          items:
            $ref: '#/components/schemas/ShippingTaxes'
        feeTaxes:
          type: array
          items:
            $ref: '#/components/schemas/FeeTaxes'
    OrderDraftPayload:
      required:
        - estimatedTax
        - paymentDetails
      type: object
      properties:
        orderNumber:
          $ref: '#/components/schemas/OrderNumber'
        orderSequence:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/OrderSequence'
        customer:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/Customer'
            - type: object
              description: Customer details
        paymentDetails:
          type: array
          description: Payment details
          items:
            $ref: '#/components/schemas/PaymentDetailsRequest'
        estimatedTax:
          allOf:
            - $ref: '#/components/schemas/EstimatedTax'
            - type: object
              description: Estimated tax object
        orderType:
          $ref: '#/components/schemas/OrderType'
        orderSubType:
          $ref: '#/components/schemas/OrderSubType'
      description: Sample request to create order draft
    ItemDetails:
      required:
        - itemId
        - shippingDetailsId
        - sku
        - lineItemId
      type: object
      allOf:
        - $ref: '#/components/schemas/CartItemResponse'
      properties:
        type:
          type: string
          description: >-
            ItemType(WEB_SHIP/WEB_PICKUP/WEB_SDD/INTERNATIONAL/POS/POS_SHIP/POS_PICKUP)
          nullable: true
          example: WEB_SHIP
        subType:
          type: string
          description: >-
            Item sub type. For International type, provide subType as
            Borderfree.
          nullable: true
          example: Borderfree
        uom:
          type: string
          description: Unit Of measure
          nullable: true
          example: ITEM
        itemTaxTotal:
          type: number
          description: Total tax on item
          format: double
          nullable: true
        taxCode:
          type: string
          description: Tax code for an item
          nullable: true
          example: FR1000
        taxDetail:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/Tax'
            - type: object
              description: Item tax details
    PaymentDetails:
      required:
        - paymentToken
        - amount
      type: object
      allOf:
        - $ref: '#/components/schemas/PaymentDetailsRequest'
    OrderNumberSource:
      type: string
      description: Determines how an order number is created
      enum:
        - CART_ID
        - FABRIC
        - EXTERNAL
        - NONE
    DependencySource:
      type: string
      description: Source of an order number
      enum:
        - FABRIC
        - EXTERNAL
        - NONE
    ConfigurationBehaviour:
      type: string
      description: Cart configurations used to determine behavior of cart.
      enum:
        - BLOCK
        - WARN
        - DROP
        - NONE
    InventoryConfiguration:
      type: object
      properties:
        source:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/DependencySource'
        ttl:
          description: Expiry time in seconds
          type: integer
          format: int32
          example: 60
          nullable: true
        newItemBehaviour:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/ConfigurationBehaviour'
        updateItemBehaviour:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/ConfigurationBehaviour'
        viewItemBehaviour:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/ConfigurationBehaviour'
        expiredDataBehaviour:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/ConfigurationBehaviour'
    CartConfiguration:
      type: object
      properties:
        allowAnonymousUser:
          type: boolean
          nullable: true
          default: true
          example: true
          description: >-
            true: Allows a cart to be a guest cart.<br />false: Allows cart only
            if user is logged in.
        orderNumberSource:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/OrderNumberSource'
        softReserve:
          type: boolean
          nullable: true
          default: false
          example: false
          description: >-
            true: Soft reserve is used for an inventory check.<br/> false: Soft
            reserve is not used for an inventory check.
        addItemBySku:
          type: boolean
          default: false
          example: false
          description: >-
            true: Item can be added to cart by SKU; itemId is not mandatory to
            add an item to cart <br/> false: itemId is mandatory to add item to
            cart
        inventory:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/InventoryConfiguration'
    OrderDraftPaginatedResponse:
      required:
        - data
        - query
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/OrderDraftResponse'
        query:
          $ref: '#/components/schemas/OrderDraftQueryResponse'
    OrderDraftQueryResponse:
      required:
        - count
      properties:
        count:
          description: Total number of records found
          type: integer
          format: int32
          minimum: 0
          example: 10
    OrderDraftResponse:
      required:
        - cartId
        - createdAt
        - currency
        - items
        - orderDiscount
        - orderStatus
        - orderSubTotal
        - orderTotal
        - shipInfo
        - taxTotal
      type: object
      properties:
        cartId:
          $ref: '#/components/schemas/cartId'
        orderNumber:
          $ref: '#/components/schemas/OrderNumber'
        orderType:
          $ref: '#/components/schemas/OrderType'
        orderSubType:
          $ref: '#/components/schemas/OrderSubType'
        orderStatus:
          $ref: '#/components/schemas/OrderStatus'
        orderTotal:
          $ref: '#/components/schemas/OrderTotal'
        orderSubTotal:
          $ref: '#/components/schemas/OrderSubTotal'
        taxTotal:
          $ref: '#/components/schemas/OrderTaxTotal'
        orderDiscount:
          $ref: '#/components/schemas/OrderDiscount'
        currency:
          $ref: '#/components/schemas/currency'
        createdAt:
          type: string
          description: Time order draft was created
          format: date-time
          example: '2022-02-18T15:12:40.974580'
        items:
          type: array
          items:
            $ref: '#/components/schemas/ItemDetails'
        customer:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/Customer'
            - type: object
              description: Customer details
        attributes:
          type: object
          additionalProperties: true
          description: Cart metadata
          nullable: true
          example:
            approver: 620d8896058edb0009385311
        shipInfo:
          type: array
          items:
            $ref: '#/components/schemas/ShipResponse'
        payments:
          type: array
          nullable: true
          items:
            $ref: '#/components/schemas/PaymentDetails'
        accountId:
          type: string
          description: Customer account ID
          nullable: true
          example: 5f689caa4216e7000750d1ef
        totalItems:
          type: integer
          description: Total number of items in the cart
          format: int32
          nullable: true
          example: 3
        totalUniqueItems:
          type: integer
          description: Total number of unique line items in the cart
          format: int32
          nullable: true
          example: 2
        configuration:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/CartConfiguration'
            - type: object
              description: Cart configuration
        fees:
          type: array
          description: >-
            Fees associated with a specific cart or an individual line item of a
            cart
          nullable: true
          items:
            $ref: '#/components/schemas/fees'
        orderTotalFees:
          $ref: '#/components/schemas/OrderTotalFees'
        error:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/ExceptionDetail'
            - type: object
              description: error object
      description: Order draft response
