API documentation Address Validation
Contents
Validate address
Validates address and displays errors if any.
Endpoint
[POST] /v4/address_validation
Attributes
Key | Description | Datatype | Constraints | Errors |
service | Name | String | Optional. The name of the delivery service that is planned to be used with the submitted address. It will be used to check if that courier charges extra for delivering to the given address. 200 OK with an additional JSON payload of warnings (See example). The address is still considered valid and can be used in subsequent requests despite the warning. |
|
name1 | Name | String | Maximum 35 characters. Must only contain latin or printable ASCII characters. Must not contain line breaks. |
|
name2 | Name (continued) | String | Optional. Maximum 35 characters. Must only contain latin or printable ASCII characters. Must not contain line breaks. |
|
street | Street | String | Maximum 70 characters. Must only contain latin or printable ASCII characters. Must not contain line breaks. Must not contain zip code. Must not contain city. |
|
city | City | String | 2-35 characters. Must only contain latin or printable ASCII characters. Must not contain line breaks. |
|
country | Country | String | 2 character ISO 3166-Alpha 2 country code. |
|
zip | Zip | String | Zipcode associated with the address |
|
Email of recipient | String | Optional. Maximum 50 characters |
|
|
phone | Phone number | String | Optional. Maximum 15 characters. Must only contain characters 0-9, plus and minus. |
|
Examples
Request
-
Without the
service
parameter
{ "name1": "Mr Appleseed", "name2": "The Fruit Company, Building A", "street": "Example Street 1", "city": "Example City", "zip": "12345", "country": "FR", "phone": "0044123456" }
-
With the
service
parameter
{ "name1": "Mr Appleseed", "street": "Example Street 1", "city": "Example City", "zip": "12345", "country": "FR", "phone": "0044123456", "service": "UPS_NL_MULTI" }
Responses
-
If a service is not supported
STATUS 422 UNPROCESSABLE ENTITY {"errors" => ["Service not recognized"]}