Create Inbound Shipment From Purchase Invoice
POST/api/inbound-shipments/from-invoice/:purchaseInvoice
Create a new inbound shipment pre-filled from a supplier invoice. Each invoice line is converted into a shipment line that retains the purchase_invoice_line_id and resolves to its underlying purchase_order_line_id.
purchase-orders:writeGrant this scope to your token under Settings → Developer → Personal Access Tokens.
Validation:
- destination_warehouse_id: required, must exist on warehouses
- lines: required, min 1, each must reference an existing purchase_invoice_line_id
- expected_quantity: required, numeric > 0
If an invoice line has already been fully shipped on a prior shipment, the response includes a soft warning under warnings[] (key: lines.<purchase_invoice_line_id>) rather than failing the request. Set mark_as_shipped=true to immediately transition the new shipment to in_transit.
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.