Address Validation
Get Address Form
Review this information carefully if you are planning to integrate Envia in multiple countries. Address structure may vary depending on the country the package is being shipped from. It can be by zipcode or city/locality. Use this to get the required fields and validation rules for address forms.
get/generic-form
Query parameters
country_code'US' | 'MX' | 'CA' | 'CO' | 'IN' | 'CL' | 'GT' | 'BR' | 'AR' | 'PE' required
Example:MX
Two-digit country code
form'address_info' | 'billing_info' required
Example:address_info
Form type
Response
Successful response
Example response
[
{
"fieldId": "address1",
"fieldName": "street",
"fieldLabel": "Address1",
"fieldLabelLang": "createLabel.addressInfo.street",
"fieldType": "text",
"fieldPlaceholder": "Address1",
"fieldPlaceholderLang": "createLabel.addressInfo.street",
"fieldIcon": "fas fa-map-marker-alt",
"dataType": "string",
"visible": true,
"size": "L",
"rules": {
"required": true,
"min": "2",
"max": "50",
"validationType": "street"
},
"on_change": [
{
"condition": "/(^[0-9]{5})$/",
"action": "request",
"url": "https://geocodes.envia.com/zipcode/{{values.country}}/{{values.postal_code}}",
"name": "geocodes"
}
]
}
]