Shipment Error Codes
Errors in Ship can have many causes, such as badly-formed requests, incorrect permissions, or unforeseen issues during request processing. This section provides an explanation of the Ship API error object and a reference list of the errors that Ship can return.
Error Structure in PRO
Errors codes in Ship have two levels - a top-level code corresponding to standard HTTP error codes and a "child" code giving more detail on the specifics of the problem.
Note
For a detailed breakdown of the error codes that Ship can return, see the List of Error Codes section.
When an API request encounters an error, Ship returns an API Error object. The API Error object contains the following information:
correlation_id
- A unique reference for the error.code
- The top-level error code.message
- A plain-text message explaining the top-level error code returned.details
- An object indicating the affected shipmentproperty
(where applicable), child errorcode
, and an explanatorymessage
.links
- Links to relevant resources.
Note
The explanatory message
properties should not be considered part of Ship's data contract and no logic should be programmed against them, as they are subject to change at any time.
Example API Error Object
{
"correlation_id": "6c4e6a77-feab-42ab-9d7b-f559dc1b90ca",
"code": "validation_error",
"message": "A provided property has an invalid format",
"details": [
{
"property": "addresses[0].contact.contact_details.email",
"code": "invalid_format",
"message": "'test@something' is not a valid email address"
}
],
"_links": null
}
List of Error Codes
Ship can return the following error codes:
531
521
- 521 - Allocation Failed
- 521 - Carrier Service Not Found
- 521 - Carrier Service Shipment Mismatch
- 521 - Shipment Invalid State
- 521 - Shipment Not Found
500
429
410
405
404
401
400
- 400 - Validation Error
- 400 - Address Type Required
- 400 - Conflicting Properties
- 400 - Date In Past
- 400 - Duplicate Address Type
- 400 - Duplicate Metadata Key
- 400 - Duplicate References
- 400 - Duplicate Tags
- 400 - Duplicate Values
- 400 - Invalid Accessibility
- 400 - Invalid Address Type
- 400 - Invalid Carrier Service
- 400 - Invalid Category Type
- 400 - Invalid Hazard Class
- 400 - Invalid Contents Reference
- 400 - Invalid Country Code
- 400 - Invalid Cron Expression
- 400 - Invalid Currency
- 400 - Invalid Date Range
- 400 - Invalid Dimension Unit
- 400 - Invalid Direction
- 400 - Invalid Email
- 400 - Invalid Format
- 400 - Invalid Metadata Type
- 400 - Invalid Package Size Reference
- 400 - Invalid Packing Group
- 400 - Invalid Physical Form
- 400 - Invalid Postal Code
- 400 - Invalid Radioactivity
- 400 - Invalid Reference Format
- 400 - Invalid Region
- 400 - Invalid Request
- 400 - Invalid Shipment State
- 400 - Invalid Shipment Type
- 400 - Invalid Shipping Terms
- 400 - Invalid State For Operation
- 400 - Invalid Value
- 400 - Invalid Weight Unit
- 400 - Required Property Missing
- 400 - System Shipment State
- 400 - System Use Only
- 400 - Too Few Elements
- 400 - Too Many Elements
- 400 - Unit Mismatch
- 400 - Value Too Large
- 400 - Value Too Long
- 400 - Value Too Short
- 400 - Value Too Small
- 400 - Version Header Error
- 400 - Version Header Missing
- 400 - File Too Large
- 400 - Non-Unique Reference
- 400 - Virtual Service Not Found
- 400 - Text Decoder Error