> ## Documentation Index
> Fetch the complete documentation index at: https://developer.fabric.inc/llms.txt
> Use this file to discover all available pages before exploring further.

# Order query

> Order query



## OpenAPI

````yaml oms_v1 post /api-order/orders/query
openapi: 3.0.0
info:
  description: Order Management System
  version: 1.0.0
  title: Orders v1 (OMS v1)
  contact:
    email: oms-team@fabric.inc
  license:
    name: fabric API license
    url: https://fabric.inc/api-license
servers:
  - url: https://prod01-apigw.{customer_name}.fabric.zone
    description: Production
    variables:
      customer_name:
        default: yourcompany
        description: Customer name, provided by support team
security: []
tags:
  - name: Cart
    description: >-
      Cart APIs<br /><br />**Note:** These are the legacy Cart APIs. To view
      fabric's new Cart APIs, navigate to *Cart API > Cart* from the left side
      navigation pane.
  - name: Bill To
    description: Bill To APIs [Deprecated]
  - name: Ship To
    description: >-
      Ship To APIs<br /><br />**Note:** These are the legacy Ship To APIs. To
      view fabric's new Shipping APIs, navigate to *Cart API > Shipping* from
      the left side navigation pane.
  - name: Wishlist
    description: Wishlist APIs
  - name: Cart Decoupled
    description: Cart Decoupled APIs
  - name: Warehouse
    description: Warehouse APIs
  - name: Inventory
    description: Inventory APIs
  - name: Attributes
    description: >-
      Attributes APIs<br /><br />**Note:** These are the legacy Attribute APIs.
      To view fabric's new Attribute APIs, navigate to *Cart API > Attribute*
      from the left side navigation pane.
  - name: List
    description: List APIs
  - name: Tax/Address Validate
    description: Tax/Address Validate APIs
  - name: Shipping
    description: Shipping APIs
  - name: Payments
    description: Payments APIs
  - name: Order
    description: Order APIs
