Merchants can enable additional address fields for shipping and billing addresses at checkout to comply with address standards in specific regions.
This guide introduces how to extract the additional field data from the standard address fields when [additional address fields](https://help.shopify.com/manual/markets/shipping-and-markets/international-considerations#additional-address) have been enabled by a merchant. Example extensions are provided for converting and updating extended address fields.
## How it works
When additional address fields are enabled, [supported countries](https://help.shopify.com/manual/markets/shipping-and-markets/international-considerations#additional-address) will offer an extended address form in checkout. Depending on the country, the extended address form:
- Replaces standard field `address1` with additional fields `streetName` and `streetNumber`
- Replaces standard field `address2` with additional fields `line2` and `neighborhood`
The data captured in the additional fields is merged back into the standard fields. The data is joined with the Unicode format character, [word joiner](https://en.wikipedia.org/wiki/Word_joiner), alongside regional decorators.
Shopify uses the [JavaScript](#javascript-clients) and [Ruby](#ruby-clients) libraries offered in the open source library [Worldwide](https://github.com/Shopify/worldwide) to parse the additional field data. We recommend that you use the same libraries in your app to ensure a consistent experience.
### JavaScript clients
Worldwide offers the parsing logic as an `npm` package [@shopify/worldwide](https://www.npmjs.com/package/@shopify/worldwide).
The `npm` package provides concatenation and splitting functions for both `address1` and `address2`:
- `concatenateAddress1`
- `concatenateAddress2`
- `splitAddress1`
- `splitAddress2`
The usage details are described in the [README](https://www.npmjs.com/package/@shopify/worldwide).
### Ruby clients
Worldwide offers the ruby class, [`Worldwide::Address`](https://github.com/Shopify/worldwide/blob/main/lib/worldwide/address.rb), which exposes the following public methods:
- `concatenate_address1`
- `concatenate_address2`
- `split_address1`
- `split_address2`
The usage details are described in the [README](https://github.com/Shopify/worldwide/blob/main/README.md).
## Requirements
- The additional address fields feature is enabled on the store.
- You've created a [Partner account](https://www.shopify.com/partners).
- You've created a [development store](/docs/api/development-stores#create-a-development-store-to-test-your-app).
- You've [created an app that uses Shopify CLI 3.49.5 or higher](/docs/apps/build/scaffold-app). If you previously installed Shopify CLI, then make sure that you're using the [latest version](/docs/api/shopify-cli#upgrade).
If you plan to create a UI for your extension, then start with the [Remix app template](/docs/api#app-templates).
- You've installed [Node.js](https://nodejs.org/en/download) 16 or higher.
- You've [installed your app](/docs/apps/build/scaffold-app#step-3-install-your-app-on-your-development-store) on the development store.
### Rust-specific requirements
The following requirements are specific to Rust-based development with Shopify Functions.
- You've installed [Rust](https://www.rust-lang.org/tools/install).
On Windows, Rust requires the [Microsoft C++ Build Tools](https://docs.microsoft.com/en-us/windows/dev-environment/rust/setup). Make sure to select the **Desktop development with C++** workload when installing the tools.
- You've installed the [`wasm32-wasip1` target](https://doc.rust-lang.org/rustc/platform-support/wasm32-wasip1.html):
## Example: Performing address validations on the extended address form
The following example checkout UI extension uses `splitAddress` and the [Cart and Checkout Validation API](/docs/api/functions/reference/cart-checkout-validation/graphql) to block checkout and render an error message when the street number and neighborhood in Brazil do not meet defined conditions:
## Example: Updating addresses when additional address fields are enabled
The following example checkout UI extension uses `concatenatedAddress` and `useApplyShippingAddressChange` to convert the extended address fields into the standard address fields and updates the standard address fields `address1` and `address2`: