Expected response
- There may be a variety of reasons why a request may fail ie. not supported service, weight cannot be 0, customs information is missing, multi-package shipments are not supported etc.
- In such cases, it is important to send back a user error message to give the user visibility into the failed request which Fulfil will then display
- The expected error response body will be an object with an
errors
key which will have a list of errors:- Each with it's own
code
anddescription
field
- Each with it's own
- The response code should be a 400 error
example:
{
"errors": [
{
"code": "HK-001",
"description": "Weight cannot be 0."
},
{
"code": "BT-001",
"description": "International shipments not supported with this service."
}
]
}