Validation error
| Problem type | https://help.orderhi.com/partner-api/problems/validation-error |
| HTTP status | 422 |
Meaning
The request is valid JSON, but its content is not acceptable. Details are in errors, each with a field name (field) and a message (message).
Typical causes
- A required field is missing (for example
items,customer.firstname, or the address fields forDELIVERY). - A reference code is unknown (
service_type_ref,payment_ref). total_centsdoes not equal items plus options plus charges minus discounts.requested_timeis in the past or more than 7 days ahead.- A value has the wrong type or is too long.
How to fix it
- Read
errors[].fieldand correct the named field. - Check the allowed values under "Reference codes" in the API documentation.
- Compute
total_centsfrom items, options, charges and discounts.
Example response
The response has the content type application/problem+json.
{
"type": "https://help.orderhi.com/partner-api/problems/validation-error",
"title": "Validation failed",
"status": 422,
"detail": "The order is invalid.",
"errors": [
{
"field": "items[0].sku_ref",
"message": "Required."
},
{
"field": "total_cents",
"message": "Must equal items + charges - discounts (2150)."
}
]
}