---
title: "Erp purchase order created"
method: POST
path: "erp-purchase-order.created"
---

# Erp purchase order created

`POST erp-purchase-order.created` (webhook)

When a Purchase Order is created.

## Payload

- union
  - ErpPurchaseOrdersCreatedFullWebhook
    - `connection_id` string, required
    - `data` ErpPurchaseOrderApiItemSchema, required
      - `id` string, required: The unique ID of the purchase order in the ERP.
      - `created_date` string, date-time, required: The date the purchase order was created.
      - `updated_date` string, date-time, required: The date the purchase order was last updated.
      - `order_number` string, required: The user-facing identifier of the purchase order as assigned by the ERP.
      - `reference_id` string, nullable, required: An external reference on the order, such as the supplier's quote number. Null if the ERP has no external reference.
      - `status` 'pending_approval' | 'pending_supplier' | 'open' | 'partially_received' | 'received' | 'closed' | 'cancelled' | 'other', required: The status of the purchase order. See the [purchase order information](info) for more details.
      - `raw_status` string, nullable, required: The raw status label returned directly from the ERP (e.g., 'Pending Receipt', 'Partially Received').
      - `order_date` string, date-time, required: The date the purchase order was placed or booked in the ERP.
      - `expected_arrival_date` string, date-time, nullable, required: The expected or promised receipt date for the order.
      - `vendor_id` string, required: ID of the vendor in the ERP.
      - `employee_id` string, nullable, required: ID of the internal employee (requestor / buyer) on the order. Optional on writes; passed through to the ERP when provided. When omitted, the ERP's own enforcement applies — accounts that require an employee will reject the request.
      - `location_id` string, nullable, required: ID of the ERP location the order will be received into, when set at the order level.
      - `total_price` number, nullable, required: Grand total the supplier will be paid for the order (item subtotal plus tax and shipping minus discount), 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
      - `notes` string[], required: List of free-form notes recorded on the order.
      - `line_items` ErpPurchaseOrderLineItem[], required: List of line items on the purchase order.
        - `line_item_id` string, required: Line-unique ID within the order.
        - `id` string, required: Deprecated: use line_item_id instead. Same value.
        - `item_id` string, required: ID of the item purchased 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.
        - `location_id` string, nullable, required: ID of the location the line will be received into. Set per-line when an order splits items across multiple destinations; otherwise inherits the order-level `location_id`.
      - `custom_fields` object, required: Per-account custom fields defined on the purchase 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 purchase 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-purchase-order.created', required
    - `integration_name` string, required
    - `integration_type` string, required
  - ErpPurchaseOrdersCreatedTruncatedWebhook
    - `connection_id` string, required
    - `data` ErpPurchaseOrdersCreatedTruncatedData, required
      - `id` string: The record this event is about. Absent on connection webhooks, which carry dates rather than a row.
    - `event_type` 'erp-purchase-order.created', required
    - `integration_name` string, required
    - `integration_type` string, 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)
