Upsert Shipment with Line Items
POST/v1/api/integrations/sync/shipment-with-line-items
Creates or updates a shipment along with its line items in a single atomic operation. Follows the same upsert
semantics as the POST /v1/api/integrations/sync/shipment endpoint.
Upsert behaviour:
- If
shipment_keyis provided and a matching shipment exists, it will be updated - Shipment fields are patched — omitting a field preserves the existing value
- Shipments with status
completedare never modified - Only
typeandline_itemsare required
Line item upsert (line_items):
- Matched by
product_id— if a line item with the same product already exists on this shipment, it will be updated - On update,
expected_quantity,actual_quantity,line_no, andadditional_dataare patched nameandskuare intentionally not updated — a different name/SKU implies a different product
Pallet identifiers (pallet_identifiers):
- Any identifiers in the payload are upserted (inserted if new, ignored if already present)
- If
sync_pallet_identifiers: trueis provided, any untracked identifiers not in the payload are deleted, syncing the identifier list to the payload. Already-tracked identifiers are always preserved.
Response: Returns the full shipment record including all joined data (line items, pallet identifiers, location, etc.)
Auth Required
Required Permissions:
quality.inspection.shipment:write("Quality Inspection Shipment Write")
Request
Responses
- 200
- 400
- 401
- 403
- 500
Shipment with line items upserted successfully
Bad Request. The request was invalid or cannot be otherwise served.
Unauthorized. User is not authenticated or session is invalid.
Forbidden. User does not have the required permissions.
Internal Server Error