Send ASN
POST/api/purchase-orders/:purchase_order/asn
Send an Advanced Shipment Notice (ASN) for this purchase order to its destination third-party logistics (3PL) warehouse. The destination warehouse must be of type 3PL.
purchase-orders:writeGrant this scope to your token under Settings → Developer → Personal Access Tokens.
How it is sent depends on the destination warehouse:
- Warehouse system — when the destination warehouse is mapped to a Trackstar warehouse-system connection that can create inbound shipments, the ASN is created directly in that warehouse system as an inbound shipment (using the connection's configured receipt type). This happens once per purchase order: a second request returns 422, because the warehouse system cannot change the lines of a shipment it has already created — make any further changes in the warehouse system. The destination warehouse needs no email address in this case.
- Email — otherwise the ASN is emailed as a spreadsheet to the email address on the destination warehouse's address record, and can be resent.
GET /api/purchase-orders/{purchase_order} returns asn_warehouse_system — the name of the warehouse-system connection the ASN will be created in, or null when it will be emailed.
Response: data.channel (email or warehouse_system), data.message (also returned as the top-level message) and data.external_reference (the inbound shipment ID in the warehouse system; null for email, or when the warehouse system did not return an ID).
Returns 422 when the destination warehouse is not a 3PL; when it has no email address and no connected warehouse system; when the order has no product lines; when the ASN was already sent to the warehouse system; or when the warehouse system refuses it (for example a product without a SKU, a fractional quantity, a receipt type the warehouse system does not accept, or a field it requires that SKU.io cannot fill) — the message says which.
Requires permission: purchase_orders.update
Authentication: Requires Bearer token.
When the ASN is emailed, its email template must be turned on; otherwise the request is refused with 422 and nothing is marked as sent.
Request
Responses
- 200
- 401
- 403
- 404
- 422
- 429
OK
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Not found — no record with the given identifier (or the route does not exist). Verify the ID before retrying.
Unprocessable Entity
Response Headers
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.