components:
  headers:
    xFabricRequestIdResponseHeader:
      description: Unique request ID
      example: 263e731c-45c8-11ed-b878-0242ac120002
      required: false
      schema:
        type: string
  parameters:
    xFabricChannelId:
      description: x-fabric-channel-id identifies the sales channel where the API request is being made; primarily for multichannel use cases. The channel ids are 12 corresponding to US and 13 corresponding to Canada. The default channel id is 12. This field is required.
      example: "12"
      in: header
      name: x-fabric-channel-id
      required: true
      schema:
        type: string
    xFabricChannelIdOptional:
      description: x-fabric-channel-id identifies the sales channel through which the API request is being made; primarily for multichannel use cases. It is an optional field. The default US channel is 12 while the default Canada channel is 13.
      example: "12"
      in: header
      name: x-fabric-channel-id
      required: false
      schema:
        type: string
    xFabricChannelIds:
      description: x-fabric-channel-id identifies the sales channel where the API request is being made; primarily for multichannel use cases. The channel ids are 12 corresponding to US and 13 corresponding to Canada. The default channel id is 12. This field is required. A comma separated list of sales channel IDs. This comma separated list of sales channel IDs are required when using multiple channels.
      example: 12, 13, 16
      in: header
      name: x-fabric-channel-ids
      required: false
      schema:
        type: string
    xFabricChannelIdsOptional:
      description: x-fabric-channel-id identifies the sales channel through which the API request is being made; primarily for multichannel use cases. It is an optional field. The default US channel is 12 while the default Canada channel is 13. This field is optional. **Note:** Use `xFabricChannelIds` for multiple channels, and `xFabricChannelId` for a single channel.
      example: 12, 13, 16
      in: header
      name: x-fabric-channel-ids
      required: false
      schema:
        type: string
    xFabricRequestId:
      description: Unique request ID
      example: 263e731c-45c8-11ed-b878-0242ac120002
      in: header
      name: x-fabric-request-id
      required: false
      schema:
        type: string
    xFabricTenantId:
      description: A header used by fabric to identify the tenant making the request. You must include tenant id in the authentication header for an API request to access any of fabric’s endpoints. You can retrieve the tenant id , which is also called account id, from [Copilot](/v3/platform/settings/account-details/getting-the-account-id). This header is required. 
      example: 5f328bf0b5f328bf0b5f328b
      in: header
      name: x-fabric-tenant-id
      required: true
      schema:
        type: string
  schemas:
    backOrderPreOrderResponse:
      description: Backorder-preorder response details
      properties:
        cartId:
          description: fabric system-generated cart ID. This ID identifies the cart for which backorder and preorder is created.
          example: b03b72dc-78d8-4ea4-90fc-2fe6a1fe6569
          type: string
        consentReceivedAt:
          description: The fabric system-generated time of customer consent. This field is used in combination with the `isDelayConsented` field.
          example: "2022-07-12T09:30:31.198Z"
          format: date-time
          type: string
        createdAt:
          description: The date the backorder or preorder was created.
          example: "2022-07-11T15:03:14.642Z"
          format: date-time
          type: string
        id:
          description: System-generated unique ID for backorder or preorder
          example: 63ec576ddaa2544b2dd94684
          type: string
        isDelayConsented:
          description: "true: Customer agrees to receive the product at a later date false: Customer wants the product immediately, and doesn't agree to receive the product at a later date. In such case, if the merchant can't fulfill the order immediately, they can cancel the product, change order status and notify the customer about order cancellation"
          example: true
          type: boolean
        itemId:
          description: System-generated unique identifier of item from fabric Products (previously called PIM) service
          example: 123
          format: int32
          type: integer
        lastNotifiedAt:
          description: System-generated time of last notification to customer about their order
          example: "2022-06-12T09:30:31.198Z"
          format: date-time
          type: string
        lineItemId:
          description: Item sequence ID generated by fabric Orders (also called fabric OMS)
          example: "0"
          type: string
        lineItemStatus:
          description: Line item status
          enum:
            - CANCELLED
            - REFUNDED
            - PARTIALLY_CANCELLED
            - PARTIALLY_REFUNDED
            - PARTIALLY_CANCELLED_REFUNDED
            - VALID
            - EXCHANGED
            - PENDING_EXCHANGE
            - RETURN
            - PARTIAL_RETURN
            - PENDING_RETURN
            - RETURN_PROCESSING
            - RETURN_REJECTED
            - ORDER_LINE_INVALID_SKU
            - ORDER_LINE_VALID
            - SHIPPED
            - PARTIALLY_SHIPPED
            - ALLOCATED
            - PARTIALLY_ALLOCATED
            - DELIVERED
            - PARTIALLY_DELIVERED
            - PICKED_UP
            - PARTIALLY_PICKED_UP
            - READY_FOR_PICKUP
            - READY_FOR_PARTIAL_PICKUP
          example: CANCELLED
          type: string
        locationNumber:
          description: Represents inventory location which will fulfill the order reservation
          example: WH334
          type: string
        orderId:
          description: System-generated order ID created during order creation
          example: 5fec576ddaa2544b2dd94684
          type: string
        orderNumber:
          description: System-generated order number created during order creation
          example: order_123
          type: string
        orderStatusCode:
          description: Order status
          enum:
            - ORDER_CREATED
            - ORDER_PARTIALLY_ALLOCATED
            - ORDER_ALLOCATED
            - ORDER_SHIPPED
            - ORDER_PARTIALLY_SHIPPED
            - ORDER_PICKED_UP
            - ORDER_PARTIALLY_PICKED_UP
            - ORDER_READY_FOR_PICKUP
            - ORDER_READY_FOR_PARTIAL_PICKUP
            - ORDER_DELIVERED
            - ORDER_PARTIALLY_DELIVERED
            - ORDER_RETURNED
            - ORDER_PARTIALLY_RETURNED
            - ORDER_PENDING_RETURN
            - ORDER_PENDING_PARTIAL_RETURN
            - ORDER_PARTIALLY_EXCHANGED
            - ORDER_EXCHANGED
            - ORDER_CANCELLED
            - ORDER_PARTIALLY_CANCELLED
            - ORDER_HOLD
            - ORDER_CONFIRMED
            - ORDER_HOLD_FRAUD
            - ORDER_HOLD_CSR
            - ORDER_HOLD_CROSSBORDER
            - ORDER_HOLD_REVALIDATION
            - ORDER_ERROR
            - ORDER_HOLD_AUTH_PENDING
          example: ORDER_CREATED
          type: string
        orderedAt:
          description: System-generated order creation time
          example: "2022-04-12T09:30:31.198Z"
          format: date-time
          type: string
        quantity:
          description: Number of items reserved for backorder or preorder
          example: 5
          format: int32
          type: integer
        releasedQuantity:
          description: Number of items to be released from inventory reservation
          example: 1
          format: int32
          type: integer
        sku:
          description: Stock Keeping Unit (SKU), unique identifier of item
          example: sku_123
          type: string
        status:
          description: Backorder or preorder status
          example: PARTIAL_BACK_PREORDER_RELEASE
          type: string
        type:
          description: Reservation type
          enum:
            - PREORDER
            - BACKORDER
          example: BACKORDER
          type: string
        updatedAt:
          description: The date the backorder or preorder was updated.
          example: "2022-07-11T15:03:14.642Z"
          format: date-time
          type: string
        vendorId:
          description: ID of the retailer's source of order replenishment
          example: vendor_123
          type: string
      required:
        - lineItemId
        - locationNumber
        - orderId
        - orderStatusCode
        - orderedAt
        - quantity
        - sku
        - type
      type: object
    backOrderPreOrderSearchFilter:
      description: Criteria to find backorders-preorders. To search using a single value, `valueSearchFilter` is considered. To search using multiple values, `valuesSearchFilter` is considered.
      discriminator:
        mapping:
          EQ: '#/components/schemas/valueSearchFilter'
          GT: '#/components/schemas/valueSearchFilter'
          GTE: '#/components/schemas/valueSearchFilter'
          IN: '#/components/schemas/valuesSearchFilter'
          LT: '#/components/schemas/valueSearchFilter'
          LTE: '#/components/schemas/valueSearchFilter'
          NEQ: '#/components/schemas/valueSearchFilter'
          NIN: '#/components/schemas/valuesSearchFilter'
        propertyName: condition
      properties:
        condition:
          default: EQ
          description: 'Search filter. EQ (Equal to): Searches for exact match. NEQ (Not equal to): Searches by excluding the specified value. IN: Search for multiple values. NIN (Not IN): Excludes the specified values in the search. LT (Less than): Searches for values that are less than the specified value. GT (Greater than):  Search for values that are greater than the specified value. LTE (Less than or equal to): Searches for values that are less than or equal to the specified value. GTE (Greater than or equal to): Searches for values that are greater than or equal to the specified value.'
          enum:
            - EQ
            - NEQ
            - IN
            - NIN
            - LT
            - GT
            - LTE
            - GTE
          example: EQ
          type: string
        field:
          description: Field name
          example: backOrderPreOrder.events
          pattern: ^backOrderPreOrder\.[a-zA-Z.\-_]*
          type: string
        group:
          default: Default
          description: The group name.
          example: GroupA
          type: string
      required:
        - condition
        - field
      type: object
    backOrderPreOrderSearchRequest:
      description: Backorder preorder search request details
      example:
        filters:
          - condition: EQ
            field: backOrderPreOrder.cartId
            value: 64391c190d3ce53e2ccc72b2
          - condition: IN
            field: backOrderPreOrder.itemId
            values:
              - "1122345"
              - "5544321"
        sort: -backOrderPreOrder.type
      properties:
        filters:
          items:
            oneOf:
              - $ref: '#/components/schemas/valueSearchFilter'
              - $ref: '#/components/schemas/valuesSearchFilter'
          maxItems: 50
          minItems: 0
          type: array
        sort:
          default: -backOrderPreOrder.type
          description: Property by which data is sorted
          example: +backOrderPreOrder.invoicedAt
          pattern: (^[+-]backOrderPreOrder\.[a-zA-Z.\-_]*)(,([+-]backOrderPreOrder\.[a-zA-Z.\-_]*)){0,}
          type: string
      required:
        - filters
      type: object
    backOrderPreOrderSearchResponse:
      description: Backorder preorder search response
      properties:
        data:
          items:
            $ref: '#/components/schemas/backOrderPreOrderResponse'
          type: array
        pagination:
          $ref: '#/components/schemas/pagination'
        stats:
          description: A list of stats.
          items:
            description: The stats details.
            type: string
          type: array
      type: object
    errorResponse:
      description: Error response
      properties:
        errors:
          description: Errors
          items:
            $ref: '#/components/schemas/errorResponse'
          type: array
        message:
          description: Error message
          example: Bad request
          type: string
        type:
          description: Error type
          example: CLIENT_ERROR
          type: string
      type: object
    pagination:
      description: Pagination response
      properties:
        count:
          description: Total number of search results
          example: 1000
          format: int32
          type: integer
        limit:
          default: 10
          description: Maximum number of records per page
          example: 10
          format: int32
          maximum: 100
          minimum: 1
          type: integer
        offset:
          default: 0
          description: Number of records to skip before returning all records. For example, `offset=20, limit=10` returns records 21-30.
          example: 1
          format: int32
          minimum: 0
          type: integer
      type: object
    saveDelayConsentRequest:
      description: Delay consent request
      properties:
        consent:
          description: Consent type
          enum:
            - ACCEPT
            - DECLINE
          example: ACCEPT
          type: string
      required:
        - consent
      type: object
    valueSearchFilter:
      allOf:
        - $ref: '#/components/schemas/backOrderPreOrderSearchFilter'
        - properties:
            value:
              description: A single value for field using which backorder-preorder is searched
              example: ORDER_CREATE
              oneOf:
                - description: Target record's non-numeric identifier
                  example: ORDER_CREATE
                  type: string
                - description: Target record's numeric identifier
                  example: 112233
                  format: int64
                  type: number
                - description: Target record's numeric identifier
                  example: 1122.33
                  format: double
                  type: number
          type: object
      description: Criteria to find backorder-preorder using a single value. Condition between `field` and `value` is anything except IN and NIN when `valueSearchFilter` is used.
      required:
        - condition
        - field
      type: object
    valuesSearchFilter:
      allOf:
        - $ref: '#/components/schemas/backOrderPreOrderSearchFilter'
        - properties:
            values:
              items:
                description: Multiple values for field using which data is searched
                example: ORDER_CREATE
                oneOf:
                  - description: Target record's non-numeric identifier
                    example: ORDER_CREATE
                    type: string
                  - description: Target record's numeric identifier
                    example: 112233
                    format: int64
                    type: number
                  - description: Target record's numeric identifier
                    example: 1122.33
                    format: double
                    type: number
              maxItems: 25
              minItems: 1
              type: array
          type: object
      description: Criteria to find backorder-preorder using multiple values. Condition between `field` and `values` is either IN or NIN when `valuesSearchFilter` is used.
      required:
        - condition
        - field
      type: object
  securitySchemes:
    authorization:
      bearerFormat: JWT
      scheme: bearer
      type: http
