---
title: "Get All ERP Sales Orders"
method: GET
path: "/erp/sales-orders"
tags: ["erp", "Sales Orders"]
---

# Get All ERP Sales Orders

`GET /erp/sales-orders`

## Request

- Base URL: `https://production.trackstarhq.com`
- URL: `https://production.trackstarhq.com/erp/sales-orders`
- Auth: none required

Returns all Sales Orders for the ERP connection associated with the provided access token.

## Query parameters

- `page_token` string, nullable
- `limit` integer
- `ids` ErpSalesOrderIdsQueryParam
  - `in` string[], required: A comma-separated list of resource IDs. If provided, all other query params are ignored.
- `created_date` ErpSalesOrderCreatedDateQueryParam
  - `eq` string, date-time
  - `neq` string, date-time
  - `in` string[]: Comma-separated.
  - `nin` string[]: Comma-separated.
  - `gt` string, date-time
  - `gte` string, date-time
  - `lt` string, date-time
  - `lte` string, date-time
- `updated_date` ErpSalesOrderUpdatedDateQueryParam
  - `eq` string, date-time
  - `neq` string, date-time
  - `in` string[]: Comma-separated.
  - `nin` string[]: Comma-separated.
  - `gt` string, date-time
  - `gte` string, date-time
  - `lt` string, date-time
  - `lte` string, date-time
- `trackstar_created_date` ErpSalesOrderTrackstarCreatedDateQueryParam
  - `eq` string, date-time
  - `neq` string, date-time
  - `in` string[]: Comma-separated.
  - `nin` string[]: Comma-separated.
  - `gt` string, date-time
  - `gte` string, date-time
  - `lt` string, date-time
  - `lte` string, date-time
- `trackstar_updated_date` ErpSalesOrderTrackstarUpdatedDateQueryParam
  - `eq` string, date-time
  - `neq` string, date-time
  - `in` string[]: Comma-separated.
  - `nin` string[]: Comma-separated.
  - `gt` string, date-time
  - `gte` string, date-time
  - `lt` string, date-time
  - `lte` string, date-time
- `trackstar_tags` ErpSalesOrderTrackstarTagsFlatQueryParam
  - `contains` string[]: Comma-separated.
  - `not_contains` string[]: Comma-separated.
- `status` ErpSalesOrderStatusQueryParam
  - `eq` 'pending_approval' | 'open' | 'partially_fulfilled' | 'fulfilled' | 'on_hold' | 'closed' | 'cancelled' | 'other'
  - `neq` 'pending_approval' | 'open' | 'partially_fulfilled' | 'fulfilled' | 'on_hold' | 'closed' | 'cancelled' | 'other'
  - `in` string[]: Comma-separated.
  - `nin` string[]: Comma-separated.
  - `contains` string
  - `not_contains` string
- `order_number` ErpSalesOrderOrderNumberQueryParam
  - `eq` string
  - `neq` string
  - `in` string[]: Comma-separated.
  - `nin` string[]: Comma-separated.
  - `contains` string
  - `not_contains` string
- `reference_id` ErpSalesOrderReferenceIdQueryParam
  - `eq` string
  - `neq` string
  - `in` string[]: Comma-separated.
  - `nin` string[]: Comma-separated.
  - `contains` string
  - `not_contains` string
- `order_date` ErpSalesOrderOrderDateQueryParam
  - `eq` string, date-time
  - `neq` string, date-time
  - `in` string[]: Comma-separated.
  - `nin` string[]: Comma-separated.
  - `gt` string, date-time
  - `gte` string, date-time
  - `lt` string, date-time
  - `lte` string, date-time

## Headers

- `x-trackstar-api-key` string, required
- `x-trackstar-access-token` string, required

## Response `200`

Successful response

