Format address info for country
Takes structured address data and returns a string perfect for printing on envelopes, shipping labels and more.
Path parameters
-
ISO-3166 Alpha2 or Alpha3 code for country
Query parameters
-
strict boolean
If true, will throw an exception if missing one or more required address fields. For example if 'street' is missing in US, it will throw an error. Default: false
-
include-country boolean
If true, it will append country name to the end of the string on a new line. Default: false
Body Required
We recommend sending all the properties, but leave those empty that does not apply.
-
street string
-
city string
-
district string
-
name string
-
company_name string
-
state string
-
sorting_code string
-
zip string
POST /countries/{countryCode}/format-address
curl \
-X POST https://api.tellusdb.com/v1/countries/US/format-address?token=api_token_value \
-H "Content-Type: application/json" \
-d '{"street":"Test Street 123","city":"London","district":"District name","name":"John Doe","company_name":"Apple Inc.","state":"California","sorting_code":"123","zip":"90210"}'
Request example
{
"street": "Test Street 123",
"city": "London",
"district": "District name",
"name": "John Doe",
"company_name": "Apple Inc.",
"state": "California",
"sorting_code": "123",
"zip": "90210"
}
Request examples
{
"street": "Test Street 123",
"city": "London",
"district": "District name",
"name": "John Doe",
"company_name": "Apple Inc.",
"state": "California",
"sorting_code": "123",
"zip": "90210"
}
Response examples (200)
{
"result": "John Doe\nApple Inc.\nTest Street 123\nLondon, California 90210",
"time_taken_ms": 1.3892211
}
Response examples (422)
{
"message": "Field missing: street. You are using strict mode, so the country requires filling out the following fields: street, city, zip. Documentation: https://tellusdb.com/docs"
}