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

# Get export jobs by query

> Get a paginated list of all the export jobs based on the filter criteria specified in the request body.



## OpenAPI

````yaml exports.openapi post /oms-exports/search
openapi: 3.0.1
info:
  contact:
    email: support@fabric.inc
    name: fabric Support Team
  description: >-
    fabric **Exports** API supports exporting data of different modules such as
    Orders, Locations, Allocations, Inventory, Invoices, Networks,
    Shipping_Methods, and Aggregated_Networks. fabric's Exports API lets you
    export module-specific data (saved in JSON format in the database) to a zip
    file. These zip files contain different CSV files where:

    -   Each field of a single JSON schema is a file header (also called column
    title) in the CSV file

    -   Each item of the JSON schema is a row in the CSV file

    <p>The data, in the database, are arranged as nested objects and arrays
    which are complex to use. fabric's Exports API simplifies the data of a
    single object by segregating them into multiple CSV files (by specific
    identifiers) for ease of use.</p>

    <p>The following are the module (fabric service) names and its generated CSV
    files:<br/>1. Orders: order (exported by item), discount, logs, notes,
    payments, shipInfo<br/>2. Allocations: allocation, logs<br/>3. Shipments:
    shipment<br/>4. Shipping_Methods: shipping_methods<br/>5. Locations:
    location<br/>6. Invoices: invoice, appeasements, discounts, payments<br/>7.
    Inventory: inventory.</p>
  license:
    name: fabric API License
    url: https://fabric.inc/api-license
  termsOfService: https://fabric.inc/terms-of-use
  title: Orders - Exports API
  version: 3.0.0
  x-audience: external-public
servers:
  - description: Production
    url: https://api.fabric.inc/v3
security:
  - authorization: []
tags:
  - description: >-
      fabric **Exports** API supports exporting data of different modules such
      as Orders, Locations, Allocations, Inventory, Invoices, Networks,
      Shipping_Methods, and Aggregated_Networks. fabric's Exports API lets you
      export module-specific data (saved in JSON format in the database) to a
      zip file. These zip files contain different CSV files where:

      -   Each field of a single JSON schema is a file header (also called
      column title) in the CSV file

      -   Each item of the JSON schema is a row in the CSV file

      <p>The data, in the database, are arranged as nested objects and arrays
      which are complex to use. fabric's Exports API simplifies the data of a
      single object by segregating them into multiple CSV files (by specific
      identifiers) for ease of use.</p>

      <p>The following are the module (fabric service) names and its generated
      CSV files:<br/>1. Orders: order (exported by item), discount, logs, notes,
      payments, shipInfo<br/>2. Allocations: allocation, logs<br/>3. Shipments:
      shipment<br/>4. Shipping_Methods: shipping_methods<br/>5. Locations:
      location<br/>6. Invoices: invoice, appeasements, discounts,
      payments<br/>7. Inventory: inventory.</p>
    name: Exports
externalDocs:
  description: Find out more about fabric Orders (also called OMS)
  url: https://developer.fabric.inc/v3/docs/orders-overview
paths:
  /oms-exports/search:
    post:
      tags:
        - Exports
      summary: Get export jobs by query
      description: >-
        Get a paginated list of all the export jobs based on the filter criteria
        specified in the request body.
      operationId: searchExportJobs
      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: 2
            type: number
        - description: Maximum number of records per page
          example: 10
          in: query
          name: limit
          schema:
            default: 10
            example: 10
            type: number
        - $ref: '#/components/parameters/xFabricTenantId'
        - $ref: '#/components/parameters/xFabricChannelId'
        - $ref: '#/components/parameters/xFabricRequestId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/exportHistorySearchRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/exportSearchResponse'
          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'