paths:
  /api-order/orders/query:
    post:
      tags:
        - Order
      summary: Order query
      description: Order query
      operationId: orderQuery
      parameters:
        - in: header
          name: x-api-key
          schema:
            type: string
            example: 0LybWR49k95cCwYh3cu0waCYoh4H2Eux2J52wn4k
        - $ref: '#/components/parameters/xSiteContent'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                offset:
                  type: integer
                  default: 0
                  minimum: 0
                limit:
                  type: integer
                  default: 10
                  minimum: 1
                  maximum: 500
                sortBy:
                  type: string
                  enum:
                    - createdAt
                    - orderTotal
                    - totalQuantity
                    - status
                  default: createdAt
                sortDirection:
                  type: string
                  enum:
                    - asc
                    - desc
                  default: desc
                filters:
                  type: object
                  properties:
                    status:
                      type: array
                      items:
                        type: string
                        enum:
                          - ORDER_CREATED
                          - ORDER_CONFIRMED
                          - ORDER_CANCELLED
                          - ORDER_PARTIALLY_SHIPPED
                          - ORDER_SHIPPED
                          - ORDER_PARTIALLY_DELIVERED
                          - ORDER_DELIVERED
                          - ORDER_RETURNED
                          - ORDER_PARTIALLY_RETURNED
                          - ORDER_PAYMENT_AUTHORIZED
                          - ORDER_PAYMENT_INVALID
                          - ORDER_FULFILLED
                          - ORDER_PARTIALLY_FULFILLED
                          - ORDER_REFUNDED
                      example:
                        - ORDER_CREATED
                        - ORDER_PAYMENT_AUTHORIZED
                    date:
                      title: Date
                      type: object
                      properties:
                        gte:
                          type: string
                        lte:
                          type: string
                      example:
                        gte: '2020-11-01T18:12:03.412Z'
                        lte: '2022-12-03T18:12:03.412Z'
                    orderTotal:
                      type: object
                    totalQuantity:
                      type: object
                    attributes:
                      type: array
                      items:
                        type: object
                        properties:
                          attributeId:
                            type: string
                            example: 60119337cb662800075717f8
                          value:
                            type: string
                            example: blue
                      description: ''
                    customerUserId:
                      type: array
                      items:
                        type: string
                      description: ''
                    customerEmail:
                      type: array
                      items:
                        type: string
                      description: ''
                    shipTo:
                      type: array
                      items:
                        type: object
                        properties:
                          address:
                            type: object
                            properties:
                              name:
                                type: object
                                properties:
                                  first:
                                    type: string
                                    example: Mark
                                  middle:
                                    type: string
                                    example: p
                                  last:
                                    type: string
                                    example: styler
                              phone:
                                type: object
                                properties:
                                  number:
                                    type: string
                                    example: 555-555-5555
                                  kind:
                                    type: string
                                    example: mobile
                              isValidated:
                                type: boolean
                                example: false
                              email:
                                type: string
                                example: mark@google.com
                              street1:
                                type: string
                                example: 10400 NE 4th St
                              street2:
                                type: string
                                example: Suite 500
                              city:
                                type: string
                                example: Bellevue
                              state:
                                type: string
                                example: WA
                              country:
                                type: string
                                example: USA
                              zipCode:
                                type: string
                                example: '98004'
                              kind:
                                type: string
                                example: Ship to address
                          delivery:
                            type: object
                            properties:
                              actual:
                                type: string
                          shipping:
                            type: object
                            properties:
                              actual:
                                type: string
                          promosApplied:
                            type: array
                            items:
                              type: object
                              properties:
                                name:
                                  type: string
                                  example: test1
                          _id:
                            type: string
                            example: 602c1511fcc5e900078ba4af
                          shipToId:
                            type: number
                            example: 1000001
                          shipToType:
                            type: string
                            example: SHIP_TO_ADDRESS
                          price:
                            type: number
                            example: 24.87
                          currency:
                            type: string
                            example: USD
                          estimatedTax:
                            type: number
                            example: 10
                          committedTax:
                            type: number
                            example: 10
                          total:
                            type: number
                            example: 34.87
                          taxCode:
                            type: string
                            example: FR020000
                          shipmentCarrier:
                            type: string
                            example: Fedex
                          shipmentMethod:
                            type: string
                            example: Express
                          shipmentMethodId:
                            type: string
                            example: '10000001'
                          promisedDeliveryDate:
                            type: string
                            example: '2021-02-14T00:00:00.000Z'
                          shipmentInstructions:
                            type: string
                            example: Leave at back door
                          shipmentStatus:
                            type: string
                            example: Delivered
                          readyForPickups:
                            type: array
                          id:
                            type: string
                            example: 602c1511fcc5e900078ba4af
      responses:
        '200':
          description: Returned orders
          content:
            application/json:
              schema:
                type: object
                properties:
                  query:
                    type: object
                    properties:
                      limit:
                        type: number
                        example: 2
                      offset:
                        type: number
                        example: 0
                      count:
                        type: number
                        example: 6
                      orderTotalSum:
                        type: number
                        example: 13543.5
                      orderAverage:
                        type: number
                        example: 2257.25
                      totalQuantitySum:
                        type: number
                        example: 82
                      statusCounts:
                        type: object
                        properties:
                          ORDER_CREATED:
                            type: number
                            example: 0
                          ORDER_CONFIRMED:
                            type: number
                            example: 0
                          ORDER_CANCELLED:
                            type: number
                            example: 0
                          ORDER_PARTIALLY_SHIPPED:
                            type: number
                            example: 0
                          ORDER_SHIPPED:
                            type: number
                            example: 0
                          ORDER_PARTIALLY_DELIVERED:
                            type: number
                            example: 0
                          ORDER_DELIVERED:
                            type: number
                            example: 0
                          ORDER_RETURNED:
                            type: number
                            example: 0
                          ORDER_PARTIALLY_RETURNED:
                            type: number
                            example: 0
                          ORDER_PAYMENT_AUTHORIZED:
                            type: number
                            example: 0
                          ORDER_PAYMENT_INVALID:
                            type: number
                            example: 0
                          ORDER_FULFILLED:
                            type: number
                            example: 0
                          ORDER_PARTIALLY_FULFILLED:
                            type: number
                            example: 0
                          ORDER_REFUNDED:
                            type: number
                            example: 6
                      paymentStatusCounts:
                        type: object
                        properties:
                          succeeded:
                            type: number
                            example: 3
                  orders:
                    type: array
                    items:
                      type: object
                      properties:
                        _id:
                          type: string
                          example: 608c8f995cc215000848a8e0
                        tags:
                          type: array
                        cartId:
                          type: string
                          example: 608c8c9e79f00c00080fbacc
                        attributes:
                          type: array
                        customerEmail:
                          type: string
                          example: mike@fabric.inc
                        orderCurrency:
                          type: string
                          example: USD
                        orderTotal:
                          type: number
                          example: 950.5
                        taxTotal:
                          type: number
                          example: 2.5
                        channel:
                          type: number
                          example: 12
                        status:
                          type: string
                          example: ORDER_REFUNDED
                        statusLog:
                          type: string
                          example: Order has been shipped
                        orderReference:
                          type: string
                          example: 9975-7559-14446
                        orderId:
                          type: string
                          example: 2660-5356-89773
                        shipTo:
                          type: array
                          items:
                            type: object
                            properties:
                              pickupPerson:
                                type: object
                                properties:
                                  name:
                                    type: object
                                    properties:
                                      first:
                                        type: string
                                        example: John
                                      last:
                                        type: string
                                        example: Doe
                                  phone:
                                    type: object
                                    properties:
                                      number:
                                        type: string
                                        example: 8087769338
                                      kind:
                                        type: string
                                        example: Mobile
                                  email:
                                    type: string
                                    example: johndoe@fabric.inc
                              altPickupPerson:
                                type: object
                                properties:
                                  name:
                                    type: object
                                    properties:
                                      first:
                                        type: string
                                        example: first
                                      last:
                                        type: string
                                        example: last
                                  phone:
                                    type: object
                                    properties:
                                      number:
                                        type: string
                                        example: 8087769338
                                      kind:
                                        type: string
                                        example: Mobile
                                  email:
                                    type: string
                                    example: first@fabric.inc
                              promosApplied:
                                type: array
                              _id:
                                type: string
                                example: 608c8d2f798c0900083f60ee
                              shipToType:
                                type: string
                                example: BOPIS
                              taxCode:
                                type: string
                                example: FR1000
                              shipToId:
                                type: number
                                example: 978
                              price:
                                type: number
                                example: 0
                              currency:
                                type: string
                                example: null
                              shipmentMethodId:
                                type: string
                                example: null
                              estimatedTax:
                                type: number
                                example: 0
                              shipmentCarrier:
                                type: string
                                example: null
                              shipmentMethod:
                                type: string
                                example: null
                              total:
                                type: number
                                example: 0
                              id:
                                type: string
                                example: 608c8d2f798c0900083f60ee
                        items:
                          type: array
                          items:
                            type: object
                            properties:
                              group:
                                type: array
                                items:
                                  type: string
                                  example: 1.2312312312312322e+23
                              promosApplied:
                                type: array
                              _id:
                                type: string
                                example: 608c8cd679f00c00080fbace
                              price:
                                type: number
                                example: 900
                              weightUnit:
                                type: string
                                example: lb
                              isPickup:
                                type: boolean
                              itemId:
                                type: number
                                example: 1000000051
                              quantity:
                                type: number
                                example: 1
                              priceListId:
                                type: number
                                example: 100269
                              sku:
                                type: string
                                example: 1538910
                              taxCode:
                                type: string
                                example: PH060771
                              title:
                                type: string
                                example: Luminous Cushion Lagoon
                              weight:
                                type: number
                                example: 1
                              lineItemId:
                                type: number
                                example: 1
                              attributeTotalPrice:
                                type: number
                                example: 0
                              attributes:
                                type: array
                              warehouseId:
                                type: string
                                example: 605d0c47c87d0e0008a3b5a8
                              currency:
                                type: string
                                example: USD
                              shipToId:
                                type: number
                                example: 978
                              discount:
                                type: number
                                example: 0
                              estimatedTax:
                                type: number
                                example: 1
                              total:
                                type: number
                                example: 901
                              reservedLocation:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    _id:
                                      type: string
                                      example: 608c8f9de4b526000842505f
                                    warehouseId:
                                      type: string
                                      example: 605d0c47c87d0e0008a3b5a8
                                    quantity:
                                      type: number
                                      example: 1
                                    id:
                                      type: string
                                      example: 608c8f9de4b526000842505f
                              id:
                                type: string
                                example: 608c8cd679f00c00080fbace
                        shipments:
                          type: array
                          items:
                            type: object
                            properties:
                              _id:
                                type: string
                                example: 60936b987d5a2f0008e8bea6
                              shippedDate:
                                type: string
                                example: '2021-05-06T04:07:47.654Z'
                              shipToId:
                                type: number
                                example: 978
                              shipmentCarrier:
                                type: string
                                example: USPS
                              shipmentCarrierUrl:
                                type: string
                                example: >-
                                  https://tools.usps.com/go/TrackConfirmAction?tRef=fullpage&tLc=2&text28777=&tLabels=65765798989
                              trackingNumber:
                                type: string
                                example: 65765798989
                              lineItems:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    _id:
                                      type: string
                                      example: 60936b987d5a2f0008e8bea7
                                    lineItemId:
                                      type: number
                                      example: 1
                                    quantity:
                                      type: number
                                      example: 1
                                    id:
                                      type: string
                                      example: 60936b987d5a2f0008e8bea7
                              shipmentStatus:
                                type: string
                                example: ORDER_SHIPPED
                              id:
                                type: string
                                example: 60936b987d5a2f0008e8bea6
                        revision:
                          type: number
                          example: 2
                        totalQuantity:
                          type: number
                          example: 2
                        statusDescriptions:
                          type: array
                        events:
                          type: array
                        createdAt:
                          type: string
                          example: '2021-04-30T23:15:37.094Z'
                        updatedAt:
                          type: string
                          example: '2021-05-06T04:09:09.970Z'
                        __v:
                          type: number
                          example: 0
        '400':
          $ref: '#/components/responses/GenericClientError'
        '403':
          $ref: '#/components/responses/MissingXApiKeyHeader'
        '500':
          $ref: '#/components/responses/GenericServerError'
components:
  parameters:
    xSiteContent:
      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"}
  responses:
    GenericClientError:
      description: A generic client error
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                description: The error code
                type: string
              message:
                description: The error message
                type: string
    MissingXApiKeyHeader:
      description: Missing x-api-key in header
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                description: The error message
                example: Forbidden
                type: string
    GenericServerError:
      description: A generic server error
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                description: The error code
                type: string
              message:
                description: The error message
                type: string

````