Next-generation platform

Implementing address capture and display

Addresses of the customers are required to create, modify, and fulfill an order. A store associate can capture valid addresses of customers and Sterling Store Engagement displays the addresses in appropriate formats. This section describes APIs, user exits, services, and other components that are used to implement address capture and display and to support country-based address capture forms and templates.

Note: For more information about extending the address capture and display capability, see Extending address capture and Extending address display.

Solution

A store associate can either add or edit the address of a customer during order creation or order modification.
  • While capturing the address, if the country and postal code of the customer are not captured, they are taken as the default country and postal code of the current store.
  • However, if the customer wants to provide an address with a different country, the store associate can select a country from the Country/Region list.

    To populate the list of countries, the getCommonCodeList API is called with the CodeType as COUNTRY.

  • The getRegionList API returns a list of regions that satisfy input criteria. This API determines the region schema from the Region Schema To Use For State Selection rule and returns a list of the regions to be used by the State attribute in the PersonInfo element of the entity.
  • When the store associate selects the country, the appropriate address capture fields are displayed and the corresponding list of states is retrieved by using the getRegionList API. If no regions are retrieved, the list is replaced by a text field.
  • State and city is auto-populated by using the getRegionList API when a valid postal code is provided.

Address verification

The addresses of the customers are verified before saving it to the order. The verifyAddress API is called to verify the address. The API in turn calls the YCDVerifyAddressWithAVSUE user exit that validates the input that is provided by the user.

If all attributes are valid and the address is properly verified, the IsAddressVerified flag is updated appropriately. The application uses the user exit to interact with the Address Verification System (AVS) and returns appropriate values to the verifyAddress API.

The following values as returned as a result of address verification:
  • VERIFIED. The screen is closed and the address is marked as verified.
  • FAILED. The error reasons that are returned by the verifyAddress API are displayed in the screen for the store associate to resolve. If the store associate selects Apply, the address is assumed to be valid and returned as verified.
  • AVS_DOWN. The screen is closed and the address is marked as not verified, but considered to be valid.

If multiple addresses are returned or the ProceedWithSingleAVSResult attribute is returned with the value as N, the screen switches to a multiple address selection mode, where the store associate is presented with a list of results along with the original address, from which the associate can select an address.

The following APIs are used to verify the addresses:
  • getCommonCodeList. Fetches the list of countries with CodeType as COUNTRY.
  • getRegionList. Fetches the list of states based on the selected country and the region schema from the Region Schema To Use For State Selection rule. It also fetches the State and City based on ZIP code.
  • verifyAddress. Validates the input address against an address verification system (AVS).

Address capture UI component

The address capture shared component is created in the app-common-module to capture addresses in Sterling Store Engagement. You can use this component for adding or modifying the addresses of customers during order capture.

By default, address capture templates for US and Canada are supported. You can add address capture templates for other countries and map the address fields to the countries. For more information about extending the address capture implementation, see Extending address capture.