---
title: "Create ERP Sales Order Shipment"
method: POST
path: "/erp/sales-order-shipments"
tags: ["erp", "Sales Order Shipments"]
---

# Create ERP Sales Order Shipment

`POST /erp/sales-order-shipments`

## Request

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

Records a shipment (fulfillment) against an existing sales order. The
parent sales order is identified by `sales_order_id` in the request
body. 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
    - `sales_order_id` string, required: ID of the parent sales order this shipment fulfills.
    - `packages` WriteErpSalesOrderShipmentPackage[]: Per-parcel breakdown of the shipment.
      - `tracking_number` string: The carrier tracking number for the package.
      - `measurements` WriteErpSalesOrderShipmentPackageMeasurements, required
        - `weight` number, required: Weight of the package.
        - `weight_unit` string: The unit of measurement for the weight.
    - `line_items` ErpSalesOrderShipmentCreateLineItemlinnworks[]: Items included in this shipment. Splits into one entry per (item, lot, bin) triple — a 100-unit ship of one item drawn from two lots (60 + 40) across two bins emits one entry per (lot, bin).
      - `line_item_id` string, required
      - `item_id` string, required
      - `quantity` number, required
  - object
    - `sales_order_id` string, required: ID of the parent sales order this shipment fulfills.
    - `shipped_date` string, date-time: Date the shipment was sent.
    - `packages` WriteErpSalesOrderShipmentPackage[]: Per-parcel breakdown of the shipment.
      - `tracking_number` string: The carrier tracking number for the package.
      - `measurements` WriteErpSalesOrderShipmentPackageMeasurements, required
        - `weight` number, required: Weight of the package.
        - `weight_unit` string: The unit of measurement for the weight.
    - `location_id` string: ID of the location the shipment was sent from.
    - `notes` string[]: List of free-form notes recorded on the shipment.
    - `ship_to_address` ErpSalesOrderShipmentShipToAddressNetsuite
      - `full_name` string
      - `company` string
      - `address1` string
      - `address2` string
      - `city` string
      - `state` string
      - `postal_code` string
      - `country` string
      - `phone_number` string
    - `line_items` ErpSalesOrderShipmentCreateLineItemnetsuite[]: Items included in this shipment. Splits into one entry per (item, lot, bin) triple — a 100-unit ship of one item drawn from two lots (60 + 40) across two bins emits one entry per (lot, bin).
      - `line_item_id` string, required
      - `item_id` string, required
      - `quantity` number, required
      - `lots` WriteNetSuiteSalesOrderShipmentLineItemLot[]: Per-(lot, bin) commitment for this line. NetSuite requires lot when the item is lot-tracked, bin when the item is bin-tracked. Identify the lot via lot_id OR lot_name (exactly one); same for bin via bin_id OR bin_name. Name-based entries are resolved server-side. The shipment must include location_id when any bin_name is used. The sum of lots[*].quantity must equal the line's quantity.
        - `lot_id` string: NetSuite inventoryNumber.id; see /erp/inventory.lots[]. Mutually exclusive with lot_name.
        - `bin_id` string: NetSuite bin.id; see /erp/inventory.bins[]. Mutually exclusive with bin_name.
        - `quantity` number, required: Quantity drawn from this (lot, bin) pair.
        - `lot_name` string: Human-readable lot label (inventoryNumber.inventorynumber). Resolved to lot_id scoped by the line's item_id. Mutually exclusive with lot_id.
        - `bin_name` string: Human-readable bin label (bin.binnumber). Resolved to bin_id scoped by the shipment's location_id. Mutually exclusive with bin_id.
      - `kit_components` WriteNetSuiteSalesOrderShipmentKitComponent[]: The items inside this kit line, needed only when a component is lot- or bin-tracked. Use the component's own `line_item_id` from the sales order's `line_items[*].kit_components[*]`.
        - `line_item_id` string, required: ID of the component's line on the sales order.
        - `item_id` string, required: ID of the component item.
        - `quantity` number, required: Quantity of this component going out with the kits on this line.
        - `lots` WriteNetSuiteSalesOrderShipmentLineItemLot[]: Per-(lot, bin) commitment for this line. NetSuite requires lot when the item is lot-tracked, bin when the item is bin-tracked. Identify the lot via lot_id OR lot_name (exactly one); same for bin via bin_id OR bin_name. Name-based entries are resolved server-side. The shipment must include location_id when any bin_name is used. The sum of lots[*].quantity must equal the line's quantity.
          - `lot_id` string: NetSuite inventoryNumber.id; see /erp/inventory.lots[]. Mutually exclusive with lot_name.
          - `bin_id` string: NetSuite bin.id; see /erp/inventory.bins[]. Mutually exclusive with bin_name.
          - `quantity` number, required: Quantity drawn from this (lot, bin) pair.
          - `lot_name` string: Human-readable lot label (inventoryNumber.inventorynumber). Resolved to lot_id scoped by the line's item_id. Mutually exclusive with lot_id.
          - `bin_name` string: Human-readable bin label (bin.binnumber). Resolved to bin_id scoped by the shipment's location_id. Mutually exclusive with bin_id.
    - `custom_fields` object: Per-account custom fields defined on the sales order shipment. 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

