univoozAPI
Errors

Errors

The error format, the five types, and all 30 codes.

Every error uses the same format.

{
  "error": {
    "type": "invalid_request_error",
    "code": "branch_not_connected",
    "message": "Branch 'noerrebro' has no active connection to a fleet zone.",
    "param": "branch",
    "doc_url": "https://docs.univooz.com/errors/branch_not_connected",
    "request_id": "req_01KZCCF8ZH4M7XQ2VB9RSTNPKD"
  }
}
FieldMeaning
typeThe group. Five values, and they never change.
codeThe exact error. A code never changes its meaning. Use this in your code.
messageText for a person. It can change at any time. Never use it in your code.
paramThe field that caused the error, if one field caused it.
doc_urlThe page for this code.
request_idGive this to support.

The five types

TypeMeaningYour action
invalid_request_errorYour request is not correct.Correct the request.
authentication_errorYour key is missing, unknown, revoked or expired.Correct the key. Do not try again.
billing_errorYour plan or your payment.Upgrade, or pay the invoice.
rate_limit_errorToo many requests.Wait, then try again.
api_errorA failure in Univooz.Try again, with increasing delays.

400 or 422

  • 400 — Univooz could not read the request. Your code is wrong.
  • 422 — Univooz read the request, and a rule rejected it. Your data is wrong.

invalid_request is 400 only.

Field errors

A validation failure adds a details list, so you can correct everything 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:

CodeMeaning
requiredThe field is necessary and is missing.
invalid_valueThe value is not acceptable.
unknown_fieldThis request has no such 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.

request_id

Every response has request_id, in the body and in the Request-Id header. Give it to support.

The value is req_ and then a ULID. Treat it as text. The length and the characters can change.

request_id belongs to the response, not to an order. It is absent from data[] in a list, and from data in a webhook.

All 30 codes

Authentication

CodeStatusCause
invalid_api_key401Missing, incorrect or unknown
api_key_revoked401Somebody revoked it
api_key_expired401It passed its expiry date
test_mode_required403A test endpoint with a live key

Plan and payment

CodeStatusCause
subscription_inactive402The subscription is unpaid or cancelled
feature_not_available403The endpoint needs an Advanced plan

Destination

CodeStatusCause
branch_required422No branch, and you have more than one active branch
branch_not_found422No branch has that reference or id
branch_not_connected422The branch has no primary connection
branch_address_missing422The branch has no usable main address
zone_not_connected422The branch has no connection to that zone

Addresses

CodeStatusCause
address_not_found422The result was no better than the country
address_ambiguous422More than one result
address_low_confidence422A real place, but not accurate

Times

CodeStatusCause
pickup_time_in_past422The time passed
delivery_before_pickup422The times are in the wrong sequence
pickup_buffer_violation422Too soon for the minimum notice
no_shift_coverage422No shift covers the pickup

Orders

CodeStatusCause
duplicate_external_order_id409That id is in use, in one of the two modes
order_not_found404Unknown, or in the other mode, or another organization
order_not_cancellable422Too late to cancel, or the order is complete
order_not_amendable422The courier has the goods
field_not_amendable422That field controls routing or identity
invalid_status_transition422Not possible from this status

General

CodeStatusType
invalid_request400invalid_request_error
unknown_endpoint404invalid_request_error
request_too_large413invalid_request_error
invalid_time_range422invalid_request_error
rate_limit_exceeded429rate_limit_error
internal_error500api_error

On this page