Register a deviation on an order
POST/freight/:reference/deviation
Register a deviation (e.g. damaged goods, a failed pickup) on an existing order identified by its
Swipload reference. The calling company must be the shipper or the carrier on the order, and the
deviation is attributed to the user the api-token resolves to.
DeviationMoment is optional and is recorded as sent — it is not checked against the order's
status. When it is omitted the moment is derived from that status instead: Deliver for an
order that is InTransit or Delivered, PickUp for any earlier status. Either
way the moment that was recorded is returned in the response.
A deviation cannot be registered on an order that is Draft, Cancelled or
Deleted.
A supporting document is optional and may be supplied inline as DocumentData or by link as
DocumentURL, but never both. A DocumentURL that cannot be downloaded does not fail
the request: the deviation is registered and the response reports DocumentUploaded as false
with the reason in DocumentError.
Request
Responses
- 200
- 400
- 401
Deviation successfully registered.
Order not found, order is Draft, Cancelled or Deleted, deviation moment outside PickUp and Deliver, invalid document data, both DocumentData and DocumentURL supplied, or an unsupported document format from DocumentURL
Api-token missing, Unauthorized client, or the calling company is not the shipper or carrier on the order