Troubleshooting

    Fix UPCS 422 Validation Errors

    A 422 validation error means a value such as origin, lat or lng is invalid. See how to correct each field and resend the request.

    Updated 14 October 2026 · 2 min read

    A 422 validation error means UPCS received your request but one of the values in it is not acceptable. The response tells you which field to correct.

    Symptom

    A request returns HTTP 422 with success: false and a message that names a field, typically origin, lat or lng.

    Likely causes

    • origin is not a valid https origin, includes a path, or is empty.
    • lat or lng is missing, not a number, or outside its valid range.
    • Latitude and longitude are swapped, or sent as text such as "24.86, 67.00".
    • The JSON body is malformed or sent without a JSON content type.

    Fix it step by step

    1. Read the message in the response and note which field it names.
    2. For origin, send the scheme and host only, for example https://shop.example.com. Do not add a path or trailing slash. Use https; http://localhost:5173 is the development exception.
    3. For lat, send a number between -90 and 90. For lng, send a number between -180 and 180.
    4. Send each value separately as a JSON number, not combined in one string.
    5. Check that the body is valid JSON and that the request uses a JSON content type.
    6. Resend the request.

    Confirm it is fixed

    The request returns a normal successful response. If you then receive unsupported_location, the values are valid but the point is outside the supported countries; see unsupported_location. If the origin is valid but refused, see origin_not_allowed.

    When to contact support

    If the values look correct and the error continues, contact support and include the full request body (without your API key) and the response message.

    Frequently asked questions

    What is the difference between 422 validation and unsupported_location?

    A validation error means a value is badly formed. unsupported_location means the value is valid but the point is outside the supported countries.