Validating the Postal Address of the Customer Account
Validate the postal address of the customer account by using the checkAccount custom operation of your application instance, as explained below. The custom operation performs checks based on the postal addresses specified by customers in their accounts in CloudBlue Commerce.
Note: Address validation is performed only if the specified customer account does not have Microsoft 365 subscriptions.
Important: Validating postal addresses is a custom operation. The user whose key and secret you use to access the APS REST API must have http://www.parallels.com/Office365/Office365app and GET in its list of allowed operations.
HTTP Request
GET https://BRAND_DOMAIN/aps/2/resources/APS_ID_OF_APPLICATION_INSTANCE/checkAccount?accountId=SYSTEM_ID_OF_CUSTOMER_ACCOUNT&planId=0
HTTP Response
This HTTP response contains a JSON object. In this JSON object, you need to use the values of the following parameters:
- validation_result: This indicates whether the postal address of the customer account is valid (true or false).
- suggested_addresses: If address validation fails, this may contain a list of addresses similar to the current postal address of the customer account.
-
validation_message: If address validation fails, this contains a validation message.
Example (Successful Scenario)
HTTP Request
GET https://example.com/aps/2/resources/811ec898-99ba-4a69-8bcc-af7bee73c598/checkAccount?accountId=1000042&planId=0
HTTP Response
{
"addon_limits_validation_result": null,
"has_o365": false,
"is_multitenant": null,
"education_offers_selected": false,
"tenants": null,
"microsoft_cloud_agreement_metadata": {
"templateId": "117a77b0-9360-443b-8795-c6dedc750cf9",
"agreementLink": "https://aka.ms/customeragreement",
"versionRank": 0
},
"service_plans_compatibility": null,
"enhanced_data": null,
"address_validation": {
"validation_result": true,
"suggested_addresses": null,
"validation_message": null
}
}
Example (Failed Scenario)
HTTP Request
GET https://example.com/aps/2/resources/811ec898-99ba-4a69-8bcc-af7bee73c598/checkAccount?accountId=1000042&planId=0
HTTP Response
{
"addon_limits_validation_result": null,
"has_o365": false,
"is_multitenant": null,
"education_offers_selected": false,
"tenants": null,
"microsoft_cloud_agreement_metadata": {
"templateId": "117a77b0-9360-443b-8795-c6dedc750cf9",
"agreementLink": "https://aka.ms/customeragreement",
"versionRank": 0
},
"service_plans_compatibility": null,
"enhanced_data": null,
"address_validation": {
"validation_result": false,
"suggested_addresses": [
{
"country": "US",
"city": "New York",
"state": "NY",
"address_line1": "767 5th Ave",
"address_line2": null,
"postal_code": "10153-0023"
}
],
"validation_message": "Address field invalid for property: 'City'"
}
}