Skip to main content

Link Inbound Shipment to Invoice

POST 

/api/purchase-invoices/:purchaseInvoice/inbound-shipments/:inboundShipment

Link an existing inbound shipment to this purchase invoice. No request body is required.

Required scope: purchase-orders:write

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

The link determines which shipment's dispatch and receipt dates drive the invoice's payment schedule when the purchase order uses a staged payment term with per-shipment final-goods lines, and marks the matching order milestones as invoiced. Each shipment line is also paired with the invoice line billing the same purchase order line, so already-received goods no longer count as outstanding to ship. A purchase order line billed across two lines of the same invoice is ambiguous and is left unpaired.

An invoice whose due date was set manually keeps that date; only a derived due date is recalculated.

A shipment may be linked to more than one invoice: a consolidated shipment carrying several purchase orders is billed once per order, and a supplier may split one shipment across several invoices. Every linked invoice dates from the shipment; links to other invoices are never affected.

Returns 422 when the shipment is cancelled or carries no lines for this invoice's purchase order. Linking a shipment that is already linked to this same invoice succeeds and changes nothing.

An explicit link is recorded with linked_via = manual (plus linked_by and linked_at; see List Inbound Shipments for Invoice), and it clears any earlier dismissal of that shipment — linking by hand is also how to undo an unlink. Shipments the matcher can link on its own are linked with linked_via = auto instead; see Auto-Link Inbound Shipments.

Authentication: Requires Bearer token.

Request

Responses

OK