# useExtensionApi()
Returns the full API object that was passed in to your extension when it was created. Depending on the extension target, this object can contain different properties.
For example, the `purchase.checkout.cart-line-item.render-after` extension target will return the [CartLineDetailsApi](https://shopify.dev/docs/api/checkout-ui-extensions/apis/cartlinedetailsapi) object. Other targets may only have access to the [StandardApi](https://shopify.dev/docs/api/checkout-ui-extensions/apis/standardapi) object, which contains a basic set of properties about the checkout.
For a full list of the API available to each extension target, see the [ExtensionTargets type](https://shopify.dev/docs/api/checkout-ui-extensions/apis/extensiontargets).
> Caution: This is deprecated, use `useApi` instead.
```jsx
import {
reactExtension,
Text,
useExtensionApi,
} from '@shopify/ui-extensions-react/checkout';
export default reactExtension(
'purchase.checkout.block.render',
() => ,
);
function Extension() {
const {shop} = useExtensionApi();
return Shop name: {shop.name};
}
```
##
### UseExtensionApiGeneratedType
Returns the full API object that was passed in to your extension when it was created. Depending on the extension target, this object can contain different properties.
For example, the `purchase.checkout.cart-line-item.render-after` extension target will return the [CartLineDetailsApi](https://shopify.dev/docs/api/checkout-ui-extensions/apis/cartlinedetailsapi) object. Other targets may only have access to the [StandardApi](https://shopify.dev/docs/api/checkout-ui-extensions/apis/standardapi) object, which contains a basic set of properties about the checkout.
For a full list of the API available to each extension target, see the [ExtensionTargets type](https://shopify.dev/docs/api/checkout-ui-extensions/apis/extensiontargets).
> Caution: This is deprecated, use `useApi` instead.
#### Returns: ApiForRenderExtension
export function useExtensionApi<
Target extends RenderExtensionTarget = RenderExtensionTarget,
>(): ApiForRenderExtension {
return useApi();
}
### RenderExtensionTargets
A UI extension will register for one or more extension targets using `shopify.extend()`. An extension target in a UI extension is a plain JavaScript function. This function receives some API for interacting with the application, and is expected to return a value in a specific shape. The input arguments and the output type are different for each extension target.
### Checkout::Actions::RenderBefore
value: `RenderExtension<
CheckoutApi & StandardApi<'Checkout::Actions::RenderBefore'>,
AnyComponent
>`
- RenderExtension: export interface RenderExtension<
Api,
AllowedComponents extends RemoteComponentType<
string,
any,
any
> = RemoteComponentType,
> {
(
connection: RenderExtensionConnection,
api: Api,
): void | Promise;
}
- CheckoutApi: export interface CheckoutApi {
/**
* Performs an update on an attribute attached to the cart and checkout. If
* successful, this mutation results in an update to the value retrieved
* through the [`attributes`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/attributes#standardapi-propertydetail-attributes) property.
*
* > Note: This method will return an error if the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay.
*/
applyAttributeChange(change: AttributeChange): Promise;
/**
* Performs an update on the merchandise line items. It resolves when the new
* line items have been negotiated and results in an update to the value
* retrieved through the
* [`lines`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/cart-lines#standardapi-propertydetail-lines)
* property.
*
* > Note: This method will return an error if the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay.
*/
applyCartLinesChange(change: CartLineChange): Promise;
/**
* Performs an update on the discount codes.
* It resolves when the new discount codes have been negotiated and results in an update
* to the value retrieved through the [`discountCodes`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/discounts#standardapi-propertydetail-discountcodes) property.
*
* > Caution:
* > See [security considerations](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#network-access) if your extension retrieves discount codes through a network call.
*
* > Note: This method will return an error if the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay.
*/
applyDiscountCodeChange(
change: DiscountCodeChange,
): Promise;
/**
* Performs an update on the gift cards.
* It resolves when gift card change have been negotiated and results in an update
* to the value retrieved through the [`appliedGiftCards`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/gift-cards#standardapi-propertydetail-appliedgiftcards) property.
*
* > Caution:
* > See [security considerations](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#network-access) if your extension retrieves gift card codes through a network call.
*
* > Note: This method will return an error if the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay.
*/
applyGiftCardChange(change: GiftCardChange): Promise;
/**
* Performs an update on a piece of metadata attached to the checkout. If
* successful, this mutation results in an update to the value retrieved
* through the [`metafields`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/metafields#standardapi-propertydetail-metafields) property.
*/
applyMetafieldChange(change: MetafieldChange): Promise;
/**
* Performs an update on the note attached to the cart and checkout. If
* successful, this mutation results in an update to the value retrieved
* through the [`note`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/note#standardapi-propertydetail-note) property.
*
* > Note: This method will return an error if the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay.
*/
applyNoteChange(change: NoteChange): Promise;
/**
* @private
*/
experimentalIsShopAppStyle?: boolean;
/**
* 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.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*/
applyShippingAddressChange?(
change: ShippingAddressChange,
): Promise;
}
- StandardApi: export interface StandardApi {
/**
* The methods for interacting with [Web Pixels](https://shopify.dev/docs/apps/marketing), such as emitting an event.
*/
analytics: Analytics;
/**
* Gift Cards that have been applied to the checkout.
*/
appliedGiftCards: StatefulRemoteSubscribable;
/**
* The metafields requested in the
* [`shopify.extension.toml`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration)
* file. These metafields are updated when there's a change in the merchandise items
* being purchased by the customer.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*
* > Tip:
* > Cart metafields are only available on carts created via the Storefront API version `2023-04` or later.*
*/
appMetafields: StatefulRemoteSubscribable;
/**
* The custom attributes left by the customer to the merchant, either in their cart or during checkout.
*/
attributes: StatefulRemoteSubscribable;
/**
* All available payment options.
*/
availablePaymentOptions: StatefulRemoteSubscribable;
/**
* Information about the buyer that is interacting with the checkout.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*/
buyerIdentity?: BuyerIdentity;
/**
* Provides details on the buyer's progression through the checkout.
*
* Refer to [buyer journey](https://shopify.dev/docs/api/checkout-ui-extensions/apis/buyer-journey#examples)
* examples for more information.
*/
buyerJourney: BuyerJourney;
/**
* Settings applied to the buyer's checkout.
*/
checkoutSettings: StatefulRemoteSubscribable;
/**
* A stable ID that represents the current checkout.
*
* Matches the `token` field in the [WebPixel checkout payload](https://shopify.dev/docs/api/pixels/customer-events#checkout)
* and the `checkout_token` field in the [REST Admin API `Order` resource](https://shopify.dev/docs/api/admin-rest/unstable/resources/order#resource-object).
*/
checkoutToken: StatefulRemoteSubscribable;
/**
* Details on the costs the buyer will pay for this checkout.
*/
cost: CartCost;
/**
* A list of delivery groups containing information about the delivery of the items the customer intends to purchase.
*/
deliveryGroups: StatefulRemoteSubscribable;
/**
* A list of discount codes currently applied to the checkout.
*/
discountCodes: StatefulRemoteSubscribable;
/**
* Discounts that have been applied to the entire cart.
*/
discountAllocations: StatefulRemoteSubscribable;
/**
* The meta information about the extension.
*/
extension: Extension;
/**
* The identifier that specifies where in Shopify’s UI your code is being
* injected. This will be one of the targets you have included in your
* extension’s configuration file.
*
* @example 'purchase.checkout.block.render'
* @see /docs/api/checkout-ui-extensions/2024-04/extension-targets-overview
* @see /docs/apps/app-extensions/configuration#targets
*
* @deprecated Deprecated as of version `2023-07`, use `extension.target` instead.
*/
extensionPoint: Target;
/**
* Utilities for translating content and formatting values according to the current
* [`localization`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/localization)
* of the checkout.
*
* Refer to [`localization` examples](https://shopify.dev/docs/api/checkout-ui-extensions/apis/localization#examples)
* for more information.
*/
i18n: I18n;
/**
* A list of lines containing information about the items the customer intends to purchase.
*/
lines: StatefulRemoteSubscribable;
/**
* The details about the location, language, and currency of the customer. For utilities to easily
* format and translate content based on these details, you can use the
* [`i18n`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/localization#standardapi-propertydetail-i18n)
* object instead.
*/
localization: Localization;
/**
* The metafields that apply to the current checkout.
*
* Metafields are stored locally on the client and are applied to the order object after the checkout completes.
*
* These metafields are shared by all extensions running on checkout, and
* persist for as long as the customer is working on this checkout.
*
* Once the order is created, you can query these metafields using the
* [GraphQL Admin API](https://shopify.dev/docs/admin-api/graphql/reference/orders/order#metafield-2021-01)
*/
metafields: StatefulRemoteSubscribable;
/**
* A note left by the customer to the merchant, either in their cart or during checkout.
*/
note: StatefulRemoteSubscribable;
/**
* The method used to query the Storefront GraphQL API with a prefetched token.
*
* Refer to [Storefront API access examples](https://shopify.dev/docs/api/checkout-ui-extensions/apis/storefront-api) for more information.
*/
query: >(
query: string,
options?: {variables?: Variables; version?: StorefrontApiVersion},
) => Promise<{data?: Data; errors?: GraphQLError[]}>;
/**
* Payment options selected by the buyer.
*/
selectedPaymentOptions: StatefulRemoteSubscribable;
/**
* The session token providing a set of claims as a signed JSON Web Token (JWT).
*
* The token has a TTL of 5 minutes.
*
* If the previous token expires, this value will reflect a new session token with a new signature and expiry.
*
* Refer to [session token examples](https://shopify.dev/docs/api/checkout-ui-extensions/apis/session-token) for more information.
*/
sessionToken: SessionToken;
/**
* The settings matching the settings definition written in the
* [`shopify.extension.toml`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration) file.
*
* Refer to [settings examples](https://shopify.dev/docs/api/checkout-ui-extensions/apis/settings#examples) for more information.
*
* > Note: When an extension is being installed in the editor, the settings will be empty until
* a merchant sets a value. In that case, this object will be updated in real time as a merchant fills in the settings.
*/
settings: StatefulRemoteSubscribable;
/**
* 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.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*/
shippingAddress?: StatefulRemoteSubscribable;
/**
* The proposed customer billing address. The address updates when the field is
* committed (on change) rather than every keystroke.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*/
billingAddress?: StatefulRemoteSubscribable;
/** The shop where the checkout is taking place. */
shop: Shop;
/**
* The key-value storage for the extension.
*
* It uses `localStorage` and should persist across the customer's current checkout session.
*
* > Caution: Data persistence isn't guaranteed and storage is reset when the customer starts a new checkout.
*
* Data is shared across all activated extension targets of this extension. In versions 2023-07 and earlier,
* each activated extension target had its own storage.
*/
storage: Storage;
/**
* Methods to interact with the extension's UI.
*/
ui: Ui;
/**
* The renderer version being used for the extension.
*
* @example 'unstable'
*/
version: Version;
/**
* Customer privacy consent settings and a flag denoting if consent has previously been collected.
*/
customerPrivacy: StatefulRemoteSubscribable;
/**
* Allows setting and updating customer privacy consent settings and tracking consent metafields.
*
* > Note: Requires the [`customer_privacy` capability](https://shopify.dev/docs/api/checkout-ui-extensions/2024-04/configuration#collect-buyer-consent) to be set to `true`.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*/
applyTrackingConsentChange: ApplyTrackingConsentChangeType;
}
- Extension: export interface Extension {
/**
* The API version that was set in the extension config file.
*
* @example '2023-07', '2023-10', '2024-01', '2024-04', 'unstable'
*/
apiVersion: ApiVersion;
/**
* The allowed capabilities of the extension, defined
* in your [shopify.extension.toml](https://shopify.dev/docs/api/checkout-ui-extensions/configuration) file.
*
* * [`api_access`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#api-access): the extension can access the Storefront API.
*
* * [`network_access`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#network-access): the extension can make external network calls.
*
* * [`block_progress`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#block-progress): the extension can block a customer's progress and the merchant has allowed this blocking behavior.
*
* * [`collect_buyer_consent.sms_marketing`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#collect-buyer-consent): the extension can collect customer consent for SMS marketing.
*
* * [`collect_buyer_consent.customer_privacy`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#collect-buyer-consent): the extension can register customer consent decisions that will be honored on Shopify-managed services.
*/
capabilities: StatefulRemoteSubscribable;
/**
* Information about the editor where the extension is being rendered.
*
* If the value is undefined, then the extension is not running in an editor.
*/
editor?: Editor;
/**
* A Boolean to show whether your extension is currently rendered to the screen.
*
* Shopify might render your extension before it's visible in the UI,
* typically to pre-render extensions that will appear on a later step of the
* checkout.
*
* Your extension might also continue to run after the customer has navigated away
* from where it was rendered. The extension continues running so that
* your extension is immediately available to render if the customer navigates back.
*/
rendered: StatefulRemoteSubscribable;
/**
* The URL to the script that started the extension target.
*/
scriptUrl: string;
/**
* The identifier that specifies where in Shopify’s UI your code is being
* injected. This will be one of the targets you have included in your
* extension’s configuration file.
*
* @example 'purchase.checkout.block.render'
* @see /docs/api/checkout-ui-extensions/2024-04/extension-targets-overview
* @see /docs/apps/app-extensions/configuration#targets
*/
target: Target;
/**
* The published version of the running extension target.
*
* For unpublished extensions, the value is `undefined`.
*
* @example 3.0.10
*/
version?: string;
}
- AnyComponent: AnyComponentBuilder
A static extension target that is rendered immediately before any actions within each step.
### Checkout::CartLineDetails::RenderAfter
value: `RenderExtension<
CheckoutApi &
CartLineItemApi &
StandardApi<'Checkout::CartLineDetails::RenderAfter'> &
OrderStatusApi,
AnyComponent
>`
- RenderExtension: export interface RenderExtension<
Api,
AllowedComponents extends RemoteComponentType<
string,
any,
any
> = RemoteComponentType,
> {
(
connection: RenderExtensionConnection,
api: Api,
): void | Promise;
}
- CheckoutApi: export interface CheckoutApi {
/**
* Performs an update on an attribute attached to the cart and checkout. If
* successful, this mutation results in an update to the value retrieved
* through the [`attributes`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/attributes#standardapi-propertydetail-attributes) property.
*
* > Note: This method will return an error if the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay.
*/
applyAttributeChange(change: AttributeChange): Promise;
/**
* Performs an update on the merchandise line items. It resolves when the new
* line items have been negotiated and results in an update to the value
* retrieved through the
* [`lines`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/cart-lines#standardapi-propertydetail-lines)
* property.
*
* > Note: This method will return an error if the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay.
*/
applyCartLinesChange(change: CartLineChange): Promise;
/**
* Performs an update on the discount codes.
* It resolves when the new discount codes have been negotiated and results in an update
* to the value retrieved through the [`discountCodes`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/discounts#standardapi-propertydetail-discountcodes) property.
*
* > Caution:
* > See [security considerations](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#network-access) if your extension retrieves discount codes through a network call.
*
* > Note: This method will return an error if the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay.
*/
applyDiscountCodeChange(
change: DiscountCodeChange,
): Promise;
/**
* Performs an update on the gift cards.
* It resolves when gift card change have been negotiated and results in an update
* to the value retrieved through the [`appliedGiftCards`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/gift-cards#standardapi-propertydetail-appliedgiftcards) property.
*
* > Caution:
* > See [security considerations](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#network-access) if your extension retrieves gift card codes through a network call.
*
* > Note: This method will return an error if the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay.
*/
applyGiftCardChange(change: GiftCardChange): Promise;
/**
* Performs an update on a piece of metadata attached to the checkout. If
* successful, this mutation results in an update to the value retrieved
* through the [`metafields`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/metafields#standardapi-propertydetail-metafields) property.
*/
applyMetafieldChange(change: MetafieldChange): Promise;
/**
* Performs an update on the note attached to the cart and checkout. If
* successful, this mutation results in an update to the value retrieved
* through the [`note`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/note#standardapi-propertydetail-note) property.
*
* > Note: This method will return an error if the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay.
*/
applyNoteChange(change: NoteChange): Promise;
/**
* @private
*/
experimentalIsShopAppStyle?: boolean;
/**
* 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.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*/
applyShippingAddressChange?(
change: ShippingAddressChange,
): Promise;
}
- CartLine: export interface CartLine {
/**
* These line item IDs are not stable at the moment, they might change after
* any operations on the line items. You should always look up for an updated
* ID before any call to `applyCartLinesChange` because you'll need the ID to
* create a `CartLineChange` object.
* @example 'gid://shopify/CartLine/123'
*/
id: string;
/**
* The merchandise being purchased.
*/
merchandise: Merchandise;
/**
* The quantity of the merchandise being purchased.
*/
quantity: number;
/**
* The details about the cost components attributed to the cart line.
*/
cost: CartLineCost;
/**
* The line item additional custom attributes.
*/
attributes: Attribute[];
/**
* Discounts applied to the cart line.
*/
discountAllocations: CartDiscountAllocation[];
/**
* Sub lines of the merchandise line. If no sub lines are present, this will be an empty array.
*/
lineComponents: CartLineComponentType[];
}
- StandardApi: export interface StandardApi {
/**
* The methods for interacting with [Web Pixels](https://shopify.dev/docs/apps/marketing), such as emitting an event.
*/
analytics: Analytics;
/**
* Gift Cards that have been applied to the checkout.
*/
appliedGiftCards: StatefulRemoteSubscribable;
/**
* The metafields requested in the
* [`shopify.extension.toml`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration)
* file. These metafields are updated when there's a change in the merchandise items
* being purchased by the customer.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*
* > Tip:
* > Cart metafields are only available on carts created via the Storefront API version `2023-04` or later.*
*/
appMetafields: StatefulRemoteSubscribable;
/**
* The custom attributes left by the customer to the merchant, either in their cart or during checkout.
*/
attributes: StatefulRemoteSubscribable;
/**
* All available payment options.
*/
availablePaymentOptions: StatefulRemoteSubscribable;
/**
* Information about the buyer that is interacting with the checkout.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*/
buyerIdentity?: BuyerIdentity;
/**
* Provides details on the buyer's progression through the checkout.
*
* Refer to [buyer journey](https://shopify.dev/docs/api/checkout-ui-extensions/apis/buyer-journey#examples)
* examples for more information.
*/
buyerJourney: BuyerJourney;
/**
* Settings applied to the buyer's checkout.
*/
checkoutSettings: StatefulRemoteSubscribable;
/**
* A stable ID that represents the current checkout.
*
* Matches the `token` field in the [WebPixel checkout payload](https://shopify.dev/docs/api/pixels/customer-events#checkout)
* and the `checkout_token` field in the [REST Admin API `Order` resource](https://shopify.dev/docs/api/admin-rest/unstable/resources/order#resource-object).
*/
checkoutToken: StatefulRemoteSubscribable;
/**
* Details on the costs the buyer will pay for this checkout.
*/
cost: CartCost;
/**
* A list of delivery groups containing information about the delivery of the items the customer intends to purchase.
*/
deliveryGroups: StatefulRemoteSubscribable;
/**
* A list of discount codes currently applied to the checkout.
*/
discountCodes: StatefulRemoteSubscribable;
/**
* Discounts that have been applied to the entire cart.
*/
discountAllocations: StatefulRemoteSubscribable;
/**
* The meta information about the extension.
*/
extension: Extension;
/**
* The identifier that specifies where in Shopify’s UI your code is being
* injected. This will be one of the targets you have included in your
* extension’s configuration file.
*
* @example 'purchase.checkout.block.render'
* @see /docs/api/checkout-ui-extensions/2024-04/extension-targets-overview
* @see /docs/apps/app-extensions/configuration#targets
*
* @deprecated Deprecated as of version `2023-07`, use `extension.target` instead.
*/
extensionPoint: Target;
/**
* Utilities for translating content and formatting values according to the current
* [`localization`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/localization)
* of the checkout.
*
* Refer to [`localization` examples](https://shopify.dev/docs/api/checkout-ui-extensions/apis/localization#examples)
* for more information.
*/
i18n: I18n;
/**
* A list of lines containing information about the items the customer intends to purchase.
*/
lines: StatefulRemoteSubscribable;
/**
* The details about the location, language, and currency of the customer. For utilities to easily
* format and translate content based on these details, you can use the
* [`i18n`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/localization#standardapi-propertydetail-i18n)
* object instead.
*/
localization: Localization;
/**
* The metafields that apply to the current checkout.
*
* Metafields are stored locally on the client and are applied to the order object after the checkout completes.
*
* These metafields are shared by all extensions running on checkout, and
* persist for as long as the customer is working on this checkout.
*
* Once the order is created, you can query these metafields using the
* [GraphQL Admin API](https://shopify.dev/docs/admin-api/graphql/reference/orders/order#metafield-2021-01)
*/
metafields: StatefulRemoteSubscribable;
/**
* A note left by the customer to the merchant, either in their cart or during checkout.
*/
note: StatefulRemoteSubscribable;
/**
* The method used to query the Storefront GraphQL API with a prefetched token.
*
* Refer to [Storefront API access examples](https://shopify.dev/docs/api/checkout-ui-extensions/apis/storefront-api) for more information.
*/
query: >(
query: string,
options?: {variables?: Variables; version?: StorefrontApiVersion},
) => Promise<{data?: Data; errors?: GraphQLError[]}>;
/**
* Payment options selected by the buyer.
*/
selectedPaymentOptions: StatefulRemoteSubscribable;
/**
* The session token providing a set of claims as a signed JSON Web Token (JWT).
*
* The token has a TTL of 5 minutes.
*
* If the previous token expires, this value will reflect a new session token with a new signature and expiry.
*
* Refer to [session token examples](https://shopify.dev/docs/api/checkout-ui-extensions/apis/session-token) for more information.
*/
sessionToken: SessionToken;
/**
* The settings matching the settings definition written in the
* [`shopify.extension.toml`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration) file.
*
* Refer to [settings examples](https://shopify.dev/docs/api/checkout-ui-extensions/apis/settings#examples) for more information.
*
* > Note: When an extension is being installed in the editor, the settings will be empty until
* a merchant sets a value. In that case, this object will be updated in real time as a merchant fills in the settings.
*/
settings: StatefulRemoteSubscribable;
/**
* 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.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*/
shippingAddress?: StatefulRemoteSubscribable;
/**
* The proposed customer billing address. The address updates when the field is
* committed (on change) rather than every keystroke.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*/
billingAddress?: StatefulRemoteSubscribable;
/** The shop where the checkout is taking place. */
shop: Shop;
/**
* The key-value storage for the extension.
*
* It uses `localStorage` and should persist across the customer's current checkout session.
*
* > Caution: Data persistence isn't guaranteed and storage is reset when the customer starts a new checkout.
*
* Data is shared across all activated extension targets of this extension. In versions 2023-07 and earlier,
* each activated extension target had its own storage.
*/
storage: Storage;
/**
* Methods to interact with the extension's UI.
*/
ui: Ui;
/**
* The renderer version being used for the extension.
*
* @example 'unstable'
*/
version: Version;
/**
* Customer privacy consent settings and a flag denoting if consent has previously been collected.
*/
customerPrivacy: StatefulRemoteSubscribable;
/**
* Allows setting and updating customer privacy consent settings and tracking consent metafields.
*
* > Note: Requires the [`customer_privacy` capability](https://shopify.dev/docs/api/checkout-ui-extensions/2024-04/configuration#collect-buyer-consent) to be set to `true`.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*/
applyTrackingConsentChange: ApplyTrackingConsentChangeType;
}
- Extension: export interface Extension {
/**
* The API version that was set in the extension config file.
*
* @example '2023-07', '2023-10', '2024-01', '2024-04', 'unstable'
*/
apiVersion: ApiVersion;
/**
* The allowed capabilities of the extension, defined
* in your [shopify.extension.toml](https://shopify.dev/docs/api/checkout-ui-extensions/configuration) file.
*
* * [`api_access`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#api-access): the extension can access the Storefront API.
*
* * [`network_access`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#network-access): the extension can make external network calls.
*
* * [`block_progress`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#block-progress): the extension can block a customer's progress and the merchant has allowed this blocking behavior.
*
* * [`collect_buyer_consent.sms_marketing`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#collect-buyer-consent): the extension can collect customer consent for SMS marketing.
*
* * [`collect_buyer_consent.customer_privacy`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#collect-buyer-consent): the extension can register customer consent decisions that will be honored on Shopify-managed services.
*/
capabilities: StatefulRemoteSubscribable;
/**
* Information about the editor where the extension is being rendered.
*
* If the value is undefined, then the extension is not running in an editor.
*/
editor?: Editor;
/**
* A Boolean to show whether your extension is currently rendered to the screen.
*
* Shopify might render your extension before it's visible in the UI,
* typically to pre-render extensions that will appear on a later step of the
* checkout.
*
* Your extension might also continue to run after the customer has navigated away
* from where it was rendered. The extension continues running so that
* your extension is immediately available to render if the customer navigates back.
*/
rendered: StatefulRemoteSubscribable;
/**
* The URL to the script that started the extension target.
*/
scriptUrl: string;
/**
* The identifier that specifies where in Shopify’s UI your code is being
* injected. This will be one of the targets you have included in your
* extension’s configuration file.
*
* @example 'purchase.checkout.block.render'
* @see /docs/api/checkout-ui-extensions/2024-04/extension-targets-overview
* @see /docs/apps/app-extensions/configuration#targets
*/
target: Target;
/**
* The published version of the running extension target.
*
* For unpublished extensions, the value is `undefined`.
*
* @example 3.0.10
*/
version?: string;
}
- AnyComponent: AnyComponentBuilder
- CartLineItemApi: export interface CartLineItemApi {
/**
* The cart line the extension is attached to. Until version `2023-04`, this property was a `StatefulRemoteSubscribable`.
*/
target: StatefulRemoteSubscribable;
}
- OrderStatusApi: export interface OrderStatusApi {
/**
* Order information that's available post-checkout.
*/
order: StatefulRemoteSubscribable;
}
- Order: export interface Order {
/**
* A globally-unique identifier.
* @example 'gid://shopify/Order/1'
*/
id: string;
/**
* Unique identifier for the order that appears on the order.
* @example '#1000'
*/
name: string;
/**
* If cancelled, the time at which the order was cancelled.
*/
cancelledAt?: string;
/**
* A randomly generated alpha-numeric identifier for the order.
* For orders created in 2024 and onwards, the number will always be present. For orders created before that date, the number might not be present.
*/
confirmationNumber?: string;
}
A static extension target that renders on every line item, inside the details under the line item properties element.
### Checkout::CartLineDetails::RenderLineComponents
value: `RenderExtension<
CartLineItemApi &
StandardApi<'Checkout::CartLineDetails::RenderLineComponents'>,
AnyComponent
>`
- RenderExtension: export interface RenderExtension<
Api,
AllowedComponents extends RemoteComponentType<
string,
any,
any
> = RemoteComponentType,
> {
(
connection: RenderExtensionConnection,
api: Api,
): void | Promise;
}
- CartLine: export interface CartLine {
/**
* These line item IDs are not stable at the moment, they might change after
* any operations on the line items. You should always look up for an updated
* ID before any call to `applyCartLinesChange` because you'll need the ID to
* create a `CartLineChange` object.
* @example 'gid://shopify/CartLine/123'
*/
id: string;
/**
* The merchandise being purchased.
*/
merchandise: Merchandise;
/**
* The quantity of the merchandise being purchased.
*/
quantity: number;
/**
* The details about the cost components attributed to the cart line.
*/
cost: CartLineCost;
/**
* The line item additional custom attributes.
*/
attributes: Attribute[];
/**
* Discounts applied to the cart line.
*/
discountAllocations: CartDiscountAllocation[];
/**
* Sub lines of the merchandise line. If no sub lines are present, this will be an empty array.
*/
lineComponents: CartLineComponentType[];
}
- StandardApi: export interface StandardApi {
/**
* The methods for interacting with [Web Pixels](https://shopify.dev/docs/apps/marketing), such as emitting an event.
*/
analytics: Analytics;
/**
* Gift Cards that have been applied to the checkout.
*/
appliedGiftCards: StatefulRemoteSubscribable;
/**
* The metafields requested in the
* [`shopify.extension.toml`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration)
* file. These metafields are updated when there's a change in the merchandise items
* being purchased by the customer.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*
* > Tip:
* > Cart metafields are only available on carts created via the Storefront API version `2023-04` or later.*
*/
appMetafields: StatefulRemoteSubscribable;
/**
* The custom attributes left by the customer to the merchant, either in their cart or during checkout.
*/
attributes: StatefulRemoteSubscribable;
/**
* All available payment options.
*/
availablePaymentOptions: StatefulRemoteSubscribable;
/**
* Information about the buyer that is interacting with the checkout.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*/
buyerIdentity?: BuyerIdentity;
/**
* Provides details on the buyer's progression through the checkout.
*
* Refer to [buyer journey](https://shopify.dev/docs/api/checkout-ui-extensions/apis/buyer-journey#examples)
* examples for more information.
*/
buyerJourney: BuyerJourney;
/**
* Settings applied to the buyer's checkout.
*/
checkoutSettings: StatefulRemoteSubscribable;
/**
* A stable ID that represents the current checkout.
*
* Matches the `token` field in the [WebPixel checkout payload](https://shopify.dev/docs/api/pixels/customer-events#checkout)
* and the `checkout_token` field in the [REST Admin API `Order` resource](https://shopify.dev/docs/api/admin-rest/unstable/resources/order#resource-object).
*/
checkoutToken: StatefulRemoteSubscribable;
/**
* Details on the costs the buyer will pay for this checkout.
*/
cost: CartCost;
/**
* A list of delivery groups containing information about the delivery of the items the customer intends to purchase.
*/
deliveryGroups: StatefulRemoteSubscribable;
/**
* A list of discount codes currently applied to the checkout.
*/
discountCodes: StatefulRemoteSubscribable;
/**
* Discounts that have been applied to the entire cart.
*/
discountAllocations: StatefulRemoteSubscribable;
/**
* The meta information about the extension.
*/
extension: Extension;
/**
* The identifier that specifies where in Shopify’s UI your code is being
* injected. This will be one of the targets you have included in your
* extension’s configuration file.
*
* @example 'purchase.checkout.block.render'
* @see /docs/api/checkout-ui-extensions/2024-04/extension-targets-overview
* @see /docs/apps/app-extensions/configuration#targets
*
* @deprecated Deprecated as of version `2023-07`, use `extension.target` instead.
*/
extensionPoint: Target;
/**
* Utilities for translating content and formatting values according to the current
* [`localization`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/localization)
* of the checkout.
*
* Refer to [`localization` examples](https://shopify.dev/docs/api/checkout-ui-extensions/apis/localization#examples)
* for more information.
*/
i18n: I18n;
/**
* A list of lines containing information about the items the customer intends to purchase.
*/
lines: StatefulRemoteSubscribable;
/**
* The details about the location, language, and currency of the customer. For utilities to easily
* format and translate content based on these details, you can use the
* [`i18n`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/localization#standardapi-propertydetail-i18n)
* object instead.
*/
localization: Localization;
/**
* The metafields that apply to the current checkout.
*
* Metafields are stored locally on the client and are applied to the order object after the checkout completes.
*
* These metafields are shared by all extensions running on checkout, and
* persist for as long as the customer is working on this checkout.
*
* Once the order is created, you can query these metafields using the
* [GraphQL Admin API](https://shopify.dev/docs/admin-api/graphql/reference/orders/order#metafield-2021-01)
*/
metafields: StatefulRemoteSubscribable;
/**
* A note left by the customer to the merchant, either in their cart or during checkout.
*/
note: StatefulRemoteSubscribable;
/**
* The method used to query the Storefront GraphQL API with a prefetched token.
*
* Refer to [Storefront API access examples](https://shopify.dev/docs/api/checkout-ui-extensions/apis/storefront-api) for more information.
*/
query: >(
query: string,
options?: {variables?: Variables; version?: StorefrontApiVersion},
) => Promise<{data?: Data; errors?: GraphQLError[]}>;
/**
* Payment options selected by the buyer.
*/
selectedPaymentOptions: StatefulRemoteSubscribable;
/**
* The session token providing a set of claims as a signed JSON Web Token (JWT).
*
* The token has a TTL of 5 minutes.
*
* If the previous token expires, this value will reflect a new session token with a new signature and expiry.
*
* Refer to [session token examples](https://shopify.dev/docs/api/checkout-ui-extensions/apis/session-token) for more information.
*/
sessionToken: SessionToken;
/**
* The settings matching the settings definition written in the
* [`shopify.extension.toml`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration) file.
*
* Refer to [settings examples](https://shopify.dev/docs/api/checkout-ui-extensions/apis/settings#examples) for more information.
*
* > Note: When an extension is being installed in the editor, the settings will be empty until
* a merchant sets a value. In that case, this object will be updated in real time as a merchant fills in the settings.
*/
settings: StatefulRemoteSubscribable;
/**
* 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.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*/
shippingAddress?: StatefulRemoteSubscribable;
/**
* The proposed customer billing address. The address updates when the field is
* committed (on change) rather than every keystroke.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*/
billingAddress?: StatefulRemoteSubscribable;
/** The shop where the checkout is taking place. */
shop: Shop;
/**
* The key-value storage for the extension.
*
* It uses `localStorage` and should persist across the customer's current checkout session.
*
* > Caution: Data persistence isn't guaranteed and storage is reset when the customer starts a new checkout.
*
* Data is shared across all activated extension targets of this extension. In versions 2023-07 and earlier,
* each activated extension target had its own storage.
*/
storage: Storage;
/**
* Methods to interact with the extension's UI.
*/
ui: Ui;
/**
* The renderer version being used for the extension.
*
* @example 'unstable'
*/
version: Version;
/**
* Customer privacy consent settings and a flag denoting if consent has previously been collected.
*/
customerPrivacy: StatefulRemoteSubscribable;
/**
* Allows setting and updating customer privacy consent settings and tracking consent metafields.
*
* > Note: Requires the [`customer_privacy` capability](https://shopify.dev/docs/api/checkout-ui-extensions/2024-04/configuration#collect-buyer-consent) to be set to `true`.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*/
applyTrackingConsentChange: ApplyTrackingConsentChangeType;
}
- Extension: export interface Extension {
/**
* The API version that was set in the extension config file.
*
* @example '2023-07', '2023-10', '2024-01', '2024-04', 'unstable'
*/
apiVersion: ApiVersion;
/**
* The allowed capabilities of the extension, defined
* in your [shopify.extension.toml](https://shopify.dev/docs/api/checkout-ui-extensions/configuration) file.
*
* * [`api_access`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#api-access): the extension can access the Storefront API.
*
* * [`network_access`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#network-access): the extension can make external network calls.
*
* * [`block_progress`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#block-progress): the extension can block a customer's progress and the merchant has allowed this blocking behavior.
*
* * [`collect_buyer_consent.sms_marketing`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#collect-buyer-consent): the extension can collect customer consent for SMS marketing.
*
* * [`collect_buyer_consent.customer_privacy`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#collect-buyer-consent): the extension can register customer consent decisions that will be honored on Shopify-managed services.
*/
capabilities: StatefulRemoteSubscribable;
/**
* Information about the editor where the extension is being rendered.
*
* If the value is undefined, then the extension is not running in an editor.
*/
editor?: Editor;
/**
* A Boolean to show whether your extension is currently rendered to the screen.
*
* Shopify might render your extension before it's visible in the UI,
* typically to pre-render extensions that will appear on a later step of the
* checkout.
*
* Your extension might also continue to run after the customer has navigated away
* from where it was rendered. The extension continues running so that
* your extension is immediately available to render if the customer navigates back.
*/
rendered: StatefulRemoteSubscribable;
/**
* The URL to the script that started the extension target.
*/
scriptUrl: string;
/**
* The identifier that specifies where in Shopify’s UI your code is being
* injected. This will be one of the targets you have included in your
* extension’s configuration file.
*
* @example 'purchase.checkout.block.render'
* @see /docs/api/checkout-ui-extensions/2024-04/extension-targets-overview
* @see /docs/apps/app-extensions/configuration#targets
*/
target: Target;
/**
* The published version of the running extension target.
*
* For unpublished extensions, the value is `undefined`.
*
* @example 3.0.10
*/
version?: string;
}
- AnyComponent: AnyComponentBuilder
- CartLineItemApi: export interface CartLineItemApi {
/**
* The cart line the extension is attached to. Until version `2023-04`, this property was a `StatefulRemoteSubscribable`.
*/
target: StatefulRemoteSubscribable;
}
A static extension target that renders on every bundle line item, inside the details under the line item properties element. It replaces the default bundle products rendering.
### Checkout::CartLines::RenderAfter
value: `RenderExtension<
CheckoutApi &
StandardApi<'Checkout::CartLines::RenderAfter'> &
OrderStatusApi,
AnyComponent
>`
- RenderExtension: export interface RenderExtension<
Api,
AllowedComponents extends RemoteComponentType<
string,
any,
any
> = RemoteComponentType,
> {
(
connection: RenderExtensionConnection,
api: Api,
): void | Promise;
}
- CheckoutApi: export interface CheckoutApi {
/**
* Performs an update on an attribute attached to the cart and checkout. If
* successful, this mutation results in an update to the value retrieved
* through the [`attributes`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/attributes#standardapi-propertydetail-attributes) property.
*
* > Note: This method will return an error if the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay.
*/
applyAttributeChange(change: AttributeChange): Promise;
/**
* Performs an update on the merchandise line items. It resolves when the new
* line items have been negotiated and results in an update to the value
* retrieved through the
* [`lines`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/cart-lines#standardapi-propertydetail-lines)
* property.
*
* > Note: This method will return an error if the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay.
*/
applyCartLinesChange(change: CartLineChange): Promise;
/**
* Performs an update on the discount codes.
* It resolves when the new discount codes have been negotiated and results in an update
* to the value retrieved through the [`discountCodes`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/discounts#standardapi-propertydetail-discountcodes) property.
*
* > Caution:
* > See [security considerations](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#network-access) if your extension retrieves discount codes through a network call.
*
* > Note: This method will return an error if the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay.
*/
applyDiscountCodeChange(
change: DiscountCodeChange,
): Promise;
/**
* Performs an update on the gift cards.
* It resolves when gift card change have been negotiated and results in an update
* to the value retrieved through the [`appliedGiftCards`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/gift-cards#standardapi-propertydetail-appliedgiftcards) property.
*
* > Caution:
* > See [security considerations](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#network-access) if your extension retrieves gift card codes through a network call.
*
* > Note: This method will return an error if the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay.
*/
applyGiftCardChange(change: GiftCardChange): Promise;
/**
* Performs an update on a piece of metadata attached to the checkout. If
* successful, this mutation results in an update to the value retrieved
* through the [`metafields`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/metafields#standardapi-propertydetail-metafields) property.
*/
applyMetafieldChange(change: MetafieldChange): Promise;
/**
* Performs an update on the note attached to the cart and checkout. If
* successful, this mutation results in an update to the value retrieved
* through the [`note`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/note#standardapi-propertydetail-note) property.
*
* > Note: This method will return an error if the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay.
*/
applyNoteChange(change: NoteChange): Promise;
/**
* @private
*/
experimentalIsShopAppStyle?: boolean;
/**
* 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.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*/
applyShippingAddressChange?(
change: ShippingAddressChange,
): Promise;
}
- CartLine: export interface CartLine {
/**
* These line item IDs are not stable at the moment, they might change after
* any operations on the line items. You should always look up for an updated
* ID before any call to `applyCartLinesChange` because you'll need the ID to
* create a `CartLineChange` object.
* @example 'gid://shopify/CartLine/123'
*/
id: string;
/**
* The merchandise being purchased.
*/
merchandise: Merchandise;
/**
* The quantity of the merchandise being purchased.
*/
quantity: number;
/**
* The details about the cost components attributed to the cart line.
*/
cost: CartLineCost;
/**
* The line item additional custom attributes.
*/
attributes: Attribute[];
/**
* Discounts applied to the cart line.
*/
discountAllocations: CartDiscountAllocation[];
/**
* Sub lines of the merchandise line. If no sub lines are present, this will be an empty array.
*/
lineComponents: CartLineComponentType[];
}
- StandardApi: export interface StandardApi {
/**
* The methods for interacting with [Web Pixels](https://shopify.dev/docs/apps/marketing), such as emitting an event.
*/
analytics: Analytics;
/**
* Gift Cards that have been applied to the checkout.
*/
appliedGiftCards: StatefulRemoteSubscribable;
/**
* The metafields requested in the
* [`shopify.extension.toml`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration)
* file. These metafields are updated when there's a change in the merchandise items
* being purchased by the customer.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*
* > Tip:
* > Cart metafields are only available on carts created via the Storefront API version `2023-04` or later.*
*/
appMetafields: StatefulRemoteSubscribable;
/**
* The custom attributes left by the customer to the merchant, either in their cart or during checkout.
*/
attributes: StatefulRemoteSubscribable;
/**
* All available payment options.
*/
availablePaymentOptions: StatefulRemoteSubscribable;
/**
* Information about the buyer that is interacting with the checkout.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*/
buyerIdentity?: BuyerIdentity;
/**
* Provides details on the buyer's progression through the checkout.
*
* Refer to [buyer journey](https://shopify.dev/docs/api/checkout-ui-extensions/apis/buyer-journey#examples)
* examples for more information.
*/
buyerJourney: BuyerJourney;
/**
* Settings applied to the buyer's checkout.
*/
checkoutSettings: StatefulRemoteSubscribable;
/**
* A stable ID that represents the current checkout.
*
* Matches the `token` field in the [WebPixel checkout payload](https://shopify.dev/docs/api/pixels/customer-events#checkout)
* and the `checkout_token` field in the [REST Admin API `Order` resource](https://shopify.dev/docs/api/admin-rest/unstable/resources/order#resource-object).
*/
checkoutToken: StatefulRemoteSubscribable;
/**
* Details on the costs the buyer will pay for this checkout.
*/
cost: CartCost;
/**
* A list of delivery groups containing information about the delivery of the items the customer intends to purchase.
*/
deliveryGroups: StatefulRemoteSubscribable;
/**
* A list of discount codes currently applied to the checkout.
*/
discountCodes: StatefulRemoteSubscribable;
/**
* Discounts that have been applied to the entire cart.
*/
discountAllocations: StatefulRemoteSubscribable;
/**
* The meta information about the extension.
*/
extension: Extension;
/**
* The identifier that specifies where in Shopify’s UI your code is being
* injected. This will be one of the targets you have included in your
* extension’s configuration file.
*
* @example 'purchase.checkout.block.render'
* @see /docs/api/checkout-ui-extensions/2024-04/extension-targets-overview
* @see /docs/apps/app-extensions/configuration#targets
*
* @deprecated Deprecated as of version `2023-07`, use `extension.target` instead.
*/
extensionPoint: Target;
/**
* Utilities for translating content and formatting values according to the current
* [`localization`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/localization)
* of the checkout.
*
* Refer to [`localization` examples](https://shopify.dev/docs/api/checkout-ui-extensions/apis/localization#examples)
* for more information.
*/
i18n: I18n;
/**
* A list of lines containing information about the items the customer intends to purchase.
*/
lines: StatefulRemoteSubscribable;
/**
* The details about the location, language, and currency of the customer. For utilities to easily
* format and translate content based on these details, you can use the
* [`i18n`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/localization#standardapi-propertydetail-i18n)
* object instead.
*/
localization: Localization;
/**
* The metafields that apply to the current checkout.
*
* Metafields are stored locally on the client and are applied to the order object after the checkout completes.
*
* These metafields are shared by all extensions running on checkout, and
* persist for as long as the customer is working on this checkout.
*
* Once the order is created, you can query these metafields using the
* [GraphQL Admin API](https://shopify.dev/docs/admin-api/graphql/reference/orders/order#metafield-2021-01)
*/
metafields: StatefulRemoteSubscribable;
/**
* A note left by the customer to the merchant, either in their cart or during checkout.
*/
note: StatefulRemoteSubscribable;
/**
* The method used to query the Storefront GraphQL API with a prefetched token.
*
* Refer to [Storefront API access examples](https://shopify.dev/docs/api/checkout-ui-extensions/apis/storefront-api) for more information.
*/
query: >(
query: string,
options?: {variables?: Variables; version?: StorefrontApiVersion},
) => Promise<{data?: Data; errors?: GraphQLError[]}>;
/**
* Payment options selected by the buyer.
*/
selectedPaymentOptions: StatefulRemoteSubscribable;
/**
* The session token providing a set of claims as a signed JSON Web Token (JWT).
*
* The token has a TTL of 5 minutes.
*
* If the previous token expires, this value will reflect a new session token with a new signature and expiry.
*
* Refer to [session token examples](https://shopify.dev/docs/api/checkout-ui-extensions/apis/session-token) for more information.
*/
sessionToken: SessionToken;
/**
* The settings matching the settings definition written in the
* [`shopify.extension.toml`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration) file.
*
* Refer to [settings examples](https://shopify.dev/docs/api/checkout-ui-extensions/apis/settings#examples) for more information.
*
* > Note: When an extension is being installed in the editor, the settings will be empty until
* a merchant sets a value. In that case, this object will be updated in real time as a merchant fills in the settings.
*/
settings: StatefulRemoteSubscribable;
/**
* 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.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*/
shippingAddress?: StatefulRemoteSubscribable;
/**
* The proposed customer billing address. The address updates when the field is
* committed (on change) rather than every keystroke.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*/
billingAddress?: StatefulRemoteSubscribable;
/** The shop where the checkout is taking place. */
shop: Shop;
/**
* The key-value storage for the extension.
*
* It uses `localStorage` and should persist across the customer's current checkout session.
*
* > Caution: Data persistence isn't guaranteed and storage is reset when the customer starts a new checkout.
*
* Data is shared across all activated extension targets of this extension. In versions 2023-07 and earlier,
* each activated extension target had its own storage.
*/
storage: Storage;
/**
* Methods to interact with the extension's UI.
*/
ui: Ui;
/**
* The renderer version being used for the extension.
*
* @example 'unstable'
*/
version: Version;
/**
* Customer privacy consent settings and a flag denoting if consent has previously been collected.
*/
customerPrivacy: StatefulRemoteSubscribable;
/**
* Allows setting and updating customer privacy consent settings and tracking consent metafields.
*
* > Note: Requires the [`customer_privacy` capability](https://shopify.dev/docs/api/checkout-ui-extensions/2024-04/configuration#collect-buyer-consent) to be set to `true`.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*/
applyTrackingConsentChange: ApplyTrackingConsentChangeType;
}
- Extension: export interface Extension {
/**
* The API version that was set in the extension config file.
*
* @example '2023-07', '2023-10', '2024-01', '2024-04', 'unstable'
*/
apiVersion: ApiVersion;
/**
* The allowed capabilities of the extension, defined
* in your [shopify.extension.toml](https://shopify.dev/docs/api/checkout-ui-extensions/configuration) file.
*
* * [`api_access`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#api-access): the extension can access the Storefront API.
*
* * [`network_access`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#network-access): the extension can make external network calls.
*
* * [`block_progress`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#block-progress): the extension can block a customer's progress and the merchant has allowed this blocking behavior.
*
* * [`collect_buyer_consent.sms_marketing`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#collect-buyer-consent): the extension can collect customer consent for SMS marketing.
*
* * [`collect_buyer_consent.customer_privacy`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#collect-buyer-consent): the extension can register customer consent decisions that will be honored on Shopify-managed services.
*/
capabilities: StatefulRemoteSubscribable;
/**
* Information about the editor where the extension is being rendered.
*
* If the value is undefined, then the extension is not running in an editor.
*/
editor?: Editor;
/**
* A Boolean to show whether your extension is currently rendered to the screen.
*
* Shopify might render your extension before it's visible in the UI,
* typically to pre-render extensions that will appear on a later step of the
* checkout.
*
* Your extension might also continue to run after the customer has navigated away
* from where it was rendered. The extension continues running so that
* your extension is immediately available to render if the customer navigates back.
*/
rendered: StatefulRemoteSubscribable;
/**
* The URL to the script that started the extension target.
*/
scriptUrl: string;
/**
* The identifier that specifies where in Shopify’s UI your code is being
* injected. This will be one of the targets you have included in your
* extension’s configuration file.
*
* @example 'purchase.checkout.block.render'
* @see /docs/api/checkout-ui-extensions/2024-04/extension-targets-overview
* @see /docs/apps/app-extensions/configuration#targets
*/
target: Target;
/**
* The published version of the running extension target.
*
* For unpublished extensions, the value is `undefined`.
*
* @example 3.0.10
*/
version?: string;
}
- AnyComponent: AnyComponentBuilder
- OrderStatusApi: export interface OrderStatusApi {
/**
* Order information that's available post-checkout.
*/
order: StatefulRemoteSubscribable;
}
- Order: export interface Order {
/**
* A globally-unique identifier.
* @example 'gid://shopify/Order/1'
*/
id: string;
/**
* Unique identifier for the order that appears on the order.
* @example '#1000'
*/
name: string;
/**
* If cancelled, the time at which the order was cancelled.
*/
cancelledAt?: string;
/**
* A randomly generated alpha-numeric identifier for the order.
* For orders created in 2024 and onwards, the number will always be present. For orders created before that date, the number might not be present.
*/
confirmationNumber?: string;
}
A static extension target that is rendered after all line items.
### Checkout::Contact::RenderAfter
value: `RenderExtension<
CheckoutApi & StandardApi<'Checkout::Contact::RenderAfter'>,
AnyComponent
>`
- RenderExtension: export interface RenderExtension<
Api,
AllowedComponents extends RemoteComponentType<
string,
any,
any
> = RemoteComponentType,
> {
(
connection: RenderExtensionConnection,
api: Api,
): void | Promise;
}
- CheckoutApi: export interface CheckoutApi {
/**
* Performs an update on an attribute attached to the cart and checkout. If
* successful, this mutation results in an update to the value retrieved
* through the [`attributes`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/attributes#standardapi-propertydetail-attributes) property.
*
* > Note: This method will return an error if the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay.
*/
applyAttributeChange(change: AttributeChange): Promise;
/**
* Performs an update on the merchandise line items. It resolves when the new
* line items have been negotiated and results in an update to the value
* retrieved through the
* [`lines`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/cart-lines#standardapi-propertydetail-lines)
* property.
*
* > Note: This method will return an error if the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay.
*/
applyCartLinesChange(change: CartLineChange): Promise;
/**
* Performs an update on the discount codes.
* It resolves when the new discount codes have been negotiated and results in an update
* to the value retrieved through the [`discountCodes`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/discounts#standardapi-propertydetail-discountcodes) property.
*
* > Caution:
* > See [security considerations](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#network-access) if your extension retrieves discount codes through a network call.
*
* > Note: This method will return an error if the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay.
*/
applyDiscountCodeChange(
change: DiscountCodeChange,
): Promise;
/**
* Performs an update on the gift cards.
* It resolves when gift card change have been negotiated and results in an update
* to the value retrieved through the [`appliedGiftCards`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/gift-cards#standardapi-propertydetail-appliedgiftcards) property.
*
* > Caution:
* > See [security considerations](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#network-access) if your extension retrieves gift card codes through a network call.
*
* > Note: This method will return an error if the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay.
*/
applyGiftCardChange(change: GiftCardChange): Promise;
/**
* Performs an update on a piece of metadata attached to the checkout. If
* successful, this mutation results in an update to the value retrieved
* through the [`metafields`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/metafields#standardapi-propertydetail-metafields) property.
*/
applyMetafieldChange(change: MetafieldChange): Promise;
/**
* Performs an update on the note attached to the cart and checkout. If
* successful, this mutation results in an update to the value retrieved
* through the [`note`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/note#standardapi-propertydetail-note) property.
*
* > Note: This method will return an error if the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay.
*/
applyNoteChange(change: NoteChange): Promise;
/**
* @private
*/
experimentalIsShopAppStyle?: boolean;
/**
* 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.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*/
applyShippingAddressChange?(
change: ShippingAddressChange,
): Promise;
}
- StandardApi: export interface StandardApi {
/**
* The methods for interacting with [Web Pixels](https://shopify.dev/docs/apps/marketing), such as emitting an event.
*/
analytics: Analytics;
/**
* Gift Cards that have been applied to the checkout.
*/
appliedGiftCards: StatefulRemoteSubscribable;
/**
* The metafields requested in the
* [`shopify.extension.toml`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration)
* file. These metafields are updated when there's a change in the merchandise items
* being purchased by the customer.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*
* > Tip:
* > Cart metafields are only available on carts created via the Storefront API version `2023-04` or later.*
*/
appMetafields: StatefulRemoteSubscribable;
/**
* The custom attributes left by the customer to the merchant, either in their cart or during checkout.
*/
attributes: StatefulRemoteSubscribable;
/**
* All available payment options.
*/
availablePaymentOptions: StatefulRemoteSubscribable;
/**
* Information about the buyer that is interacting with the checkout.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*/
buyerIdentity?: BuyerIdentity;
/**
* Provides details on the buyer's progression through the checkout.
*
* Refer to [buyer journey](https://shopify.dev/docs/api/checkout-ui-extensions/apis/buyer-journey#examples)
* examples for more information.
*/
buyerJourney: BuyerJourney;
/**
* Settings applied to the buyer's checkout.
*/
checkoutSettings: StatefulRemoteSubscribable;
/**
* A stable ID that represents the current checkout.
*
* Matches the `token` field in the [WebPixel checkout payload](https://shopify.dev/docs/api/pixels/customer-events#checkout)
* and the `checkout_token` field in the [REST Admin API `Order` resource](https://shopify.dev/docs/api/admin-rest/unstable/resources/order#resource-object).
*/
checkoutToken: StatefulRemoteSubscribable;
/**
* Details on the costs the buyer will pay for this checkout.
*/
cost: CartCost;
/**
* A list of delivery groups containing information about the delivery of the items the customer intends to purchase.
*/
deliveryGroups: StatefulRemoteSubscribable;
/**
* A list of discount codes currently applied to the checkout.
*/
discountCodes: StatefulRemoteSubscribable;
/**
* Discounts that have been applied to the entire cart.
*/
discountAllocations: StatefulRemoteSubscribable;
/**
* The meta information about the extension.
*/
extension: Extension;
/**
* The identifier that specifies where in Shopify’s UI your code is being
* injected. This will be one of the targets you have included in your
* extension’s configuration file.
*
* @example 'purchase.checkout.block.render'
* @see /docs/api/checkout-ui-extensions/2024-04/extension-targets-overview
* @see /docs/apps/app-extensions/configuration#targets
*
* @deprecated Deprecated as of version `2023-07`, use `extension.target` instead.
*/
extensionPoint: Target;
/**
* Utilities for translating content and formatting values according to the current
* [`localization`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/localization)
* of the checkout.
*
* Refer to [`localization` examples](https://shopify.dev/docs/api/checkout-ui-extensions/apis/localization#examples)
* for more information.
*/
i18n: I18n;
/**
* A list of lines containing information about the items the customer intends to purchase.
*/
lines: StatefulRemoteSubscribable;
/**
* The details about the location, language, and currency of the customer. For utilities to easily
* format and translate content based on these details, you can use the
* [`i18n`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/localization#standardapi-propertydetail-i18n)
* object instead.
*/
localization: Localization;
/**
* The metafields that apply to the current checkout.
*
* Metafields are stored locally on the client and are applied to the order object after the checkout completes.
*
* These metafields are shared by all extensions running on checkout, and
* persist for as long as the customer is working on this checkout.
*
* Once the order is created, you can query these metafields using the
* [GraphQL Admin API](https://shopify.dev/docs/admin-api/graphql/reference/orders/order#metafield-2021-01)
*/
metafields: StatefulRemoteSubscribable;
/**
* A note left by the customer to the merchant, either in their cart or during checkout.
*/
note: StatefulRemoteSubscribable;
/**
* The method used to query the Storefront GraphQL API with a prefetched token.
*
* Refer to [Storefront API access examples](https://shopify.dev/docs/api/checkout-ui-extensions/apis/storefront-api) for more information.
*/
query: >(
query: string,
options?: {variables?: Variables; version?: StorefrontApiVersion},
) => Promise<{data?: Data; errors?: GraphQLError[]}>;
/**
* Payment options selected by the buyer.
*/
selectedPaymentOptions: StatefulRemoteSubscribable;
/**
* The session token providing a set of claims as a signed JSON Web Token (JWT).
*
* The token has a TTL of 5 minutes.
*
* If the previous token expires, this value will reflect a new session token with a new signature and expiry.
*
* Refer to [session token examples](https://shopify.dev/docs/api/checkout-ui-extensions/apis/session-token) for more information.
*/
sessionToken: SessionToken;
/**
* The settings matching the settings definition written in the
* [`shopify.extension.toml`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration) file.
*
* Refer to [settings examples](https://shopify.dev/docs/api/checkout-ui-extensions/apis/settings#examples) for more information.
*
* > Note: When an extension is being installed in the editor, the settings will be empty until
* a merchant sets a value. In that case, this object will be updated in real time as a merchant fills in the settings.
*/
settings: StatefulRemoteSubscribable;
/**
* 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.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*/
shippingAddress?: StatefulRemoteSubscribable;
/**
* The proposed customer billing address. The address updates when the field is
* committed (on change) rather than every keystroke.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*/
billingAddress?: StatefulRemoteSubscribable;
/** The shop where the checkout is taking place. */
shop: Shop;
/**
* The key-value storage for the extension.
*
* It uses `localStorage` and should persist across the customer's current checkout session.
*
* > Caution: Data persistence isn't guaranteed and storage is reset when the customer starts a new checkout.
*
* Data is shared across all activated extension targets of this extension. In versions 2023-07 and earlier,
* each activated extension target had its own storage.
*/
storage: Storage;
/**
* Methods to interact with the extension's UI.
*/
ui: Ui;
/**
* The renderer version being used for the extension.
*
* @example 'unstable'
*/
version: Version;
/**
* Customer privacy consent settings and a flag denoting if consent has previously been collected.
*/
customerPrivacy: StatefulRemoteSubscribable;
/**
* Allows setting and updating customer privacy consent settings and tracking consent metafields.
*
* > Note: Requires the [`customer_privacy` capability](https://shopify.dev/docs/api/checkout-ui-extensions/2024-04/configuration#collect-buyer-consent) to be set to `true`.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*/
applyTrackingConsentChange: ApplyTrackingConsentChangeType;
}
- Extension: export interface Extension {
/**
* The API version that was set in the extension config file.
*
* @example '2023-07', '2023-10', '2024-01', '2024-04', 'unstable'
*/
apiVersion: ApiVersion;
/**
* The allowed capabilities of the extension, defined
* in your [shopify.extension.toml](https://shopify.dev/docs/api/checkout-ui-extensions/configuration) file.
*
* * [`api_access`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#api-access): the extension can access the Storefront API.
*
* * [`network_access`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#network-access): the extension can make external network calls.
*
* * [`block_progress`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#block-progress): the extension can block a customer's progress and the merchant has allowed this blocking behavior.
*
* * [`collect_buyer_consent.sms_marketing`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#collect-buyer-consent): the extension can collect customer consent for SMS marketing.
*
* * [`collect_buyer_consent.customer_privacy`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#collect-buyer-consent): the extension can register customer consent decisions that will be honored on Shopify-managed services.
*/
capabilities: StatefulRemoteSubscribable;
/**
* Information about the editor where the extension is being rendered.
*
* If the value is undefined, then the extension is not running in an editor.
*/
editor?: Editor;
/**
* A Boolean to show whether your extension is currently rendered to the screen.
*
* Shopify might render your extension before it's visible in the UI,
* typically to pre-render extensions that will appear on a later step of the
* checkout.
*
* Your extension might also continue to run after the customer has navigated away
* from where it was rendered. The extension continues running so that
* your extension is immediately available to render if the customer navigates back.
*/
rendered: StatefulRemoteSubscribable;
/**
* The URL to the script that started the extension target.
*/
scriptUrl: string;
/**
* The identifier that specifies where in Shopify’s UI your code is being
* injected. This will be one of the targets you have included in your
* extension’s configuration file.
*
* @example 'purchase.checkout.block.render'
* @see /docs/api/checkout-ui-extensions/2024-04/extension-targets-overview
* @see /docs/apps/app-extensions/configuration#targets
*/
target: Target;
/**
* The published version of the running extension target.
*
* For unpublished extensions, the value is `undefined`.
*
* @example 3.0.10
*/
version?: string;
}
- AnyComponent: AnyComponentBuilder
A static extension target that is rendered immediately after the contact form element.
### Checkout::CustomerInformation::RenderAfter
value: `RenderExtension<
OrderStatusApi &
CheckoutApi &
StandardApi<'Checkout::CustomerInformation::RenderAfter'>,
AnyComponent
>`
- RenderExtension: export interface RenderExtension<
Api,
AllowedComponents extends RemoteComponentType<
string,
any,
any
> = RemoteComponentType,
> {
(
connection: RenderExtensionConnection,
api: Api,
): void | Promise;
}
- CheckoutApi: export interface CheckoutApi {
/**
* Performs an update on an attribute attached to the cart and checkout. If
* successful, this mutation results in an update to the value retrieved
* through the [`attributes`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/attributes#standardapi-propertydetail-attributes) property.
*
* > Note: This method will return an error if the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay.
*/
applyAttributeChange(change: AttributeChange): Promise;
/**
* Performs an update on the merchandise line items. It resolves when the new
* line items have been negotiated and results in an update to the value
* retrieved through the
* [`lines`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/cart-lines#standardapi-propertydetail-lines)
* property.
*
* > Note: This method will return an error if the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay.
*/
applyCartLinesChange(change: CartLineChange): Promise;
/**
* Performs an update on the discount codes.
* It resolves when the new discount codes have been negotiated and results in an update
* to the value retrieved through the [`discountCodes`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/discounts#standardapi-propertydetail-discountcodes) property.
*
* > Caution:
* > See [security considerations](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#network-access) if your extension retrieves discount codes through a network call.
*
* > Note: This method will return an error if the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay.
*/
applyDiscountCodeChange(
change: DiscountCodeChange,
): Promise;
/**
* Performs an update on the gift cards.
* It resolves when gift card change have been negotiated and results in an update
* to the value retrieved through the [`appliedGiftCards`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/gift-cards#standardapi-propertydetail-appliedgiftcards) property.
*
* > Caution:
* > See [security considerations](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#network-access) if your extension retrieves gift card codes through a network call.
*
* > Note: This method will return an error if the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay.
*/
applyGiftCardChange(change: GiftCardChange): Promise;
/**
* Performs an update on a piece of metadata attached to the checkout. If
* successful, this mutation results in an update to the value retrieved
* through the [`metafields`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/metafields#standardapi-propertydetail-metafields) property.
*/
applyMetafieldChange(change: MetafieldChange): Promise;
/**
* Performs an update on the note attached to the cart and checkout. If
* successful, this mutation results in an update to the value retrieved
* through the [`note`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/note#standardapi-propertydetail-note) property.
*
* > Note: This method will return an error if the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay.
*/
applyNoteChange(change: NoteChange): Promise;
/**
* @private
*/
experimentalIsShopAppStyle?: boolean;
/**
* 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.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*/
applyShippingAddressChange?(
change: ShippingAddressChange,
): Promise;
}
- StandardApi: export interface StandardApi {
/**
* The methods for interacting with [Web Pixels](https://shopify.dev/docs/apps/marketing), such as emitting an event.
*/
analytics: Analytics;
/**
* Gift Cards that have been applied to the checkout.
*/
appliedGiftCards: StatefulRemoteSubscribable;
/**
* The metafields requested in the
* [`shopify.extension.toml`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration)
* file. These metafields are updated when there's a change in the merchandise items
* being purchased by the customer.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*
* > Tip:
* > Cart metafields are only available on carts created via the Storefront API version `2023-04` or later.*
*/
appMetafields: StatefulRemoteSubscribable;
/**
* The custom attributes left by the customer to the merchant, either in their cart or during checkout.
*/
attributes: StatefulRemoteSubscribable;
/**
* All available payment options.
*/
availablePaymentOptions: StatefulRemoteSubscribable;
/**
* Information about the buyer that is interacting with the checkout.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*/
buyerIdentity?: BuyerIdentity;
/**
* Provides details on the buyer's progression through the checkout.
*
* Refer to [buyer journey](https://shopify.dev/docs/api/checkout-ui-extensions/apis/buyer-journey#examples)
* examples for more information.
*/
buyerJourney: BuyerJourney;
/**
* Settings applied to the buyer's checkout.
*/
checkoutSettings: StatefulRemoteSubscribable;
/**
* A stable ID that represents the current checkout.
*
* Matches the `token` field in the [WebPixel checkout payload](https://shopify.dev/docs/api/pixels/customer-events#checkout)
* and the `checkout_token` field in the [REST Admin API `Order` resource](https://shopify.dev/docs/api/admin-rest/unstable/resources/order#resource-object).
*/
checkoutToken: StatefulRemoteSubscribable;
/**
* Details on the costs the buyer will pay for this checkout.
*/
cost: CartCost;
/**
* A list of delivery groups containing information about the delivery of the items the customer intends to purchase.
*/
deliveryGroups: StatefulRemoteSubscribable;
/**
* A list of discount codes currently applied to the checkout.
*/
discountCodes: StatefulRemoteSubscribable;
/**
* Discounts that have been applied to the entire cart.
*/
discountAllocations: StatefulRemoteSubscribable;
/**
* The meta information about the extension.
*/
extension: Extension;
/**
* The identifier that specifies where in Shopify’s UI your code is being
* injected. This will be one of the targets you have included in your
* extension’s configuration file.
*
* @example 'purchase.checkout.block.render'
* @see /docs/api/checkout-ui-extensions/2024-04/extension-targets-overview
* @see /docs/apps/app-extensions/configuration#targets
*
* @deprecated Deprecated as of version `2023-07`, use `extension.target` instead.
*/
extensionPoint: Target;
/**
* Utilities for translating content and formatting values according to the current
* [`localization`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/localization)
* of the checkout.
*
* Refer to [`localization` examples](https://shopify.dev/docs/api/checkout-ui-extensions/apis/localization#examples)
* for more information.
*/
i18n: I18n;
/**
* A list of lines containing information about the items the customer intends to purchase.
*/
lines: StatefulRemoteSubscribable;
/**
* The details about the location, language, and currency of the customer. For utilities to easily
* format and translate content based on these details, you can use the
* [`i18n`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/localization#standardapi-propertydetail-i18n)
* object instead.
*/
localization: Localization;
/**
* The metafields that apply to the current checkout.
*
* Metafields are stored locally on the client and are applied to the order object after the checkout completes.
*
* These metafields are shared by all extensions running on checkout, and
* persist for as long as the customer is working on this checkout.
*
* Once the order is created, you can query these metafields using the
* [GraphQL Admin API](https://shopify.dev/docs/admin-api/graphql/reference/orders/order#metafield-2021-01)
*/
metafields: StatefulRemoteSubscribable;
/**
* A note left by the customer to the merchant, either in their cart or during checkout.
*/
note: StatefulRemoteSubscribable;
/**
* The method used to query the Storefront GraphQL API with a prefetched token.
*
* Refer to [Storefront API access examples](https://shopify.dev/docs/api/checkout-ui-extensions/apis/storefront-api) for more information.
*/
query: >(
query: string,
options?: {variables?: Variables; version?: StorefrontApiVersion},
) => Promise<{data?: Data; errors?: GraphQLError[]}>;
/**
* Payment options selected by the buyer.
*/
selectedPaymentOptions: StatefulRemoteSubscribable;
/**
* The session token providing a set of claims as a signed JSON Web Token (JWT).
*
* The token has a TTL of 5 minutes.
*
* If the previous token expires, this value will reflect a new session token with a new signature and expiry.
*
* Refer to [session token examples](https://shopify.dev/docs/api/checkout-ui-extensions/apis/session-token) for more information.
*/
sessionToken: SessionToken;
/**
* The settings matching the settings definition written in the
* [`shopify.extension.toml`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration) file.
*
* Refer to [settings examples](https://shopify.dev/docs/api/checkout-ui-extensions/apis/settings#examples) for more information.
*
* > Note: When an extension is being installed in the editor, the settings will be empty until
* a merchant sets a value. In that case, this object will be updated in real time as a merchant fills in the settings.
*/
settings: StatefulRemoteSubscribable;
/**
* 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.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*/
shippingAddress?: StatefulRemoteSubscribable;
/**
* The proposed customer billing address. The address updates when the field is
* committed (on change) rather than every keystroke.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*/
billingAddress?: StatefulRemoteSubscribable;
/** The shop where the checkout is taking place. */
shop: Shop;
/**
* The key-value storage for the extension.
*
* It uses `localStorage` and should persist across the customer's current checkout session.
*
* > Caution: Data persistence isn't guaranteed and storage is reset when the customer starts a new checkout.
*
* Data is shared across all activated extension targets of this extension. In versions 2023-07 and earlier,
* each activated extension target had its own storage.
*/
storage: Storage;
/**
* Methods to interact with the extension's UI.
*/
ui: Ui;
/**
* The renderer version being used for the extension.
*
* @example 'unstable'
*/
version: Version;
/**
* Customer privacy consent settings and a flag denoting if consent has previously been collected.
*/
customerPrivacy: StatefulRemoteSubscribable;
/**
* Allows setting and updating customer privacy consent settings and tracking consent metafields.
*
* > Note: Requires the [`customer_privacy` capability](https://shopify.dev/docs/api/checkout-ui-extensions/2024-04/configuration#collect-buyer-consent) to be set to `true`.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*/
applyTrackingConsentChange: ApplyTrackingConsentChangeType;
}
- Customer: export interface Customer {
/**
* Customer ID.
*
* {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*
* @example 'gid://shopify/Customer/123'
*/
id: string;
/**
* The email of the customer.
*
* {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*/
email?: string;
/**
* The phone number of the customer.
*
* {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*/
phone?: string;
/**
* The full name of the customer.
*
* {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*/
fullName?: string;
/**
* The first name of the customer.
*
* {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*/
firstName?: string;
/**
* The last name of the customer.
*
* {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*/
lastName?: string;
/**
* The image associated with the customer.
*
* {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*/
image: ImageDetails;
/**
* Defines if the customer email accepts marketing activities.
*
* {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*
* > Caution: This field is deprecated and will be removed in a future version. Use `acceptsEmailMarketing` or `acceptsSmsMarketing` instead.
*
* @deprecated Use `acceptsEmailMarketing` or `acceptsSmsMarketing` instead.
*/
acceptsMarketing: boolean;
/**
* Defines if the customer accepts email marketing activities.
*
* {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*/
acceptsEmailMarketing: boolean;
/**
* Defines if the customer accepts SMS marketing activities.
*
* {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*/
acceptsSmsMarketing: boolean;
/**
* The Store Credit Accounts owned by the customer and usable during the checkout process.
*
* {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*
* @private
*/
storeCreditAccounts: StoreCreditAccount[];
}
- Extension: export interface Extension {
/**
* The API version that was set in the extension config file.
*
* @example '2023-07', '2023-10', '2024-01', '2024-04', 'unstable'
*/
apiVersion: ApiVersion;
/**
* The allowed capabilities of the extension, defined
* in your [shopify.extension.toml](https://shopify.dev/docs/api/checkout-ui-extensions/configuration) file.
*
* * [`api_access`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#api-access): the extension can access the Storefront API.
*
* * [`network_access`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#network-access): the extension can make external network calls.
*
* * [`block_progress`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#block-progress): the extension can block a customer's progress and the merchant has allowed this blocking behavior.
*
* * [`collect_buyer_consent.sms_marketing`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#collect-buyer-consent): the extension can collect customer consent for SMS marketing.
*
* * [`collect_buyer_consent.customer_privacy`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#collect-buyer-consent): the extension can register customer consent decisions that will be honored on Shopify-managed services.
*/
capabilities: StatefulRemoteSubscribable;
/**
* Information about the editor where the extension is being rendered.
*
* If the value is undefined, then the extension is not running in an editor.
*/
editor?: Editor;
/**
* A Boolean to show whether your extension is currently rendered to the screen.
*
* Shopify might render your extension before it's visible in the UI,
* typically to pre-render extensions that will appear on a later step of the
* checkout.
*
* Your extension might also continue to run after the customer has navigated away
* from where it was rendered. The extension continues running so that
* your extension is immediately available to render if the customer navigates back.
*/
rendered: StatefulRemoteSubscribable;
/**
* The URL to the script that started the extension target.
*/
scriptUrl: string;
/**
* The identifier that specifies where in Shopify’s UI your code is being
* injected. This will be one of the targets you have included in your
* extension’s configuration file.
*
* @example 'purchase.checkout.block.render'
* @see /docs/api/checkout-ui-extensions/2024-04/extension-targets-overview
* @see /docs/apps/app-extensions/configuration#targets
*/
target: Target;
/**
* The published version of the running extension target.
*
* For unpublished extensions, the value is `undefined`.
*
* @example 3.0.10
*/
version?: string;
}
- AnyComponent: AnyComponentBuilder
- OrderStatusApi: export interface OrderStatusApi {
/**
* Order information that's available post-checkout.
*/
order: StatefulRemoteSubscribable;
}
- Order: export interface Order {
/**
* A globally-unique identifier.
* @example 'gid://shopify/Order/1'
*/
id: string;
/**
* Unique identifier for the order that appears on the order.
* @example '#1000'
*/
name: string;
/**
* If cancelled, the time at which the order was cancelled.
*/
cancelledAt?: string;
/**
* A randomly generated alpha-numeric identifier for the order.
* For orders created in 2024 and onwards, the number will always be present. For orders created before that date, the number might not be present.
*/
confirmationNumber?: string;
}
A static extension target that is rendered after a purchase below the customer information.
### Checkout::DeliveryAddress::RenderBefore
value: `RenderExtension<
CheckoutApi & StandardApi<'Checkout::DeliveryAddress::RenderBefore'>,
AnyComponent
>`
- RenderExtension: export interface RenderExtension<
Api,
AllowedComponents extends RemoteComponentType<
string,
any,
any
> = RemoteComponentType,
> {
(
connection: RenderExtensionConnection,
api: Api,
): void | Promise;
}
- CheckoutApi: export interface CheckoutApi {
/**
* Performs an update on an attribute attached to the cart and checkout. If
* successful, this mutation results in an update to the value retrieved
* through the [`attributes`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/attributes#standardapi-propertydetail-attributes) property.
*
* > Note: This method will return an error if the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay.
*/
applyAttributeChange(change: AttributeChange): Promise;
/**
* Performs an update on the merchandise line items. It resolves when the new
* line items have been negotiated and results in an update to the value
* retrieved through the
* [`lines`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/cart-lines#standardapi-propertydetail-lines)
* property.
*
* > Note: This method will return an error if the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay.
*/
applyCartLinesChange(change: CartLineChange): Promise;
/**
* Performs an update on the discount codes.
* It resolves when the new discount codes have been negotiated and results in an update
* to the value retrieved through the [`discountCodes`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/discounts#standardapi-propertydetail-discountcodes) property.
*
* > Caution:
* > See [security considerations](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#network-access) if your extension retrieves discount codes through a network call.
*
* > Note: This method will return an error if the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay.
*/
applyDiscountCodeChange(
change: DiscountCodeChange,
): Promise;
/**
* Performs an update on the gift cards.
* It resolves when gift card change have been negotiated and results in an update
* to the value retrieved through the [`appliedGiftCards`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/gift-cards#standardapi-propertydetail-appliedgiftcards) property.
*
* > Caution:
* > See [security considerations](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#network-access) if your extension retrieves gift card codes through a network call.
*
* > Note: This method will return an error if the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay.
*/
applyGiftCardChange(change: GiftCardChange): Promise;
/**
* Performs an update on a piece of metadata attached to the checkout. If
* successful, this mutation results in an update to the value retrieved
* through the [`metafields`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/metafields#standardapi-propertydetail-metafields) property.
*/
applyMetafieldChange(change: MetafieldChange): Promise;
/**
* Performs an update on the note attached to the cart and checkout. If
* successful, this mutation results in an update to the value retrieved
* through the [`note`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/note#standardapi-propertydetail-note) property.
*
* > Note: This method will return an error if the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay.
*/
applyNoteChange(change: NoteChange): Promise;
/**
* @private
*/
experimentalIsShopAppStyle?: boolean;
/**
* 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.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*/
applyShippingAddressChange?(
change: ShippingAddressChange,
): Promise;
}
- StandardApi: export interface StandardApi {
/**
* The methods for interacting with [Web Pixels](https://shopify.dev/docs/apps/marketing), such as emitting an event.
*/
analytics: Analytics;
/**
* Gift Cards that have been applied to the checkout.
*/
appliedGiftCards: StatefulRemoteSubscribable;
/**
* The metafields requested in the
* [`shopify.extension.toml`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration)
* file. These metafields are updated when there's a change in the merchandise items
* being purchased by the customer.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*
* > Tip:
* > Cart metafields are only available on carts created via the Storefront API version `2023-04` or later.*
*/
appMetafields: StatefulRemoteSubscribable;
/**
* The custom attributes left by the customer to the merchant, either in their cart or during checkout.
*/
attributes: StatefulRemoteSubscribable;
/**
* All available payment options.
*/
availablePaymentOptions: StatefulRemoteSubscribable;
/**
* Information about the buyer that is interacting with the checkout.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*/
buyerIdentity?: BuyerIdentity;
/**
* Provides details on the buyer's progression through the checkout.
*
* Refer to [buyer journey](https://shopify.dev/docs/api/checkout-ui-extensions/apis/buyer-journey#examples)
* examples for more information.
*/
buyerJourney: BuyerJourney;
/**
* Settings applied to the buyer's checkout.
*/
checkoutSettings: StatefulRemoteSubscribable;
/**
* A stable ID that represents the current checkout.
*
* Matches the `token` field in the [WebPixel checkout payload](https://shopify.dev/docs/api/pixels/customer-events#checkout)
* and the `checkout_token` field in the [REST Admin API `Order` resource](https://shopify.dev/docs/api/admin-rest/unstable/resources/order#resource-object).
*/
checkoutToken: StatefulRemoteSubscribable;
/**
* Details on the costs the buyer will pay for this checkout.
*/
cost: CartCost;
/**
* A list of delivery groups containing information about the delivery of the items the customer intends to purchase.
*/
deliveryGroups: StatefulRemoteSubscribable;
/**
* A list of discount codes currently applied to the checkout.
*/
discountCodes: StatefulRemoteSubscribable;
/**
* Discounts that have been applied to the entire cart.
*/
discountAllocations: StatefulRemoteSubscribable;
/**
* The meta information about the extension.
*/
extension: Extension;
/**
* The identifier that specifies where in Shopify’s UI your code is being
* injected. This will be one of the targets you have included in your
* extension’s configuration file.
*
* @example 'purchase.checkout.block.render'
* @see /docs/api/checkout-ui-extensions/2024-04/extension-targets-overview
* @see /docs/apps/app-extensions/configuration#targets
*
* @deprecated Deprecated as of version `2023-07`, use `extension.target` instead.
*/
extensionPoint: Target;
/**
* Utilities for translating content and formatting values according to the current
* [`localization`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/localization)
* of the checkout.
*
* Refer to [`localization` examples](https://shopify.dev/docs/api/checkout-ui-extensions/apis/localization#examples)
* for more information.
*/
i18n: I18n;
/**
* A list of lines containing information about the items the customer intends to purchase.
*/
lines: StatefulRemoteSubscribable;
/**
* The details about the location, language, and currency of the customer. For utilities to easily
* format and translate content based on these details, you can use the
* [`i18n`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/localization#standardapi-propertydetail-i18n)
* object instead.
*/
localization: Localization;
/**
* The metafields that apply to the current checkout.
*
* Metafields are stored locally on the client and are applied to the order object after the checkout completes.
*
* These metafields are shared by all extensions running on checkout, and
* persist for as long as the customer is working on this checkout.
*
* Once the order is created, you can query these metafields using the
* [GraphQL Admin API](https://shopify.dev/docs/admin-api/graphql/reference/orders/order#metafield-2021-01)
*/
metafields: StatefulRemoteSubscribable;
/**
* A note left by the customer to the merchant, either in their cart or during checkout.
*/
note: StatefulRemoteSubscribable;
/**
* The method used to query the Storefront GraphQL API with a prefetched token.
*
* Refer to [Storefront API access examples](https://shopify.dev/docs/api/checkout-ui-extensions/apis/storefront-api) for more information.
*/
query: >(
query: string,
options?: {variables?: Variables; version?: StorefrontApiVersion},
) => Promise<{data?: Data; errors?: GraphQLError[]}>;
/**
* Payment options selected by the buyer.
*/
selectedPaymentOptions: StatefulRemoteSubscribable;
/**
* The session token providing a set of claims as a signed JSON Web Token (JWT).
*
* The token has a TTL of 5 minutes.
*
* If the previous token expires, this value will reflect a new session token with a new signature and expiry.
*
* Refer to [session token examples](https://shopify.dev/docs/api/checkout-ui-extensions/apis/session-token) for more information.
*/
sessionToken: SessionToken;
/**
* The settings matching the settings definition written in the
* [`shopify.extension.toml`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration) file.
*
* Refer to [settings examples](https://shopify.dev/docs/api/checkout-ui-extensions/apis/settings#examples) for more information.
*
* > Note: When an extension is being installed in the editor, the settings will be empty until
* a merchant sets a value. In that case, this object will be updated in real time as a merchant fills in the settings.
*/
settings: StatefulRemoteSubscribable;
/**
* 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.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*/
shippingAddress?: StatefulRemoteSubscribable;
/**
* The proposed customer billing address. The address updates when the field is
* committed (on change) rather than every keystroke.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*/
billingAddress?: StatefulRemoteSubscribable;
/** The shop where the checkout is taking place. */
shop: Shop;
/**
* The key-value storage for the extension.
*
* It uses `localStorage` and should persist across the customer's current checkout session.
*
* > Caution: Data persistence isn't guaranteed and storage is reset when the customer starts a new checkout.
*
* Data is shared across all activated extension targets of this extension. In versions 2023-07 and earlier,
* each activated extension target had its own storage.
*/
storage: Storage;
/**
* Methods to interact with the extension's UI.
*/
ui: Ui;
/**
* The renderer version being used for the extension.
*
* @example 'unstable'
*/
version: Version;
/**
* Customer privacy consent settings and a flag denoting if consent has previously been collected.
*/
customerPrivacy: StatefulRemoteSubscribable;
/**
* Allows setting and updating customer privacy consent settings and tracking consent metafields.
*
* > Note: Requires the [`customer_privacy` capability](https://shopify.dev/docs/api/checkout-ui-extensions/2024-04/configuration#collect-buyer-consent) to be set to `true`.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*/
applyTrackingConsentChange: ApplyTrackingConsentChangeType;
}
- Extension: export interface Extension {
/**
* The API version that was set in the extension config file.
*
* @example '2023-07', '2023-10', '2024-01', '2024-04', 'unstable'
*/
apiVersion: ApiVersion;
/**
* The allowed capabilities of the extension, defined
* in your [shopify.extension.toml](https://shopify.dev/docs/api/checkout-ui-extensions/configuration) file.
*
* * [`api_access`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#api-access): the extension can access the Storefront API.
*
* * [`network_access`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#network-access): the extension can make external network calls.
*
* * [`block_progress`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#block-progress): the extension can block a customer's progress and the merchant has allowed this blocking behavior.
*
* * [`collect_buyer_consent.sms_marketing`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#collect-buyer-consent): the extension can collect customer consent for SMS marketing.
*
* * [`collect_buyer_consent.customer_privacy`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#collect-buyer-consent): the extension can register customer consent decisions that will be honored on Shopify-managed services.
*/
capabilities: StatefulRemoteSubscribable;
/**
* Information about the editor where the extension is being rendered.
*
* If the value is undefined, then the extension is not running in an editor.
*/
editor?: Editor;
/**
* A Boolean to show whether your extension is currently rendered to the screen.
*
* Shopify might render your extension before it's visible in the UI,
* typically to pre-render extensions that will appear on a later step of the
* checkout.
*
* Your extension might also continue to run after the customer has navigated away
* from where it was rendered. The extension continues running so that
* your extension is immediately available to render if the customer navigates back.
*/
rendered: StatefulRemoteSubscribable;
/**
* The URL to the script that started the extension target.
*/
scriptUrl: string;
/**
* The identifier that specifies where in Shopify’s UI your code is being
* injected. This will be one of the targets you have included in your
* extension’s configuration file.
*
* @example 'purchase.checkout.block.render'
* @see /docs/api/checkout-ui-extensions/2024-04/extension-targets-overview
* @see /docs/apps/app-extensions/configuration#targets
*/
target: Target;
/**
* The published version of the running extension target.
*
* For unpublished extensions, the value is `undefined`.
*
* @example 3.0.10
*/
version?: string;
}
- AnyComponent: AnyComponentBuilder
A static extension target that is rendered between the shipping address header and shipping address form elements.
### Checkout::Dynamic::Render
value: `RenderExtension<
CheckoutApi & OrderStatusApi & StandardApi<'Checkout::Dynamic::Render'>,
AnyComponent
>`
- RenderExtension: export interface RenderExtension<
Api,
AllowedComponents extends RemoteComponentType<
string,
any,
any
> = RemoteComponentType,
> {
(
connection: RenderExtensionConnection,
api: Api,
): void | Promise;
}
- CheckoutApi: export interface CheckoutApi {
/**
* Performs an update on an attribute attached to the cart and checkout. If
* successful, this mutation results in an update to the value retrieved
* through the [`attributes`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/attributes#standardapi-propertydetail-attributes) property.
*
* > Note: This method will return an error if the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay.
*/
applyAttributeChange(change: AttributeChange): Promise;
/**
* Performs an update on the merchandise line items. It resolves when the new
* line items have been negotiated and results in an update to the value
* retrieved through the
* [`lines`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/cart-lines#standardapi-propertydetail-lines)
* property.
*
* > Note: This method will return an error if the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay.
*/
applyCartLinesChange(change: CartLineChange): Promise;
/**
* Performs an update on the discount codes.
* It resolves when the new discount codes have been negotiated and results in an update
* to the value retrieved through the [`discountCodes`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/discounts#standardapi-propertydetail-discountcodes) property.
*
* > Caution:
* > See [security considerations](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#network-access) if your extension retrieves discount codes through a network call.
*
* > Note: This method will return an error if the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay.
*/
applyDiscountCodeChange(
change: DiscountCodeChange,
): Promise;
/**
* Performs an update on the gift cards.
* It resolves when gift card change have been negotiated and results in an update
* to the value retrieved through the [`appliedGiftCards`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/gift-cards#standardapi-propertydetail-appliedgiftcards) property.
*
* > Caution:
* > See [security considerations](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#network-access) if your extension retrieves gift card codes through a network call.
*
* > Note: This method will return an error if the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay.
*/
applyGiftCardChange(change: GiftCardChange): Promise;
/**
* Performs an update on a piece of metadata attached to the checkout. If
* successful, this mutation results in an update to the value retrieved
* through the [`metafields`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/metafields#standardapi-propertydetail-metafields) property.
*/
applyMetafieldChange(change: MetafieldChange): Promise;
/**
* Performs an update on the note attached to the cart and checkout. If
* successful, this mutation results in an update to the value retrieved
* through the [`note`](https://shopify.dev/docs/api/checkout-ui-extensions/apis/note#standardapi-propertydetail-note) property.
*
* > Note: This method will return an error if the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay.
*/
applyNoteChange(change: NoteChange): Promise;
/**
* @private
*/
experimentalIsShopAppStyle?: boolean;
/**
* 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.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*/
applyShippingAddressChange?(
change: ShippingAddressChange,
): Promise;
}
- StandardApi: export interface StandardApi {
/**
* The methods for interacting with [Web Pixels](https://shopify.dev/docs/apps/marketing), such as emitting an event.
*/
analytics: Analytics;
/**
* Gift Cards that have been applied to the checkout.
*/
appliedGiftCards: StatefulRemoteSubscribable;
/**
* The metafields requested in the
* [`shopify.extension.toml`](https://shopify.dev/docs/api/checkout-ui-extensions/configuration)
* file. These metafields are updated when there's a change in the merchandise items
* being purchased by the customer.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data).
*
* > Tip:
* > Cart metafields are only available on carts created via the Storefront API version `2023-04` or later.*
*/
appMetafields: StatefulRemoteSubscribable;
/**
* The custom attributes left by the customer to the merchant, either in their cart or during checkout.
*/
attributes: StatefulRemoteSubscribable;
/**
* All available payment options.
*/
availablePaymentOptions: StatefulRemoteSubscribable