AddressValidation container
The AddressValidation
container displays a suggested shipping address (from a third-party verification service) alongside the entered address, allowing shoppers to choose between them.
Typically invoked from a modal during address creation after calling your address verification service.
AddressValidation configurations
The AddressValidation
container provides the following configuration options:
AddressValidationProps interface
The AddressValidation
container receives an object that implements the following interface:
interface AddressValidationProps { selectedAddress?: 'suggested' | 'original' | null; suggestedAddress: Partial<CustomerAddressesModel> | null; originalAddress: CustomerAddressesModel | null; handleSelectedAddress?: (payload: { selection: 'suggested' | 'original'; address: CustomerAddressesModel | null | undefined; }) => void;}
CustomerAddressesModel type
The CustomerAddressesModel
type has this shape:
interface CustomerAddressesModel { city?: string; countryCode?: string; region?: { region: string; regionCode: string; regionId: string | number }; postcode?: string; street?: string;}
Example
For a complete walkthrough, see the Validate address tutorial.