externalDocs:
  description: Find out more about fabric Orders (also called OMS)
  url: https://developer.fabric.inc/v3/docs/orders-overview
info:
  contact:
    email: support@fabric.inc
    name: fabric Orders Team
  description: fabric **Backorders and Preorders** refer to orders placed for products not currently available for shipment or sale. Backorders are orders for out-of-stock products that will be shipped to customers as soon as they're available for shipment. Preorders are orders for products that aren't yet available in the market, but will be launched for sale. Customers can preorder products, and the products will be shipped when they're available for sale. fabric's Backorders & Preorders API supports multi-tenant service.
  license:
    name: fabric Privacy Policy
    url: https://fabric.inc/api-license
  termsOfService: https://fabric.inc/terms-of-use
  title: Orders - Backorders Preorders API
  version: 3.0.0
  x-audience: external-public
openapi: 3.0.1
"x-mint": {
    "mcp": {
      "enabled": true
    }
  }
paths:
  /backorders-preorders/search:
    post:
      description: Search for the backorder or preorder reservations based on filter criteria.
      operationId: searchReservations
      parameters:
        - description: Number of records to be skipped before returning all records. Default is `0` when no value is specified.
          example: 0
          in: query
          name: offset
          schema:
            default: 0
            example: 0
            format: int32
            type: integer
        - description: Maximum number of records per page
          example: 10
          in: query
          name: limit
          schema:
            default: 10
            example: 10
            format: int32
            maximum: 100
            minimum: 1
            type: integer
        - $ref: '#/components/parameters/xFabricTenantId'
        - $ref: '#/components/parameters/xFabricChannelId'
        - $ref: '#/components/parameters/xFabricRequestId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/backOrderPreOrderSearchRequest'
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/backOrderPreOrderSearchResponse'
          description: OK
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponseHeader'
        "400":
          content:
            application/json:
              example:
                errors:
                  - message: Invalid request
                    type: CLIENT_ERROR
                message: Bad request
                type: CLIENT_ERROR
              schema:
                $ref: '#/components/schemas/errorResponse'
          description: Bad request
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponseHeader'
        "401":
          content:
            application/json:
              example:
                message: Unauthorized request
                type: CLIENT_ERROR
              schema:
                $ref: '#/components/schemas/errorResponse'
          description: Unauthorized
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponseHeader'
        "500":
          content:
            application/json:
              example:
                message: Internal server error
                type: SERVER_ERROR
              schema:
                $ref: '#/components/schemas/errorResponse'
          description: Internal server error
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponseHeader'
      summary: Search for backorders or preorders by query
      tags:
        - Backorders Preorders
  /backorders-preorders/{id}:
    get:
      description: Get backorder or preorder reservation details by ID.
      operationId: getReservation
      parameters:
        - description: Backorder or preorder ID
          example: 63ec576ddaa2544b2dd94684
          in: path
          name: id
          required: true
          schema:
            type: string
        - $ref: '#/components/parameters/xFabricTenantId'
        - $ref: '#/components/parameters/xFabricChannelId'
        - $ref: '#/components/parameters/xFabricRequestId'
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/backOrderPreOrderResponse'
          description: OK
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponseHeader'
        "400":
          content:
            application/json:
              example:
                errors:
                  - message: Invalid request
                    type: CLIENT_ERROR
                message: Bad request
                type: CLIENT_ERROR
              schema:
                $ref: '#/components/schemas/errorResponse'
          description: Bad request
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponseHeader'
        "401":
          content:
            application/json:
              example:
                message: Unauthorized request
                type: CLIENT_ERROR
              schema:
                $ref: '#/components/schemas/errorResponse'
          description: Unauthorized
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponseHeader'
        "404":
          content:
            application/json:
              example:
                message: Reservation not found
                type: CLIENT_ERROR
              schema:
                $ref: '#/components/schemas/errorResponse'
          description: Not found
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponseHeader'
        "500":
          content:
            application/json:
              example:
                message: Internal server error
                type: SERVER_ERROR
              schema:
                $ref: '#/components/schemas/errorResponse'
          description: Internal server error
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponseHeader'
      summary: Get backorder or preorder details by ID
      tags:
        - Backorders Preorders
  /backorders-preorders/{id}/actions/save-delay-consent:
    post:
      description: Record customer's agreement to delay the shipment.
      operationId: saveDelayConsent
      parameters:
        - description: Unique ID for backorder or preorder
          example: 63ec576ddaa2544b2dd94684
          in: path
          name: id
          required: true
          schema:
            type: string
        - $ref: '#/components/parameters/xFabricTenantId'
        - $ref: '#/components/parameters/xFabricChannelId'
        - $ref: '#/components/parameters/xFabricRequestId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/saveDelayConsentRequest'
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/backOrderPreOrderResponse'
          description: OK
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponseHeader'
        "400":
          content:
            application/json:
              example:
                errors:
                  - message: Invalid request
                    type: CLIENT_ERROR
                message: Bad request
                type: CLIENT_ERROR
              schema:
                $ref: '#/components/schemas/errorResponse'
          description: Bad request
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponseHeader'
        "401":
          content:
            application/json:
              example:
                message: Unauthorized request
                type: CLIENT_ERROR
              schema:
                $ref: '#/components/schemas/errorResponse'
          description: Unauthorized
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponseHeader'
        "404":
          content:
            application/json:
              example:
                message: Reservation not found
                type: CLIENT_ERROR
              schema:
                $ref: '#/components/schemas/errorResponse'
          description: Not found
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponseHeader'
        "500":
          content:
            application/json:
              example:
                message: Internal server error
                type: SERVER_ERROR
              schema:
                $ref: '#/components/schemas/errorResponse'
          description: Internal server error
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponseHeader'
      summary: Record customer agreement to delay shipment
      tags:
        - Backorders Preorders
security:
  - authorization: []
servers:
  - description: Production
    url: https://api.fabric.inc/v3
tags:
  - description: fabric **Backorders and Preorders** refer to orders placed for products not currently available for shipment or sale. Backorders are orders for out-of-stock products that will be shipped to customers as soon as they're available for shipment. Preorders are orders for products that aren't yet available in the market, but will be launched for sale. Customers can preorder products, and the products will be shipped when they're available for sale. fabric's Backorders & Preorders API supports multi-tenant service.
    name: Backorders Preorders
