Skip to main content

Addresses
API

Requires level 2 access to protected customer data.

The API for interacting with addresses.

The base API object provided to purchase extension targets.

StatefulRemoteSubscribable< | undefined>

The proposed customer billing address. The address updates when the field is committed (on change) rather than every keystroke.

Requires access to protected customer data.

StatefulRemoteSubscribable< | undefined>

The proposed customer shipping address. During the information step, the address updates when the field is committed (on change) rather than every keystroke. An address value is only present if delivery is required. Otherwise, the subscribable value is undefined.

Requires access to protected customer data.

Was this section helpful?

The API object provided to purchase.checkout extension targets.

Anchor to applyShippingAddressChange
applyShippingAddressChange
(change: ) => Promise<>

Performs an update of the shipping address. Shipping address changes will completely overwrite the existing shipping address added by the user without any prompts. If successful, this mutation results in an update to the value retrieved through the shippingAddress property.

Note

This method will return an error if the cart instruction delivery.canSelectCustomAddress is false, or the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay.

Requires access to protected customer data.

Was this section helpful?

Anchor to useBillingAddress
useBillingAddress()

Returns the proposed billingAddress applied to the checkout.

| undefined
Was this section helpful?

Anchor to useShippingAddress
useShippingAddress()

Returns the proposed shippingAddress applied to the checkout.

| undefined
Was this section helpful?

Anchor to useApplyShippingAddressChange
useApplyShippingAddressChange()

Returns a function to mutate the shippingAddress property of checkout.

(change: ) => Promise<> | undefined
Was this section helpful?