- ErpCreateSalesOrderShipmentResponse
  - `data` CreateErpSalesOrderShipmentResponseDataSchema
    - `id` string, required: The unique ID of the shipment transaction in the ERP.
    - `sales_order_id` string, required: ID of the parent sales order this shipment fulfills.
    - `created_date` string, date-time, required: The date the sales order shipment was created.
    - `updated_date` string, date-time, required: The date the sales order shipment was last updated.
    - `shipment_number` string, nullable, required: The user-facing identifier of the shipment as assigned by the ERP.
    - `shipped_date` string, date-time, required: Date the shipment was sent.
    - `location_id` string, nullable, required: ID of the location the shipment was sent from.
    - `notes` string[], required: List of free-form notes recorded on the shipment.
    - `packages` ErpSalesOrderShipmentPackage[], required: Per-parcel breakdown of the shipment. Mirrors the WMS shipment.packages shape — one entry per package shipped, carrying its own tracking number and measurements.
      - `package_id` string, required: The ID of the package within the shipment.
      - `tracking_number` string, nullable, required: The carrier tracking number for the package.
      - `measurements` PackageMeasurements, required
        - `length` number, nullable, required
        - `width` number, nullable, required
        - `height` number, nullable, required
        - `unit` 'cm' | 'in', nullable, required: The unit of measurement for the size of the package.
        - `weight` number, nullable, required
        - `weight_unit` 'kg' | 'oz' | 'lb', nullable, required: The unit of measurement for the weight of the package.
    - `line_items` ErpSalesOrderShipmentLineItem[], required: Items included in this shipment. Splits into one entry per (item, lot, bin) triple — a 100-unit ship of one item drawn from two lots (60 + 40) across two bins emits one entry per (lot, bin).
      - `shipment_line_item_id` string, required: ID of the line within the shipment record.
      - `line_item_id` string, nullable, required: ID of the source sales-order line that this shipment line fulfills. Joins back to the parent sales order's `line_items[*].line_item_id`. Null when the ERP doesn't expose the link.
      - `item_id` string, required: ID of the inventory item shipped.
      - `sku` string, required: SKU / item number of the item shipped.
      - `quantity` number, required: Quantity shipped on this line.
      - `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` ErpSalesOrderShipmentKitComponent[], required: The items that shipped inside this kit line, and the lots or bins each was drawn from. Empty unless the line is a kit.
        - `line_item_id` string, nullable, required: Line-unique ID of the component on the source sales order.
        - `item_id` string, required: ID of the component item shipped.
        - `sku` string, required: SKU / item number of the component item.
        - `quantity` number, required: Quantity of this component shipped.
        - `lots` ErpSalesOrderShipmentKitComponentLot[], required: The lots and bins this component was drawn from. Empty for components that are not lot or bin tracked.
          - `lot_id` string, nullable, required: ID of the lot this component was drawn from.
          - `lot_name` string, nullable, required: Human-readable lot name.
          - `bin_id` string, nullable, required: ID of the bin this component was drawn from.
          - `bin_name` string, nullable, required: Human-readable bin name.
          - `quantity` number, required: Quantity drawn from this lot or bin.
      - `lot_id` string, nullable, required: ID of the lot this line was drawn from. Null for non-lot-tracked items.
      - `lot_name` string, nullable, required: Human-readable name of the lot this line was drawn from.
      - `expiration_date` string, date-time, nullable, required: Expiration date of the lot this line was drawn from.
      - `bin_id` string, nullable, required: ID of the bin this line was drawn from. Null for non-bin-tracked items.
      - `bin_name` string, nullable, required: Human-readable name of the bin this line was drawn from.
    - `custom_fields` object, required: Per-account custom fields defined on the sales order shipment. 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 shipment 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-order-shipments/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)
