Errors
invalid_request
Univooz could not read the request, or the request did not pass validation.
HTTP 400invalid_request_error
This error is about your code, not your data. Univooz did not start the business checks.
invalid_request is 400 only. It is never 422.
Why it happens
- The body is not valid JSON.
- A necessary field is missing, or a field has the wrong type.
- The body has an unknown field. Univooz rejects unknown fields. It does not ignore them.
- A field belongs to a different schedule mode. Example:
pickupTimewith"mode": "asap". Theparamisschedule.mode. - The body has no
schedule. There is no default mode. - A text field contains a NUL character (
U+0000). All other characters are permitted, and this includes emoji and right-to-left text. - In a
PATCH, a field that the order does not have.
How to fix it
Read details. It lists all the problems, so you can correct them one time:
{
"error": {
"type": "invalid_request_error",
"code": "invalid_request",
"message": "The request contains 2 invalid fields.",
"request_id": "req_01KZCCF8ZH4M7XQ2VB9RSTNPKD",
"details": [
{ "code": "invalid_value", "message": "Not a valid phone number.", "param": "customer.phone" },
{ "code": "required", "message": "This field is required.", "param": "schedule.mode" }
]
}
}details[].code has three values only: required, invalid_value and unknown_field.
One field can give more than one entry, one for each failed rule. Show details as a list.
Do not use param as a unique key.