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
originis not a valid https origin, includes a path, or is empty.latorlngis 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
- Read the message in the response and note which field it names.
- For
origin, send the scheme and host only, for examplehttps://shop.example.com. Do not add a path or trailing slash. Use https;http://localhost:5173is the development exception. - For
lat, send a number between -90 and 90. Forlng, send a number between -180 and 180. - Send each value separately as a JSON number, not combined in one string.
- Check that the body is valid JSON and that the request uses a JSON content type.
- 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.
