Get address formatting rules by market
Applies to: Partner Center | Partner Center operated by 21Vianet | Partner Center for Microsoft Cloud for US Government
Get the expected address format based on the iso code for the market.
Prerequisites
- Credentials as described in Partner Center authentication. This scenario supports authentication with both standalone App and App+User credentials.
REST request
Request syntax
Method | Request URI |
---|---|
GET | {baseURL}/v1/countryvalidationrules/{isocode-id} HTTP/1.1 |
URI parameter
Name | Type | Required | Description |
---|---|---|---|
isocode-id | string | Y | The two-character ISO country code. |
Request headers
For more information, see Partner Center REST headers.
Request body
None.
Request example
GET https://api.partnercenter.microsoft.com/v1/countryvalidationrules/{isocode-id} HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: 124b0e41-a093-4fec-b871-3eeb45fd734b
MS-CorrelationId: 5cfd634d-b936-47af-87f0-0f0217425dcc
REST response
If successful, this method returns a CountryInformation object in the response body.
Response success and error codes
Each response comes with an HTTP status code that indicates success or failure and additional debugging information. Use a network trace tool to read this code, error type, and additional parameters. For the full list, see Error Codes.
Response example
HTTP/1.1 200 OK
Content-Length: 1856
Content-Type: application/json
MS-CorrelationId: 5cfd634d-b936-47af-87f0-0f0217425dcc
MS-RequestId: 124b0e41-a093-4fec-b871-3eeb45fd734b
Date: Wed, 25 Nov 2015 06:36:47 GMT
{
"iso2Code": "US",
"defaultCulture": "en-US",
"isStateRequired": true,
"states": {
"value": ["AK","AL","AR", "AZ","CA","CO","CT","DC","DE","FL","GA","HI","IA","ID","IL","IN",
"KS","KY","LA","MA","MD","ME","MI","MN","MO","MS","MT","NC","ND","NE","NH","NJ","NM","NV",
"NY","OH","OK","OR","PA","RI","SC","SD","TN","TX","UT","VA","VT","WA","WI","WV","WY"]
},
"supportedLanguages": {
"value": ["en",
"es"]
},
"supportedCultures": {
"value": ["en-US",
"es-US"]
},
"isPostalCodeRequired": true,
"postalCodeRegex": "^\\d{
5
}(-\\d{
4
})?$",
"isCityRequired": true,
"isVatIdSupported": false,
"taxIdFormat": "US######",
"taxIdSample": "US999965",
"phoneNumberRegex": "^(1[\\-\\/\\.]?)?(\((\\d{3})\)|(\\d{3}))[\\-\\/\\.]?(\\d{3})[\\-\\/\\.]?(\\d{4})$",
"isRegistrationNumberSupported": false,
"isTaxIdSupported": true,
"resellerAgreementRegion": "AOC",
"geographicRegion": "NorthAndLatinAmerica",
"countryCallingCodes": {
"value": ["1"]
},
"attributes": {
"objectType": "CountryInformation"
}
}
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for