components:
  parameters:
    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
    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
    xFabricRequestId:
      description: Unique request ID
      example: 263e731c-45c8-11ed-b878-0242ac120002
      in: header
      name: x-fabric-request-id
      required: false
      schema:
        type: string
  schemas:
    exportHistorySearchRequest:
      description: Export search request details
      example:
        filters:
          - condition: EQ
            field: export.module
            value: Order
          - condition: IN
            field: export.status
            values:
              - FINISHED
              - PROCESSING
        sort: '-export.createdAt'
      properties:
        filters:
          items:
            oneOf:
              - $ref: '#/components/schemas/valueSearchFilter'
              - $ref: '#/components/schemas/valuesSearchFilter'
          maxItems: 50
          minItems: 0
          type: array
        sort:
          default: '-export.createdAt'
          description: Property by which data is sorted
          example: +export.createdAt
          pattern: (^[+-]export\.[a-zA-Z.\-_]*)(,([+-]export\.[a-zA-Z.\-_]*)){0,}
          type: string
      required:
        - filters
      type: object
    exportSearchResponse:
      description: Search response details for the exported data
      properties:
        data:
          items:
            $ref: '#/components/schemas/exportLog'
          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
    valueSearchFilter:
      allOf:
        - $ref: '#/components/schemas/exportSearchFilter'
        - properties:
            value:
              description: A single value 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
          type: object
      description: >-
        Criteria to find exports 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/exportSearchFilter'
        - properties:
            values:
              items:
                description: Multiple values 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 exports using multiple values. Condition between
        `field` and `values` is either IN or NIN when `valuesSearchFilter` is
        used.
      required:
        - condition
        - field
      type: object
    exportLog:
      description: Export log details
      properties:
        createdAt:
          description: Time when the export operation was triggered for the first time
          example: '2022-11-22T10:26:38Z'
          format: date-time
          type: string
        csvHeadersConfig:
          description: Header name by which the module is exported to CSV
          example: default
          type: string
        exportId:
          description: Unique ID for export request
          example: order_2022-11-25T17-25-38-417225543Z
          type: string
        module:
          description: >-
            Module (fabric service) for which data is exported. Accepted values
            are ORDER, LOCATION, ALLOCATION, INVENTORY, INVOICE, SHIPMENT,
            NETWORK, SHIPPING_METHODS, AGGREGATED_NETWORK
          example: ORDER
          type: string
        recordFormat:
          default: CSV
          description: >-
            The file format used to export your records. The records are
            exported in a zip file that can be downloaded from the provided URL
            link and extracted. Both CSV and JSON are supported.
          enum:
            - CSV
            - JSON
          example: CSV
          type: string
        status:
          description: >-
            Export log status. `INITIATED`: Export request is successfully
            initiated. `PROCESSING`: Export request is accepted, and the export
            is under process. `FINISHED`: Request is successfully completed. Use
            the *GET/exports/{exportId}* endpoint to download export records.
            `SYSTEM_ERROR`: Request errored out for some reason. 
          enum:
            - INITIATED
            - PROCESSING
            - FINISHED
            - SYSTEM_ERROR
          example: INITIATED
          type: string
        totalRecordsExported:
          description: Total number of records (allocation, order, etc) exported
          example: 20
          format: int32
          type: integer
        totalRowsExported:
          description: Total number of rows exported for a record
          example: 20
          format: int32
          type: integer
        updatedAt:
          description: Time when the export operation was updated last time
          example: '2022-11-22T10:26:38Z'
          format: date-time
          type: string
        url:
          description: >-
            Download URL. The URL will be available to download only when status
            is `FINISHED`
          example: https://abc.zip
          type: string
        version:
          description: >-
            Number of updates happened to this export document. This gets
            incremented with every update that happens to the export document.
            For example, when export of data is initiated, the status is marked
            `INITIATED`, then the status gets updated to `PROCESSING`, and then
            it's marked `FINISHED`, thereby the document gets updated thrice.
            So, the version will be 3.
          example: 2
          format: int64
          type: integer
      required:
        - module
        - recordFormat
        - version
      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
    exportSearchFilter:
      description: >-
        Criteria to find export details. To search using a single value,
        `valueSearchFilter` is considered. To search using multiple values,
        `valuesSearchFilter` is considered.
      discriminator:
        mapping:
          EQ:
            $ref: '#/components/schemas/valueSearchFilter'
          GT:
            $ref: '#/components/schemas/valueSearchFilter'
          GTE:
            $ref: '#/components/schemas/valueSearchFilter'
          IN:
            $ref: '#/components/schemas/valuesSearchFilter'
          LT:
            $ref: '#/components/schemas/valueSearchFilter'
          LTE:
            $ref: '#/components/schemas/valueSearchFilter'
          NEQ:
            $ref: '#/components/schemas/valueSearchFilter'
          NIN:
            $ref: '#/components/schemas/valuesSearchFilter'
        propertyName: condition
      properties:
        condition:
          default: EQ
          description: >-
            Filter conditions. 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: export.module
          pattern: ^export\.[a-zA-Z.\-_]*
          type: string
      required:
        - condition
        - field
      type: object
  headers:
    xFabricRequestIdResponseHeader:
      description: Unique request ID
      example: 263e731c-45c8-11ed-b878-0242ac120002
      required: false
      schema:
        type: string
  securitySchemes:
    authorization:
      bearerFormat: JWT
      scheme: bearer
      type: http

````