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

# List orders

> Returns a paginated list of orders with optional filters by creation/updated windows, phase, status, and JSONB properties.

**Property Filtering:** Use `propertyPath`, `propertyValue`, and `propertyExists` to filter orders by integration-specific metadata stored in the `properties` JSONB field.
- `propertyPath`: Dot-notation path to the property (e.g., "sage200Evo.salesOrderNo")
- `propertyValue`: Value to match exactly (mutually exclusive with `propertyExists`)
- `propertyExists`: Boolean to check existence (true) or non-existence (false) of the property path (mutually exclusive with `propertyValue`)

**Examples:**
- Find all orders synced to Sage 200: `?propertyPath=sage200Evo.salesOrderNo&propertyExists=true`
- Find orders NOT synced to Sage 200: `?propertyPath=sage200Evo.salesOrderNo&propertyExists=false`
- Find specific Sage 200 order: `?propertyPath=sage200Evo.salesOrderNo&propertyValue=12345`
- Find ACTIVE+ACCEPTED orders without Sage sync: `?phase=ACTIVE&status=ACCEPTED&propertyPath=sage200Evo.salesOrderNo&propertyExists=false`



## OpenAPI

````yaml openapi.json get /api/v1/orders
openapi: 3.0.3
info:
  title: Polinate External API
  version: 1.0.0
  description: >-
    External API for partners and services. Authentication via X-Business-Id and
    X-API-Key headers.


    Credentials location: In the Polinate app, navigate to Business Settings →
    Integrations to find your Business ID and API Key.
servers:
  - url: https://integrations.polinate.ai
    description: Production
security: []
tags:
  - name: Items
    description: >-
      Manage items and item variants. Auth: X-Business-Id and X-API-Key (see
      Business Settings → Integrations).
  - name: Buyers
    description: >-
      Create buyers and related contacts/locations. Auth: X-Business-Id and
      X-API-Key (see Business Settings → Integrations).
  - name: Pricing
    description: >-
      Create price lists and entries. Auth: X-Business-Id and X-API-Key (see
      Business Settings → Integrations).
  - name: Invoices
    description: >-
      List and update invoices. Auth: X-Business-Id and X-API-Key (see Business
      Settings → Integrations).
  - name: Orders
    description: >-
      Order ingestion. Auth: X-Business-Id and X-API-Key (see Business Settings
      → Integrations).
