Skip to content

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 for DELIVERY).
  • A reference code is unknown (service_type_ref, payment_ref).
  • total_cents does not equal items plus options plus charges minus discounts.
  • requested_time is 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[].field and correct the named field.
  • Check the allowed values under "Reference codes" in the API documentation.
  • Compute total_cents from 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)."
    }
  ]
}

All problem types · Deutsche Version