Skip to main content

Address Validation API

Try Now

POST https://api.piyovi.io/v1/shipment/address_validation

Overview

The Address Validation API allows you to verify and standardize addresses before creating a shipment. This helps reduce delivery issues and shipping costs by ensuring address data is accurate and properly formatted.

Authentication

This API requires authentication using one of the following methods:

  • Bearer Token: Include JWT with Bearer prefix in the Authorization header
  • API Key: Include X-API-KEY header with your API key

For more details, see Authentication Guide.

Request Format

POST /v1/shipment/address_validation
Content-Type: application/json
Authorization: Bearer {token}

Request Body

{
"address": {
"companyName": "Acme Corp",
"contactName": "John Smith",
"emailAddress": "john@example.com",
"phoneNumber1": "555-123-4567",
"address1": "123 Main St",
"address2": "Suite 200",
"area": "Downtown",
"city": "San Francisco",
"stateProvince": "CA",
"country": "US",
"zipPostalCode": "94105",
"vatorTax": "12345",
"vatorTaxType": "EIN",
"vatorTaxTypeCountryCode": "US",
"addressType": "Commercial"
}
}

Response Format

Success Response (200 OK)

{
"success": true,
"validatedAddress": [
{
"addressId": "addr-12345",
"companyName": "Acme Corp",
"contactName": "John Smith",
"emailAddress": "john@example.com",
"phoneNumber1": "555-123-4567",
"address1": "123 MAIN ST",
"address2": "STE 200",
"city": "SAN FRANCISCO",
"stateProvince": "CA",
"country": "US",
"zipPostalCode": "94105-1234",
"verified": true
}
],
"status": "Valid",
"addressType": "Commercial",
"validationOptions": [
{
"key": "StandardizedAddress",
"value": "123 MAIN ST STE 200, SAN FRANCISCO CA 94105-1234",
"message": "Address has been standardized",
"messageType": "Info"
}
]
}

Error Response (400 Bad Request)

{
"success": false,
"errors": [
{
"code": "InvalidAddress",
"message": "Unable to validate address",
"type": "ValidationError"
}
]
}

Field Reference

Request Fields

FieldTypeRequiredDescription
addressobjectYesContainer for address information

Address Object Fields

FieldTypeRequiredDescription
companyNamestringNoCompany name
contactNamestringNoContact person's name
emailAddressstringNoEmail address for communications
phoneNumber1stringNoPrimary phone number
address1stringYesPrimary address line (street number and name)
address2stringNoSecondary address information (apt, suite, unit)
areastringNoArea or district within city
citystringYesCity name
stateProvincestringYesState, province, or region
countrystringYesCountry code (2-letter ISO code recommended)
zipPostalCodestringYesPostal or ZIP code
vatorTaxstringNoVAT number or tax ID
vatorTaxTypestringNoType of tax identifier (e.g., EIN, VAT)
vatorTaxTypeCountryCodestringNoCountry code for tax purposes
addressTypestringNoType of address (e.g., Commercial, Residential)

Response Fields

FieldTypeDescription
successbooleanIndicates if validation was successful
errorsarrayError details if validation failed
warningsarrayWarning messages about potential issues
validatedAddressarrayArray of validated address objects
statusstringOverall validation status (Valid, Invalid, Partial)
addressTypestringDetected address type (Commercial, Residential)
remarksobjectAdditional information about address validation
validationOptionsarrayAlternative address suggestions or corrections

Validated Address Object Fields

FieldTypeDescription
addressIdstringUnique identifier for the address
companyNamestringStandardized company name
contactNamestringContact person's name
emailAddressstringEmail address
phoneNumber1stringPrimary phone number
address1stringStandardized street address line 1
address2stringStandardized street address line 2
citystringStandardized city name
stateProvincestringStandardized state or province
countrystringStandardized country
zipPostalCodestringStandardized postal or ZIP code
fullAddressstringComplete formatted address
verifiedbooleanIndicates if address is verified

Validation Option Fields

FieldTypeDescription
keystringType of validation option
valuestringSuggested value or correction
messagestringDescription of the suggestion
messageTypestringType of message (Info, Warning, Error)

Examples

US Address Validation

{
"address": {
"companyName": "Tech Solutions Inc",
"contactName": "Sarah Johnson",
"address1": "1 Market St",
"address2": "Floor 23",
"city": "San Francisco",
"stateProvince": "CA",
"country": "US",
"zipPostalCode": "94105"
}
}

International Address Validation

{
"address": {
"companyName": "Global Imports GmbH",
"contactName": "Hans Schmidt",
"address1": "Friedrichstrasse 123",
"city": "Berlin",
"stateProvince": "Berlin",
"country": "DE",
"zipPostalCode": "10117"
}
}

Residential Address Validation

{
"address": {
"contactName": "Maria Garcia",
"address1": "742 Evergreen Terrace",
"city": "Springfield",
"stateProvince": "IL",
"country": "US",
"zipPostalCode": "62701",
"addressType": "Residential"
}
}

Address Validation with Incomplete Information

{
"address": {
"companyName": "Widgets Co",
"address1": "123 Main",
"city": "Chicago",
"stateProvince": "IL",
"country": "US",
"zipPostalCode": "60601"
}
}

Notes

  • Always validate addresses before creating shipments to avoid delivery issues and additional charges.
  • The API will attempt to standardize and correct addresses, adding any missing information when possible.
  • Address validation is particularly important for international shipments to ensure customs compliance.
  • The response may include multiple suggestions if the address could not be fully validated.
  • Address type detection (Commercial vs. Residential) helps avoid carrier surcharges for incorrect address type classification.
  • Standardized addresses conform to the postal authority format for the specified country.