--- title: Addresses API description: >- The Addresses API provides the buyer's shipping and billing addresses from the order. Use this API to display address details or compare shipping and billing information. api_version: 2025-07 api_name: customer-account-ui-extensions source_url: html: >- https://shopify.dev/docs/api/customer-account-ui-extensions/2025-07/target-apis/order-apis/addresses-api md: >- https://shopify.dev/docs/api/customer-account-ui-extensions/2025-07/target-apis/order-apis/addresses-api.md --- Migrate to Polaris Version 2025-07 is the last API version to support React-based UI components. Later versions use [web components](https://shopify.dev/docs/api/customer-account-ui-extensions/latest/polaris-web-components), native UI elements with built-in accessibility, better performance, and consistent styling with [Shopify's design system](https://shopify.dev/docs/apps/design). Check out the [migration guide](https://shopify.dev/docs/api/customer-account-ui-extensions/2025-10/upgrading-to-2025-10) to upgrade your extension. # Addresses API **Requires access to \[protected customer data]\(/docs/apps/store/data-protection/protected-customer-data). Most properties require level 2 access. The \`company\` property requires level 1 access.:** The Addresses API provides the buyer's shipping and billing addresses from the order. Use this API to display address details or compare shipping and billing information. ## Properties The `OrderStatusApi` object provides the buyer's shipping and billing addresses. Access the following properties on the `OrderStatusApi` object to read address data. * **billingAddress** **StatefulRemoteSubscribable\** The billing address associated with the buyer's payment method. * **shippingAddress** **StatefulRemoteSubscribable\** The shipping address that the buyer provided for the order. ### MailingAddress {% include /apps/checkout/privacy-icon.md %} Requires access to \[protected customer data]\(/docs/apps/store/data-protection/protected-customer-data). Most properties require level 2 access. The \`company\` property requires level 1 access. * address1 The first line of the street address, including the street number and name. ```ts string ``` * address2 The second line of the street address, such as apartment number, suite, or unit. ```ts string ``` * city The city, town, or village name. ```ts string ``` * company The company or organization name associated with the address. ```ts string ``` * countryCode The \[ISO 3166-1 Alpha-2]\(https://www\.iso.org/iso-3166-country-codes.html) country code. ```ts CountryCode ``` * firstName The buyer's given name. ```ts string ``` * lastName The buyer's family name. ```ts string ``` * name The buyer's full name, typically the first and last name combined. ```ts string ``` * phone The phone number associated with the address. ```ts string ``` * provinceCode The buyer's province, state, or region code. ```ts string ``` * zip The postal code or ZIP code. ```ts string ``` ### CountryCode ```ts 'AC' | 'AD' | 'AE' | 'AF' | 'AG' | 'AI' | 'AL' | 'AM' | 'AN' | 'AO' | 'AR' | 'AT' | 'AU' | 'AW' | 'AX' | 'AZ' | 'BA' | 'BB' | 'BD' | 'BE' | 'BF' | 'BG' | 'BH' | 'BI' | 'BJ' | 'BL' | 'BM' | 'BN' | 'BO' | 'BQ' | 'BR' | 'BS' | 'BT' | 'BV' | 'BW' | 'BY' | 'BZ' | 'CA' | 'CC' | 'CD' | 'CF' | 'CG' | 'CH' | 'CI' | 'CK' | 'CL' | 'CM' | 'CN' | 'CO' | 'CR' | 'CU' | 'CV' | 'CW' | 'CX' | 'CY' | 'CZ' | 'DE' | 'DJ' | 'DK' | 'DM' | 'DO' | 'DZ' | 'EC' | 'EE' | 'EG' | 'EH' | 'ER' | 'ES' | 'ET' | 'FI' | 'FJ' | 'FK' | 'FO' | 'FR' | 'GA' | 'GB' | 'GD' | 'GE' | 'GF' | 'GG' | 'GH' | 'GI' | 'GL' | 'GM' | 'GN' | 'GP' | 'GQ' | 'GR' | 'GS' | 'GT' | 'GW' | 'GY' | 'HK' | 'HM' | 'HN' | 'HR' | 'HT' | 'HU' | 'ID' | 'IE' | 'IL' | 'IM' | 'IN' | 'IO' | 'IQ' | 'IR' | 'IS' | 'IT' | 'JE' | 'JM' | 'JO' | 'JP' | 'KE' | 'KG' | 'KH' | 'KI' | 'KM' | 'KN' | 'KP' | 'KR' | 'KW' | 'KY' | 'KZ' | 'LA' | 'LB' | 'LC' | 'LI' | 'LK' | 'LR' | 'LS' | 'LT' | 'LU' | 'LV' | 'LY' | 'MA' | 'MC' | 'MD' | 'ME' | 'MF' | 'MG' | 'MK' | 'ML' | 'MM' | 'MN' | 'MO' | 'MQ' | 'MR' | 'MS' | 'MT' | 'MU' | 'MV' | 'MW' | 'MX' | 'MY' | 'MZ' | 'NA' | 'NC' | 'NE' | 'NF' | 'NG' | 'NI' | 'NL' | 'NO' | 'NP' | 'NR' | 'NU' | 'NZ' | 'OM' | 'PA' | 'PE' | 'PF' | 'PG' | 'PH' | 'PK' | 'PL' | 'PM' | 'PN' | 'PS' | 'PT' | 'PY' | 'QA' | 'RE' | 'RO' | 'RS' | 'RU' | 'RW' | 'SA' | 'SB' | 'SC' | 'SD' | 'SE' | 'SG' | 'SH' | 'SI' | 'SJ' | 'SK' | 'SL' | 'SM' | 'SN' | 'SO' | 'SR' | 'SS' | 'ST' | 'SV' | 'SX' | 'SY' | 'SZ' | 'TA' | 'TC' | 'TD' | 'TF' | 'TG' | 'TH' | 'TJ' | 'TK' | 'TL' | 'TM' | 'TN' | 'TO' | 'TR' | 'TT' | 'TV' | 'TW' | 'TZ' | 'UA' | 'UG' | 'UM' | 'US' | 'UY' | 'UZ' | 'VA' | 'VC' | 'VE' | 'VG' | 'VN' | 'VU' | 'WF' | 'WS' | 'XK' | 'YE' | 'YT' | 'ZA' | 'ZM' | 'ZW' | 'ZZ' ``` ## use​Shipping​Address() Returns the buyer's shipping address for the order. The value is `undefined` for digital orders or when the address hasn't been provided. ### Returns * **MailingAddress | undefined** ### MailingAddress {% include /apps/checkout/privacy-icon.md %} Requires access to \[protected customer data]\(/docs/apps/store/data-protection/protected-customer-data). Most properties require level 2 access. The \`company\` property requires level 1 access. * address1 The first line of the street address, including the street number and name. ```ts string ``` * address2 The second line of the street address, such as apartment number, suite, or unit. ```ts string ``` * city The city, town, or village name. ```ts string ``` * company The company or organization name associated with the address. ```ts string ``` * countryCode The \[ISO 3166-1 Alpha-2]\(https://www\.iso.org/iso-3166-country-codes.html) country code. ```ts CountryCode ``` * firstName The buyer's given name. ```ts string ``` * lastName The buyer's family name. ```ts string ``` * name The buyer's full name, typically the first and last name combined. ```ts string ``` * phone The phone number associated with the address. ```ts string ``` * provinceCode The buyer's province, state, or region code. ```ts string ``` * zip The postal code or ZIP code. ```ts string ``` ### CountryCode ```ts 'AC' | 'AD' | 'AE' | 'AF' | 'AG' | 'AI' | 'AL' | 'AM' | 'AN' | 'AO' | 'AR' | 'AT' | 'AU' | 'AW' | 'AX' | 'AZ' | 'BA' | 'BB' | 'BD' | 'BE' | 'BF' | 'BG' | 'BH' | 'BI' | 'BJ' | 'BL' | 'BM' | 'BN' | 'BO' | 'BQ' | 'BR' | 'BS' | 'BT' | 'BV' | 'BW' | 'BY' | 'BZ' | 'CA' | 'CC' | 'CD' | 'CF' | 'CG' | 'CH' | 'CI' | 'CK' | 'CL' | 'CM' | 'CN' | 'CO' | 'CR' | 'CU' | 'CV' | 'CW' | 'CX' | 'CY' | 'CZ' | 'DE' | 'DJ' | 'DK' | 'DM' | 'DO' | 'DZ' | 'EC' | 'EE' | 'EG' | 'EH' | 'ER' | 'ES' | 'ET' | 'FI' | 'FJ' | 'FK' | 'FO' | 'FR' | 'GA' | 'GB' | 'GD' | 'GE' | 'GF' | 'GG' | 'GH' | 'GI' | 'GL' | 'GM' | 'GN' | 'GP' | 'GQ' | 'GR' | 'GS' | 'GT' | 'GW' | 'GY' | 'HK' | 'HM' | 'HN' | 'HR' | 'HT' | 'HU' | 'ID' | 'IE' | 'IL' | 'IM' | 'IN' | 'IO' | 'IQ' | 'IR' | 'IS' | 'IT' | 'JE' | 'JM' | 'JO' | 'JP' | 'KE' | 'KG' | 'KH' | 'KI' | 'KM' | 'KN' | 'KP' | 'KR' | 'KW' | 'KY' | 'KZ' | 'LA' | 'LB' | 'LC' | 'LI' | 'LK' | 'LR' | 'LS' | 'LT' | 'LU' | 'LV' | 'LY' | 'MA' | 'MC' | 'MD' | 'ME' | 'MF' | 'MG' | 'MK' | 'ML' | 'MM' | 'MN' | 'MO' | 'MQ' | 'MR' | 'MS' | 'MT' | 'MU' | 'MV' | 'MW' | 'MX' | 'MY' | 'MZ' | 'NA' | 'NC' | 'NE' | 'NF' | 'NG' | 'NI' | 'NL' | 'NO' | 'NP' | 'NR' | 'NU' | 'NZ' | 'OM' | 'PA' | 'PE' | 'PF' | 'PG' | 'PH' | 'PK' | 'PL' | 'PM' | 'PN' | 'PS' | 'PT' | 'PY' | 'QA' | 'RE' | 'RO' | 'RS' | 'RU' | 'RW' | 'SA' | 'SB' | 'SC' | 'SD' | 'SE' | 'SG' | 'SH' | 'SI' | 'SJ' | 'SK' | 'SL' | 'SM' | 'SN' | 'SO' | 'SR' | 'SS' | 'ST' | 'SV' | 'SX' | 'SY' | 'SZ' | 'TA' | 'TC' | 'TD' | 'TF' | 'TG' | 'TH' | 'TJ' | 'TK' | 'TL' | 'TM' | 'TN' | 'TO' | 'TR' | 'TT' | 'TV' | 'TW' | 'TZ' | 'UA' | 'UG' | 'UM' | 'US' | 'UY' | 'UZ' | 'VA' | 'VC' | 'VE' | 'VG' | 'VN' | 'VU' | 'WF' | 'WS' | 'XK' | 'YE' | 'YT' | 'ZA' | 'ZM' | 'ZW' | 'ZZ' ``` ## use​Billing​Address() Returns the buyer's billing address for the order. The value is `undefined` when the billing address isn't available. ### Returns * **MailingAddress | undefined** ### MailingAddress {% include /apps/checkout/privacy-icon.md %} Requires access to \[protected customer data]\(/docs/apps/store/data-protection/protected-customer-data). Most properties require level 2 access. The \`company\` property requires level 1 access. * address1 The first line of the street address, including the street number and name. ```ts string ``` * address2 The second line of the street address, such as apartment number, suite, or unit. ```ts string ``` * city The city, town, or village name. ```ts string ``` * company The company or organization name associated with the address. ```ts string ``` * countryCode The \[ISO 3166-1 Alpha-2]\(https://www\.iso.org/iso-3166-country-codes.html) country code. ```ts CountryCode ``` * firstName The buyer's given name. ```ts string ``` * lastName The buyer's family name. ```ts string ``` * name The buyer's full name, typically the first and last name combined. ```ts string ``` * phone The phone number associated with the address. ```ts string ``` * provinceCode The buyer's province, state, or region code. ```ts string ``` * zip The postal code or ZIP code. ```ts string ``` ### CountryCode ```ts 'AC' | 'AD' | 'AE' | 'AF' | 'AG' | 'AI' | 'AL' | 'AM' | 'AN' | 'AO' | 'AR' | 'AT' | 'AU' | 'AW' | 'AX' | 'AZ' | 'BA' | 'BB' | 'BD' | 'BE' | 'BF' | 'BG' | 'BH' | 'BI' | 'BJ' | 'BL' | 'BM' | 'BN' | 'BO' | 'BQ' | 'BR' | 'BS' | 'BT' | 'BV' | 'BW' | 'BY' | 'BZ' | 'CA' | 'CC' | 'CD' | 'CF' | 'CG' | 'CH' | 'CI' | 'CK' | 'CL' | 'CM' | 'CN' | 'CO' | 'CR' | 'CU' | 'CV' | 'CW' | 'CX' | 'CY' | 'CZ' | 'DE' | 'DJ' | 'DK' | 'DM' | 'DO' | 'DZ' | 'EC' | 'EE' | 'EG' | 'EH' | 'ER' | 'ES' | 'ET' | 'FI' | 'FJ' | 'FK' | 'FO' | 'FR' | 'GA' | 'GB' | 'GD' | 'GE' | 'GF' | 'GG' | 'GH' | 'GI' | 'GL' | 'GM' | 'GN' | 'GP' | 'GQ' | 'GR' | 'GS' | 'GT' | 'GW' | 'GY' | 'HK' | 'HM' | 'HN' | 'HR' | 'HT' | 'HU' | 'ID' | 'IE' | 'IL' | 'IM' | 'IN' | 'IO' | 'IQ' | 'IR' | 'IS' | 'IT' | 'JE' | 'JM' | 'JO' | 'JP' | 'KE' | 'KG' | 'KH' | 'KI' | 'KM' | 'KN' | 'KP' | 'KR' | 'KW' | 'KY' | 'KZ' | 'LA' | 'LB' | 'LC' | 'LI' | 'LK' | 'LR' | 'LS' | 'LT' | 'LU' | 'LV' | 'LY' | 'MA' | 'MC' | 'MD' | 'ME' | 'MF' | 'MG' | 'MK' | 'ML' | 'MM' | 'MN' | 'MO' | 'MQ' | 'MR' | 'MS' | 'MT' | 'MU' | 'MV' | 'MW' | 'MX' | 'MY' | 'MZ' | 'NA' | 'NC' | 'NE' | 'NF' | 'NG' | 'NI' | 'NL' | 'NO' | 'NP' | 'NR' | 'NU' | 'NZ' | 'OM' | 'PA' | 'PE' | 'PF' | 'PG' | 'PH' | 'PK' | 'PL' | 'PM' | 'PN' | 'PS' | 'PT' | 'PY' | 'QA' | 'RE' | 'RO' | 'RS' | 'RU' | 'RW' | 'SA' | 'SB' | 'SC' | 'SD' | 'SE' | 'SG' | 'SH' | 'SI' | 'SJ' | 'SK' | 'SL' | 'SM' | 'SN' | 'SO' | 'SR' | 'SS' | 'ST' | 'SV' | 'SX' | 'SY' | 'SZ' | 'TA' | 'TC' | 'TD' | 'TF' | 'TG' | 'TH' | 'TJ' | 'TK' | 'TL' | 'TM' | 'TN' | 'TO' | 'TR' | 'TT' | 'TV' | 'TW' | 'TZ' | 'UA' | 'UG' | 'UM' | 'US' | 'UY' | 'UZ' | 'VA' | 'VC' | 'VE' | 'VG' | 'VN' | 'VU' | 'WF' | 'WS' | 'XK' | 'YE' | 'YT' | 'ZA' | 'ZM' | 'ZW' | 'ZZ' ``` Examples ### Examples * #### Display the shipping address ##### Description Read the shipping address from the order and render each address field in a formatted block. This example uses the \`useShippingAddress\` hook and handles the case where the address is \`undefined\` for digital orders. ##### React ```jsx import { reactExtension, useShippingAddress, } from '@shopify/ui-extensions-react/customer-account'; import { BlockStack, Text, } from '@shopify/ui-extensions/customer-account'; export default reactExtension( 'customer-account.order-status.block.render', () => , ); function Extension() { const address = useShippingAddress(); if (!address) { return No shipping address available.; } return ( Shipping address {address.name && {address.name}} {address.address1 && {address.address1}} {address.address2 && {address.address2}} {[address.city, address.zoneCode, address.zip] .filter(Boolean) .join(', ')} {address.territoryCode && {address.territoryCode}} ); } ``` ##### TS ```js import { extension, BlockStack, Text, } from '@shopify/ui-extensions/customer-account'; export default extension( 'customer-account.order-status.block.render', (root, api) => { const address = api.shippingAddress?.current; if (!address) { root.appendChild( root.createComponent(Text, {}, 'No shipping address available.'), ); return; } const stack = root.createComponent(BlockStack, {}); stack.appendChild( root.createComponent(Text, {emphasis: 'bold'}, 'Shipping address'), ); if (address.name) { stack.appendChild(root.createComponent(Text, {}, address.name)); } if (address.address1) { stack.appendChild(root.createComponent(Text, {}, address.address1)); } const cityLine = [address.city, address.zoneCode, address.zip] .filter(Boolean) .join(', '); stack.appendChild(root.createComponent(Text, {}, cityLine)); root.appendChild(stack); }, ); ``` * #### Compare shipping and billing addresses ##### Description Compare the shipping and billing addresses to determine if they match, and display a status banner. This example uses both \`useShippingAddress\` and \`useBillingAddress\` to check key fields like \`address1\`, \`city\`, and \`zip\`. ##### React ```jsx import { reactExtension, useShippingAddress, useBillingAddress, } from '@shopify/ui-extensions-react/customer-account'; import { Banner, Text, } from '@shopify/ui-extensions/customer-account'; export default reactExtension( 'customer-account.order-status.block.render', () => , ); function Extension() { const shipping = useShippingAddress(); const billing = useBillingAddress(); if (!shipping || !billing) { return null; } const isSameAddress = shipping.address1 === billing.address1 && shipping.city === billing.city && shipping.zip === billing.zip && shipping.territoryCode === billing.territoryCode; return ( {isSameAddress ? 'Shipping and billing addresses match.' : 'Shipping and billing addresses are different.'} ); } ``` ##### TS ```js import { extension, Banner, Text, } from '@shopify/ui-extensions/customer-account'; export default extension( 'customer-account.order-status.block.render', (root, api) => { const shipping = api.shippingAddress?.current; const billing = api.billingAddress?.current; if (!shipping || !billing) return; const isSameAddress = shipping.address1 === billing.address1 && shipping.city === billing.city && shipping.zip === billing.zip && shipping.territoryCode === billing.territoryCode; const banner = root.createComponent( Banner, {status: isSameAddress ? 'info' : 'warning'}, ); banner.appendChild( root.createComponent( Text, {}, isSameAddress ? 'Shipping and billing addresses match.' : 'Shipping and billing addresses are different.', ), ); root.appendChild(banner); }, ); ``` * #### Display the billing address ##### Description Read the billing address from the order and render each field in a formatted block. This example uses the \`useBillingAddress\` hook and gracefully handles \`undefined\` values for optional fields. ##### React ```jsx import { reactExtension, useBillingAddress, } from '@shopify/ui-extensions-react/customer-account'; import { BlockStack, Text, } from '@shopify/ui-extensions/customer-account'; export default reactExtension( 'customer-account.order-status.block.render', () => , ); function Extension() { const address = useBillingAddress(); if (!address) { return No billing address available.; } return ( Billing address {address.name && {address.name}} {address.address1 && {address.address1}} {[address.city, address.zoneCode, address.zip] .filter(Boolean) .join(', ')} ); } ``` ##### TS ```js import { extension, BlockStack, Text, } from '@shopify/ui-extensions/customer-account'; export default extension( 'customer-account.order-status.block.render', (root, api) => { const address = api.billingAddress?.current; if (!address) { root.appendChild( root.createComponent(Text, {}, 'No billing address available.'), ); return; } const stack = root.createComponent(BlockStack, {}); stack.appendChild( root.createComponent(Text, {emphasis: 'bold'}, 'Billing address'), ); if (address.name) { stack.appendChild(root.createComponent(Text, {}, address.name)); } if (address.address1) { stack.appendChild(root.createComponent(Text, {}, address.address1)); } const cityLine = [address.city, address.zoneCode, address.zip] .filter(Boolean) .join(', '); stack.appendChild(root.createComponent(Text, {}, cityLine)); root.appendChild(stack); }, ); ``` ## Best practices * **Gracefully handle missing addresses**: Either the shipping or billing address may be `undefined`. Always check for `undefined` before rendering address fields. * **Don't assume address completeness**: Some fields like `address2`, `company`, and `phone` are optional and may not be present. ## Limitations * Addresses reflect the state at the time of checkout. If the customer updates their address in their account after placing the order, the values returned by this API don't change.