---
title: "Erp sales order updated"
method: POST
path: "erp-sales-order.updated"
---

# Erp sales order updated

`POST erp-sales-order.updated` (webhook)

When a Sales Order is updated.

## Payload

- union
  - ErpSalesOrdersUpdatedFullWebhook
    - `connection_id` string, required
    - `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
    - `event_type` 'erp-sales-order.updated', required
    - `integration_name` string, required
    - `integration_type` string, required
    - `previous_attributes` ErpSalesOrdersUpdatedPreviousAttributes, required
      - `id` string: The unique ID of the sales order in the ERP.
      - `created_date` string, date-time: The date the sales order was created.
      - `updated_date` string, date-time: The date the sales order was last updated.
      - `order_number` string: The user-facing identifier of the sales order as assigned by the ERP.
      - `reference_id` string, nullable: 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': The status of the sales order. See the [sales order information](info) for more details.
      - `raw_status` string, nullable: The raw status label returned directly from the ERP (e.g., 'Pending Fulfillment', 'Partially Fulfilled').
      - `order_date` string, date-time: The date the order was placed or booked in the ERP.
      - `expected_ship_date` string, date-time, nullable: The expected or promised ship date for the order.
      - `customer_id` string, nullable: ID of the customer in the ERP.
      - `location_id` string, nullable: ID of the ERP location the order ships from, when set at the order level.
      - `subtotal` number, nullable: Sum of item line amounts before tax, shipping, and discount, in the order currency.
      - `total_tax` number, nullable: Total tax charged on the order, in the order currency.
      - `total_shipping` number, nullable: Total shipping charged on the order, in the order currency.
      - `total_discount` number, nullable: Total discount applied to the order, in the order currency.
      - `total_price` number, nullable: Grand total the customer will be billed for the order, in the order currency.
      - `ship_to_address` ShipToAddress
        - `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
        - `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: ID of the shipping method on the order.
      - `shipping_method_name` string, nullable: Display name of the shipping method.
      - `notes` string[]: List of free-form notes recorded on the order.
      - `line_items` ErpSalesOrderLineItem[]: 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: 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: URL link to the sales order in the external system (WMS/Freight etc).
      - `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
      - `additional_fields` object: Integration-specific fields
      - `trackstar_created_date` string, date-time
      - `trackstar_updated_date` string, date-time
  - ErpSalesOrdersUpdatedTruncatedWebhook
    - `connection_id` string, required
    - `data` ErpSalesOrdersUpdatedTruncatedData, required
      - `id` string: The record this event is about. Absent on connection webhooks, which carry dates rather than a row.
    - `event_type` 'erp-sales-order.updated', required
    - `integration_name` string, required
    - `integration_type` string, required
    - `previous_attributes` ErpSalesOrdersUpdatedTruncatedPreviousAttributes, required
    - `data_truncated` boolean, required: Always true on this shape. The event was too large to send in full, so `data` holds only the `id` and `previous_attributes` is empty.
    - `data_url` string, required: Called with your usual API key, it returns a download link for this event exactly as it would have been delivered.

## Acknowledgement `200`

Success

---

[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)
