Address - Validate

Validates an address. Use the operation to validate an address before using it as soldTo or a billTo address.

POST https://management.azure.com/providers/Microsoft.Billing/validateAddress?api-version=2020-05-01

URI Parameters

Name In Required Type Description
api-version
query True

string

The version of the API to be used with the client request. The current version is 2020-05-01.

Request Body

Name Required Type Description
addressLine1 True

string

Address line 1.

country True

string

Country code uses ISO2, 2-digit format.

addressLine2

string

Address line 2.

addressLine3

string

Address line 3.

city

string

Address city.

companyName

string

Company name.

district

string

Address district.

email

string

Email address.

firstName

string

First name.

lastName

string

Last name.

middleName

string

Middle name.

phoneNumber

string

Phone number.

postalCode

string

Postal code.

region

string

Address region.

Responses

Name Type Description
200 OK

ValidateAddressResponse

OK. The request has succeeded.

Other Status Codes

ErrorResponse

Error response describing why the operation failed.

Security

azure_auth

Azure Active Directory OAuth2 Flow.

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

AddressInvalid
AddressValid

AddressInvalid

Sample Request

POST https://management.azure.com/providers/Microsoft.Billing/validateAddress?api-version=2020-05-01

{
  "addressLine1": "1 Test",
  "city": "bellevue",
  "region": "wa",
  "postalCode": "12345",
  "country": "us"
}

Sample Response

{
  "status": "Invalid",
  "suggestedAddresses": [
    {
      "country": "US",
      "region": "WA",
      "city": "Bellevue",
      "addressLine1": "1 Test Address",
      "postalCode": "98052"
    },
    {
      "country": "US",
      "region": "WA",
      "city": "Bellevue",
      "addressLine1": "1 Test Address",
      "postalCode": "12345-0000"
    }
  ],
  "validationMessage": "Invalid address"
}

AddressValid

Sample Request

POST https://management.azure.com/providers/Microsoft.Billing/validateAddress?api-version=2020-05-01

{
  "addressLine1": "1 Test Address",
  "city": "bellevue",
  "region": "wa",
  "postalCode": "12345",
  "country": "us"
}

Sample Response

{
  "status": "Valid",
  "suggestedAddresses": [
    {
      "country": "US",
      "region": "WA",
      "city": "Bellevue",
      "addressLine1": "1 Test Address",
      "postalCode": "12345-0000"
    }
  ]
}

Definitions

Name Description
AddressDetails

Address details.

addressValidationStatus

status of the address validation.

ErrorDetails

The details of the error.

ErrorResponse

Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message.

ErrorSubDetails
ValidateAddressResponse

Result of the address validation

AddressDetails

Address details.

Name Type Description
addressLine1

string

Address line 1.

addressLine2

string

Address line 2.

addressLine3

string

Address line 3.

city

string

Address city.

companyName

string

Company name.

country

string

Country code uses ISO2, 2-digit format.

district

string

Address district.

email

string

Email address.

firstName

string

First name.

lastName

string

Last name.

middleName

string

Middle name.

phoneNumber

string

Phone number.

postalCode

string

Postal code.

region

string

Address region.

addressValidationStatus

status of the address validation.

Name Type Description
Invalid

string

Valid

string

ErrorDetails

The details of the error.

Name Type Description
code

string

Error code.

details

ErrorSubDetails[]

The sub details of the error.

message

string

Error message indicating why the operation failed.

target

string

The target of the particular error.

ErrorResponse

Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message.

Name Type Description
error

ErrorDetails

The details of the error.

ErrorSubDetails

Name Type Description
code

string

Error code.

message

string

Error message indicating why the operation failed.

target

string

The target of the particular error.

ValidateAddressResponse

Result of the address validation

Name Type Description
status

addressValidationStatus

status of the address validation.

suggestedAddresses

AddressDetails[]

The list of suggested addresses.

validationMessage

string

Validation error message.