paths:
  /api/v1/orders:
    get:
      tags:
        - Orders
      summary: List orders
      description: >-
        Returns a paginated list of orders with optional filters by
        creation/updated windows, phase, status, and JSONB properties.


        **Property Filtering:** Use `propertyPath`, `propertyValue`, and
        `propertyExists` to filter orders by integration-specific metadata
        stored in the `properties` JSONB field.

        - `propertyPath`: Dot-notation path to the property (e.g.,
        "sage200Evo.salesOrderNo")

        - `propertyValue`: Value to match exactly (mutually exclusive with
        `propertyExists`)

        - `propertyExists`: Boolean to check existence (true) or non-existence
        (false) of the property path (mutually exclusive with `propertyValue`)


        **Examples:**

        - Find all orders synced to Sage 200:
        `?propertyPath=sage200Evo.salesOrderNo&propertyExists=true`

        - Find orders NOT synced to Sage 200:
        `?propertyPath=sage200Evo.salesOrderNo&propertyExists=false`

        - Find specific Sage 200 order:
        `?propertyPath=sage200Evo.salesOrderNo&propertyValue=12345`

        - Find ACTIVE+ACCEPTED orders without Sage sync:
        `?phase=ACTIVE&status=ACCEPTED&propertyPath=sage200Evo.salesOrderNo&propertyExists=false`
      operationId: listOrders
      parameters:
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 1
          required: false
          name: page
          in: query
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 20
          required: false
          name: limit
          in: query
        - schema:
            type: string
            format: date-time
            example: '2024-01-01T00:00:00Z'
          required: false
          name: createdSince
          in: query
        - schema:
            type: string
            format: date-time
            example: '2024-01-15T00:00:00Z'
          required: false
          name: updatedSince
          in: query
        - schema:
            type: string
            format: date-time
            example: '2024-02-01T00:00:00Z'
          required: false
          name: modifiedSince
          in: query
        - schema:
            type: string
            enum:
              - DRAFT
              - PENDING
              - DELETED
              - ACTIVE
              - ARCHIVED
              - REJECTED
              - CANCELLED
            example: ACTIVE
          required: false
          name: phase
          in: query
        - schema:
            type: string
            enum:
              - UNASSIGNED
              - ACCEPTED
              - PACKED
              - IN_TRANSIT
              - DELIVERED
              - RETURNED
              - NOT_APPLICABLE
            example: ACCEPTED
          required: false
          name: status
          in: query
        - schema:
            type: string
            description: >-
              Dot-notation path to filter by JSONB property (e.g.,
              "sage200Evo.salesOrderNo", "unleashed.unleashedSalesOrderGuid")
            example: sage200Evo.salesOrderNo
          required: false
          name: propertyPath
          in: query
        - schema:
            type: string
            description: >-
              Value to match exactly for the property path (mutually exclusive
              with propertyExists)
            example: '12345'
          required: false
          name: propertyValue
          in: query
        - schema:
            type: boolean
            description: >-
              Boolean to check existence (true) or non-existence (false) of the
              property path (mutually exclusive with propertyValue)
            example: false
          required: false
          name: propertyExists
          in: query
        - schema:
            type: string
            description: >-
              Business identifier for external auth. Find in Polinate app →
              Business Settings → Integrations.
            example: '{{businessId}}'
          required: true
          name: X-Business-Id
          in: header
        - schema:
            type: string
            description: >-
              Per-business API key for external auth. Find in Polinate app →
              Business Settings → Integrations.
            example: '{{apiKey}}'
          required: true
          name: X-API-Key
          in: header
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Paginated_ZodObject'
                  - properties:
                      items:
                        type: array
                        items:
                          $ref: '#/components/schemas/Order'
                      total:
                        type: number
                      page:
                        type: number
                      pageSize:
                        type: number
              example:
                items: []
                total: 0
                page: 1
                pageSize: 20
        '400':
          description: >-
            Bad Request - Invalid query parameters or invalid property filter
            combinations
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardError'
              examples:
                ValidationError:
                  summary: Invalid enum value
                  value:
                    errorCode: VALIDATION_ERROR
                    message: Invalid phase value
                MissingPropertyPath:
                  summary: propertyValue requires propertyPath
                  value:
                    errorCode: VALIDATION_ERROR
                    message: propertyValue requires propertyPath to be specified
                MutuallyExclusiveParams:
                  summary: propertyValue and propertyExists are mutually exclusive
                  value:
                    errorCode: VALIDATION_ERROR
                    message: propertyValue and propertyExists cannot be used together
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardError'
        '429':
          description: Rate limited
          headers:
            Retry-After:
              schema:
                type: string
              description: Seconds to wait before retrying
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardError'
components:
  schemas:
    Paginated_ZodObject:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/Invoice'
        total:
          type: number
        page:
          type: number
        pageSize:
          type: number
      required:
        - items
        - total
        - page
        - pageSize
    Order:
      type: object
      properties:
        id:
          type: string
        partnershipId:
          type: string
          description: The business partnership this order belongs to
        membershipId:
          type: string
          nullable: true
        integrationId:
          type: string
          nullable: true
        phase:
          type: string
          enum:
            - DRAFT
            - PENDING
            - DELETED
            - ACTIVE
            - ARCHIVED
            - REJECTED
            - CANCELLED
        status:
          type: string
          enum:
            - UNASSIGNED
            - ACCEPTED
            - PACKED
            - IN_TRANSIT
            - DELIVERED
            - RETURNED
            - NOT_APPLICABLE
        internalReference:
          type: string
        externalReference:
          type: string
          nullable: true
        notes:
          type: string
          nullable: true
        deliveryAddress:
          type: string
          nullable: true
        expectedDeliveryAt:
          type: string
          format: date-time
        deliveredAt:
          type: string
          nullable: true
          format: date-time
        shippedAt:
          type: string
          nullable: true
          format: date-time
        currency:
          type: string
        totalAmount:
          type: string
          description: Decimal as string
        properties:
          type: object
          nullable: true
          properties: {}
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        orderItems:
          type: array
          items:
            $ref: '#/components/schemas/OrderItem'
      required:
        - id
        - partnershipId
        - internalReference
        - expectedDeliveryAt
        - currency
        - totalAmount
        - createdAt
        - updatedAt
    StandardError:
      type: object
      properties:
        errorCode:
          type: string
        message:
          type: string
        fieldErrors:
          type: object
          additionalProperties:
            type: string
      required:
        - errorCode
        - message
    Invoice:
      type: object
      properties:
        id:
          type: string
        status:
          type: string
          enum:
            - DELETED
            - DRAFT
            - AUTHORISED
            - PARTIALLY_PAID
            - PAID
            - OVERPAID
            - OVERDUE
            - VOIDED
            - DEFAULTED
            - CREDITED
            - REFUNDED
        reference:
          type: string
        notes:
          type: string
        createdAt:
          type: string
        updatedAt:
          type: string
        properties:
          type: object
          properties: {}
        invoiceLineItems:
          type: array
          items:
            $ref: '#/components/schemas/InvoiceLineItem'
      required:
        - id
    OrderItem:
      type: object
      properties:
        id:
          type: string
        orderId:
          type: string
        lineNumber:
          type: number
        itemListEntryId:
          type: string
        itemListEntry:
          type: object
          properties:
            itemVariantId:
              type: string
            itemVariant:
              type: object
              properties:
                itemId:
                  type: string
              required:
                - itemId
          required:
            - itemVariantId
            - itemVariant
        quantity:
          type: number
        unitOfMeasure:
          type: string
        currency:
          type: string
        price:
          type: string
          description: Decimal as string
        cost:
          type: string
          description: Decimal as string
        properties:
          type: object
          nullable: true
          properties: {}
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      required:
        - id
        - orderId
        - lineNumber
        - itemListEntryId
        - itemListEntry
        - quantity
        - unitOfMeasure
        - currency
        - price
        - cost
        - createdAt
        - updatedAt
    InvoiceLineItem:
      type: object
      properties:
        id:
          type: string
        invoiceId:
          type: string
        itemVariantId:
          type: string
        description:
          type: string
        quantity:
          type: number
        unitAmount:
          type: number
        currency:
          type: string
      required:
        - id
        - invoiceId

````