---
title: "Create ERP Sales Order"
method: POST
path: "/erp/sales-orders"
tags: ["erp", "Sales Orders"]
---

# Create ERP Sales Order

`POST /erp/sales-orders`

## Request

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

Get the required, optional, and integration specific fields by calling the [integrations](/api-reference/mgmt/integrations) endpoint.

## Headers

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

## Request body

- union
  - object
    - `trackstar_tags` unknown[], nullable: 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
    - `customer_id` string, required: ID of the customer in the ERP.
    - `reference_id` string: An external reference on the order, such as the customer's PO number. Null if the ERP has no external reference.
    - `order_date` string, date-time: The date the order was placed or booked in the ERP.
    - `expected_ship_date` string, date-time: The expected or promised ship date for the order.
    - `location_id` string: ID of the ERP location the order ships from, when set at the order level.
    - `notes` string[]: List of free-form notes recorded on the order.
    - `line_items` ErpSalesOrderWriteLineItemfulfil[], required: List of line items on the sales order.
      - `item_id` string, required
      - `sku` string
      - `quantity` number, required
      - `unit_price` number
  - object
    - `trackstar_tags` unknown[], nullable: 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
    - `customer_id` string, required: ID of the customer in the ERP.
    - `reference_id` string: An external reference on the order, such as the customer's PO number. Null if the ERP has no external reference.
    - `order_date` string, date-time: The date the order was placed or booked in the ERP.
    - `expected_ship_date` string, date-time: The expected or promised ship date for the order.
    - `location_id` string: ID of the ERP location the order ships from, when set at the order level.
    - `ship_to_address` ErpSalesOrderShipToAddressLinnworks
      - `full_name` string
      - `company` string
      - `address1` string
      - `address2` string
      - `city` string
      - `state` string
      - `postal_code` string
      - `country` string
      - `address3` string
      - `phone_number` string
    - `bill_to_address` ErpSalesOrderBillToAddressLinnworks
      - `full_name` string
      - `company` string
      - `address1` string
      - `address2` string
      - `city` string
      - `state` string
      - `postal_code` string
      - `country` string
      - `address3` string
    - `notes` string[]: List of free-form notes recorded on the order.
    - `line_items` ErpSalesOrderWriteLineItemlinnworks[], required: List of line items on the sales order.
      - `item_id` string, required
      - `sku` string
      - `quantity` number, required
      - `unit_price` number
      - `location_id` string
    - `custom_fields` object: 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.
    - `source` string: Sales channel name the order is created under. Linnworks stores it upper-case.
    - `sub_source` string: Sales channel sub-name the order is created under.
  - object
    - `trackstar_tags` unknown[], nullable: 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
    - `customer_id` string, required: ID of the customer in the ERP.
    - `reference_id` string: An external reference on the order, such as the customer's PO number. Null if the ERP has no external reference.
    - `order_number` string: The user-facing identifier of the sales order as assigned by the ERP.
    - `order_date` string, date-time: The date the order was placed or booked in the ERP.
    - `expected_ship_date` string, date-time: The expected or promised ship date for the order.
    - `location_id` string: ID of the ERP location the order ships from, when set at the order level.
    - `ship_to_address` ErpSalesOrderShipToAddressNetsuite
      - `full_name` string
      - `company` string
      - `address1` string
      - `address2` string
      - `city` string
      - `state` string
      - `postal_code` string
      - `country` string
      - `phone_number` string
    - `bill_to_address` ErpSalesOrderBillToAddressNetsuite
      - `full_name` string
      - `company` string
      - `address1` string
      - `address2` string
      - `city` string
      - `state` string
      - `postal_code` string
      - `country` string
    - `notes` string[]: List of free-form notes recorded on the order.
    - `line_items` ErpSalesOrderWriteLineItemnetsuite[], required: List of line items on the sales order.
      - `item_id` string, required
      - `sku` string
      - `quantity` number, required
      - `unit_price` number
      - `location_id` string
    - `custom_fields` object: 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.

## Response `200`

Successful response

- ErpCreateSalesOrderResponse
  - `data` CreateErpSalesOrderResponseDataSchema
    - `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
  - `id` string, required: The ID of the object that has been created or modified
  - `unused_fields` string[], required: Unused fields

## 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/post.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)
