addressLookup
The addresses at a postal code and house number. Without streetNumberSuffix every address at that number is listed, one per addition, so a form can offer them; with it, only the one that matches.
An empty list means no such address exists. Null means the lookup cannot answer this: the source does not cover the country, or it is unavailable. A form then asks for the address another way.
Arguments
| Argument | Type | Description |
|---|---|---|
country | CountryCode! | |
postalCode | String! | |
streetNumber | String! | |
streetNumberSuffix | String |
Returns
| Field | Type | Description |
|---|---|---|
streetAddress | String! | The first address line as the country writes it, street and number together, for a country whose addresses do not split into the fields below |
streetName | String! | |
streetNumber | String | Null for an address without a separate house number |
streetNumberSuffix | String | The addition to the house number, such as a letter or a unit, when it has one |
postalCode | String! | |
city | String! | |
country | CountryCode! |
Example
query AddressLookup( $country: CountryCode! $postalCode: String! $streetNumber: String! $streetNumberSuffix: String) { addressLookup( country: $country postalCode: $postalCode streetNumber: $streetNumber streetNumberSuffix: $streetNumberSuffix ) { streetAddress streetName streetNumber streetNumberSuffix postalCode city country }}{ "country": "NL", "postalCode": "Example", "streetNumber": "Example", "streetNumberSuffix": "Example"}{ "data": { "addressLookup": [ { "streetAddress": "Example", "streetName": "Example", "streetNumber": "Example", "streetNumberSuffix": "Example", "postalCode": "Example", "city": "Example", "country": "NL" } ] }}The query selects the return type's fields two levels deep; pick the ones you need. The response shows its shape with placeholder values.
Used by
The storefront packages that send it, in these GraphQL documents:
- @evolve-storefront/commerce-ui:
CommerceAddressLookup

