Skip to main content

Preview ASN

GET 

/api/purchase-orders/:purchase_order/asn/preview

Dry run of the ASN for this purchase order: exactly what its warehouse system (ShipHero) would receive, without sending anything.

Required scope: purchase-orders:read

Grant this scope to your token under Settings → Developer → Personal Access Tokens.

  • mode is create for a purchase order not yet sent, or update when it is already in the warehouse system; then diff lists the changes Push ASN Changes would make (lines[].action: update, delete, add — a new SKU the warehouse system can't add to an existing PO — or blocked — a quantity below what was already received) and changed header fields; diff.structural ({reason, label} or null) is a vendor or warehouse change, which cancels the warehouse-system PO and sends it again (it has no line or header diff); diff.can_push says whether Push ASN Changes has anything it can send. Removing every line of an already-sent PO is not a blocker in update mode: each line is set to 0. A PO with more than 200 warehouse-system SKUs is blocked (too_many_lines).
  • payload holds the PO number, warehouse, vendor (with resolution: matched, will_be_created, fixed, omitted, unmapped, not_verified), PO date and its source, tracking, notes, totals, and the lines combined per warehouse-system SKU (name_truncated_from is the original length when a name was cut).
  • blockers stop the send (missing products, an unmapped vendor, fractional quantities, a locked or closed warehouse PO). warnings don't (names cut, unknown weight, no tracking, no expected arrival, not_verified when the warehouse system couldn't be reached — the payload is still shown).
  • backup_spreadsheet says whether the backup ASN spreadsheet will also be emailed, to whom, and how many backups remain after this one.

Returns 422 when the destination warehouse isn't connected to a warehouse system that supports previews. Returns 422 ASN sending is off for {connection}… when the connection's ASN sending (asn.enabled) was switched off after the PO was sent; receipts keep syncing.

Requires permission: purchase_orders.show

Authentication: Requires Bearer token.

Request​

Responses​

OK

Response Headers
    Content-Type