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.
purchase-orders:writeGrant 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
- 200
- 401
- 403
- 404
- 422
- 429
OK
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
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.