- ErpSalesOrdersListEndpoint
  - `data` ErpSalesOrderApiItemSchema[], required
    - `id` string, required: The unique ID of the sales order in the ERP.
    - `created_date` string, date-time, required: The date the sales order was created.
    - `updated_date` string, date-time, required: The date the sales order was last updated.
    - `order_number` string, required: The user-facing identifier of the sales order as assigned by the ERP.
    - `reference_id` string, nullable, required: An external reference on the order, such as the customer's PO number. Null if the ERP has no external reference.
    - `status` 'pending_approval' | 'open' | 'partially_fulfilled' | 'fulfilled' | 'on_hold' | 'closed' | 'cancelled' | 'other', required: The status of the sales order. See the [sales order information](info) for more details.
    - `raw_status` string, nullable, required: The raw status label returned directly from the ERP (e.g., 'Pending Fulfillment', 'Partially Fulfilled').
    - `order_date` string, date-time, required: The date the order was placed or booked in the ERP.
    - `expected_ship_date` string, date-time, nullable, required: The expected or promised ship date for the order.
    - `customer_id` string, nullable, required: ID of the customer in the ERP.
    - `location_id` string, nullable, required: ID of the ERP location the order ships from, when set at the order level.
    - `subtotal` number, nullable, required: Sum of item line amounts before tax, shipping, and discount, in the order currency.
    - `total_tax` number, nullable, required: Total tax charged on the order, in the order currency.
    - `total_shipping` number, nullable, required: Total shipping charged on the order, in the order currency.
    - `total_discount` number, nullable, required: Total discount applied to the order, in the order currency.
    - `total_price` number, nullable, required: Grand total the customer will be billed for the order, in the order currency.
    - `ship_to_address` ShipToAddress, required
      - `full_name` string, nullable, required
      - `company` string, nullable, required
      - `address1` string, nullable, required
      - `address2` string, nullable, required
      - `address3` string, nullable, required
      - `city` string, nullable, required
      - `state` string, nullable, required
      - `postal_code` string, nullable, required
      - `country` string, nullable, required
      - `phone_number` string, nullable, required
      - `email_address` string, nullable, required
    - `bill_to_address` BillToAddress, required
      - `full_name` string, nullable, required
      - `address1` string, nullable, required
      - `address2` string, nullable, required
      - `address3` string, nullable, required
      - `city` string, nullable, required
      - `state` string, nullable, required
      - `postal_code` string, nullable, required
      - `country` string, nullable, required
    - `shipping_method_id` string, nullable, required: ID of the shipping method on the order.
    - `shipping_method_name` string, nullable, required: Display name of the shipping method.
    - `notes` string[], required: List of free-form notes recorded on the order.
    - `line_items` ErpSalesOrderLineItem[], required: List of line items on the sales order.
      - `line_item_id` string, required: Line-unique ID within the order.
      - `item_id` string, required: ID of the item sold on this line.
      - `sku` string, required: SKU / item number of the item.
      - `quantity` number, required: Quantity ordered on this line.
      - `unit_price` number, required: Per-unit price in the order currency.
      - `is_kit` boolean, required: Whether this line is a kit. A kit ships as a unit, so its components are not listed as separate lines here; they are nested under `kit_components`.
      - `kit_components` ErpSalesOrderKitComponent[], required: The items inside this kit line, at the quantities this line ordered. Empty unless the line is a kit. Each entry has its own line_item_id, which is what you reference when supplying lot or bin information at fulfillment.
        - `line_item_id` string, required: Line-unique ID of the component within the order.
        - `item_id` string, required: ID of the component item.
        - `sku` string, required: SKU / item number of the component item.
        - `quantity` number, required: Quantity of this component ordered on this kit line.
      - `location_id` string, nullable, required: ID of the location the line ships from. Set per-line when an order splits items across multiple origins; otherwise inherits the order-level `location_id`.
    - `custom_fields` object, required: Per-account custom fields defined on the sales order. Keys are the field names as defined in the ERP; each value carries the raw value, its declared type, and a human-readable label.
    - `external_system_url` string, nullable, required: URL link to the sales order in the external system (WMS/Freight etc).
    - `trackstar_tags` unknown[], nullable, required: A list of custom tags associated with the resource. A tag can be either a string or a dictionary with one key-value pair.
      - unknown
    - `additional_fields` object, required: Integration-specific fields
    - `trackstar_created_date` string, date-time, required
    - `trackstar_updated_date` string, date-time, required
  - `next_token` string, nullable, required: See [pagination](/how-to-guides/about-the-api#pagination) for more details.
  - `total_count` integer, required: The number of items returned.

## Other responses

- `422`: Validation error

## Changes

- **2026-11-03** `f9f948f2a7b3`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/trackstarhq/apis/trackstar-api/changes/erp/sales-orders/get.md)

---

[API](https://skmtc.dev/trackstarhq/apis/trackstar-api.md) - [All operations](https://skmtc.dev/trackstarhq/apis/trackstar-api/llms.txt) - [OpenAPI document](https://skmtc.dev/trackstarhq/apis/trackstar-api/revisions/08647f790594?raw)
