use Extension Api()React Hook
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 object. Other targets may only have access to the 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.
This is deprecated, use instead.
Anchor to useExtensionApiuse Extension Api()
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](/docs/api/checkout-ui-extensions/apis/cartlinedetailsapi) object. Other targets may only have access to the [StandardApi](/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](/docs/api/checkout-ui-extensions/apis/extensiontargets). > Caution: This is deprecated, use `useApi` instead.
ApiForExtension<Target extends RenderExtensionTarget = RenderExtensionTarget>
export function useExtensionApi<
Target extends RenderExtensionTarget = RenderExtensionTarget,
>(): ApiForExtension<Target> {
return useApi();
}
ApiForExtension
For a given extension target, returns the type of the API that the extension will receive at runtime.
ApiForExtension<Target>
RenderExtensionTarget
A union type containing all of the extension targets that follow the pattern of accepting a [`@remote-ui/core` `RemoteRoot`](https://github.com/Shopify/remote-dom/tree/remote-ui/packages/core) and an additional `api` argument, and using those arguments to render UI.
keyof RenderExtensionTargets
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
A static extension target that is rendered immediately before any actions within each step.
RenderExtension< CheckoutApi & StandardApi<'Checkout::Actions::RenderBefore'>, AnyComponent >
- Checkout::CartLineDetails::RenderAfter
A static extension target that renders on every line item, inside the details under the line item properties element.
RenderExtension< CheckoutApi & CartLineItemApi & StandardApi<'Checkout::CartLineDetails::RenderAfter'> & OrderStatusApi, AnyComponent >
- Checkout::CartLineDetails::RenderLineComponents
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.
RenderExtension< CartLineItemApi & StandardApi<'Checkout::CartLineDetails::RenderLineComponents'>, AnyComponent >
- Checkout::CartLines::RenderAfter
A static extension target that is rendered after all line items.
RenderExtension< CheckoutApi & StandardApi<'Checkout::CartLines::RenderAfter'> & OrderStatusApi, AnyComponent >
- Checkout::Contact::RenderAfter
A static extension target that is rendered immediately after the contact form element.
RenderExtension< CheckoutApi & StandardApi<'Checkout::Contact::RenderAfter'>, AnyComponent >
- Checkout::CustomerInformation::RenderAfter
A static extension target that is rendered after a purchase below the customer information.
RenderExtension< OrderStatusApi & CheckoutApi & StandardApi<'Checkout::CustomerInformation::RenderAfter'>, AnyComponent >
- Checkout::DeliveryAddress::RenderBefore
A static extension target that is rendered between the shipping address header and shipping address form elements.
RenderExtension< CheckoutApi & StandardApi<'Checkout::DeliveryAddress::RenderBefore'>, AnyComponent >
- Checkout::Dynamic::Render
A [block extension target](/docs/api/checkout-ui-extensions/extension-targets-overview#block-extension-targets) that isn't tied to a specific checkout section or feature. Unlike static extension targets, block extension targets render where the merchant sets them using the [checkout editor](/apps/checkout/test-ui-extensions#test-the-extension-in-the-checkout-editor). The [supported locations](/docs/api/checkout-ui-extensions/extension-targets-overview#supported-locations) for block extension targets can be previewed during development by [using a URL parameter](/docs/apps/checkout/best-practices/testing-ui-extensions#block-extension-targets).
RenderExtension< CheckoutApi & OrderStatusApi & StandardApi<'Checkout::Dynamic::Render'>, AnyComponent >
- Checkout::GiftCard::Render
A static extension target that renders the gift card entry form fields after the buyer ticks a box to use a gift card. This does not replace the native gift card entry form which is rendered in a separate part of checkout.
RenderExtension< RedeemableApi & CheckoutApi & StandardApi<'Checkout::GiftCard::Render'>, AnyComponent >
- Checkout::OrderStatus::CartLineDetails::RenderAfter
A static extension target that renders on every line item, inside the details under the line item properties element on the **Order status** page.
RenderExtension< CartLineItemApi & OrderStatusApi & CustomerAccountStandardApi<'Checkout::OrderStatus::CartLineDetails::RenderAfter'>, AnyComponent >
- Checkout::OrderStatus::CartLines::RenderAfter
A static extension target that is rendered after all line items on the **Order status** page.
RenderExtension< OrderStatusApi & CustomerAccountStandardApi<'Checkout::OrderStatus::CartLines::RenderAfter'>, AnyComponent >
- Checkout::OrderStatus::CustomerInformation::RenderAfter
A static extension target that is rendered after a purchase below the customer information on the **Order status** page.
RenderExtension< OrderStatusApi & CustomerAccountStandardApi<'Checkout::OrderStatus::CustomerInformation::RenderAfter'>, AnyComponent >
- Checkout::OrderStatus::Dynamic::Render
A [block extension target](/docs/api/checkout-ui-extensions/extension-targets-overview#block-extension-targets) that renders exclusively on the **Order status** page. Unlike static extension targets, block extension targets render where the merchant sets them using the [checkout editor](/apps/checkout/test-ui-extensions#test-the-extension-in-the-checkout-editor). The [supported locations](/docs/api/checkout-ui-extensions/extension-targets-overview#supported-locations) for block extension targets can be previewed during development by [using a URL parameter](/docs/apps/checkout/best-practices/testing-ui-extensions#block-extension-targets).
RenderExtension< OrderStatusApi & CustomerAccountStandardApi<'Checkout::OrderStatus::Dynamic::Render'>, AnyComponent >
- Checkout::PaymentMethod::HostedFields::RenderAfter
A static extension target that renders after the hosted fields of a credit card payment method. for a credit card payment method when selected by the buyer.
RenderExtension< PaymentOptionItemApi & CheckoutApi & StandardApi<'Checkout::PaymentMethod::HostedFields::RenderAfter'>, AnyComponent >
- Checkout::PaymentMethod::Render
A static extension target that renders the form fields for a payment method when selected by the buyer.
RenderExtension< PaymentOptionItemApi & CheckoutApi & StandardApi<'Checkout::PaymentMethod::Render'>, AnyComponent >
- Checkout::PaymentMethod::RenderRequiredAction
A static extension target that renders a form modal when a buyer selects the custom onsite payment method.
RenderExtension< CheckoutApi & StandardApi<'Checkout::PaymentMethod::RenderRequiredAction'>, AnyComponent >
- Checkout::PickupLocations::RenderAfter
A static extension target that is rendered after pickup location options.
RenderExtension< PickupLocationListApi & CheckoutApi & StandardApi<'Checkout::PickupLocations::RenderAfter'>, AnyComponent >
- Checkout::PickupLocations::RenderBefore
A static extension target that is rendered before pickup location options.
RenderExtension< PickupLocationListApi & CheckoutApi & StandardApi<'Checkout::PickupLocations::RenderBefore'>, AnyComponent >
- Checkout::PickupPoints::RenderAfter
A static extension target that is rendered immediately after the pickup points.
RenderExtension< PickupPointListApi & CheckoutApi & StandardApi<'Checkout::PickupPoints::RenderAfter'>, AnyComponent >
- Checkout::PickupPoints::RenderBefore
A static extension target that is rendered immediately before the pickup points.
RenderExtension< PickupPointListApi & CheckoutApi & StandardApi<'Checkout::PickupPoints::RenderBefore'>, AnyComponent >
- Checkout::Reductions::RenderAfter
A static extension target that is rendered in the order summary, after the discount form and discount tag elements.
RenderExtension< CheckoutApi & StandardApi<'Checkout::Reductions::RenderAfter'>, AnyComponent >
- Checkout::Reductions::RenderBefore
A static extension target that is rendered in the order summary, before the discount form element.
RenderExtension< CheckoutApi & StandardApi<'Checkout::Reductions::RenderBefore'>, AnyComponent >
- Checkout::ShippingMethodDetails::RenderAfter
A static extension target that is rendered after the shipping method details within the shipping method option list, for each option.
RenderExtension< ShippingOptionItemApi & CheckoutApi & StandardApi<'Checkout::ShippingMethodDetails::RenderAfter'>, AnyComponent >
- Checkout::ShippingMethodDetails::RenderExpanded
A static extension target that is rendered under the shipping method within the shipping method option list, for each option.
RenderExtension< ShippingOptionItemApi & CheckoutApi & StandardApi<'Checkout::ShippingMethodDetails::RenderExpanded'>, AnyComponent >
- Checkout::ShippingMethods::RenderAfter
A static extension target that is rendered after the shipping method options.
RenderExtension< ShippingOptionListApi & CheckoutApi & StandardApi<'Checkout::ShippingMethods::RenderAfter'>, AnyComponent >
- Checkout::ShippingMethods::RenderBefore
A static extension target that is rendered between the shipping method header and shipping method options.
RenderExtension< ShippingOptionListApi & CheckoutApi & StandardApi<'Checkout::ShippingMethods::RenderBefore'>, AnyComponent >
- Checkout::ThankYou::CartLineDetails::RenderAfter
A static extension target that renders on every line item, inside the details under the line item properties element on the **Thank you** page.
RenderExtension< OrderConfirmationApi & CartLineItemApi & StandardApi<'Checkout::ThankYou::CartLineDetails::RenderAfter'>, AnyComponent >
- Checkout::ThankYou::CartLines::RenderAfter
A static extension target that is rendered after all line items on the **Thank you** page.
RenderExtension< OrderConfirmationApi & StandardApi<'Checkout::ThankYou::CartLines::RenderAfter'>, AnyComponent >
- Checkout::ThankYou::CustomerInformation::RenderAfter
A static extension target that is rendered after a purchase below the customer information on the **Thank you** page.
RenderExtension< OrderConfirmationApi & StandardApi<'Checkout::ThankYou::CustomerInformation::RenderAfter'>, AnyComponent >
- Checkout::ThankYou::Dynamic::Render
A [block extension target](/docs/api/checkout-ui-extensions/extension-targets-overview#block-extension-targets) that renders exclusively on the **Thank you** page. Unlike static extension targets, block extension targets render where the merchant sets them using the [checkout editor](/apps/checkout/test-ui-extensions#test-the-extension-in-the-checkout-editor). The [supported locations](/docs/api/checkout-ui-extensions/extension-targets-overview#supported-locations) for block extension targets can be previewed during development by [using a URL parameter](/docs/apps/checkout/best-practices/testing-ui-extensions#block-extension-targets).
RenderExtension< OrderConfirmationApi & StandardApi<'Checkout::ThankYou::Dynamic::Render'>, AnyComponent >
- customer-account.order-status.block.render
A [block extension target](/docs/api/checkout-ui-extensions/extension-targets-overview#block-extension-targets) that renders exclusively on the **Order status** page. Unlike static extension targets, block extension targets render where the merchant sets them using the [checkout editor](/apps/checkout/test-ui-extensions#test-the-extension-in-the-checkout-editor). The [supported locations](/docs/api/checkout-ui-extensions/extension-targets-overview#supported-locations) for block extension targets can be previewed during development by [using a URL parameter](/docs/apps/checkout/best-practices/testing-ui-extensions#block-extension-targets).
RenderExtension< OrderStatusApi & CustomerAccountStandardApi<'customer-account.order-status.block.render'>, AnyComponent >
- customer-account.order-status.cart-line-item.render-after
A static extension target that renders on every line item, inside the details under the line item properties element on the **Order status** page.
RenderExtension< CartLineItemApi & OrderStatusApi & CustomerAccountStandardApi<'customer-account.order-status.cart-line-item.render-after'>, AnyComponent >
- customer-account.order-status.cart-line-list.render-after
A static extension target that is rendered after all line items on the **Order status** page.
RenderExtension< OrderStatusApi & CustomerAccountStandardApi<'customer-account.order-status.cart-line-list.render-after'>, AnyComponent >
- customer-account.order-status.customer-information.render-after
A static extension target that is rendered after a purchase below the customer information on the **Order status** page.
RenderExtension< OrderStatusApi & CustomerAccountStandardApi<'customer-account.order-status.customer-information.render-after'>, AnyComponent >
- purchase.cart-line-item.line-components.render
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.
RenderExtension< CartLineItemApi & StandardApi<'purchase.cart-line-item.line-components.render'>, AnyComponent >
- purchase.checkout.actions.render-before
A static extension target that is rendered immediately before any actions within each step.
RenderExtension< CheckoutApi & StandardApi<'purchase.checkout.actions.render-before'>, AnyComponent >
- purchase.checkout.block.render
A [block extension target](/docs/api/checkout-ui-extensions/extension-targets-overview#block-extension-targets) that isn't tied to a specific checkout section or feature. Unlike static extension targets, block extension targets render where the merchant sets them using the [checkout editor](/apps/checkout/test-ui-extensions#test-the-extension-in-the-checkout-editor). The [supported locations](/docs/api/checkout-ui-extensions/extension-targets-overview#supported-locations) for block extension targets can be previewed during development by [using a URL parameter](/docs/apps/checkout/best-practices/testing-ui-extensions#block-extension-targets).
RenderExtension< CheckoutApi & StandardApi<'purchase.checkout.block.render'>, AnyComponent >
- purchase.checkout.cart-line-item.render-after
A static extension target that renders on every line item, inside the details under the line item properties element.
RenderExtension< CheckoutApi & CartLineItemApi & StandardApi<'purchase.checkout.cart-line-item.render-after'>, AnyComponent >
- purchase.checkout.cart-line-list.render-after
A static extension target that is rendered after all line items.
RenderExtension< CheckoutApi & StandardApi<'purchase.checkout.cart-line-list.render-after'>, AnyComponent >
- purchase.checkout.contact.render-after
A static extension target that is rendered immediately after the contact form element.
RenderExtension< CheckoutApi & StandardApi<'purchase.checkout.contact.render-after'>, AnyComponent >
- purchase.checkout.delivery-address.render-after
A static extension target that is rendered after the shipping address form elements.
RenderExtension< CheckoutApi & StandardApi<'purchase.checkout.delivery-address.render-after'>, AnyComponent >
- purchase.checkout.delivery-address.render-before
A static extension target that is rendered between the shipping address header and shipping address form elements.
RenderExtension< CheckoutApi & StandardApi<'purchase.checkout.delivery-address.render-before'>, AnyComponent >
- purchase.checkout.footer.render-after
A static extension target that is rendered below the footer.
RenderExtension< CheckoutApi & StandardApi<'purchase.checkout.footer.render-after'>, AnyComponent >
- purchase.checkout.gift-card.render
A static extension target that renders the gift card entry form fields after the buyer ticks a box to use a gift card. This does not replace the native gift card entry form which is rendered in a separate part of checkout.
RenderExtension< RedeemableApi & CheckoutApi & StandardApi<'purchase.checkout.gift-card.render'>, AnyComponent >
- purchase.checkout.header.render-after
A static extension target that is rendered below the header.
RenderExtension< CheckoutApi & StandardApi<'purchase.checkout.header.render-after'>, AnyComponent >
- purchase.checkout.payment-method-list.render-after
A static extension target that renders below the list of payment methods.
RenderExtension< CheckoutApi & StandardApi<'purchase.checkout.payment-method-list.render-after'>, AnyComponent >
- purchase.checkout.payment-method-list.render-before
A static extension target that renders between the payment heading and payment method list.
RenderExtension< CheckoutApi & StandardApi<'purchase.checkout.payment-method-list.render-before'>, AnyComponent >
- purchase.checkout.payment-option-item.action-required.render
A static extension target that renders a form modal when a buyer selects the custom onsite payment method.
RenderExtension< CheckoutApi & StandardApi<'purchase.checkout.payment-option-item.action-required.render'>, AnyComponent >
- purchase.checkout.payment-option-item.details.render
A static extension target that renders the form fields for a payment method when selected by the buyer.
RenderExtension< PaymentOptionItemApi & CheckoutApi & StandardApi<'purchase.checkout.payment-option-item.details.render'>, AnyComponent >
- purchase.checkout.payment-option-item.hosted-fields.render-after
A static extension target that renders after the hosted fields of a credit card payment method.
RenderExtension< PaymentOptionItemApi & CheckoutApi & StandardApi<'purchase.checkout.payment-option-item.hosted-fields.render-after'>, AnyComponent >
- purchase.checkout.pickup-location-list.render-after
A static extension target that is rendered after pickup location options.
RenderExtension< PickupLocationListApi & CheckoutApi & StandardApi<'purchase.checkout.pickup-location-list.render-after'>, AnyComponent >
- purchase.checkout.pickup-location-list.render-before
A static extension target that is rendered before pickup location options.
RenderExtension< PickupLocationListApi & CheckoutApi & StandardApi<'purchase.checkout.pickup-location-list.render-before'>, AnyComponent >
- purchase.checkout.pickup-location-option-item.render-after
A static extension target that is rendered after the pickup location details within the local pickup option list, for each option.
RenderExtension< PickupLocationItemApi & CheckoutApi & StandardApi<'purchase.checkout.pickup-location-option-item.render-after'>, AnyComponent >
- purchase.checkout.pickup-point-list.render-after
A static extension target that is rendered immediately after the pickup points.
RenderExtension< PickupPointListApi & CheckoutApi & StandardApi<'purchase.checkout.pickup-point-list.render-after'>, AnyComponent >
- purchase.checkout.pickup-point-list.render-before
A static extension target that is rendered immediately before the pickup points.
RenderExtension< PickupPointListApi & CheckoutApi & StandardApi<'purchase.checkout.pickup-point-list.render-before'>, AnyComponent >
- purchase.checkout.reductions.render-after
A static extension target that is rendered in the order summary, after the discount form and discount tag elements.
RenderExtension< CheckoutApi & StandardApi<'purchase.checkout.reductions.render-after'>, AnyComponent >
- purchase.checkout.reductions.render-before
A static extension target that is rendered in the order summary, before the discount form element.
RenderExtension< CheckoutApi & StandardApi<'purchase.checkout.reductions.render-before'>, AnyComponent >
- purchase.checkout.shipping-option-item.details.render
A static extension target that is rendered under the shipping method within the shipping method option list, for each option.
RenderExtension< ShippingOptionItemApi & CheckoutApi & StandardApi<'purchase.checkout.shipping-option-item.details.render'>, AnyComponent >
- purchase.checkout.shipping-option-item.render-after
A static extension target that is rendered after the shipping method details within the shipping method option list, for each option.
RenderExtension< ShippingOptionItemApi & CheckoutApi & StandardApi<'purchase.checkout.shipping-option-item.render-after'>, AnyComponent >
- purchase.checkout.shipping-option-list.render-after
A static extension target that is rendered after the shipping method options.
RenderExtension< ShippingOptionListApi & CheckoutApi & StandardApi<'purchase.checkout.shipping-option-list.render-after'>, AnyComponent >
- purchase.checkout.shipping-option-list.render-before
A static extension target that is rendered between the shipping method header and shipping method options.
RenderExtension< ShippingOptionListApi & CheckoutApi & StandardApi<'purchase.checkout.shipping-option-list.render-before'>, AnyComponent >
- purchase.thank-you.block.render
A [block extension target](/docs/api/checkout-ui-extensions/extension-targets-overview#block-extension-targets) that renders exclusively on the **Thank you** page. Unlike static extension targets, block extension targets render where the merchant sets them using the [checkout editor](/apps/checkout/test-ui-extensions#test-the-extension-in-the-checkout-editor). The [supported locations](/docs/api/checkout-ui-extensions/extension-targets-overview#supported-locations) for block extension targets can be previewed during development by [using a URL parameter](/docs/apps/checkout/best-practices/testing-ui-extensions#block-extension-targets).
RenderExtension< OrderConfirmationApi & StandardApi<'purchase.thank-you.block.render'>, AnyComponent >
- purchase.thank-you.cart-line-item.render-after
A static extension target that renders on every line item, inside the details under the line item properties element on the **Thank you** page.
RenderExtension< OrderConfirmationApi & CartLineItemApi & StandardApi<'purchase.thank-you.cart-line-item.render-after'>, AnyComponent >
- purchase.thank-you.cart-line-list.render-after
A static extension target that is rendered after all line items on the **Thank you** page.
RenderExtension< OrderConfirmationApi & StandardApi<'purchase.thank-you.cart-line-list.render-after'>, AnyComponent >
- purchase.thank-you.customer-information.render-after
A static extension target that is rendered after a purchase below the customer information on the **Thank you** page.
RenderExtension< OrderConfirmationApi & StandardApi<'purchase.thank-you.customer-information.render-after'>, AnyComponent >
- purchase.thank-you.footer.render-after
A static extension target that is rendered below the footer on the **Thank you** page.
RenderExtension< OrderConfirmationApi & StandardApi<'purchase.thank-you.footer.render-after'>, AnyComponent >
- purchase.thank-you.header.render-after
A static extension target that is rendered below the header on the **Thank you** page.
RenderExtension< OrderConfirmationApi & StandardApi<'purchase.thank-you.header.render-after'>, AnyComponent >
export interface RenderExtensionTargets {
/**
* A static extension target that is rendered immediately before any actions within each step.
*/
'purchase.checkout.actions.render-before': RenderExtension<
CheckoutApi & StandardApi<'purchase.checkout.actions.render-before'>,
AnyComponent
>;
/**
* A static extension target that is rendered immediately before any actions within each step.
*
* @deprecated Use `purchase.checkout.actions.render-before` instead.
*/
'Checkout::Actions::RenderBefore': RenderExtension<
CheckoutApi & StandardApi<'Checkout::Actions::RenderBefore'>,
AnyComponent
>;
/**
* A static extension target that is rendered after all line items.
*/
'purchase.checkout.cart-line-list.render-after': RenderExtension<
CheckoutApi & StandardApi<'purchase.checkout.cart-line-list.render-after'>,
AnyComponent
>;
/**
* A static extension target that is rendered after all line items.
*
* @deprecated Use `purchase.checkout.cart-line-list.render-after` instead.
*/
'Checkout::CartLines::RenderAfter': RenderExtension<
CheckoutApi &
StandardApi<'Checkout::CartLines::RenderAfter'> &
OrderStatusApi,
AnyComponent
>;
/**
* A static extension target that renders on every line item, inside the details
* under the line item properties element.
*/
'purchase.checkout.cart-line-item.render-after': RenderExtension<
CheckoutApi &
CartLineItemApi &
StandardApi<'purchase.checkout.cart-line-item.render-after'>,
AnyComponent
>;
/**
* A static extension target that renders on every line item, inside the details
* under the line item properties element.
*
* @deprecated Use `purchase.checkout.cart-line-item.render-after` instead.
*/
'Checkout::CartLineDetails::RenderAfter': RenderExtension<
CheckoutApi &
CartLineItemApi &
StandardApi<'Checkout::CartLineDetails::RenderAfter'> &
OrderStatusApi,
AnyComponent
>;
/**
* 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.
* @private
*/
'purchase.cart-line-item.line-components.render': RenderExtension<
CartLineItemApi &
StandardApi<'purchase.cart-line-item.line-components.render'>,
AnyComponent
>;
/**
* 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.
*
* @deprecated Use `purchase.cart-line-item.line-components.render` instead.
* @private
*/
'Checkout::CartLineDetails::RenderLineComponents': RenderExtension<
CartLineItemApi &
StandardApi<'Checkout::CartLineDetails::RenderLineComponents'>,
AnyComponent
>;
/**
* A static extension target that is rendered immediately after the contact form element.
*/
'purchase.checkout.contact.render-after': RenderExtension<
CheckoutApi & StandardApi<'purchase.checkout.contact.render-after'>,
AnyComponent
>;
/**
* A static extension target that is rendered immediately after the contact form element.
*
* @deprecated Use `purchase.checkout.contact.render-after` instead.
*/
'Checkout::Contact::RenderAfter': RenderExtension<
CheckoutApi & StandardApi<'Checkout::Contact::RenderAfter'>,
AnyComponent
>;
/**
* A static extension target that is rendered after a purchase below the customer information.
*
* @deprecated Use `purchase.thank-you.customer-information.render-after` or
* `customer-account.order-status.customer-information.render-after` from `@shopify/ui-extension/customer-account` instead.
*/
'Checkout::CustomerInformation::RenderAfter': RenderExtension<
OrderStatusApi &
CheckoutApi &
StandardApi<'Checkout::CustomerInformation::RenderAfter'>,
AnyComponent
>;
/**
* A static extension target that is rendered between the shipping address header
* and shipping address form elements.
*/
'purchase.checkout.delivery-address.render-before': RenderExtension<
CheckoutApi &
StandardApi<'purchase.checkout.delivery-address.render-before'>,
AnyComponent
>;
/**
* A static extension target that is rendered between the shipping address header
* and shipping address form elements.
*
* @deprecated Use `purchase.checkout.delivery-address.render-before` instead.
*/
'Checkout::DeliveryAddress::RenderBefore': RenderExtension<
CheckoutApi & StandardApi<'Checkout::DeliveryAddress::RenderBefore'>,
AnyComponent
>;
/**
* A static extension target that is rendered after the shipping address form elements.
*/
'purchase.checkout.delivery-address.render-after': RenderExtension<
CheckoutApi &
StandardApi<'purchase.checkout.delivery-address.render-after'>,
AnyComponent
>;
/**
* A [block extension target](/docs/api/checkout-ui-extensions/extension-targets-overview#block-extension-targets) that isn't tied to a specific checkout section or feature.
* Unlike static extension targets, block extension targets render where the merchant
* sets them using the [checkout editor](/apps/checkout/test-ui-extensions#test-the-extension-in-the-checkout-editor).
*
* The [supported locations](/docs/api/checkout-ui-extensions/extension-targets-overview#supported-locations) for block extension targets can be previewed during development
* by [using a URL parameter](/docs/apps/checkout/best-practices/testing-ui-extensions#block-extension-targets).
*/
'purchase.checkout.block.render': RenderExtension<
CheckoutApi & StandardApi<'purchase.checkout.block.render'>,
AnyComponent
>;
/**
* A [block extension target](/docs/api/checkout-ui-extensions/extension-targets-overview#block-extension-targets) that isn't tied to a specific checkout section or feature.
* Unlike static extension targets, block extension targets render where the merchant
* sets them using the [checkout editor](/apps/checkout/test-ui-extensions#test-the-extension-in-the-checkout-editor).
*
* The [supported locations](/docs/api/checkout-ui-extensions/extension-targets-overview#supported-locations) for block extension targets can be previewed during development
* by [using a URL parameter](/docs/apps/checkout/best-practices/testing-ui-extensions#block-extension-targets).
*
* @deprecated Use `purchase.checkout.block.render` instead.
*/
'Checkout::Dynamic::Render': RenderExtension<
CheckoutApi & OrderStatusApi & StandardApi<'Checkout::Dynamic::Render'>,
AnyComponent
>;
/**
* A [block extension target](/docs/api/checkout-ui-extensions/extension-targets-overview#block-extension-targets) that renders exclusively on the **Thank you** page.
* Unlike static extension targets, block extension targets render where the merchant
* sets them using the [checkout editor](/apps/checkout/test-ui-extensions#test-the-extension-in-the-checkout-editor).
*
* The [supported locations](/docs/api/checkout-ui-extensions/extension-targets-overview#supported-locations) for block extension targets can be previewed during development
* by [using a URL parameter](/docs/apps/checkout/best-practices/testing-ui-extensions#block-extension-targets).
*
*/
'purchase.thank-you.block.render': RenderExtension<
OrderConfirmationApi & StandardApi<'purchase.thank-you.block.render'>,
AnyComponent
>;
/**
* A [block extension target](/docs/api/checkout-ui-extensions/extension-targets-overview#block-extension-targets) that renders exclusively on the **Thank you** page.
* Unlike static extension targets, block extension targets render where the merchant
* sets them using the [checkout editor](/apps/checkout/test-ui-extensions#test-the-extension-in-the-checkout-editor).
*
* The [supported locations](/docs/api/checkout-ui-extensions/extension-targets-overview#supported-locations) for block extension targets can be previewed during development
* by [using a URL parameter](/docs/apps/checkout/best-practices/testing-ui-extensions#block-extension-targets).
*
* @deprecated Use `purchase.thank-you.block.render` instead.
*/
'Checkout::ThankYou::Dynamic::Render': RenderExtension<
OrderConfirmationApi & StandardApi<'Checkout::ThankYou::Dynamic::Render'>,
AnyComponent
>;
/**
* A static extension target that renders on every line item, inside the details
* under the line item properties element on the **Thank you** page.
*/
'purchase.thank-you.cart-line-item.render-after': RenderExtension<
OrderConfirmationApi &
CartLineItemApi &
StandardApi<'purchase.thank-you.cart-line-item.render-after'>,
AnyComponent
>;
/**
* A static extension target that renders on every line item, inside the details
* under the line item properties element on the **Thank you** page.
*
* @deprecated Use `purchase.thank-you.cart-line-item.render-after` instead.
*/
'Checkout::ThankYou::CartLineDetails::RenderAfter': RenderExtension<
OrderConfirmationApi &
CartLineItemApi &
StandardApi<'Checkout::ThankYou::CartLineDetails::RenderAfter'>,
AnyComponent
>;
/**
* A static extension target that is rendered after all line items on the **Thank you** page.
*/
'purchase.thank-you.cart-line-list.render-after': RenderExtension<
OrderConfirmationApi &
StandardApi<'purchase.thank-you.cart-line-list.render-after'>,
AnyComponent
>;
/**
* A static extension target that is rendered after all line items on the **Thank you** page.
*
* @deprecated Use `purchase.thank-you.cart-line-list.render-after` instead.
*/
'Checkout::ThankYou::CartLines::RenderAfter': RenderExtension<
OrderConfirmationApi &
StandardApi<'Checkout::ThankYou::CartLines::RenderAfter'>,
AnyComponent
>;
/**
* A static extension target that is rendered after a purchase below the customer information on the **Thank you** page.
*/
'purchase.thank-you.customer-information.render-after': RenderExtension<
OrderConfirmationApi &
StandardApi<'purchase.thank-you.customer-information.render-after'>,
AnyComponent
>;
/**
* A static extension target that is rendered after a purchase below the customer information on the **Thank you** page.
*
* @deprecated Use `purchase.thank-you.customer-information.render-after` instead.
*/
'Checkout::ThankYou::CustomerInformation::RenderAfter': RenderExtension<
OrderConfirmationApi &
StandardApi<'Checkout::ThankYou::CustomerInformation::RenderAfter'>,
AnyComponent
>;
/**
* A [block extension target](/docs/api/checkout-ui-extensions/extension-targets-overview#block-extension-targets) that renders exclusively on the **Order status** page.
* Unlike static extension targets, block extension targets render where the merchant
* sets them using the [checkout editor](/apps/checkout/test-ui-extensions#test-the-extension-in-the-checkout-editor).
*
* The [supported locations](/docs/api/checkout-ui-extensions/extension-targets-overview#supported-locations) for block extension targets can be previewed during development
* by [using a URL parameter](/docs/apps/checkout/best-practices/testing-ui-extensions#block-extension-targets).
*
* @deprecated Use `customer-account.order-status.block.render` from `@shopify/ui-extension/customer-account` instead.
*/
'customer-account.order-status.block.render': RenderExtension<
OrderStatusApi &
CustomerAccountStandardApi<'customer-account.order-status.block.render'>,
AnyComponent
>;
/**
* A [block extension target](/docs/api/checkout-ui-extensions/extension-targets-overview#block-extension-targets) that renders exclusively on the **Order status** page.
* Unlike static extension targets, block extension targets render where the merchant
* sets them using the [checkout editor](/apps/checkout/test-ui-extensions#test-the-extension-in-the-checkout-editor).
*
* The [supported locations](/docs/api/checkout-ui-extensions/extension-targets-overview#supported-locations) for block extension targets can be previewed during development
* by [using a URL parameter](/docs/apps/checkout/best-practices/testing-ui-extensions#block-extension-targets).
*
* @deprecated Use `customer-account.order-status.block.render` from `@shopify/ui-extension/customer-account` instead.
*/
'Checkout::OrderStatus::Dynamic::Render': RenderExtension<
OrderStatusApi &
CustomerAccountStandardApi<'Checkout::OrderStatus::Dynamic::Render'>,
AnyComponent
>;
/**
* A static extension target that renders on every line item, inside the details
* under the line item properties element on the **Order status** page.
*
* @deprecated Use `customer-account.order-status.cart-line-item.render-after` from `@shopify/ui-extension/customer-account` instead.
*/
'customer-account.order-status.cart-line-item.render-after': RenderExtension<
CartLineItemApi &
OrderStatusApi &
CustomerAccountStandardApi<'customer-account.order-status.cart-line-item.render-after'>,
AnyComponent
>;
/**
* A static extension target that renders on every line item, inside the details
* under the line item properties element on the **Order status** page.
*
* @deprecated Use `customer-account.order-status.cart-line-item.render-after` instead.
*/
'Checkout::OrderStatus::CartLineDetails::RenderAfter': RenderExtension<
CartLineItemApi &
OrderStatusApi &
CustomerAccountStandardApi<'Checkout::OrderStatus::CartLineDetails::RenderAfter'>,
AnyComponent
>;
/**
* A static extension target that is rendered after all line items on the **Order status** page.
*
* @deprecated Use `customer-account.order-status.cart-line-list.render-after` from `@shopify/ui-extension/customer-account` instead.
*/
'customer-account.order-status.cart-line-list.render-after': RenderExtension<
OrderStatusApi &
CustomerAccountStandardApi<'customer-account.order-status.cart-line-list.render-after'>,
AnyComponent
>;
/**
* A static extension target that is rendered after all line items on the **Order status** page.
*
* @deprecated Use `customer-account.order-status.cart-line-list.render-after` from `@shopify/ui-extension/customer-account` instead.
*/
'Checkout::OrderStatus::CartLines::RenderAfter': RenderExtension<
OrderStatusApi &
CustomerAccountStandardApi<'Checkout::OrderStatus::CartLines::RenderAfter'>,
AnyComponent
>;
/**
* A static extension target that is rendered after a purchase below the customer information on the **Order status** page.
*
* @deprecated Use `customer-account.order-status.customer-information.render-after` from `@shopify/ui-extension/customer-account` instead.
*/
'customer-account.order-status.customer-information.render-after': RenderExtension<
OrderStatusApi &
CustomerAccountStandardApi<'customer-account.order-status.customer-information.render-after'>,
AnyComponent
>;
/**
* A static extension target that is rendered after a purchase below the customer information on the **Order status** page.
*
* @deprecated Use `customer-account.order-status.customer-information.render-after` from `@shopify/ui-extension/customer-account` instead.
*/
'Checkout::OrderStatus::CustomerInformation::RenderAfter': RenderExtension<
OrderStatusApi &
CustomerAccountStandardApi<'Checkout::OrderStatus::CustomerInformation::RenderAfter'>,
AnyComponent
>;
/**
* A static extension target that renders the gift card entry form fields after
* the buyer ticks a box to use a gift card. This does not replace the
* native gift card entry form which is rendered in a separate part of checkout.
*
* @private
*/
'purchase.checkout.gift-card.render': RenderExtension<
RedeemableApi &
CheckoutApi &
StandardApi<'purchase.checkout.gift-card.render'>,
AnyComponent
>;
/**
* A static extension target that renders the gift card entry form fields after
* the buyer ticks a box to use a gift card. This does not replace the
* native gift card entry form which is rendered in a separate part of checkout.
*
* @private
* @deprecated Use `purchase.checkout.gift-card.render` instead.
*/
'Checkout::GiftCard::Render': RenderExtension<
RedeemableApi & CheckoutApi & StandardApi<'Checkout::GiftCard::Render'>,
AnyComponent
>;
/**
* A static extension target that renders the form fields for a payment method when selected by the buyer.
*
* @private
*/
'purchase.checkout.payment-option-item.details.render': RenderExtension<
PaymentOptionItemApi &
CheckoutApi &
StandardApi<'purchase.checkout.payment-option-item.details.render'>,
AnyComponent
>;
/**
* A static extension target that renders the form fields for a payment method when selected by the buyer.
*
* @private
* @deprecated Use `purchase.checkout.payment-option-item.details.render` instead.
*/
'Checkout::PaymentMethod::Render': RenderExtension<
PaymentOptionItemApi &
CheckoutApi &
StandardApi<'Checkout::PaymentMethod::Render'>,
AnyComponent
>;
/**
* A static extension target that renders after the hosted fields of a credit card payment method.
*
* @private
*/
'purchase.checkout.payment-option-item.hosted-fields.render-after': RenderExtension<
PaymentOptionItemApi &
CheckoutApi &
StandardApi<'purchase.checkout.payment-option-item.hosted-fields.render-after'>,
AnyComponent
>;
/**
* A static extension target that renders after the hosted fields of a credit card payment method.
* for a credit card payment method when selected by the buyer.
*
* @private
* @deprecated Use `purchase.checkout.payment-option-item.hosted-fields.render-after` instead.
*/
'Checkout::PaymentMethod::HostedFields::RenderAfter': RenderExtension<
PaymentOptionItemApi &
CheckoutApi &
StandardApi<'Checkout::PaymentMethod::HostedFields::RenderAfter'>,
AnyComponent
>;
/**
* A static extension target that renders a form modal when a buyer selects the custom onsite payment method.
*
* @private
*/
'purchase.checkout.payment-option-item.action-required.render': RenderExtension<
CheckoutApi &
StandardApi<'purchase.checkout.payment-option-item.action-required.render'>,
AnyComponent
>;
/**
* A static extension target that renders a form modal when a buyer selects the custom onsite payment method.
*
* @private
* @deprecated Use `purchase.checkout.payment-option-item.action-required.render` instead.
*/
'Checkout::PaymentMethod::RenderRequiredAction': RenderExtension<
CheckoutApi & StandardApi<'Checkout::PaymentMethod::RenderRequiredAction'>,
AnyComponent
>;
/**
* A static extension target that renders between the payment heading and payment method list.
*
*/
'purchase.checkout.payment-method-list.render-before': RenderExtension<
CheckoutApi &
StandardApi<'purchase.checkout.payment-method-list.render-before'>,
AnyComponent
>;
/**
* A static extension target that renders below the list of payment methods.
*
*/
'purchase.checkout.payment-method-list.render-after': RenderExtension<
CheckoutApi &
StandardApi<'purchase.checkout.payment-method-list.render-after'>,
AnyComponent
>;
/**
* A static extension target that is rendered in the order summary, before the discount form element.
*/
'purchase.checkout.reductions.render-before': RenderExtension<
CheckoutApi & StandardApi<'purchase.checkout.reductions.render-before'>,
AnyComponent
>;
/**
* A static extension target that is rendered in the order summary, before the discount form element.
*
* @deprecated Use `purchase.checkout.reductions.render-before` instead.
*/
'Checkout::Reductions::RenderBefore': RenderExtension<
CheckoutApi & StandardApi<'Checkout::Reductions::RenderBefore'>,
AnyComponent
>;
/**
* A static extension target that is rendered in the order summary, after the discount form
* and discount tag elements.
*/
'purchase.checkout.reductions.render-after': RenderExtension<
CheckoutApi & StandardApi<'purchase.checkout.reductions.render-after'>,
AnyComponent
>;
/**
* A static extension target that is rendered in the order summary, after the discount form
* and discount tag elements.
*
* @deprecated Use `purchase.checkout.reductions.render-after` instead.
*/
'Checkout::Reductions::RenderAfter': RenderExtension<
CheckoutApi & StandardApi<'Checkout::Reductions::RenderAfter'>,
AnyComponent
>;
/**
* A static extension target that is rendered between the shipping method
* header and shipping method options.
*/
'purchase.checkout.shipping-option-list.render-before': RenderExtension<
ShippingOptionListApi &
CheckoutApi &
StandardApi<'purchase.checkout.shipping-option-list.render-before'>,
AnyComponent
>;
/**
* A static extension target that is rendered between the shipping method
* header and shipping method options.
*
* @deprecated Use `purchase.checkout.shipping-option-list.render-before` instead.
*/
'Checkout::ShippingMethods::RenderBefore': RenderExtension<
ShippingOptionListApi &
CheckoutApi &
StandardApi<'Checkout::ShippingMethods::RenderBefore'>,
AnyComponent
>;
/**
* A static extension target that is rendered after the shipping method
* options.
*/
'purchase.checkout.shipping-option-list.render-after': RenderExtension<
ShippingOptionListApi &
CheckoutApi &
StandardApi<'purchase.checkout.shipping-option-list.render-after'>,
AnyComponent
>;
/**
* A static extension target that is rendered after the shipping method
* options.
*
* @deprecated Use `purchase.checkout.shipping-option-list.render-after` instead.
*/
'Checkout::ShippingMethods::RenderAfter': RenderExtension<
ShippingOptionListApi &
CheckoutApi &
StandardApi<'Checkout::ShippingMethods::RenderAfter'>,
AnyComponent
>;
/**
* A static extension target that is rendered before pickup location options.
*/
'purchase.checkout.pickup-location-list.render-before': RenderExtension<
PickupLocationListApi &
CheckoutApi &
StandardApi<'purchase.checkout.pickup-location-list.render-before'>,
AnyComponent
>;
/**
* A static extension target that is rendered before pickup location options.
*
* @deprecated Use `purchase.checkout.pickup-location-list.render-before` instead.
*/
'Checkout::PickupLocations::RenderBefore': RenderExtension<
PickupLocationListApi &
CheckoutApi &
StandardApi<'Checkout::PickupLocations::RenderBefore'>,
AnyComponent
>;
/**
* A static extension target that is rendered after pickup location options.
*/
'purchase.checkout.pickup-location-list.render-after': RenderExtension<
PickupLocationListApi &
CheckoutApi &
StandardApi<'purchase.checkout.pickup-location-list.render-after'>,
AnyComponent
>;
/**
* A static extension target that is rendered after pickup location options.
*
* @deprecated Use `purchase.checkout.pickup-location-list.render-after` instead.
*/
'Checkout::PickupLocations::RenderAfter': RenderExtension<
PickupLocationListApi &
CheckoutApi &
StandardApi<'Checkout::PickupLocations::RenderAfter'>,
AnyComponent
>;
/**
* A static extension target that is rendered after the shipping method
* details within the shipping method option list, for each option.
*/
'purchase.checkout.shipping-option-item.render-after': RenderExtension<
ShippingOptionItemApi &
CheckoutApi &
StandardApi<'purchase.checkout.shipping-option-item.render-after'>,
AnyComponent
>;
/**
* A static extension target that is rendered after the shipping method
* details within the shipping method option list, for each option.
*
* @deprecated Use `purchase.checkout.shipping-option-item.render-after` instead.
*/
'Checkout::ShippingMethodDetails::RenderAfter': RenderExtension<
ShippingOptionItemApi &
CheckoutApi &
StandardApi<'Checkout::ShippingMethodDetails::RenderAfter'>,
AnyComponent
>;
/**
* A static extension target that is rendered under the shipping method
* within the shipping method option list, for each option.
*/
'purchase.checkout.shipping-option-item.details.render': RenderExtension<
ShippingOptionItemApi &
CheckoutApi &
StandardApi<'purchase.checkout.shipping-option-item.details.render'>,
AnyComponent
>;
/**
* A static extension target that is rendered under the shipping method
* within the shipping method option list, for each option.
*
* @deprecated Use `purchase.checkout.shipping-option-item.details.render` instead.
*/
'Checkout::ShippingMethodDetails::RenderExpanded': RenderExtension<
ShippingOptionItemApi &
CheckoutApi &
StandardApi<'Checkout::ShippingMethodDetails::RenderExpanded'>,
AnyComponent
>;
/**
* A static extension target that is rendered immediately before the pickup points.
*/
'purchase.checkout.pickup-point-list.render-before': RenderExtension<
PickupPointListApi &
CheckoutApi &
StandardApi<'purchase.checkout.pickup-point-list.render-before'>,
AnyComponent
>;
/**
* A static extension target that is rendered immediately before the pickup points.
*
* @deprecated Use `purchase.checkout.pickup-point-list.render-before` instead.
*/
'Checkout::PickupPoints::RenderBefore': RenderExtension<
PickupPointListApi &
CheckoutApi &
StandardApi<'Checkout::PickupPoints::RenderBefore'>,
AnyComponent
>;
/**
* A static extension target that is rendered immediately after the pickup points.
*/
'purchase.checkout.pickup-point-list.render-after': RenderExtension<
PickupPointListApi &
CheckoutApi &
StandardApi<'purchase.checkout.pickup-point-list.render-after'>,
AnyComponent
>;
/**
* A static extension target that is rendered immediately after the pickup points.
*
* @deprecated Use `purchase.checkout.pickup-point-list.render-after` instead.
*/
'Checkout::PickupPoints::RenderAfter': RenderExtension<
PickupPointListApi &
CheckoutApi &
StandardApi<'Checkout::PickupPoints::RenderAfter'>,
AnyComponent
>;
/**
* A static extension target that is rendered after the pickup location
* details within the local pickup option list, for each option.
*/
'purchase.checkout.pickup-location-option-item.render-after': RenderExtension<
PickupLocationItemApi &
CheckoutApi &
StandardApi<'purchase.checkout.pickup-location-option-item.render-after'>,
AnyComponent
>;
/**
* A static extension target that is rendered below the header.
*/
'purchase.checkout.header.render-after': RenderExtension<
CheckoutApi & StandardApi<'purchase.checkout.header.render-after'>,
AnyComponent
>;
/**
* A static extension target that is rendered below the footer.
*/
'purchase.checkout.footer.render-after': RenderExtension<
CheckoutApi & StandardApi<'purchase.checkout.footer.render-after'>,
AnyComponent
>;
/**
* A static extension target that is rendered below the header on the **Thank you** page.
*/
'purchase.thank-you.header.render-after': RenderExtension<
OrderConfirmationApi &
StandardApi<'purchase.thank-you.header.render-after'>,
AnyComponent
>;
/**
* A static extension target that is rendered below the footer on the **Thank you** page.
*/
'purchase.thank-you.footer.render-after': RenderExtension<
OrderConfirmationApi &
StandardApi<'purchase.thank-you.footer.render-after'>,
AnyComponent
>;
}
RenderExtension
export interface RenderExtension<
Api,
AllowedComponents extends RemoteComponentType<
string,
any,
any
> = RemoteComponentType<any, any, any>,
> {
(
connection: RenderExtensionConnection<AllowedComponents>,
api: Api,
): void | Promise<void>;
}
CheckoutApi
- applyAttributeChange
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`](/docs/api/checkout-ui-extensions/apis/attributes#standardapi-propertydetail-attributes) property. > Note: This method will return an error if the [cart instruction](/docs/api/checkout-ui-extensions/apis/cart-instructions#standardapi-propertydetail-instructions) `attributes.canUpdateAttributes` is false, or the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay.
(change: AttributeUpdateChange) => Promise<AttributeChangeResult>
- applyCartLinesChange
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`](/docs/api/checkout-ui-extensions/apis/cart-lines#standardapi-propertydetail-lines) property. > Note: This method will return an error if the [cart instruction](/docs/api/checkout-ui-extensions/apis/cart-instructions#standardapi-propertydetail-instructions) `lines.canAddCartLine` is false, or the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay.
(change: CartLineChange) => Promise<CartLineChangeResult>
- applyDiscountCodeChange
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`](/docs/api/checkout-ui-extensions/apis/discounts#standardapi-propertydetail-discountcodes) property. > Caution: > See [security considerations](/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 [cart instruction](/docs/api/checkout-ui-extensions/apis/cart-instructions#standardapi-propertydetail-instructions) `discounts.canUpdateDiscountCodes` is false, or the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay.
(change: DiscountCodeChange) => Promise<DiscountCodeChangeResult>
- applyGiftCardChange
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`](/docs/api/checkout-ui-extensions/apis/gift-cards#standardapi-propertydetail-appliedgiftcards) property. > Caution: > See [security considerations](/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.
(change: GiftCardChange) => Promise<GiftCardChangeResult>
- applyMetafieldChange
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`](/docs/api/checkout-ui-extensions/apis/metafields#standardapi-propertydetail-metafields) property. > Note: This method will return an error if the [cart instruction](/docs/api/checkout-ui-extensions/apis/cart-instructions#standardapi-propertydetail-instructions) `metafields.canSetCartMetafields` is false, or the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay.
(change: MetafieldChange) => Promise<MetafieldChangeResult>
- applyNoteChange
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`](/docs/api/checkout-ui-extensions/apis/note#standardapi-propertydetail-note) property. > Note: This method will return an error if the [cart instruction](/docs/api/checkout-ui-extensions/apis/cart-instructions#standardapi-propertydetail-instructions) `notes.canUpdateNote` is false, or the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay.
(change: NoteChange) => Promise<NoteChangeResult>
- applyShippingAddressChange
Performs an update of the shipping address. Shipping address changes will completely overwrite the existing shipping address added by the user without any prompts. If successful, this mutation results in an update to the value retrieved through the `shippingAddress` property. > Note: This method will return an error if the [cart instruction](/docs/api/checkout-ui-extensions/apis/cart-instructions#standardapi-propertydetail-instructions) `delivery.canSelectCustomAddress` is false, or the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay. {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
(change: ShippingAddressUpdateChange) => Promise<ShippingAddressChangeResult>
- experimentalIsShopAppStyle
boolean
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`](/docs/api/checkout-ui-extensions/apis/attributes#standardapi-propertydetail-attributes) property.
*
* > Note: This method will return an error if the [cart instruction](/docs/api/checkout-ui-extensions/apis/cart-instructions#standardapi-propertydetail-instructions) `attributes.canUpdateAttributes` is false, or the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay.
*/
applyAttributeChange(change: AttributeChange): Promise<AttributeChangeResult>;
/**
* 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`](/docs/api/checkout-ui-extensions/apis/cart-lines#standardapi-propertydetail-lines)
* property.
*
* > Note: This method will return an error if the [cart instruction](/docs/api/checkout-ui-extensions/apis/cart-instructions#standardapi-propertydetail-instructions) `lines.canAddCartLine` is false, or the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay.
*/
applyCartLinesChange(change: CartLineChange): Promise<CartLineChangeResult>;
/**
* 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`](/docs/api/checkout-ui-extensions/apis/discounts#standardapi-propertydetail-discountcodes) property.
*
* > Caution:
* > See [security considerations](/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 [cart instruction](/docs/api/checkout-ui-extensions/apis/cart-instructions#standardapi-propertydetail-instructions) `discounts.canUpdateDiscountCodes` is false, or the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay.
*/
applyDiscountCodeChange(
change: DiscountCodeChange,
): Promise<DiscountCodeChangeResult>;
/**
* 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`](/docs/api/checkout-ui-extensions/apis/gift-cards#standardapi-propertydetail-appliedgiftcards) property.
*
* > Caution:
* > See [security considerations](/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<GiftCardChangeResult>;
/**
* 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`](/docs/api/checkout-ui-extensions/apis/metafields#standardapi-propertydetail-metafields) property.
*
* > Note: This method will return an error if the [cart instruction](/docs/api/checkout-ui-extensions/apis/cart-instructions#standardapi-propertydetail-instructions) `metafields.canSetCartMetafields` is false, or the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay.
*/
applyMetafieldChange(change: MetafieldChange): Promise<MetafieldChangeResult>;
/**
* 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`](/docs/api/checkout-ui-extensions/apis/note#standardapi-propertydetail-note) property.
*
* > Note: This method will return an error if the [cart instruction](/docs/api/checkout-ui-extensions/apis/cart-instructions#standardapi-propertydetail-instructions) `notes.canUpdateNote` is false, or the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay.
*/
applyNoteChange(change: NoteChange): Promise<NoteChangeResult>;
/**
* @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.
*
* > Note: This method will return an error if the [cart instruction](/docs/api/checkout-ui-extensions/apis/cart-instructions#standardapi-propertydetail-instructions) `delivery.canSelectCustomAddress` is false, or the buyer is using an accelerated checkout method, such as Apple Pay, Google Pay, or Meta Pay.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
*/
applyShippingAddressChange?(
change: ShippingAddressChange,
): Promise<ShippingAddressChangeResult>;
}
AttributeUpdateChange
Updates an attribute on the order. If an attribute with the provided key does not already exist, it gets created.
- key
Key of the attribute to add or update
string
- type
The type of the `AttributeUpdateChange` API.
"updateAttribute"
- value
Value for the attribute to add or update
string
export interface AttributeUpdateChange {
/**
* The type of the `AttributeUpdateChange` API.
*/
type: 'updateAttribute';
/**
* Key of the attribute to add or update
*/
key: string;
/**
* Value for the attribute to add or update
*/
value: string;
}
Attribute
- key
The key for the attribute.
string
- value
The value for the attribute.
string
export interface Attribute {
/**
* The key for the attribute.
*/
key: string;
/**
* The value for the attribute.
*/
value: string;
}
AttributeChangeResult
AttributeChangeResultSuccess | AttributeChangeResultError
AttributeChangeResultSuccess
The returned result of a successful update to an attribute.
- type
The type of the `AttributeChangeResultSuccess` API.
"success"
export interface AttributeChangeResultSuccess {
/**
* The type of the `AttributeChangeResultSuccess` API.
*/
type: 'success';
}
AttributeChangeResultError
The returned result of an unsuccessful update to an attribute with a message detailing the type of error that occurred.
- message
A message that explains the error. This message is useful for debugging. It is **not** localized, and therefore should not be presented directly to the buyer.
string
- type
The type of the `AttributeChangeResultError` API.
"error"
export interface AttributeChangeResultError {
/**
* The type of the `AttributeChangeResultError` API.
*/
type: 'error';
/**
* A message that explains the error. This message is useful for debugging.
* It is **not** localized, and therefore should not be presented directly
* to the buyer.
*/
message: string;
}
CartLineChange
CartLineAddChange | CartLineRemoveChange | CartLineUpdateChange
CartLineAddChange
- attributes
The attributes associated with the line item.
Attribute[]
- merchandiseId
The merchandise ID being added.
string
- quantity
The quantity of the merchandise being added.
number
- sellingPlanId
The identifier of the selling plan that the merchandise is being purchased with.
string
- type
An identifier for changes that add line items.
"addCartLine"
export interface CartLineAddChange {
/**
* An identifier for changes that add line items.
*/
type: 'addCartLine';
/**
* The merchandise ID being added.
* @example 'gid://shopify/ProductVariant/123'
*/
merchandiseId: string;
/**
* The quantity of the merchandise being added.
*/
quantity: number;
/**
* The attributes associated with the line item.
*/
attributes?: Attribute[];
/**
* The identifier of the selling plan that the merchandise is being purchased
* with.
*/
sellingPlanId?: SellingPlan['id'];
}
CartLine
- attributes
The line item additional custom attributes.
Attribute[]
- cost
The details about the cost components attributed to the cart line.
CartLineCost
- discountAllocations
Discounts applied to the cart line.
CartDiscountAllocation[]
- id
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.
string
- lineComponents
Sub lines of the merchandise line. If no sub lines are present, this will be an empty array.
CartBundleLineComponent[]
- merchandise
The merchandise being purchased.
Merchandise
- quantity
The quantity of the merchandise being purchased.
number
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[];
}
CartLineCost
- totalAmount
The total amount after reductions the buyer can expect to pay that is directly attributable to a single cart line.
Money
export interface CartLineCost {
/**
* The total amount after reductions the buyer can expect to pay that is directly attributable to a single
* cart line.
*/
totalAmount: Money;
}
Money
- amount
The price amount.
number
- currencyCode
The ISO 4217 format for the currency.
CurrencyCode
export interface Money {
/**
* The price amount.
*/
amount: number;
/**
* The ISO 4217 format for the currency.
* @example 'CAD' for Canadian dollar
*/
currencyCode: CurrencyCode;
}
CurrencyCode
'AED' | 'AFN' | 'ALL' | 'AMD' | 'ANG' | 'AOA' | 'ARS' | 'AUD' | 'AWG' | 'AZN' | 'BAM' | 'BBD' | 'BDT' | 'BGN' | 'BHD' | 'BIF' | 'BMD' | 'BND' | 'BOB' | 'BOV' | 'BRL' | 'BSD' | 'BTN' | 'BWP' | 'BYN' | 'BZD' | 'CAD' | 'CDF' | 'CHE' | 'CHF' | 'CHW' | 'CLF' | 'CLP' | 'CNY' | 'COP' | 'COU' | 'CRC' | 'CUC' | 'CUP' | 'CVE' | 'CZK' | 'DJF' | 'DKK' | 'DOP' | 'DZD' | 'EGP' | 'ERN' | 'ETB' | 'EUR' | 'FJD' | 'FKP' | 'GBP' | 'GEL' | 'GHS' | 'GIP' | 'GMD' | 'GNF' | 'GTQ' | 'GYD' | 'HKD' | 'HNL' | 'HRK' | 'HTG' | 'HUF' | 'IDR' | 'ILS' | 'INR' | 'IQD' | 'IRR' | 'ISK' | 'JMD' | 'JOD' | 'JPY' | 'KES' | 'KGS' | 'KHR' | 'KMF' | 'KPW' | 'KRW' | 'KWD' | 'KYD' | 'KZT' | 'LAK' | 'LBP' | 'LKR' | 'LRD' | 'LSL' | 'LYD' | 'MAD' | 'MDL' | 'MGA' | 'MKD' | 'MMK' | 'MNT' | 'MOP' | 'MRU' | 'MUR' | 'MVR' | 'MWK' | 'MXN' | 'MXV' | 'MYR' | 'MZN' | 'NAD' | 'NGN' | 'NIO' | 'NOK' | 'NPR' | 'NZD' | 'OMR' | 'PAB' | 'PEN' | 'PGK' | 'PHP' | 'PKR' | 'PLN' | 'PYG' | 'QAR' | 'RON' | 'RSD' | 'RUB' | 'RWF' | 'SAR' | 'SBD' | 'SCR' | 'SDG' | 'SEK' | 'SGD' | 'SHP' | 'SLL' | 'SOS' | 'SRD' | 'SSP' | 'STN' | 'SVC' | 'SYP' | 'SZL' | 'THB' | 'TJS' | 'TMT' | 'TND' | 'TOP' | 'TRY' | 'TTD' | 'TWD' | 'TZS' | 'UAH' | 'UGX' | 'USD' | 'USN' | 'UYI' | 'UYU' | 'UYW' | 'UZS' | 'VES' | 'VND' | 'VUV' | 'WST' | 'XAF' | 'XAG' | 'XAU' | 'XBA' | 'XBB' | 'XBC' | 'XBD' | 'XCD' | 'XDR' | 'XOF' | 'XPD' | 'XPF' | 'XPT' | 'XSU' | 'XTS' | 'XUA' | 'XXX' | 'YER' | 'ZAR' | 'ZMW' | 'ZWL'
CartDiscountAllocation
CartCodeDiscountAllocation | CartAutomaticDiscountAllocation | CartCustomDiscountAllocation
CartCodeDiscountAllocation
- code
The code for the discount
string
- discountedAmount
The money amount that has been discounted from the order
Money
- type
The type of the code discount
"code"
export interface CartCodeDiscountAllocation extends CartDiscountAllocationBase {
/**
* The code for the discount
*/
code: string;
/**
* The type of the code discount
*/
type: 'code';
}
CartAutomaticDiscountAllocation
- discountedAmount
The money amount that has been discounted from the order
Money
- title
The title of the automatic discount
string
- type
The type of the automatic discount
"automatic"
export interface CartAutomaticDiscountAllocation
extends CartDiscountAllocationBase {
/**
* The title of the automatic discount
*/
title: string;
/**
* The type of the automatic discount
*/
type: 'automatic';
}
CartCustomDiscountAllocation
- discountedAmount
The money amount that has been discounted from the order
Money
- title
The title of the custom discount
string
- type
The type of the custom discount
"custom"
export interface CartCustomDiscountAllocation
extends CartDiscountAllocationBase {
/**
* The title of the custom discount
*/
title: string;
/**
* The type of the custom discount
*/
type: 'custom';
}
CartBundleLineComponent
- attributes
Additional custom attributes for the bundle line component.
Attribute[]
- cost
The cost attributed to this bundle line component.
CartLineCost
- id
A unique identifier for the bundle line component. This ID is not stable. If an operation updates the line items in any way, all IDs could change.
string
- merchandise
The merchandise of this bundle line component.
Merchandise
- quantity
The quantity of merchandise being purchased.
number
- type
"bundle"
export interface CartBundleLineComponent {
type: 'bundle';
/**
* A unique identifier for the bundle line component.
*
* This ID is not stable. If an operation updates the line items in any way, all IDs could change.
*
* @example 'gid://shopify/CartLineComponent/123'
*/
id: string;
/**
* The merchandise of this bundle line component.
*/
merchandise: Merchandise;
/**
* The quantity of merchandise being purchased.
*/
quantity: number;
/**
* The cost attributed to this bundle line component.
*/
cost: CartLineCost;
/**
* Additional custom attributes for the bundle line component.
*
* @example [{key: 'engraving', value: 'hello world'}]
*/
attributes: Attribute[];
}
Merchandise
- id
A globally-unique identifier.
string
- image
Image associated with the product variant. This field falls back to the product image if no image is available.
ImageDetails
- product
The product object that the product variant belongs to.
Product
- requiresShipping
Whether or not the product requires shipping.
boolean
- selectedOptions
List of product options applied to the variant.
SelectedOption[]
- sellingPlan
The selling plan associated with the merchandise.
SellingPlan
- sku
The product variant's sku.
string
- subtitle
The product variant's subtitle.
string
- title
The product variant’s title.
string
- type
"variant"
ProductVariant
ImageDetails
- altText
The alternative text for the image.
string
- url
The image URL.
string
export interface ImageDetails {
/**
* The image URL.
*/
url: string;
/**
* The alternative text for the image.
*/
altText?: string;
}
Product
- id
A globally-unique identifier.
string
- productType
A categorization that a product can be tagged with, commonly used for filtering and searching.
string
- vendor
The product’s vendor name.
string
export interface Product {
/**
* A globally-unique identifier.
*/
id: string;
/**
* The product’s vendor name.
*/
vendor: string;
/**
* A categorization that a product can be tagged with, commonly used for filtering and searching.
*/
productType: string;
}
SelectedOption
- name
The name of the merchandise option.
string
- value
The value of the merchandise option.
string
export interface SelectedOption {
/**
* The name of the merchandise option.
*/
name: string;
/**
* The value of the merchandise option.
*/
value: string;
}
SellingPlan
- id
A globally-unique identifier.
string
export interface SellingPlan {
/**
* A globally-unique identifier.
* @example 'gid://shopify/SellingPlan/1'
*/
id: string;
}
CartLineRemoveChange
- id
Line Item ID.
string
- quantity
The quantity being removed for this line item.
number
- type
An identifier for changes that remove line items.
"removeCartLine"
export interface CartLineRemoveChange {
/**
* An identifier for changes that remove line items.
*/
type: 'removeCartLine';
/**
* Line Item ID.
* @example 'gid://shopify/CartLine/123'
*/
id: string;
/**
* The quantity being removed for this line item.
*/
quantity: number;
}
CartLineUpdateChange
- attributes
The new attributes for the line item.
Attribute[]
- id
Line Item ID.
string
- merchandiseId
The new merchandise ID for the line item.
string
- quantity
The new quantity for the line item.
number
- sellingPlanId
The identifier of the selling plan that the merchandise is being purchased with or `null` to remove the the product from the selling plan.
SellingPlan['id'] | null
- type
An identifier for changes that update line items.
"updateCartLine"
export interface CartLineUpdateChange {
/**
* An identifier for changes that update line items.
*/
type: 'updateCartLine';
/**
* Line Item ID.
* @example 'gid://shopify/CartLine/123'
*/
id: string;
/**
* The new merchandise ID for the line item.
* @example 'gid://shopify/ProductVariant/123'
*/
merchandiseId?: string;
/**
* The new quantity for the line item.
*/
quantity?: number;
/**
* The new attributes for the line item.
*/
attributes?: Attribute[];
/**
* The identifier of the selling plan that the merchandise is being purchased
* with or `null` to remove the the product from the selling plan.
*/
sellingPlanId?: SellingPlan['id'] | null;
}
CartLineChangeResult
CartLineChangeResultSuccess | CartLineChangeResultError
CartLineChangeResultSuccess
- type
Indicates that the line item was changed successfully.
"success"
export interface CartLineChangeResultSuccess {
/**
* Indicates that the line item was changed successfully.
*/
type: 'success';
}
CartLineChangeResultError
- message
A message that explains the error. This message is useful for debugging. It is **not** localized, and therefore should not be presented directly to the buyer.
string
- type
Indicates that the line item was not changed successfully. Refer to the `message` property for details about the error.
"error"
export interface CartLineChangeResultError {
/**
* Indicates that the line item was not changed successfully. Refer to the `message` property for details about the error.
*/
type: 'error';
/**
* A message that explains the error. This message is useful for debugging.
* It is **not** localized, and therefore should not be presented directly
* to the buyer.
*/
message: string;
}
DiscountCodeChange
DiscountCodeAddChange | DiscountCodeRemoveChange
DiscountCodeAddChange
- code
The code for the discount (case-sensitive)
string
- type
The type of the `DiscountCodeChange` API.
"addDiscountCode"
export interface DiscountCodeAddChange {
/**
* The type of the `DiscountCodeChange` API.
*/
type: 'addDiscountCode';
/**
* The code for the discount (case-sensitive)
*/
code: string;
}
DiscountCodeRemoveChange
- code
The code for the discount (case-sensitive)
string
- type
The type of the `DiscountCodeChange` API.
"removeDiscountCode"
export interface DiscountCodeRemoveChange {
/**
* The type of the `DiscountCodeChange` API.
*/
type: 'removeDiscountCode';
/**
* The code for the discount (case-sensitive)
*/
code: string;
}
DiscountCodeChangeResult
DiscountCodeChangeResultSuccess | DiscountCodeChangeResultError
DiscountCodeChangeResultSuccess
- type
Indicates that the discount code change was applied successfully.
"success"
export interface DiscountCodeChangeResultSuccess {
/**
* Indicates that the discount code change was applied successfully.
*/
type: 'success';
}
DiscountCodeChangeResultError
- message
A message that explains the error. This message is useful for debugging. It is **not** localized, and therefore should not be presented directly to the buyer.
string
- type
Indicates that the discount code change failed.
"error"
export interface DiscountCodeChangeResultError {
/**
* Indicates that the discount code change failed.
*/
type: 'error';
/**
* A message that explains the error. This message is useful for debugging.
* It is **not** localized, and therefore should not be presented directly
* to the buyer.
*/
message: string;
}
GiftCardChange
GiftCardAddChange | GiftCardRemoveChange
GiftCardAddChange
- code
Gift card code.
string
- type
The type of the `GiftCardChange` API.
"addGiftCard"
export interface GiftCardAddChange {
/**
* The type of the `GiftCardChange` API.
*/
type: 'addGiftCard';
/**
* Gift card code.
*/
code: string;
}
GiftCardRemoveChange
- code
The full gift card code, or the last four digits of the code.
string
- type
The type of the `GiftCardChange` API.
"removeGiftCard"
export interface GiftCardRemoveChange {
/**
* The type of the `GiftCardChange` API.
*/
type: 'removeGiftCard';
/**
* The full gift card code, or the last four digits of the code.
*/
code: string;
}
GiftCardChangeResult
GiftCardChangeResultSuccess | GiftCardChangeResultError
GiftCardChangeResultSuccess
- type
Indicates that the gift card change was applied successfully.
"success"
export interface GiftCardChangeResultSuccess {
/**
* Indicates that the gift card change was applied successfully.
*/
type: 'success';
}
GiftCardChangeResultError
- message
A message that explains the error. This message is useful for debugging. It is **not** localized, and therefore should not be presented directly to the buyer.
string
- type
Indicates that the gift card change failed.
"error"
export interface GiftCardChangeResultError {
/**
* Indicates that the gift card change failed.
*/
type: 'error';
/**
* A message that explains the error. This message is useful for debugging.
* It is **not** localized, and therefore should not be presented directly
* to the buyer.
*/
message: string;
}
MetafieldChange
MetafieldRemoveChange | MetafieldUpdateChange | MetafieldRemoveCartChange | MetafieldUpdateCartChange
MetafieldRemoveChange
Removes a metafield.
- key
The name of the metafield to remove.
string
- namespace
The namespace of the metafield to remove.
string
- type
The type of the `MetafieldRemoveChange` API.
"removeMetafield"
export interface MetafieldRemoveChange {
/**
* The type of the `MetafieldRemoveChange` API.
*/
type: 'removeMetafield';
/**
* The name of the metafield to remove.
*/
key: string;
/**
* The namespace of the metafield to remove.
*/
namespace: string;
}
Metafield
Metadata associated with the checkout.
- key
The name of the metafield. It must be between 3 and 30 characters in length (inclusive).
string
- namespace
A container for a set of metafields. You need to define a custom namespace for your metafields to distinguish them from the metafields used by other apps. This must be between 2 and 20 characters in length (inclusive).
string
- value
The information to be stored as metadata.
string | number
- valueType
The metafield’s information type.
'integer' | 'string' | 'json_string'
export interface Metafield {
/**
* The name of the metafield. It must be between 3 and 30 characters in
* length (inclusive).
*/
key: string;
/**
* A container for a set of metafields. You need to define a custom
* namespace for your metafields to distinguish them from the metafields
* used by other apps. This must be between 2 and 20 characters in length (inclusive).
*/
namespace: string;
/**
* The information to be stored as metadata.
*/
value: string | number;
/** The metafield’s information type. */
valueType: 'integer' | 'string' | 'json_string';
}
MetafieldUpdateChange
Updates a metafield. If a metafield with the provided key and namespace does not already exist, it gets created.
- key
The name of the metafield to update.
string
- namespace
The namespace of the metafield to add.
string
- type
The type of the `MetafieldUpdateChange` API.
"updateMetafield"
- value
The new information to store in the metafield.
string | number
- valueType
The metafield’s information type.
'integer' | 'string' | 'json_string'
export interface MetafieldUpdateChange {
/**
* The type of the `MetafieldUpdateChange` API.
*/
type: 'updateMetafield';
/** The name of the metafield to update. */
key: string;
/** The namespace of the metafield to add. */
namespace: string;
/** The new information to store in the metafield. */
value: string | number;
/**
* The metafield’s information type.
*/
valueType: 'integer' | 'string' | 'json_string';
}
MetafieldRemoveCartChange
Removes a cart metafield.
- key
The name of the metafield to remove.
string
- namespace
The namespace of the metafield to remove.
string
- type
The type of the `MetafieldRemoveChange` API.
"removeCartMetafield"
export interface MetafieldRemoveCartChange {
/**
* The type of the `MetafieldRemoveChange` API.
*/
type: 'removeCartMetafield';
/**
* The name of the metafield to remove.
*/
key: string;
/**
* The namespace of the metafield to remove.
*/
namespace: string;
}
CartMetafield
Represents a custom metadata attached to a resource.
- key
The key name of a metafield.
string
- namespace
The namespace for a metafield.
string
- type
The metafield's type name.
string
- value
The value of a metafield.
string
export interface CartMetafield {
/** The key name of a metafield. */
key: string;
/** The namespace for a metafield. */
namespace: string;
/** The value of a metafield. */
value: string;
/** The metafield's type name. */
type: string;
}
MetafieldUpdateCartChange
Updates a cart metafield. If a metafield with the provided key and namespace does not already exist, it gets created.
- metafield
{ key: string; namespace: string; value: string; type: string; }
- type
The type of the `MetafieldUpdateChange` API.
"updateCartMetafield"
export interface MetafieldUpdateCartChange {
/**
* The type of the `MetafieldUpdateChange` API.
*/
type: 'updateCartMetafield';
metafield: {
/** The name of the metafield to update. */
key: string;
/** The namespace of the metafield to add. */
namespace: string;
/** The new information to store in the metafield. */
value: string;
/**
* The metafield’s information type.
* See the [`metafields documentation`](/docs/apps/custom-data/metafields/types) for a list of supported types.
*/
type: string;
};
}
MetafieldChangeResult
MetafieldChangeResultSuccess | MetafieldChangeResultError
MetafieldChangeResultSuccess
- type
The type of the `MetafieldChangeResultSuccess` API.
"success"
export interface MetafieldChangeResultSuccess {
/**
* The type of the `MetafieldChangeResultSuccess` API.
*/
type: 'success';
}
MetafieldChangeResultError
- message
A message that explains the error. This message is useful for debugging. It is **not** localized, and therefore should not be presented directly to the buyer.
string
- type
The type of the `MetafieldChangeResultError` API.
"error"
export interface MetafieldChangeResultError {
/**
* The type of the `MetafieldChangeResultError` API.
*/
type: 'error';
/**
* A message that explains the error. This message is useful for debugging.
* It is **not** localized, and therefore should not be presented directly
* to the buyer.
*/
message: string;
}
NoteChange
NoteRemoveChange | NoteUpdateChange
NoteRemoveChange
Removes a note
- type
The type of the `NoteRemoveChange` API.
"removeNote"
export interface NoteRemoveChange {
/**
* The type of the `NoteRemoveChange` API.
*/
type: 'removeNote';
}
NoteUpdateChange
An Update to a note on the order. for example, the buyer could request detailed packaging instructions in an order note
- note
The new value of the note.
string
- type
The type of the `NoteUpdateChange` API.
"updateNote"
export interface NoteUpdateChange {
/**
* The type of the `NoteUpdateChange` API.
*/
type: 'updateNote';
/**
* The new value of the note.
*/
note: string;
}
NoteChangeResult
NoteChangeResultSuccess | NoteChangeResultError
NoteChangeResultSuccess
- type
The type of the `NoteChangeResultSuccess` API.
"success"
export interface NoteChangeResultSuccess {
/**
* The type of the `NoteChangeResultSuccess` API.
*/
type: 'success';
}
NoteChangeResultError
- message
A message that explains the error. This message is useful for debugging. It is **not** localized, and therefore should not be presented directly to the buyer.
string
- type
The type of the `NoteChangeResultError` API.
"error"
export interface NoteChangeResultError {
/**
* The type of the `NoteChangeResultError` API.
*/
type: 'error';
/**
* A message that explains the error. This message is useful for debugging.
* It is **not** localized, and therefore should not be presented directly
* to the buyer.
*/
message: string;
}
ShippingAddressUpdateChange
- address
Fields to update in the shipping address. You only need to provide values for the fields you want to update — any fields you do not list will keep their current values.
Partial<ShippingAddress>
- type
The type of the `ShippingAddressUpdateChange` API.
"updateShippingAddress"
export interface ShippingAddressUpdateChange {
/**
* The type of the `ShippingAddressUpdateChange` API.
*/
type: 'updateShippingAddress';
/**
* Fields to update in the shipping address. You only need to provide
* values for the fields you want to update — any fields you do not list
* will keep their current values.
*/
address: Partial<ShippingAddress>;
}
ShippingAddress
- address1
The first line of the buyer's address, including street name and number. {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
string
- address2
The second line of the buyer's address, like apartment number, suite, etc. {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
string
- city
The buyer's city. {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
string
- company
The buyer's company name. {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
string
- countryCode
The ISO 3166 Alpha-2 format for the buyer's country. Refer to https://www.iso.org/iso-3166-country-codes.html. {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
CountryCode
- firstName
The buyer's first name. {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
string
- lastName
The buyer's last name. {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
string
- name
The buyer's full name. {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
string
- oneTimeUse
Specifies whether the address should be saved to the buyer's account.
boolean
- phone
The buyer's phone number. {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
string
- provinceCode
The buyer's province code, such as state, province, prefecture, or region. {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
string
- zip
The buyer's postal or ZIP code. {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
string
export interface ShippingAddress extends MailingAddress {
/**
* Specifies whether the address should be saved to the buyer's account.
*/
oneTimeUse?: boolean;
}
CountryCode
'AC' | 'AD' | 'AE' | 'AF' | 'AG' | 'AI' | 'AL' | 'AM' | 'AN' | 'AO' | 'AR' | 'AT' | 'AU' | 'AW' | 'AX' | 'AZ' | 'BA' | 'BB' | 'BD' | 'BE' | 'BF' | 'BG' | 'BH' | 'BI' | 'BJ' | 'BL' | 'BM' | 'BN' | 'BO' | 'BQ' | 'BR' | 'BS' | 'BT' | 'BV' | 'BW' | 'BY' | 'BZ' | 'CA' | 'CC' | 'CD' | 'CF' | 'CG' | 'CH' | 'CI' | 'CK' | 'CL' | 'CM' | 'CN' | 'CO' | 'CR' | 'CU' | 'CV' | 'CW' | 'CX' | 'CY' | 'CZ' | 'DE' | 'DJ' | 'DK' | 'DM' | 'DO' | 'DZ' | 'EC' | 'EE' | 'EG' | 'EH' | 'ER' | 'ES' | 'ET' | 'FI' | 'FJ' | 'FK' | 'FO' | 'FR' | 'GA' | 'GB' | 'GD' | 'GE' | 'GF' | 'GG' | 'GH' | 'GI' | 'GL' | 'GM' | 'GN' | 'GP' | 'GQ' | 'GR' | 'GS' | 'GT' | 'GW' | 'GY' | 'HK' | 'HM' | 'HN' | 'HR' | 'HT' | 'HU' | 'ID' | 'IE' | 'IL' | 'IM' | 'IN' | 'IO' | 'IQ' | 'IR' | 'IS' | 'IT' | 'JE' | 'JM' | 'JO' | 'JP' | 'KE' | 'KG' | 'KH' | 'KI' | 'KM' | 'KN' | 'KP' | 'KR' | 'KW' | 'KY' | 'KZ' | 'LA' | 'LB' | 'LC' | 'LI' | 'LK' | 'LR' | 'LS' | 'LT' | 'LU' | 'LV' | 'LY' | 'MA' | 'MC' | 'MD' | 'ME' | 'MF' | 'MG' | 'MK' | 'ML' | 'MM' | 'MN' | 'MO' | 'MQ' | 'MR' | 'MS' | 'MT' | 'MU' | 'MV' | 'MW' | 'MX' | 'MY' | 'MZ' | 'NA' | 'NC' | 'NE' | 'NF' | 'NG' | 'NI' | 'NL' | 'NO' | 'NP' | 'NR' | 'NU' | 'NZ' | 'OM' | 'PA' | 'PE' | 'PF' | 'PG' | 'PH' | 'PK' | 'PL' | 'PM' | 'PN' | 'PS' | 'PT' | 'PY' | 'QA' | 'RE' | 'RO' | 'RS' | 'RU' | 'RW' | 'SA' | 'SB' | 'SC' | 'SD' | 'SE' | 'SG' | 'SH' | 'SI' | 'SJ' | 'SK' | 'SL' | 'SM' | 'SN' | 'SO' | 'SR' | 'SS' | 'ST' | 'SV' | 'SX' | 'SY' | 'SZ' | 'TA' | 'TC' | 'TD' | 'TF' | 'TG' | 'TH' | 'TJ' | 'TK' | 'TL' | 'TM' | 'TN' | 'TO' | 'TR' | 'TT' | 'TV' | 'TW' | 'TZ' | 'UA' | 'UG' | 'UM' | 'US' | 'UY' | 'UZ' | 'VA' | 'VC' | 'VE' | 'VG' | 'VN' | 'VU' | 'WF' | 'WS' | 'XK' | 'YE' | 'YT' | 'ZA' | 'ZM' | 'ZW' | 'ZZ'
ShippingAddressChangeResult
ShippingAddressChangeResultSuccess | ShippingAddressChangeResultError
ShippingAddressChangeResultSuccess
The returned result of a successful update to the shipping address.
- errors
null
- type
The type of the `ShippingAddressChangeResultSuccess` API.
"success"
export interface ShippingAddressChangeResultSuccess {
/**
* The type of the `ShippingAddressChangeResultSuccess` API.
*/
type: 'success';
errors: null;
}
ShippingAddressChangeResultError
The returned result of an update to the shipping address with a messages detailing the type of errors that occurred.
- errors
The errors corresponding to particular fields from a given change
ShippingAddressChangeFieldError[]
- type
The type of the `ShippingAddressChangeResultError` API.
"error"
export interface ShippingAddressChangeResultError {
/**
* The type of the `ShippingAddressChangeResultError` API.
*/
type: 'error';
/**
* The errors corresponding to particular fields from a given change
*/
errors: ShippingAddressChangeFieldError[];
}
ShippingAddressChangeFieldError
An error corresponding to a particular field from a given change
- field
field key from MailingAddress where the error occurred
keyof MailingAddress
- message
A message that explains the error. This message is useful for debugging. It is **not** localized, and therefore should not be presented directly to the buyer.
string
export interface ShippingAddressChangeFieldError {
/**
* field key from MailingAddress where the error occurred
*/
field?: keyof MailingAddress;
/**
* A message that explains the error. This message is useful for debugging.
* It is **not** localized, and therefore should not be presented directly
* to the buyer.
*/
message: string;
}
MailingAddress
- address1
The first line of the buyer's address, including street name and number. {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
string
- address2
The second line of the buyer's address, like apartment number, suite, etc. {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
string
- city
The buyer's city. {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
string
- company
The buyer's company name. {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
string
- countryCode
The ISO 3166 Alpha-2 format for the buyer's country. Refer to https://www.iso.org/iso-3166-country-codes.html. {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
CountryCode
- firstName
The buyer's first name. {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
string
- lastName
The buyer's last name. {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
string
- name
The buyer's full name. {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
string
- phone
The buyer's phone number. {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
string
- provinceCode
The buyer's province code, such as state, province, prefecture, or region. {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
string
- zip
The buyer's postal or ZIP code. {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
string
export interface MailingAddress {
/**
* The buyer's full name.
*
* {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
*
* @example 'John Doe'
*/
name?: string;
/**
* The buyer's first name.
*
* {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
*
* @example 'John'
*/
firstName?: string;
/**
* The buyer's last name.
*
* {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
*
* @example 'Doe'
*/
lastName?: string;
/**
* The buyer's company name.
*
* {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
*
* @example 'Shopify'
*/
company?: string;
/**
* The first line of the buyer's address, including street name and number.
*
* {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
*
* @example '151 O'Connor Street'
*/
address1?: string;
/**
* The second line of the buyer's address, like apartment number, suite, etc.
*
* {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
*
* @example 'Ground floor'
*/
address2?: string;
/**
* The buyer's city.
*
* {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
*
* @example 'Ottawa'
*/
city?: string;
/**
* The buyer's postal or ZIP code.
*
* {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
*
* @example 'K2P 2L8'
*/
zip?: string;
/**
* The ISO 3166 Alpha-2 format for the buyer's country. Refer to https://www.iso.org/iso-3166-country-codes.html.
*
* {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
*
* @example 'CA' for Canada.
*/
countryCode?: CountryCode;
/**
* The buyer's province code, such as state, province, prefecture, or region.
*
* {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
*
* @example 'ON' for Ontario.
*/
provinceCode?: string;
/**
* The buyer's phone number.
*
* {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
*
* @example '+1 613 111 2222'.
*/
phone?: string;
}
StandardApi
- analytics
The methods for interacting with [Web Pixels](/docs/apps/marketing), such as emitting an event.
Analytics
- appliedGiftCards
Gift Cards that have been applied to the checkout.
StatefulRemoteSubscribable<AppliedGiftCard[]>
- applyTrackingConsentChange
Allows setting and updating customer privacy consent settings and tracking consent metafields. > Note: Requires the [`customer_privacy` capability](/docs/api/checkout-ui-extensions/2024-07/configuration#collect-buyer-consent) to be set to `true`. {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
ApplyTrackingConsentChangeType
- appMetafields
The metafields requested in the [`shopify.extension.toml`](/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](/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.*
StatefulRemoteSubscribable<AppMetafieldEntry[]>
- attributes
The custom attributes left by the customer to the merchant, either in their cart or during checkout.
StatefulRemoteSubscribable<Attribute[] | undefined>
- availablePaymentOptions
All available payment options.
StatefulRemoteSubscribable<PaymentOption[]>
- billingAddress
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](/docs/apps/store/data-protection/protected-customer-data).
StatefulRemoteSubscribable<MailingAddress | undefined>
- buyerIdentity
Information about the buyer that is interacting with the checkout. {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
BuyerIdentity
- buyerJourney
Provides details on the buyer's progression through the checkout. Refer to [buyer journey](/docs/api/checkout-ui-extensions/apis/buyer-journey#examples) examples for more information.
BuyerJourney
- checkoutSettings
Settings applied to the buyer's checkout.
StatefulRemoteSubscribable<CheckoutSettings>
- checkoutToken
A stable ID that represents the current checkout. Matches the `token` field in the [WebPixel checkout payload](/docs/api/pixels/customer-events#checkout) and the `checkout_token` field in the [REST Admin API `Order` resource](/docs/api/admin-rest/unstable/resources/order#resource-object).
StatefulRemoteSubscribable<CheckoutToken | undefined>
- cost
Details on the costs the buyer will pay for this checkout.
CartCost
- customerPrivacy
Customer privacy consent settings and a flag denoting if consent has previously been collected.
StatefulRemoteSubscribable<CustomerPrivacy>
- deliveryGroups
A list of delivery groups containing information about the delivery of the items the customer intends to purchase.
StatefulRemoteSubscribable<DeliveryGroup[]>
- discountAllocations
Discounts that have been applied to the entire cart.
StatefulRemoteSubscribable<CartDiscountAllocation[]>
- discountCodes
A list of discount codes currently applied to the checkout.
StatefulRemoteSubscribable<CartDiscountCode[]>
- extension
The meta information about the extension.
Extension<Target>
- extensionPoint
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.
Target
- i18n
Utilities for translating content and formatting values according to the current [`localization`](/docs/api/checkout-ui-extensions/apis/localization) of the checkout. Refer to [`localization` examples](/docs/api/checkout-ui-extensions/apis/localization#examples) for more information.
I18n
- instructions
The cart instructions used to create the checkout and possibly limit extension capabilities. These instructions should be checked prior to performing any actions that may be affected by them. For example, if you intend to add a discount code via the `applyDiscountCodeChange` method, check `discounts.canUpdateDiscountCodes` to ensure it's supported in this checkout. > Caution: As of version `2024-07`, UI extension code must check for instructions before calling select APIs in case those APIs are not available. See the [update guide](/docs/api/checkout-ui-extensions/instructions-update) for more information.
StatefulRemoteSubscribable<CartInstructions>
- lines
A list of lines containing information about the items the customer intends to purchase.
StatefulRemoteSubscribable<CartLine[]>
- localization
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`](/docs/api/checkout-ui-extensions/apis/localization#standardapi-propertydetail-i18n) object instead.
Localization
- metafields
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](/docs/admin-api/graphql/reference/orders/order#metafield-2021-01)
StatefulRemoteSubscribable<Metafield[]>
- note
A note left by the customer to the merchant, either in their cart or during checkout.
StatefulRemoteSubscribable<string | undefined>
- query
The method used to query the Storefront GraphQL API with a prefetched token. Refer to [Storefront API access examples](/docs/api/checkout-ui-extensions/apis/storefront-api) for more information.
<Data = unknown, Variables = Record<string, unknown>>(query: string, options?: { variables?: Variables; version?: StorefrontApiVersion; }) => Promise<{ data?: Data; errors?: GraphQLError[]; }>
- selectedPaymentOptions
Payment options selected by the buyer.
StatefulRemoteSubscribable<SelectedPaymentOption[]>
- sessionToken
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](/docs/api/checkout-ui-extensions/apis/session-token) for more information.
SessionToken
- settings
The settings matching the settings definition written in the [`shopify.extension.toml`](/docs/api/checkout-ui-extensions/configuration) file. Refer to [settings examples](/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.
StatefulRemoteSubscribable<ExtensionSettings>
- shippingAddress
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](/docs/apps/store/data-protection/protected-customer-data).
StatefulRemoteSubscribable<ShippingAddress | undefined>
- shop
The shop where the checkout is taking place.
Shop
- storage
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
- ui
Methods to interact with the extension's UI.
Ui
- version
The renderer version being used for the extension.
Version
export interface StandardApi<Target extends ExtensionTarget = ExtensionTarget> {
/**
* The methods for interacting with [Web Pixels](/docs/apps/marketing), such as emitting an event.
*/
analytics: Analytics;
/**
* Gift Cards that have been applied to the checkout.
*/
appliedGiftCards: StatefulRemoteSubscribable<AppliedGiftCard[]>;
/**
* The cart instructions used to create the checkout and possibly limit extension capabilities.
*
* These instructions should be checked prior to performing any actions that may be affected by them.
*
* For example, if you intend to add a discount code via the `applyDiscountCodeChange` method,
* check `discounts.canUpdateDiscountCodes` to ensure it's supported in this checkout.
*
* > Caution: As of version `2024-07`, UI extension code must check for instructions before calling select APIs in case those APIs are not available.
* See the [update guide](/docs/api/checkout-ui-extensions/instructions-update) for more information.
*
*/
instructions: StatefulRemoteSubscribable<CartInstructions>;
/**
* The metafields requested in the
* [`shopify.extension.toml`](/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](/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<AppMetafieldEntry[]>;
/**
* The custom attributes left by the customer to the merchant, either in their cart or during checkout.
*/
attributes: StatefulRemoteSubscribable<Attribute[] | undefined>;
/**
* All available payment options.
*/
availablePaymentOptions: StatefulRemoteSubscribable<PaymentOption[]>;
/**
* Information about the buyer that is interacting with the checkout.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
*/
buyerIdentity?: BuyerIdentity;
/**
* Provides details on the buyer's progression through the checkout.
*
* Refer to [buyer journey](/docs/api/checkout-ui-extensions/apis/buyer-journey#examples)
* examples for more information.
*/
buyerJourney: BuyerJourney;
/**
* Settings applied to the buyer's checkout.
*/
checkoutSettings: StatefulRemoteSubscribable<CheckoutSettings>;
/**
* A stable ID that represents the current checkout.
*
* Matches the `token` field in the [WebPixel checkout payload](/docs/api/pixels/customer-events#checkout)
* and the `checkout_token` field in the [REST Admin API `Order` resource](/docs/api/admin-rest/unstable/resources/order#resource-object).
*/
checkoutToken: StatefulRemoteSubscribable<CheckoutToken | undefined>;
/**
* 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<DeliveryGroup[]>;
/**
* A list of discount codes currently applied to the checkout.
*/
discountCodes: StatefulRemoteSubscribable<CartDiscountCode[]>;
/**
* Discounts that have been applied to the entire cart.
*/
discountAllocations: StatefulRemoteSubscribable<CartDiscountAllocation[]>;
/**
* The meta information about the extension.
*/
extension: Extension<Target>;
/**
* 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-07/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`](/docs/api/checkout-ui-extensions/apis/localization)
* of the checkout.
*
* Refer to [`localization` examples](/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<CartLine[]>;
/**
* 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`](/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](/docs/admin-api/graphql/reference/orders/order#metafield-2021-01)
*/
metafields: StatefulRemoteSubscribable<Metafield[]>;
/**
* A note left by the customer to the merchant, either in their cart or during checkout.
*/
note: StatefulRemoteSubscribable<string | undefined>;
/**
* The method used to query the Storefront GraphQL API with a prefetched token.
*
* Refer to [Storefront API access examples](/docs/api/checkout-ui-extensions/apis/storefront-api) for more information.
*/
query: <Data = unknown, Variables = Record<string, unknown>>(
query: string,
options?: {variables?: Variables; version?: StorefrontApiVersion},
) => Promise<{data?: Data; errors?: GraphQLError[]}>;
/**
* Payment options selected by the buyer.
*/
selectedPaymentOptions: StatefulRemoteSubscribable<SelectedPaymentOption[]>;
/**
* 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](/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`](/docs/api/checkout-ui-extensions/configuration) file.
*
* Refer to [settings examples](/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<ExtensionSettings>;
/**
* 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](/docs/apps/store/data-protection/protected-customer-data).
*/
shippingAddress?: StatefulRemoteSubscribable<ShippingAddress | undefined>;
/**
* 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](/docs/apps/store/data-protection/protected-customer-data).
*/
billingAddress?: StatefulRemoteSubscribable<MailingAddress | undefined>;
/** 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<CustomerPrivacy>;
/**
* Allows setting and updating customer privacy consent settings and tracking consent metafields.
*
* > Note: Requires the [`customer_privacy` capability](/docs/api/checkout-ui-extensions/2024-07/configuration#collect-buyer-consent) to be set to `true`.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
*/
applyTrackingConsentChange: ApplyTrackingConsentChangeType;
}
Analytics
- publish
Publish method to emit analytics events to [Web Pixels](/docs/apps/marketing).
(name: string, data: Record<string, unknown>) => Promise<boolean>
- visitor
A method for capturing details about a visitor on the online store.
(data: { email?: string; phone?: string; }) => Promise<VisitorResult>
export interface Analytics {
/**
* Publish method to emit analytics events to [Web Pixels](/docs/apps/marketing).
*/
publish(name: string, data: Record<string, unknown>): Promise<boolean>;
/**
* A method for capturing details about a visitor on the online store.
*/
visitor(data: {email?: string; phone?: string}): Promise<VisitorResult>;
}
VisitorResult
Represents a visitor result.
VisitorSuccess | VisitorError
VisitorSuccess
Represents a successful visitor result.
- type
Indicates that the visitor information was validated and submitted.
"success"
export interface VisitorSuccess {
/**
* Indicates that the visitor information was validated and submitted.
*/
type: 'success';
}
VisitorError
Represents an unsuccessful visitor result.
- message
A message that explains the error. This message is useful for debugging. It's **not** localized, and therefore should not be presented directly to the buyer.
string
- type
Indicates that the visitor information is invalid and wasn't submitted. Examples are using the wrong data type or missing a required property.
"error"
export interface VisitorError {
/**
* Indicates that the visitor information is invalid and wasn't submitted.
* Examples are using the wrong data type or missing a required property.
*/
type: 'error';
/**
* A message that explains the error. This message is useful for debugging.
* It's **not** localized, and therefore should not be presented directly
* to the buyer.
*/
message: string;
}
AppliedGiftCard
- amountUsed
The amount of the applied gift card that will be used when the checkout is completed.
Money
- balance
The current balance of the applied gift card prior to checkout completion.
Money
- lastCharacters
The last four characters of the applied gift card's code.
string
export interface AppliedGiftCard {
/**
* The last four characters of the applied gift card's code.
*/
lastCharacters: string;
/**
* The amount of the applied gift card that will be used when the checkout is completed.
*/
amountUsed: Money;
/**
* The current balance of the applied gift card prior to checkout completion.
*/
balance: Money;
}
ApplyTrackingConsentChangeType
- visitorConsent
VisitorConsentChange
Promise<TrackingConsentChangeResult>
export type ApplyTrackingConsentChangeType = (
visitorConsent: VisitorConsentChange,
) => Promise<TrackingConsentChangeResult>;
VisitorConsentChange
- analytics
Visitor consents to recording data to understand how customers interact with the site.
boolean
- marketing
Visitor consents to ads and marketing communications based on customer interests.
boolean
- metafields
Tracking consent metafield data to be saved. If the value is `null`, the metafield will be deleted.
TrackingConsentMetafieldChange[]
- preferences
Visitor consent to remembering customer preferences, such as country or language, to personalize visits to the website.
boolean
- saleOfData
Opts the visitor out of data sharing / sales.
boolean
- type
"changeVisitorConsent"
export interface VisitorConsentChange extends VisitorConsent {
/**
* Tracking consent metafield data to be saved.
*
* If the value is `null`, the metafield will be deleted.
*
* @example `[{key: 'granularAnalytics', value: 'true'}, {key: 'granularMarketing', value: 'false'}]`
*/
metafields?: TrackingConsentMetafieldChange[];
type: 'changeVisitorConsent';
}
TrackingConsentMetafieldChange
- key
The name of the metafield. It must be between 3 and 30 characters in length (inclusive).
string
- value
The information to be stored as metadata. If the value is `null`, the metafield will be deleted.
string | null
export interface TrackingConsentMetafieldChange {
/**
* The name of the metafield. It must be between 3 and 30 characters in
* length (inclusive).
*/
key: string;
/**
* The information to be stored as metadata. If the value is `null`, the metafield will be deleted.
*
* @example 'any string', `null`, or a stringified JSON object
*/
value: string | null;
}
VisitorConsent
- analytics
Visitor consents to recording data to understand how customers interact with the site.
boolean
- marketing
Visitor consents to ads and marketing communications based on customer interests.
boolean
- preferences
Visitor consent to remembering customer preferences, such as country or language, to personalize visits to the website.
boolean
- saleOfData
Opts the visitor out of data sharing / sales.
boolean
export interface VisitorConsent {
/**
* Visitor consents to recording data to understand how customers interact with the site.
*/
analytics?: boolean;
/**
* Visitor consents to ads and marketing communications based on customer interests.
*/
marketing?: boolean;
/**
* Visitor consent to remembering customer preferences, such as country or language, to personalize visits to the website.
*/
preferences?: boolean;
/**
* Opts the visitor out of data sharing / sales.
*/
saleOfData?: boolean;
}
TrackingConsentChangeResult
TrackingConsentChangeResultSuccess | TrackingConsentChangeResultError
TrackingConsentChangeResultSuccess
The returned result of a successful tracking consent preference update.
- type
The type of the `TrackingConsentChangeResultSuccess` API.
"success"
export interface TrackingConsentChangeResultSuccess {
/**
* The type of the `TrackingConsentChangeResultSuccess` API.
*/
type: 'success';
}
TrackingConsentChangeResultError
The returned result of an unsuccessful tracking consent preference update with a message detailing the type of error that occurred.
- message
A message that explains the error. This message is useful for debugging. It is **not** localized, and therefore should not be presented directly to the buyer.
string
- type
The type of the `TrackingConsentChangeResultError` API.
"error"
export interface TrackingConsentChangeResultError {
/**
* The type of the `TrackingConsentChangeResultError` API.
*/
type: 'error';
/**
* A message that explains the error. This message is useful for debugging.
* It is **not** localized, and therefore should not be presented directly
* to the buyer.
*/
message: string;
}
AppMetafieldEntry
A metafield associated with the shop or a resource on the checkout.
- metafield
The metadata information.
AppMetafield
- target
The target that is associated to the metadata. {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data) when the type is `customer`, `company` or `companyLocation`.
AppMetafieldEntryTarget
export interface AppMetafieldEntry {
/**
* The target that is associated to the metadata.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data) when the type is `customer`, `company` or `companyLocation`.
*/
target: AppMetafieldEntryTarget;
/** The metadata information. */
metafield: AppMetafield;
}
AppMetafield
Represents a custom metadata attached to a resource.
- key
The key name of a metafield.
string
- namespace
The namespace for a metafield.
string
- type
The metafield's type name.
string
- value
The value of a metafield.
string | number | boolean
- valueType
The metafield’s information type.
'boolean' | 'float' | 'integer' | 'json_string' | 'string'
export interface AppMetafield {
/** The key name of a metafield. */
key: string;
/** The namespace for a metafield. */
namespace: string;
/** The value of a metafield. */
value: string | number | boolean;
/** The metafield’s information type. */
valueType: 'boolean' | 'float' | 'integer' | 'json_string' | 'string';
/** The metafield's type name. */
type: string;
}
AppMetafieldEntryTarget
The metafield owner.
- id
The numeric owner ID that is associated with the metafield.
string
- type
The type of the metafield owner. {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data) when the type is `customer`, `company` or `companyLocation`.
| 'customer' | 'product' | 'shop' | 'shopUser' | 'variant' | 'company' | 'companyLocation' | 'cart'
export interface AppMetafieldEntryTarget {
/**
* The type of the metafield owner.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data) when the type is `customer`, `company` or `companyLocation`.
*/
type:
| 'customer'
| 'product'
| 'shop'
| 'shopUser'
| 'variant'
| 'company'
| 'companyLocation'
| 'cart';
/** The numeric owner ID that is associated with the metafield. */
id: string;
}
PaymentOption
A payment option presented to the buyer.
- handle
The unique handle for the payment option. This is not a globally unique identifier. It may be an identifier specific to the given checkout session or the current shop.
string
- type
The type of the payment option. Shops can be configured to support many different payment options. Some options are only available to buyers in specific regions. | Type | Description | |---|---| | `creditCard` | A vaulted or manually entered credit card. | | `deferred` | A [deferred payment](https://help.shopify.com/en/manual/orders/deferred-payments), such as invoicing the buyer and collecting payment at a later time. | | `local` | A [local payment option](https://help.shopify.com/en/manual/payments/shopify-payments/local-payment-methods) specific to the current region or market | | `manualPayment` | A manual payment option such as an in-person retail transaction. | | `offsite` | A payment processed outside of Shopify's checkout, excluding integrated wallets. | | `other` | Another type of payment not defined here. | | `paymentOnDelivery` | A payment that will be collected on delivery. | | `redeemable` | A redeemable payment option such as a gift card or store credit. | | `wallet` | An integrated wallet such as PayPal, Google Pay, Apple Pay, etc. | | `customOnsite` | A custom payment option that is processed through a checkout extension with a payments app. |
| 'creditCard' | 'deferred' | 'local' | 'manualPayment' | 'offsite' | 'other' | 'paymentOnDelivery' | 'redeemable' | 'wallet' | 'customOnsite'
export interface PaymentOption {
/**
* The type of the payment option.
*
* Shops can be configured to support many different payment options. Some options are only available to buyers in specific regions.
*
* | Type | Description |
* |---|---|
* | `creditCard` | A vaulted or manually entered credit card. |
* | `deferred` | A [deferred payment](https://help.shopify.com/en/manual/orders/deferred-payments), such as invoicing the buyer and collecting payment at a later time. |
* | `local` | A [local payment option](https://help.shopify.com/en/manual/payments/shopify-payments/local-payment-methods) specific to the current region or market |
* | `manualPayment` | A manual payment option such as an in-person retail transaction. |
* | `offsite` | A payment processed outside of Shopify's checkout, excluding integrated wallets. |
* | `other` | Another type of payment not defined here. |
* | `paymentOnDelivery` | A payment that will be collected on delivery. |
* | `redeemable` | A redeemable payment option such as a gift card or store credit. |
* | `wallet` | An integrated wallet such as PayPal, Google Pay, Apple Pay, etc. |
* | `customOnsite` | A custom payment option that is processed through a checkout extension with a payments app. |
*/
type:
| 'creditCard'
| 'deferred'
| 'local'
| 'manualPayment'
| 'offsite'
| 'other'
| 'paymentOnDelivery'
| 'redeemable'
| 'wallet'
| 'customOnsite';
/**
* The unique handle for the payment option.
*
* This is not a globally unique identifier. It may be an identifier specific to the given checkout session or the current shop.
*/
handle: string;
}
BuyerIdentity
- customer
The buyer's customer account. The value is undefined if the buyer isn’t a known customer for this shop or if they haven't logged in yet. {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
StatefulRemoteSubscribable<Customer | undefined>
- email
The email address of the buyer that is interacting with the cart. The value is `undefined` if the app does not have access to customer data. {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
StatefulRemoteSubscribable<string | undefined>
- phone
The phone number of the buyer that is interacting with the cart. The value is `undefined` if the app does not have access to customer data. {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
StatefulRemoteSubscribable<string | undefined>
- purchasingCompany
Provides details of the company and the company location that the business customer is purchasing on behalf of. This includes information that can be used to identify the company and the company location that the business customer belongs to. {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
StatefulRemoteSubscribable<PurchasingCompany | undefined>
export interface BuyerIdentity {
/**
* The buyer's customer account. The value is undefined if the buyer isn’t a
* known customer for this shop or if they haven't logged in yet.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
*/
customer: StatefulRemoteSubscribable<Customer | undefined>;
/**
* The email address of the buyer that is interacting with the cart.
* The value is `undefined` if the app does not have access to customer data.
*
* {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
*/
email: StatefulRemoteSubscribable<string | undefined>;
/**
* The phone number of the buyer that is interacting with the cart.
* The value is `undefined` if the app does not have access to customer data.
*
* {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
*/
phone: StatefulRemoteSubscribable<string | undefined>;
/**
* Provides details of the company and the company location that the business customer is purchasing on behalf of.
* This includes information that can be used to identify the company and the company location that the business
* customer belongs to.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
*/
purchasingCompany: StatefulRemoteSubscribable<PurchasingCompany | undefined>;
}
Customer
Information about a customer who has previously purchased from this shop. {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
- acceptsEmailMarketing
Defines if the customer accepts email marketing activities. {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
boolean
- acceptsMarketing
Defines if the customer email accepts marketing activities. {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to [protected customer data](/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.
boolean
- acceptsSmsMarketing
Defines if the customer accepts SMS marketing activities. {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
boolean
- email
The email of the customer. {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
string
- firstName
The first name of the customer. {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
string
- fullName
The full name of the customer. {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
string
- id
Customer ID. {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
string
- image
The image associated with the customer. {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
ImageDetails
- lastName
The last name of the customer. {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
string
- phone
The phone number of the customer. {% include /apps/checkout/privacy-icon.md %} Requires level 2 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
string
- storeCreditAccounts
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](/docs/apps/store/data-protection/protected-customer-data).
StoreCreditAccount[]
export interface Customer {
/**
* Customer ID.
*
* {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to [protected customer data](/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](/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](/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](/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](/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](/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](/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](/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](/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](/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](/docs/apps/store/data-protection/protected-customer-data).
*
* @private
*/
storeCreditAccounts: StoreCreditAccount[];
}
StoreCreditAccount
Information about a Store Credit Account.
- balance
The current balance of the Store Credit Account.
Money
- id
A globally-unique identifier.
string
export interface StoreCreditAccount {
/**
* A globally-unique identifier.
* @example 'gid://shopify/StoreCreditAccount/1'
*/
id: string;
/**
* The current balance of the Store Credit Account.
*/
balance: Money;
}
PurchasingCompany
The information about a company that the business customer is purchasing on behalf of.
- company
Includes information of the company that the business customer is purchasing on behalf of. {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
Company
- location
Includes information of the company location that the business customer is purchasing on behalf of. {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
CompanyLocation
export interface PurchasingCompany {
/**
* Includes information of the company that the business customer is purchasing on behalf of.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
*/
company: Company;
/**
* Includes information of the company location that the business customer is purchasing on behalf of.
*
* {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
*/
location: CompanyLocation;
}
Company
- externalId
The external ID of the company that can be set by the merchant. {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
string
- id
The company ID. {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
string
- name
The name of the company. {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
string
export interface Company {
/**
* The company ID.
*
* {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
*/
id: string;
/**
* The name of the company.
*
* {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
*/
name: string;
/**
* The external ID of the company that can be set by the merchant.
*
* {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
*/
externalId?: string;
}
CompanyLocation
- externalId
The external ID of the company location that can be set by the merchant. {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
string
- id
The company location ID. {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
string
- name
The name of the company location. {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
string
export interface CompanyLocation {
/**
* The company location ID.
*
* {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
*/
id: string;
/**
* The name of the company location.
*
* {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
*/
name: string;
/**
* The external ID of the company location that can be set by the merchant.
*
* {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
*/
externalId?: string;
}
BuyerJourney
Provides details on the buyer's progression through the checkout.
- activeStep
What step of checkout the buyer is currently on.
StatefulRemoteSubscribable<BuyerJourneyStepReference | undefined>
- completed
This subscribable value will be true if the buyer completed submitting their order. For example, when viewing the **Order status** page after submitting payment, the buyer will have completed their order.
StatefulRemoteSubscribable<boolean>
- intercept
Installs a function for intercepting and preventing progress on checkout. This returns a promise that resolves to a teardown function. Calling the teardown function will remove the interceptor. To block checkout progress, you must set the [block_progress](/docs/api/checkout-ui-extensions/configuration#block-progress) capability in your extension's configuration.
(interceptor: Interceptor) => Promise<() => void>
- steps
All possible steps a buyer can take to complete the checkout. These steps may vary depending on the type of checkout or the shop's configuration.
StatefulRemoteSubscribable<BuyerJourneyStep[]>
export interface BuyerJourney {
/**
* Installs a function for intercepting and preventing progress on checkout.
*
* This returns a promise that resolves to a teardown function. Calling the
* teardown function will remove the interceptor.
*
* To block checkout progress, you must set the [block_progress](/docs/api/checkout-ui-extensions/configuration#block-progress)
* capability in your extension's configuration.
*/
intercept(interceptor: Interceptor): Promise<() => void>;
/**
* This subscribable value will be true if the buyer completed submitting their order.
*
* For example, when viewing the **Order status** page after submitting payment, the buyer will have completed their order.
*/
completed: StatefulRemoteSubscribable<boolean>;
/**
* All possible steps a buyer can take to complete the checkout. These steps may vary depending on the type of checkout or the shop's configuration.
*/
steps: StatefulRemoteSubscribable<BuyerJourneyStep[]>;
/**
* What step of checkout the buyer is currently on.
*/
activeStep: StatefulRemoteSubscribable<BuyerJourneyStepReference | undefined>;
}
BuyerJourneyStepReference
What step of checkout the buyer is currently on.
- handle
The handle that uniquely identifies the buyer journey step.
BuyerJourneyStepHandle
interface BuyerJourneyStepReference {
/**
* The handle that uniquely identifies the buyer journey step.
*/
handle: BuyerJourneyStepHandle;
}
BuyerJourneyStepHandle
| handle | Description | |---|---| | `cart` | The cart page. | | `checkout` | A one-page checkout, including Shop Pay. | | `information` | The contact information step of a three-page checkout. | | `shipping` | The shipping step of a three-page checkout. | | `payment` | The payment step of a three-page checkout. | | `review` | The step after payment where the buyer confirms the purchase. Not all shops are configured to have a review step. | | `thank-you` | The page displayed after the purchase, thanking the buyer. | | `unknown` | An unknown step in the buyer journey. |
'cart' | 'checkout' | 'information' | 'shipping' | 'payment' | 'review' | 'thank-you' | 'unknown'
Interceptor
A function for intercepting and preventing navigation on checkout. You can block navigation by returning an object with `{behavior: 'block', reason: InvalidResultReason.InvalidExtensionState, errors?: ValidationErrors[]}`. If you do, then you're expected to also update some part of your UI to reflect the reason why navigation was blocked, either by targeting checkout UI fields, passing errors to the page level or rendering the errors in your extension.
- interceptorProps
InterceptorProps
InterceptorRequest | Promise<InterceptorRequest>
export type Interceptor = (
interceptorProps: InterceptorProps,
) => InterceptorRequest | Promise<InterceptorRequest>;
InterceptorProps
- canBlockProgress
Whether the interceptor has the capability to block a buyer's progress through checkout. This ability might be granted by a merchant in differing checkout contexts.
boolean
export interface InterceptorProps {
/**
* Whether the interceptor has the capability to block a buyer's progress through
* checkout. This ability might be granted by a merchant in differing checkout contexts.
*/
canBlockProgress: boolean;
}
InterceptorRequest
InterceptorRequestAllow | InterceptorRequestBlock
InterceptorRequestAllow
- behavior
Indicates that the interceptor will allow the buyer's journey to continue.
"allow"
- perform
This callback is called when all interceptors finish. We recommend setting errors or reasons for blocking at this stage, so that all the errors in the UI show up at once.
(result: InterceptorResult) => void | Promise<void>
interface InterceptorRequestAllow {
/**
* Indicates that the interceptor will allow the buyer's journey to continue.
*/
behavior: 'allow';
/**
* This callback is called when all interceptors finish. We recommend
* setting errors or reasons for blocking at this stage, so that all the errors in
* the UI show up at once.
* @param result InterceptorResult with behavior as either 'allow' or 'block'
*/
perform?(result: InterceptorResult): void | Promise<void>;
}
InterceptorResult
InterceptorResultAllow | InterceptorResultBlock
InterceptorResultAllow
- behavior
Indicates that the buyer was allowed to progress through checkout.
"allow"
interface InterceptorResultAllow {
/**
* Indicates that the buyer was allowed to progress through checkout.
*/
behavior: 'allow';
}
InterceptorResultBlock
- behavior
Indicates that some part of the checkout UI intercepted and prevented the buyer’s progress. The buyer typically needs to take some action to resolve this issue and to move on to the next step.
"block"
interface InterceptorResultBlock {
/**
* Indicates that some part of the checkout UI intercepted and prevented
* the buyer’s progress. The buyer typically needs to take some action
* to resolve this issue and to move on to the next step.
*/
behavior: 'block';
}
InterceptorRequestBlock
- behavior
Indicates that the interceptor will block the buyer's journey from continuing.
"block"
- errors
Used to pass errors to the checkout UI, outside your extension's UI boundaries.
ValidationError[]
- perform
This callback is called when all interceptors finish. We recommend setting errors or reasons for blocking at this stage, so that all the errors in the UI show up at once.
(result: InterceptorResult) => void | Promise<void>
- reason
The reason for blocking the interceptor request. This value isn't presented to the buyer, so it doesn't need to be localized. The value is used only for Shopify’s own internal debugging and metrics.
string
interface InterceptorRequestBlock {
/**
* Indicates that the interceptor will block the buyer's journey from continuing.
*/
behavior: 'block';
/**
* The reason for blocking the interceptor request. This value isn't presented to
* the buyer, so it doesn't need to be localized. The value is used only for Shopify’s
* own internal debugging and metrics.
*/
reason: string;
/**
* Used to pass errors to the checkout UI, outside your extension's UI boundaries.
*/
errors?: ValidationError[];
/**
* This callback is called when all interceptors finish. We recommend
* setting errors or reasons for blocking at this stage, so that all the errors in
* the UI show up at once.
* @param result InterceptorResult with behavior as either 'allow' or 'block'
*/
perform?(result: InterceptorResult): void | Promise<void>;
}
ValidationError
- message
Error message to be displayed to the buyer.
string
- target
The checkout UI field that the error is associated with. Example: `$.cart.deliveryGroups[0].deliveryAddress.countryCode` See the [supported targets](/docs/api/functions/reference/cart-checkout-validation/graphql#supported-targets) for more information.
string
export interface ValidationError {
/**
* Error message to be displayed to the buyer.
*/
message: string;
/**
* The checkout UI field that the error is associated with.
*
* Example: `$.cart.deliveryGroups[0].deliveryAddress.countryCode`
*
* See the [supported targets](/docs/api/functions/reference/cart-checkout-validation/graphql#supported-targets)
* for more information.
*/
target?: string;
}
BuyerJourneyStep
- disabled
The disabled state of the buyer journey step. This value will be true if the buyer has not reached the step yet. For example, if the buyer has not reached the `shipping` step yet, `shipping` would be disabled.
boolean
- handle
The handle that uniquely identifies the buyer journey step.
BuyerJourneyStepHandle
- label
The localized label of the buyer journey step.
string
- to
The url of the buyer journey step. This property leverages the `shopify:` protocol E.g. `shopify:cart` or `shopify:checkout/information`.
string
export interface BuyerJourneyStep {
/**
* The handle that uniquely identifies the buyer journey step.
*/
handle: BuyerJourneyStepHandle;
/**
* The localized label of the buyer journey step.
*/
label: string;
/**
* The url of the buyer journey step. This property leverages the `shopify:` protocol
* E.g. `shopify:cart` or `shopify:checkout/information`.
*/
to: string;
/**
* The disabled state of the buyer journey step. This value will be true if the buyer has not reached the step yet.
*
* For example, if the buyer has not reached the `shipping` step yet, `shipping` would be disabled.
*/
disabled: boolean;
}
CheckoutSettings
Settings describing the behavior of the buyer's checkout.
- orderSubmission
The type of order that will be created once the buyer completes checkout.
'DRAFT_ORDER' | 'ORDER'
- paymentTermsTemplate
Represents the merchant configured payment terms.
PaymentTermsTemplate
- shippingAddress
Settings describing the behavior of the shipping address.
ShippingAddressSettings
export interface CheckoutSettings {
/**
* The type of order that will be created once the buyer completes checkout.
*/
orderSubmission: 'DRAFT_ORDER' | 'ORDER';
/**
* Represents the merchant configured payment terms.
*/
paymentTermsTemplate?: PaymentTermsTemplate;
/**
* Settings describing the behavior of the shipping address.
*/
shippingAddress: ShippingAddressSettings;
}
PaymentTermsTemplate
Represents the payment terms template object.
- dueDate
The due date for net payment terms as a ISO 8601 formatted string `YYYY-MM-DDTHH:mm:ss.sssZ`.
string
- dueInDays
The number of days between the issued date and due date if using net payment terms.
number
- id
A globally-unique ID.
string
- name
The name of the payment terms translated to the buyer's current language. Refer to [localization.language](/docs/api/checkout-ui-extensions/apis/localization#standardapi-propertydetail-localization).
string
export interface PaymentTermsTemplate {
/**
* A globally-unique ID.
* @example 'gid://shopify/PaymentTermsTemplate/1'
*/
id: string;
/**
* The name of the payment terms translated to the buyer's current language. Refer to [localization.language](/docs/api/checkout-ui-extensions/apis/localization#standardapi-propertydetail-localization).
*/
name: string;
/**
* The due date for net payment terms as a ISO 8601 formatted string `YYYY-MM-DDTHH:mm:ss.sssZ`.
*/
dueDate?: string;
/**
* The number of days between the issued date and due date if using net payment terms.
*/
dueInDays?: number;
}
ShippingAddressSettings
Settings describing the behavior of the shipping address.
- isEditable
Describes whether the buyer can ship to any address during checkout.
boolean
export interface ShippingAddressSettings {
/**
* Describes whether the buyer can ship to any address during checkout.
*/
isEditable: boolean;
}
CheckoutToken
string
CartCost
- subtotalAmount
A `Money` value representing the subtotal value of the items in the cart at the current step of checkout.
StatefulRemoteSubscribable<Money>
- totalAmount
A `Money` value representing the minimum a buyer can expect to pay at the current step of checkout. This value excludes amounts yet to be negotiated. For example, the information step might not have delivery costs calculated.
StatefulRemoteSubscribable<Money>
- totalShippingAmount
A `Money` value representing the total shipping a buyer can expect to pay at the current step of checkout. This value includes shipping discounts. Returns undefined if shipping has not been negotiated yet, such as on the information step.
StatefulRemoteSubscribable<Money | undefined>
- totalTaxAmount
A `Money` value representing the total tax a buyer can expect to pay at the current step of checkout or the total tax included in product and shipping prices. Returns undefined if taxes are unavailable.
StatefulRemoteSubscribable<Money | undefined>
export interface CartCost {
/**
* A `Money` value representing the subtotal value of the items in the cart at the current
* step of checkout.
*/
subtotalAmount: StatefulRemoteSubscribable<Money>;
/**
* A `Money` value representing the total shipping a buyer can expect to pay at the current
* step of checkout. This value includes shipping discounts. Returns undefined if shipping
* has not been negotiated yet, such as on the information step.
*/
totalShippingAmount: StatefulRemoteSubscribable<Money | undefined>;
/**
* A `Money` value representing the total tax a buyer can expect to pay at the current
* step of checkout or the total tax included in product and shipping prices. Returns
* undefined if taxes are unavailable.
*/
totalTaxAmount: StatefulRemoteSubscribable<Money | undefined>;
/**
* A `Money` value representing the minimum a buyer can expect to pay at the current
* step of checkout. This value excludes amounts yet to be negotiated. For example,
* the information step might not have delivery costs calculated.
*/
totalAmount: StatefulRemoteSubscribable<Money>;
}
CustomerPrivacy
- allowedProcessing
An object containing flags for each consent property denoting whether they can be processed based on visitor consent, merchant configuration, and user location.
AllowedProcessing
- metafields
Stored tracking consent metafield data.
TrackingConsentMetafield[]
- region
Details about the visitor's current location for use in evaluating if more granular consent controls should render.
CustomerPrivacyRegion
- saleOfDataRegion
Whether the visitor is in a region requiring data sale opt-outs.
boolean
- shouldShowBanner
Whether a consent banner should be displayed by default when the page loads. Use this as the initial open/expanded state of the consent banner. This is determined by the visitor's current privacy consent, the shop's [region visibility configuration](https://help.shopify.com/en/manual/privacy-and-security/privacy/customer-privacy-settings/privacy-settings#add-a-cookie-banner) settings, and the region in which the visitor is located.
boolean
- visitorConsent
An object containing the customer's current privacy consent settings. *
VisitorConsent
export interface CustomerPrivacy {
/**
* An object containing flags for each consent property denoting whether they can be processed based on visitor consent, merchant configuration, and user location.
*/
allowedProcessing: AllowedProcessing;
/**
* Stored tracking consent metafield data.
*
* @example `[{key: 'analyticsType', value: 'granular'}, {key: 'marketingType', value: 'granular'}]`, or `[]`
*/
metafields: TrackingConsentMetafield[];
/**
* An object containing the customer's current privacy consent settings.
* *
* @example `true` — the customer has actively granted consent, `false` — the customer has actively denied consent, or `undefined` — the customer has not yet made a decision.
*/
visitorConsent: VisitorConsent;
/**
* Whether a consent banner should be displayed by default when the page loads. Use this as the initial open/expanded state of the consent banner.
*
* This is determined by the visitor's current privacy consent, the shop's [region visibility configuration](https://help.shopify.com/en/manual/privacy-and-security/privacy/customer-privacy-settings/privacy-settings#add-a-cookie-banner) settings, and the region in which the visitor is located.
*/
shouldShowBanner: boolean;
/**
* Whether the visitor is in a region requiring data sale opt-outs.
*/
saleOfDataRegion: boolean;
/**
* Details about the visitor's current location for use in evaluating if more granular consent controls should render.
*
* @example `{countryCode: 'CA', provinceCode: 'ON'}` for a visitor in Ontario, Canada; `{countryCode: 'US', provinceCode: undefined}` for a visitor in the United States if geolocation fails to detect the state; or `undefined` if neither country nor province is detected or geolocation fails.
*
* {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
*/
region?: CustomerPrivacyRegion;
}
AllowedProcessing
- analytics
Can collect customer analytics about how the shop was used and interactions made on the shop.
boolean
- marketing
Can collect customer preference for marketing, attribution and targeted advertising from the merchant.
boolean
- preferences
Can collect customer preferences such as language, currency, size, and more.
boolean
- saleOfData
Can collect customer preference for sharing data with third parties, usually for behavioral advertising.
boolean
export interface AllowedProcessing {
/**
* Can collect customer analytics about how the shop was used and interactions made on the shop.
*/
analytics: boolean;
/**
* Can collect customer preference for marketing, attribution and targeted advertising from the merchant.
*/
marketing: boolean;
/**
* Can collect customer preferences such as language, currency, size, and more.
*/
preferences: boolean;
/**
* Can collect customer preference for sharing data with third parties, usually for behavioral advertising.
*/
saleOfData: boolean;
}
TrackingConsentMetafield
- key
The name of the metafield. It must be between 3 and 30 characters in length (inclusive).
string
- value
The information to be stored as metadata.
string
export interface TrackingConsentMetafield {
/**
* The name of the metafield. It must be between 3 and 30 characters in
* length (inclusive).
*/
key: string;
/**
* The information to be stored as metadata.
*
* @example 'any string', '', or a stringified JSON object
*/
value: string;
}
CustomerPrivacyRegion
- countryCode
The [ISO 3166 Alpha-2 format](https://www.iso.org/iso-3166-country-codes.html) for the buyer's country. {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
CountryCode
- provinceCode
The buyer's province code, such as state, province, prefecture, or region. Province codes can be found by clicking on the `Subdivisions assigned codes` column for countries listed [here](https://en.wikipedia.org/wiki/ISO_3166-2). {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
string
export interface CustomerPrivacyRegion {
/**
* The [ISO 3166 Alpha-2 format](https://www.iso.org/iso-3166-country-codes.html) for the buyer's country.
*
* {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
*
* @example 'CA' for Canada, 'US' for United States, 'GB' for Great Britain, or undefined if geolocation failed.
*/
countryCode?: CountryCode;
/**
* The buyer's province code, such as state, province, prefecture, or region.
*
* Province codes can be found by clicking on the `Subdivisions assigned codes` column for countries listed [here](https://en.wikipedia.org/wiki/ISO_3166-2).
*
* {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
*
* @example 'ON' for Ontario, 'ENG' for England, 'CA' for California, or undefined if geolocation failed or only the country was detected.
*/
provinceCode?: string;
}
DeliveryGroup
Represents the delivery information and options available for one or more cart lines.
- deliveryOptions
The delivery options available for the delivery group.
DeliveryOption[]
- groupType
The type of the delivery group.
DeliveryGroupType
- id
The unique identifier of the delivery group. On the Thank You page this value is undefined.
string
- isDeliveryRequired
Whether delivery is required for the delivery group.
boolean
- selectedDeliveryOption
The selected delivery option for the delivery group.
DeliveryOptionReference
- targetedCartLines
The cart line references associated to the delivery group.
CartLineReference[]
export interface DeliveryGroup {
/**
* The unique identifier of the delivery group. On the Thank You page this value is undefined.
*/
id?: string;
/**
* The cart line references associated to the delivery group.
*/
targetedCartLines: CartLineReference[];
/**
* The delivery options available for the delivery group.
*/
deliveryOptions: DeliveryOption[];
/**
* The selected delivery option for the delivery group.
*/
selectedDeliveryOption?: DeliveryOptionReference;
/**
* The type of the delivery group.
*/
groupType: DeliveryGroupType;
/**
* Whether delivery is required for the delivery group.
*/
isDeliveryRequired: boolean;
}
DeliveryOption
ShippingOption | PickupPointOption | PickupLocationOption
ShippingOption
Represents a delivery option that is a shipping option.
- carrier
Information about the carrier.
ShippingOptionCarrier
- code
The code of the delivery option.
string
- cost
The cost of the delivery.
Money
- costAfterDiscounts
The cost of the delivery including discounts.
Money
- deliveryEstimate
Information about the estimated delivery time.
DeliveryEstimate
- description
The description of the delivery option.
string
- handle
The unique identifier of the delivery option.
string
- title
The title of the delivery option.
string
- type
The type of this delivery option.
'shipping' | 'local'
export interface ShippingOption extends DeliveryOptionBase {
/**
* The type of this delivery option.
*/
type: 'shipping' | 'local';
/**
* Information about the carrier.
*/
carrier: ShippingOptionCarrier;
/**
* The cost of the delivery.
*/
cost: Money;
/**
* The cost of the delivery including discounts.
*/
costAfterDiscounts: Money;
/**
* Information about the estimated delivery time.
*/
deliveryEstimate: DeliveryEstimate;
}
ShippingOptionCarrier
- name
The name of the carrier.
string
export interface ShippingOptionCarrier {
/**
* The name of the carrier.
*/
name?: string;
}
DeliveryEstimate
- timeInTransit
The estimated time in transit for the delivery in seconds.
NumberRange
export interface DeliveryEstimate {
/**
* The estimated time in transit for the delivery in seconds.
*/
timeInTransit?: NumberRange;
}
NumberRange
- lower
The lower bound of the number range.
number
- upper
The upper bound of the number range.
number
export interface NumberRange {
/**
* The lower bound of the number range.
*/
lower?: number;
/**
* The upper bound of the number range.
*/
upper?: number;
}
PickupPointOption
- carrier
Information about the carrier that ships to the pickup point.
PickupPointCarrier
- code
The code of the delivery option.
string
- cost
The cost to ship to this pickup point.
Money
- costAfterDiscounts
The cost to ship to this pickup point including discounts.
Money
- description
The description of the delivery option.
string
- handle
The unique identifier of the delivery option.
string
- location
The location details of the pickup point.
PickupPointLocation
- title
The title of the delivery option.
string
- type
The type of this delivery option.
"pickupPoint"
export interface PickupPointOption extends DeliveryOptionBase {
/**
* The type of this delivery option.
*/
type: 'pickupPoint';
/**
* Information about the carrier that ships to the pickup point.
*/
carrier: PickupPointCarrier;
/**
* The cost to ship to this pickup point.
*/
cost: Money;
/**
* The cost to ship to this pickup point including discounts.
*/
costAfterDiscounts: Money;
/**
* The location details of the pickup point.
*/
location: PickupPointLocation;
}
PickupPointCarrier
- code
The code identifying the carrier.
string
- name
The name of the carrier.
string
interface PickupPointCarrier {
/**
* The code identifying the carrier.
*/
code?: string;
/**
* The name of the carrier.
*/
name?: string;
}
PickupPointLocation
- address
The address of the pickup point.
MailingAddress
- handle
The unique identifier of the pickup point.
string
- name
The name of the pickup point.
string
interface PickupPointLocation {
/**
* The name of the pickup point.
*/
name?: string;
/**
* The unique identifier of the pickup point.
*/
handle: string;
/**
* The address of the pickup point.
*/
address: MailingAddress;
}
PickupLocationOption
- code
The code of the delivery option.
string
- description
The description of the delivery option.
string
- handle
The unique identifier of the delivery option.
string
- location
The location details of the pickup location.
PickupLocation
- metafields
The metafields associated with this delivery option.
Metafield[]
- title
The title of the delivery option.
string
- type
The type of this delivery option.
"pickup"
export interface PickupLocationOption extends DeliveryOptionBase {
/**
* The type of this delivery option.
*/
type: 'pickup';
/**
* The location details of the pickup location.
*/
location: PickupLocation;
/**
* The metafields associated with this delivery option.
*/
metafields?: Metafield[];
}
PickupLocation
- address
The address of the pickup location.
MailingAddress
- name
The name of the pickup location.
string
interface PickupLocation {
/**
* The name of the pickup location.
*/
name?: string;
/**
* The address of the pickup location.
*/
address: MailingAddress;
}
DeliveryGroupType
The possible types of a delivery group.
'oneTimePurchase' | 'subscription'
DeliveryOptionReference
Represents a reference to a delivery option.
- handle
The unique identifier of the referenced delivery option.
string
export interface DeliveryOptionReference {
/**
* The unique identifier of the referenced delivery option.
*/
handle: string;
}
CartLineReference
Represents a reference to a cart line.
- id
The unique identifier of the referenced cart line.
string
export interface CartLineReference {
/**
* The unique identifier of the referenced cart line.
*/
id: string;
}
CartDiscountCode
- code
The code for the discount
string
export interface CartDiscountCode {
/**
* The code for the discount
*/
code: string;
}
Extension
The meta information about an extension target.
- apiVersion
The API version that was set in the extension config file.
ApiVersion
- capabilities
The allowed capabilities of the extension, defined in your [shopify.extension.toml](/docs/api/checkout-ui-extensions/configuration) file. * [`api_access`](/docs/api/checkout-ui-extensions/configuration#api-access): the extension can access the Storefront API. * [`network_access`](/docs/api/checkout-ui-extensions/configuration#network-access): the extension can make external network calls. * [`block_progress`](/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`](/docs/api/checkout-ui-extensions/configuration#collect-buyer-consent): the extension can collect customer consent for SMS marketing. * [`collect_buyer_consent.customer_privacy`](/docs/api/checkout-ui-extensions/configuration#collect-buyer-consent): the extension can register customer consent decisions that will be honored on Shopify-managed services.
StatefulRemoteSubscribable<Capability[]>
- editor
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
- rendered
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.
StatefulRemoteSubscribable<boolean>
- scriptUrl
The URL to the script that started the extension target.
string
- target
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.
Target
- version
The published version of the running extension target. For unpublished extensions, the value is `undefined`.
string
export interface Extension<Target extends ExtensionTarget = ExtensionTarget> {
/**
* The API version that was set in the extension config file.
*
* @example '2023-07', '2023-10', '2024-01', '2024-04', '2024-07', 'unstable'
*/
apiVersion: ApiVersion;
/**
* The allowed capabilities of the extension, defined
* in your [shopify.extension.toml](/docs/api/checkout-ui-extensions/configuration) file.
*
* * [`api_access`](/docs/api/checkout-ui-extensions/configuration#api-access): the extension can access the Storefront API.
*
* * [`network_access`](/docs/api/checkout-ui-extensions/configuration#network-access): the extension can make external network calls.
*
* * [`block_progress`](/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`](/docs/api/checkout-ui-extensions/configuration#collect-buyer-consent): the extension can collect customer consent for SMS marketing.
*
* * [`collect_buyer_consent.customer_privacy`](/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<Capability[]>;
/**
* 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<boolean>;
/**
* 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-07/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;
}
ApiVersion
Union of supported API versions
'2023-04' | '2023-07' | '2023-10' | '2024-01' | '2024-04' | '2024-07' | 'unstable'
Capability
The capabilities an extension has access to. * [`api_access`](/docs/api/checkout-ui-extensions/configuration#api-access): the extension can access the Storefront API. * [`network_access`](/docs/api/checkout-ui-extensions/configuration#network-access): the extension can make external network calls. * [`block_progress`](/docs/api/checkout-ui-extensions/configuration#block-progress): the extension can block a buyer's progress and the merchant has allowed this blocking behavior. * [`collect_buyer_consent.sms_marketing`](/docs/api/checkout-ui-extensions/configuration#collect-buyer-consent): the extension can collect buyer consent for SMS marketing. * [`collect_buyer_consent.customer_privacy`](/docs/api/checkout-ui-extensions/configuration#collect-buyer-consent): the extension can register buyer consent decisions that will be honored on Shopify-managed services.
'api_access' | 'network_access' | 'block_progress' | 'collect_buyer_consent.sms_marketing' | 'collect_buyer_consent.customer_privacy'
Editor
- type
Indicates whether the extension is rendering in the checkout editor.
"checkout"
export interface Editor {
/**
* Indicates whether the extension is rendering in the checkout editor.
*/
type: 'checkout';
}
I18n
- formatCurrency
Returns a localized currency value. This function behaves like the standard `Intl.NumberFormat()` with a style of `currency` applied. It uses the buyer's locale by default.
(number: number | bigint, options?: { inExtensionLocale?: boolean; } & NumberFormatOptions) => string
- formatDate
Returns a localized date value. This function behaves like the standard `Intl.DateTimeFormatOptions()` and uses the buyer's locale by default. Formatting options can be passed in as options.
(date: Date, options?: { inExtensionLocale?: boolean; } & DateTimeFormatOptions) => string
- formatNumber
Returns a localized number. This function behaves like the standard `Intl.NumberFormat()` with a style of `decimal` applied. It uses the buyer's locale by default.
(number: number | bigint, options?: { inExtensionLocale?: boolean; } & NumberFormatOptions) => string
- translate
Returns translated content in the buyer's locale, as supported by the extension. - `options.count` is a special numeric value used in pluralization. - The other option keys and values are treated as replacements for interpolation. - If the replacements are all primitives, then `translate()` returns a single string. - If replacements contain UI components, then `translate()` returns an array of elements.
I18nTranslate
export interface I18n {
/**
* Returns a localized number.
*
* This function behaves like the standard `Intl.NumberFormat()`
* with a style of `decimal` applied. It uses the buyer's locale by default.
*
* @param options.inExtensionLocale - if true, use the extension's locale
*/
formatNumber: (
number: number | bigint,
options?: {inExtensionLocale?: boolean} & Intl.NumberFormatOptions,
) => string;
/**
* Returns a localized currency value.
*
* This function behaves like the standard `Intl.NumberFormat()`
* with a style of `currency` applied. It uses the buyer's locale by default.
*
* @param options.inExtensionLocale - if true, use the extension's locale
*/
formatCurrency: (
number: number | bigint,
options?: {inExtensionLocale?: boolean} & Intl.NumberFormatOptions,
) => string;
/**
* Returns a localized date value.
*
* This function behaves like the standard `Intl.DateTimeFormatOptions()` and uses
* the buyer's locale by default. Formatting options can be passed in as
* options.
*
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat0
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat#using_options
*
* @param options.inExtensionLocale - if true, use the extension's locale
*/
formatDate: (
date: Date,
options?: {inExtensionLocale?: boolean} & Intl.DateTimeFormatOptions,
) => string;
/**
* Returns translated content in the buyer's locale,
* as supported by the extension.
*
* - `options.count` is a special numeric value used in pluralization.
* - The other option keys and values are treated as replacements for interpolation.
* - If the replacements are all primitives, then `translate()` returns a single string.
* - If replacements contain UI components, then `translate()` returns an array of elements.
*/
translate: I18nTranslate;
}
I18nTranslate
This returns a translated string matching a key in a locale file.
export interface I18nTranslate {
<ReplacementType = string>(
key: string,
options?: Record<string, ReplacementType | string | number>,
): ReplacementType extends string | number
? string
: (string | ReplacementType)[];
}
CartInstructions
- attributes
Cart instructions related to cart attributes.
AttributesCartInstructions
- delivery
Cart instructions related to delivery.
DeliveryCartInstructions
- discounts
Cart instructions related to discounts.
DiscountsCartInstructions
- lines
Cart instructions related to cart lines.
CartLinesCartInstructions
- metafields
Cart instructions related to metafields.
MetafieldsCartInstructions
- notes
Cart instructions related to notes.
NotesCartInstructions
export interface CartInstructions {
/**
* Cart instructions related to cart attributes.
*/
attributes: AttributesCartInstructions;
/**
* Cart instructions related to delivery.
*/
delivery: DeliveryCartInstructions;
/**
* Cart instructions related to discounts.
*/
discounts: DiscountsCartInstructions;
/**
* Cart instructions related to cart lines.
*/
lines: CartLinesCartInstructions;
/**
* Cart instructions related to metafields.
*/
metafields: MetafieldsCartInstructions;
/**
* Cart instructions related to notes.
*/
notes: NotesCartInstructions;
}
AttributesCartInstructions
- canUpdateAttributes
Indicates whether or not cart attributes can be updated.
boolean
export interface AttributesCartInstructions {
/**
* Indicates whether or not cart attributes can be updated.
*/
canUpdateAttributes: boolean;
}
DeliveryCartInstructions
- canSelectCustomAddress
Indicates whether a buyer can select a custom address. When true, this implies extensions can update the delivery address.
boolean
export interface DeliveryCartInstructions {
/**
* Indicates whether a buyer can select a custom address.
*
* When true, this implies extensions can update the delivery address.
*/
canSelectCustomAddress: boolean;
}
DiscountsCartInstructions
- canUpdateDiscountCodes
Indicates whether or not discount codes can be updated.
boolean
export interface DiscountsCartInstructions {
/**
* Indicates whether or not discount codes can be updated.
*/
canUpdateDiscountCodes: boolean;
}
CartLinesCartInstructions
- canAddCartLine
Indicates whether or not new cart lines can be added.
boolean
- canRemoveCartLine
Indicates whether or not cart lines can be removed.
boolean
- canUpdateCartLine
Indicates whether or not cart lines can be updated.
boolean
export interface CartLinesCartInstructions {
/**
* Indicates whether or not new cart lines can be added.
*/
canAddCartLine: boolean;
/**
* Indicates whether or not cart lines can be removed.
*/
canRemoveCartLine: boolean;
/**
* Indicates whether or not cart lines can be updated.
*/
canUpdateCartLine: boolean;
}
MetafieldsCartInstructions
- canDeleteCartMetafield
Indicates whether or not cart metafields can be deleted.
boolean
- canSetCartMetafields
Indicates whether or not cart metafields can be added or updated.
boolean
export interface MetafieldsCartInstructions {
/**
* Indicates whether or not cart metafields can be added or updated.
*/
canSetCartMetafields: boolean;
/**
* Indicates whether or not cart metafields can be deleted.
*/
canDeleteCartMetafield: boolean;
}
NotesCartInstructions
- canUpdateNote
Indicates whether or not notes can be updated.
boolean
export interface NotesCartInstructions {
/**
* Indicates whether or not notes can be updated.
*/
canUpdateNote: boolean;
}
Localization
- country
The country context of the checkout. This value carries over from the context of the cart, where it was used to contextualize the storefront experience. It will update if the buyer changes the country of their shipping address. If the country is unknown, then the value is undefined.
StatefulRemoteSubscribable<Country | undefined>
- currency
The currency that the customer sees for money amounts in the checkout.
StatefulRemoteSubscribable<Currency>
- extensionLanguage
This is the customer's language, as supported by the extension. If the customer's actual language is not supported by the extension, then this is the language that is used for translations. For example, if the customer's language is 'fr-CA' but your extension only supports translations for 'fr', then the `isoCode` for this language is 'fr'. If your extension does not provide french translations at all, then this value is the default locale for your extension (that is, the one matching your .default.json file).
StatefulRemoteSubscribable<Language>
- language
The language the customer sees in the checkout.
StatefulRemoteSubscribable<Language>
- market
The [market](/docs/apps/markets) context of the checkout. This value carries over from the context of the cart, where it was used to contextualize the storefront experience. It will update if the buyer changes the country of their shipping address. If the market is unknown, then the value is undefined.
StatefulRemoteSubscribable<Market | undefined>
- timezone
The buyer’s time zone.
StatefulRemoteSubscribable<Timezone>
export interface Localization {
/**
* The currency that the customer sees for money amounts in the checkout.
*/
currency: StatefulRemoteSubscribable<Currency>;
/**
* The buyer’s time zone.
*/
timezone: StatefulRemoteSubscribable<Timezone>;
/**
* The language the customer sees in the checkout.
*/
language: StatefulRemoteSubscribable<Language>;
/**
* This is the customer's language, as supported by the extension.
* If the customer's actual language is not supported by the extension,
* then this is the language that is used for translations.
*
* For example, if the customer's language is 'fr-CA' but your extension
* only supports translations for 'fr', then the `isoCode` for this
* language is 'fr'. If your extension does not provide french
* translations at all, then this value is the default locale for your
* extension (that is, the one matching your .default.json file).
*/
extensionLanguage: StatefulRemoteSubscribable<Language>;
/**
* The country context of the checkout. This value carries over from the
* context of the cart, where it was used to contextualize the storefront
* experience. It will update if the buyer changes the country of their
* shipping address. If the country is unknown, then the value is undefined.
*/
country: StatefulRemoteSubscribable<Country | undefined>;
/**
* The [market](/docs/apps/markets) context of the
* checkout. This value carries over from the context of the cart, where it
* was used to contextualize the storefront experience. It will update if the
* buyer changes the country of their shipping address. If the market is unknown,
* then the value is undefined.
*/
market: StatefulRemoteSubscribable<Market | undefined>;
}
Country
- isoCode
The ISO-3166-1 code for this country.
CountryCode
export interface Country {
/**
* The ISO-3166-1 code for this country.
* @see https://www.iso.org/iso-3166-country-codes.html
*/
isoCode: CountryCode;
}
Currency
- isoCode
The ISO-4217 code for this currency.
CurrencyCode
export interface Currency {
/**
* The ISO-4217 code for this currency.
* @see https://www.iso.org/iso-4217-currency-codes.html
*/
isoCode: CurrencyCode;
}
Language
- isoCode
The BCP-47 language tag. It may contain a dash followed by an ISO 3166-1 alpha-2 region code.
string
export interface Language {
/**
* The BCP-47 language tag. It may contain a dash followed by an ISO 3166-1 alpha-2 region code.
*
* @example 'en' for English, or 'en-US' for English local to United States.
* @see https://en.wikipedia.org/wiki/IETF_language_tag
* @see https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
*/
isoCode: string;
}
Market
- handle
The human-readable, shop-scoped identifier for the market.
string
- id
A globally-unique identifier for a market.
string
export interface Market {
/**
* A globally-unique identifier for a market.
*/
id: string;
/**
* The human-readable, shop-scoped identifier for the market.
*/
handle: string;
}
Timezone
'Africa/Abidjan' | 'Africa/Algiers' | 'Africa/Bissau' | 'Africa/Cairo' | 'Africa/Casablanca' | 'Africa/Ceuta' | 'Africa/El_Aaiun' | 'Africa/Johannesburg' | 'Africa/Juba' | 'Africa/Khartoum' | 'Africa/Lagos' | 'Africa/Maputo' | 'Africa/Monrovia' | 'Africa/Nairobi' | 'Africa/Ndjamena' | 'Africa/Sao_Tome' | 'Africa/Tripoli' | 'Africa/Tunis' | 'Africa/Windhoek' | 'America/Adak' | 'America/Anchorage' | 'America/Araguaina' | 'America/Argentina/Buenos_Aires' | 'America/Argentina/Catamarca' | 'America/Argentina/Cordoba' | 'America/Argentina/Jujuy' | 'America/Argentina/La_Rioja' | 'America/Argentina/Mendoza' | 'America/Argentina/Rio_Gallegos' | 'America/Argentina/Salta' | 'America/Argentina/San_Juan' | 'America/Argentina/San_Luis' | 'America/Argentina/Tucuman' | 'America/Argentina/Ushuaia' | 'America/Asuncion' | 'America/Bahia' | 'America/Bahia_Banderas' | 'America/Barbados' | 'America/Belem' | 'America/Belize' | 'America/Boa_Vista' | 'America/Bogota' | 'America/Boise' | 'America/Cambridge_Bay' | 'America/Campo_Grande' | 'America/Cancun' | 'America/Caracas' | 'America/Cayenne' | 'America/Chicago' | 'America/Chihuahua' | 'America/Costa_Rica' | 'America/Cuiaba' | 'America/Danmarkshavn' | 'America/Dawson' | 'America/Dawson_Creek' | 'America/Denver' | 'America/Detroit' | 'America/Edmonton' | 'America/Eirunepe' | 'America/El_Salvador' | 'America/Fort_Nelson' | 'America/Fortaleza' | 'America/Glace_Bay' | 'America/Goose_Bay' | 'America/Grand_Turk' | 'America/Guatemala' | 'America/Guayaquil' | 'America/Guyana' | 'America/Halifax' | 'America/Havana' | 'America/Hermosillo' | 'America/Indiana/Indianapolis' | 'America/Indiana/Knox' | 'America/Indiana/Marengo' | 'America/Indiana/Petersburg' | 'America/Indiana/Tell_City' | 'America/Indiana/Vevay' | 'America/Indiana/Vincennes' | 'America/Indiana/Winamac' | 'America/Inuvik' | 'America/Iqaluit' | 'America/Jamaica' | 'America/Juneau' | 'America/Kentucky/Louisville' | 'America/Kentucky/Monticello' | 'America/La_Paz' | 'America/Lima' | 'America/Los_Angeles' | 'America/Maceio' | 'America/Managua' | 'America/Manaus' | 'America/Martinique' | 'America/Matamoros' | 'America/Mazatlan' | 'America/Menominee' | 'America/Merida' | 'America/Metlakatla' | 'America/Mexico_City' | 'America/Miquelon' | 'America/Moncton' | 'America/Monterrey' | 'America/Montevideo' | 'America/New_York' | 'America/Nipigon' | 'America/Nome' | 'America/Noronha' | 'America/North_Dakota/Beulah' | 'America/North_Dakota/Center' | 'America/North_Dakota/New_Salem' | 'America/Nuuk' | 'America/Ojinaga' | 'America/Panama' | 'America/Pangnirtung' | 'America/Paramaribo' | 'America/Phoenix' | 'America/Port-au-Prince' | 'America/Porto_Velho' | 'America/Puerto_Rico' | 'America/Punta_Arenas' | 'America/Rainy_River' | 'America/Rankin_Inlet' | 'America/Recife' | 'America/Regina' | 'America/Resolute' | 'America/Rio_Branco' | 'America/Santarem' | 'America/Santiago' | 'America/Santo_Domingo' | 'America/Sao_Paulo' | 'America/Scoresbysund' | 'America/Sitka' | 'America/St_Johns' | 'America/Swift_Current' | 'America/Tegucigalpa' | 'America/Thule' | 'America/Thunder_Bay' | 'America/Tijuana' | 'America/Toronto' | 'America/Vancouver' | 'America/Whitehorse' | 'America/Winnipeg' | 'America/Yakutat' | 'America/Yellowknife' | 'Antarctica/Casey' | 'Antarctica/Davis' | 'Antarctica/Macquarie' | 'Antarctica/Mawson' | 'Antarctica/Palmer' | 'Antarctica/Rothera' | 'Antarctica/Troll' | 'Antarctica/Vostok' | 'Asia/Almaty' | 'Asia/Amman' | 'Asia/Anadyr' | 'Asia/Aqtau' | 'Asia/Aqtobe' | 'Asia/Ashgabat' | 'Asia/Atyrau' | 'Asia/Baghdad' | 'Asia/Baku' | 'Asia/Bangkok' | 'Asia/Barnaul' | 'Asia/Beirut' | 'Asia/Bishkek' | 'Asia/Brunei' | 'Asia/Chita' | 'Asia/Choibalsan' | 'Asia/Colombo' | 'Asia/Damascus' | 'Asia/Dhaka' | 'Asia/Dili' | 'Asia/Dubai' | 'Asia/Dushanbe' | 'Asia/Famagusta' | 'Asia/Gaza' | 'Asia/Hebron' | 'Asia/Ho_Chi_Minh' | 'Asia/Hong_Kong' | 'Asia/Hovd' | 'Asia/Irkutsk' | 'Asia/Jakarta' | 'Asia/Jayapura' | 'Asia/Jerusalem' | 'Asia/Kabul' | 'Asia/Kamchatka' | 'Asia/Karachi' | 'Asia/Kathmandu' | 'Asia/Khandyga' | 'Asia/Kolkata' | 'Asia/Krasnoyarsk' | 'Asia/Kuala_Lumpur' | 'Asia/Kuching' | 'Asia/Macau' | 'Asia/Magadan' | 'Asia/Makassar' | 'Asia/Manila' | 'Asia/Nicosia' | 'Asia/Novokuznetsk' | 'Asia/Novosibirsk' | 'Asia/Omsk' | 'Asia/Oral' | 'Asia/Pontianak' | 'Asia/Pyongyang' | 'Asia/Qatar' | 'Asia/Qostanay' | 'Asia/Qyzylorda' | 'Asia/Riyadh' | 'Asia/Sakhalin' | 'Asia/Samarkand' | 'Asia/Seoul' | 'Asia/Shanghai' | 'Asia/Singapore' | 'Asia/Srednekolymsk' | 'Asia/Taipei' | 'Asia/Tashkent' | 'Asia/Tbilisi' | 'Asia/Tehran' | 'Asia/Thimphu' | 'Asia/Tokyo' | 'Asia/Tomsk' | 'Asia/Ulaanbaatar' | 'Asia/Urumqi' | 'Asia/Ust-Nera' | 'Asia/Vladivostok' | 'Asia/Yakutsk' | 'Asia/Yangon' | 'Asia/Yekaterinburg' | 'Asia/Yerevan' | 'Atlantic/Azores' | 'Atlantic/Bermuda' | 'Atlantic/Canary' | 'Atlantic/Cape_Verde' | 'Atlantic/Faroe' | 'Atlantic/Madeira' | 'Atlantic/Reykjavik' | 'Atlantic/South_Georgia' | 'Atlantic/Stanley' | 'Australia/Adelaide' | 'Australia/Brisbane' | 'Australia/Broken_Hill' | 'Australia/Darwin' | 'Australia/Eucla' | 'Australia/Hobart' | 'Australia/Lindeman' | 'Australia/Lord_Howe' | 'Australia/Melbourne' | 'Australia/Perth' | 'Australia/Sydney' | 'CET' | 'CST6CDT' | 'EET' | 'EST' | 'EST5EDT' | 'Etc/GMT' | 'Etc/GMT-1' | 'Etc/GMT-10' | 'Etc/GMT-11' | 'Etc/GMT-12' | 'Etc/GMT-13' | 'Etc/GMT-14' | 'Etc/GMT-2' | 'Etc/GMT-3' | 'Etc/GMT-4' | 'Etc/GMT-5' | 'Etc/GMT-6' | 'Etc/GMT-7' | 'Etc/GMT-8' | 'Etc/GMT-9' | 'Etc/GMT+1' | 'Etc/GMT+10' | 'Etc/GMT+11' | 'Etc/GMT+12' | 'Etc/GMT+2' | 'Etc/GMT+3' | 'Etc/GMT+4' | 'Etc/GMT+5' | 'Etc/GMT+6' | 'Etc/GMT+7' | 'Etc/GMT+8' | 'Etc/GMT+9' | 'Etc/UTC' | 'Europe/Amsterdam' | 'Europe/Andorra' | 'Europe/Astrakhan' | 'Europe/Athens' | 'Europe/Belgrade' | 'Europe/Berlin' | 'Europe/Brussels' | 'Europe/Bucharest' | 'Europe/Budapest' | 'Europe/Chisinau' | 'Europe/Copenhagen' | 'Europe/Dublin' | 'Europe/Gibraltar' | 'Europe/Helsinki' | 'Europe/Istanbul' | 'Europe/Kaliningrad' | 'Europe/Kiev' | 'Europe/Kirov' | 'Europe/Lisbon' | 'Europe/London' | 'Europe/Luxembourg' | 'Europe/Madrid' | 'Europe/Malta' | 'Europe/Minsk' | 'Europe/Monaco' | 'Europe/Moscow' | 'Europe/Oslo' | 'Europe/Paris' | 'Europe/Prague' | 'Europe/Riga' | 'Europe/Rome' | 'Europe/Samara' | 'Europe/Saratov' | 'Europe/Simferopol' | 'Europe/Sofia' | 'Europe/Stockholm' | 'Europe/Tallinn' | 'Europe/Tirane' | 'Europe/Ulyanovsk' | 'Europe/Uzhgorod' | 'Europe/Vienna' | 'Europe/Vilnius' | 'Europe/Volgograd' | 'Europe/Warsaw' | 'Europe/Zaporozhye' | 'Europe/Zurich' | 'HST' | 'Indian/Chagos' | 'Indian/Christmas' | 'Indian/Cocos' | 'Indian/Kerguelen' | 'Indian/Mahe' | 'Indian/Maldives' | 'Indian/Mauritius' | 'Indian/Reunion' | 'MET' | 'MST' | 'MST7MDT' | 'Pacific/Apia' | 'Pacific/Auckland' | 'Pacific/Bougainville' | 'Pacific/Chatham' | 'Pacific/Chuuk' | 'Pacific/Easter' | 'Pacific/Efate' | 'Pacific/Fakaofo' | 'Pacific/Fiji' | 'Pacific/Funafuti' | 'Pacific/Galapagos' | 'Pacific/Gambier' | 'Pacific/Guadalcanal' | 'Pacific/Guam' | 'Pacific/Honolulu' | 'Pacific/Kanton' | 'Pacific/Kiritimati' | 'Pacific/Kosrae' | 'Pacific/Kwajalein' | 'Pacific/Majuro' | 'Pacific/Marquesas' | 'Pacific/Nauru' | 'Pacific/Niue' | 'Pacific/Norfolk' | 'Pacific/Noumea' | 'Pacific/Pago_Pago' | 'Pacific/Palau' | 'Pacific/Pitcairn' | 'Pacific/Pohnpei' | 'Pacific/Port_Moresby' | 'Pacific/Rarotonga' | 'Pacific/Tahiti' | 'Pacific/Tarawa' | 'Pacific/Tongatapu' | 'Pacific/Wake' | 'Pacific/Wallis' | 'PST8PDT' | 'WET'
StorefrontApiVersion
Union of supported storefront API versions
'2022-04' | '2022-07' | '2022-10' | '2023-01' | '2023-04' | '2023-07' | '2024-01' | '2024-04' | '2024-07' | 'unstable'
GraphQLError
GraphQL error returned by the Shopify Storefront APIs.
- extensions
{ requestId: string; code: string; }
- message
string
export interface GraphQLError {
message: string;
extensions: {
requestId: string;
code: string;
};
}
SelectedPaymentOption
A payment option selected by the buyer.
- handle
The unique handle referencing `PaymentOption.handle`. Refer to [availablePaymentOptions](/docs/api/checkout-ui-extensions/apis/payments#standardapi-propertydetail-availablepaymentoptions).
string
export interface SelectedPaymentOption {
/**
* The unique handle referencing `PaymentOption.handle`.
*
* Refer to [availablePaymentOptions](/docs/api/checkout-ui-extensions/apis/payments#standardapi-propertydetail-availablepaymentoptions).
*/
handle: string;
}
SessionToken
- get
Requests a session token that hasn't expired. You should call this method every time you need to make a request to your backend in order to get a valid token. This method will return cached tokens when possible, so you don’t need to worry about storing these tokens yourself.
() => Promise<string>
export interface SessionToken {
/**
* Requests a session token that hasn't expired. You should call this method every
* time you need to make a request to your backend in order to get a valid token.
* This method will return cached tokens when possible, so you don’t need to worry
* about storing these tokens yourself.
*/
get(): Promise<string>;
}
ExtensionSettings
The merchant-defined setting values for the extension.
Record<
string,
string | number | boolean | undefined
>
Shop
- id
The shop ID.
string
- myshopifyDomain
The shop's myshopify.com domain.
string
- name
The name of the shop.
string
- storefrontUrl
The primary storefront URL. > Caution: > As of version `2024-04` this value will no longer have a trailing slash.
string
export interface Shop {
/**
* The shop ID.
* @example 'gid://shopify/Shop/123'
*/
id: string;
/**
* The name of the shop.
*/
name: string;
/**
* The primary storefront URL.
*
* > Caution:
* > As of version `2024-04` this value will no longer have a trailing slash.
*/
storefrontUrl?: string;
/**
* The shop's myshopify.com domain.
*/
myshopifyDomain: string;
}
Storage
A key-value storage object for the extension. Stored data is only available to this specific extension and any of its instances. The storage backend is implemented with `localStorage` and should persist across the buyer's checkout session. However, data persistence isn't guaranteed.
- delete
Delete stored data by key.
(key: string) => Promise<void>
- read
Read and return a stored value by key. The stored data is deserialized from JSON and returned as its original primitive. Returns `null` if no stored data exists.
<T = unknown>(key: string) => Promise<T>
- write
Write stored data for this key. The data must be serializable to JSON.
(key: string, data: any) => Promise<void>
export interface Storage {
/**
* Read and return a stored value by key.
*
* The stored data is deserialized from JSON and returned as
* its original primitive.
*
* Returns `null` if no stored data exists.
*/
read<T = unknown>(key: string): Promise<T | null>;
/**
* Write stored data for this key.
*
* The data must be serializable to JSON.
*/
write(key: string, data: any): Promise<void>;
/**
* Delete stored data by key.
*/
delete(key: string): Promise<void>;
}
Ui
- overlay
{ close(overlayId: string): void; }
export interface Ui {
overlay: {
close(overlayId: string): void;
};
}
Version
string
AnyComponent
AnyComponentBuilder<typeof ComponentsModule>
AnyComponentBuilder
ComponentsBuilder<ComponentTypes>[keyof ComponentsBuilder<ComponentTypes>]
ComponentsBuilder
{
[K in keyof ComponentTypes]: ComponentTypes[K] extends RemoteComponentType<
any,
any
>
? ComponentTypes[K]
: never;
}
CartLineItemApi
- target
The cart line the extension is attached to. Until version `2023-04`, this property was a `StatefulRemoteSubscribable<PresentmentCartLine>`.
StatefulRemoteSubscribable<CartLine>
export interface CartLineItemApi {
/**
* The cart line the extension is attached to. Until version `2023-04`, this property was a `StatefulRemoteSubscribable<PresentmentCartLine>`.
*/
target: StatefulRemoteSubscribable<CartLine>;
}
OrderStatusApi
- order
Order information that's available post-checkout.
StatefulRemoteSubscribable<Order | undefined>
export interface OrderStatusApi {
/**
* Order information that's available post-checkout.
*/
order: StatefulRemoteSubscribable<Order | undefined>;
}
Order
Information about an order that was placed.
- cancelledAt
If cancelled, the time at which the order was cancelled.
string
- confirmationNumber
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.
string
- id
A globally-unique identifier.
string
- name
Unique identifier for the order that appears on the order.
string
- processedAt
The date and time when the order was processed. Processing happens after the checkout has completed, and indicates that the order is available in the admin.
string
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;
/**
* The date and time when the order was processed.
* Processing happens after the checkout has completed, and indicates that the order is available in the admin.
*/
processedAt?: 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;
}
RedeemableApi
- applyRedeemableChange
Applies a redeemable change to add a redeemable payment method.
(change: RedeemableAddChange) => Promise<RedeemableChangeResult>
export interface RedeemableApi {
/**
* Applies a redeemable change to add a redeemable payment method.
*/
applyRedeemableChange(
change: RedeemableChange,
): Promise<RedeemableChangeResult>;
}
RedeemableAddChange
- attributes
The redeemable attributes.
RedeemableAttribute[]
- identifier
The identifier used to represent the redeemable (e.g. the gift card code).
string
- type
The type of the `RedeemableChange` API.
"redeemableAddChange"
export interface RedeemableAddChange {
/**
* The type of the `RedeemableChange` API.
*/
type: 'redeemableAddChange';
/**
* The redeemable attributes.
*/
attributes: RedeemableAttribute[];
/**
* The identifier used to represent the redeemable (e.g. the gift card code).
*/
identifier: string;
}
RedeemableAttribute
A key-value pair that represents an attribute of a redeemable payment method.
- key
string
- value
string
export interface RedeemableAttribute {
key: string;
value: string;
}
RedeemableChangeResult
RedeemableChangeResultSuccess | RedeemableChangeResultError
RedeemableChangeResultSuccess
- type
Indicates that the redeemable change was applied successfully.
"success"
export interface RedeemableChangeResultSuccess {
/**
* Indicates that the redeemable change was applied successfully.
*/
type: 'success';
}
RedeemableChangeResultError
- message
A message that explains the error. This message is useful for debugging. It is **not** localized, and therefore should not be presented directly to the buyer.
string
- type
Indicates that the redeemable change was not applied successfully.
"error"
export interface RedeemableChangeResultError {
/**
* Indicates that the redeemable change was not applied successfully.
*/
type: 'error';
/**
* A message that explains the error. This message is useful for debugging.
* It is **not** localized, and therefore should not be presented directly
* to the buyer.
*/
message: string;
}
CustomerAccountStandardApi
The part of the standard API implemented for customer-account targets. Must match the types defined in the `surfaces/customer-account` section of this package.
- analytics
The methods for interacting with [Web Pixels](/docs/apps/marketing), such as emitting an event.
Analytics
- appliedGiftCards
Gift Cards that have been applied to the checkout.
StatefulRemoteSubscribable<AppliedGiftCard[]>
- applyTrackingConsentChange
Allows setting and updating customer privacy consent settings and tracking consent metafields. > Note: Requires the [`customer_privacy` capability](/docs/api/checkout-ui-extensions/2024-07/configuration#collect-buyer-consent) to be set to `true`. {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
ApplyTrackingConsentChangeType
- appMetafields
The metafields requested in the [`shopify.extension.toml`](/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](/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.*
StatefulRemoteSubscribable<AppMetafieldEntry[]>
- attributes
The custom attributes left by the customer to the merchant, either in their cart or during checkout.
StatefulRemoteSubscribable<Attribute[] | undefined>
- billingAddress
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](/docs/apps/store/data-protection/protected-customer-data).
StatefulRemoteSubscribable<MailingAddress | undefined>
- buyerIdentity
Information about the buyer that is interacting with the checkout. {% include /apps/checkout/privacy-icon.md %} Requires access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data).
BuyerIdentity
- checkoutSettings
Settings applied to the buyer's checkout.
StatefulRemoteSubscribable<CheckoutSettings>
- checkoutToken
A stable ID that represents the current checkout. Matches the `token` field in the [WebPixel checkout payload](/docs/api/pixels/customer-events#checkout) and the `checkout_token` field in the [REST Admin API `Order` resource](/docs/api/admin-rest/unstable/resources/order#resource-object).
StatefulRemoteSubscribable<CheckoutToken | undefined>
- cost
Details on the costs the buyer will pay for this checkout.
CartCost
- customerPrivacy
Customer privacy consent settings and a flag denoting if consent has previously been collected.
StatefulRemoteSubscribable<CustomerPrivacy>
- discountAllocations
Discounts that have been applied to the entire cart.
StatefulRemoteSubscribable<CartDiscountAllocation[]>
- discountCodes
A list of discount codes currently applied to the checkout.
StatefulRemoteSubscribable<CartDiscountCode[]>
- extension
The meta information about the extension.
Extension<Target>
- extensionPoint
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.
Target
- i18n
Utilities for translating content and formatting values according to the current [`localization`](/docs/api/checkout-ui-extensions/apis/localization) of the checkout. Refer to [`localization` examples](/docs/api/checkout-ui-extensions/apis/localization#examples) for more information.
I18n
- instructions
The cart instructions used to create the checkout and possibly limit extension capabilities. These instructions should be checked prior to performing any actions that may be affected by them. For example, if you intend to add a discount code via the `applyDiscountCodeChange` method, check `discounts.canUpdateDiscountCodes` to ensure it's supported in this checkout. > Caution: As of version `2024-07`, UI extension code must check for instructions before calling select APIs in case those APIs are not available. See the [update guide](/docs/api/checkout-ui-extensions/instructions-update) for more information.
StatefulRemoteSubscribable<CartInstructions>
- lines
A list of lines containing information about the items the customer intends to purchase.
StatefulRemoteSubscribable<CartLine[]>
- localization
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`](/docs/api/checkout-ui-extensions/apis/localization#standardapi-propertydetail-i18n) object instead.
Localization
- metafields
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](/docs/admin-api/graphql/reference/orders/order#metafield-2021-01)
StatefulRemoteSubscribable<Metafield[]>
- note
A note left by the customer to the merchant, either in their cart or during checkout.
StatefulRemoteSubscribable<string | undefined>
- query
The method used to query the Storefront GraphQL API with a prefetched token. Refer to [Storefront API access examples](/docs/api/checkout-ui-extensions/apis/storefront-api) for more information.
<Data = unknown, Variables = Record<string, unknown>>(query: string, options?: { variables?: Variables; version?: StorefrontApiVersion; }) => Promise<{ data?: Data; errors?: GraphQLError[]; }>
- sessionToken
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](/docs/api/checkout-ui-extensions/apis/session-token) for more information.
SessionToken
- settings
The settings matching the settings definition written in the [`shopify.extension.toml`](/docs/api/checkout-ui-extensions/configuration) file. Refer to [settings examples](/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.
StatefulRemoteSubscribable<ExtensionSettings>
- shippingAddress
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](/docs/apps/store/data-protection/protected-customer-data).
StatefulRemoteSubscribable<ShippingAddress | undefined>
- shop
The shop where the checkout is taking place.
Shop
- storage
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
- ui
Methods to interact with the extension's UI.
Ui
- version
The renderer version being used for the extension.
Version
export interface CustomerAccountStandardApi<
Target extends keyof ExtensionTargets,
> extends Pick<
StandardApi<Target>,
| 'analytics'
| 'appliedGiftCards'
| 'appMetafields'
| 'attributes'
| 'buyerIdentity'
| 'checkoutSettings'
| 'checkoutToken'
| 'cost'
| 'discountCodes'
| 'discountAllocations'
| 'extension'
| 'extensionPoint'
| 'i18n'
| 'instructions'
| 'lines'
| 'localization'
| 'metafields'
| 'note'
| 'query'
| 'sessionToken'
| 'settings'
| 'shippingAddress'
| 'billingAddress'
| 'shop'
| 'storage'
| 'ui'
| 'version'
| 'customerPrivacy'
| 'applyTrackingConsentChange'
> {}
PaymentOptionItemApi
- applyPaymentMethodAttributesChange
Sets the attributes of the related payment method.
(change: PaymentMethodAttributesUpdateChange) => Promise<PaymentMethodAttributesResult>
- bankIdNumber
StatefulRemoteSubscribable<string | undefined>
- paymentMethodAttributes
StatefulRemoteSubscribable< PaymentMethodAttribute[] | undefined >
export interface PaymentOptionItemApi {
/**
* Sets the attributes of the related payment method.
*/
applyPaymentMethodAttributesChange(
change: PaymentMethodAttributesChange,
): Promise<PaymentMethodAttributesResult>;
paymentMethodAttributes?: StatefulRemoteSubscribable<
PaymentMethodAttribute[] | undefined
>;
bankIdNumber?: StatefulRemoteSubscribable<string | undefined>;
}
PaymentMethodAttributesUpdateChange
- attributes
The payment method attributes
PaymentMethodAttribute[]
- type
The type of the `PaymentMethodAttributesChange` API.
"updatePaymentMethodAttributes"
export interface PaymentMethodAttributesUpdateChange {
/**
* The type of the `PaymentMethodAttributesChange` API.
*/
type: 'updatePaymentMethodAttributes';
/**
* The payment method attributes
*/
attributes: PaymentMethodAttribute[];
}
PaymentMethodAttribute
A key-value pair that represents an attribute of a payment method.
- key
string
- value
string | number | boolean
export interface PaymentMethodAttribute {
key: string;
value: string | number | boolean;
}
PaymentMethodAttributesResult
PaymentMethodAttributesResultSuccess | PaymentMethodAttributesResultError
PaymentMethodAttributesResultSuccess
- type
Indicates that the payment method attributes were set successfully.
"success"
export interface PaymentMethodAttributesResultSuccess {
/**
* Indicates that the payment method attributes were set successfully.
*/
type: 'success';
}
PaymentMethodAttributesResultError
- message
A message that explains the error. This message is useful for debugging. It is **not** localized, and therefore should not be presented directly to the buyer.
string
- type
Indicates that the payment method attributes were not set successfully.
"error"
export interface PaymentMethodAttributesResultError {
/**
* Indicates that the payment method attributes were not set successfully.
*/
type: 'error';
/**
* A message that explains the error. This message is useful for debugging.
* It is **not** localized, and therefore should not be presented directly
* to the buyer.
*/
message: string;
}
PaymentMethod
'visa' | 'master' | 'discover' | 'american-express' | 'diners-club' | 'cartes-bancaires' | 'ing-homepay' | 'jcb' | 'rupay' | 'ethereum' | 'bitcoin' | 'monero' | 'dogecoin' | 'litecoin' | 'bitcoin-cash' | 'dash' | 'eos' | 'dai' | 'usdc' | 'apecoin' | 'solanapay' | 'bnbchain' | 'polygon' | 'depay' | 'busd' | 'gusd' | 'shib' | 'usdp' | 'wbtc' | 'xrp' | 'amazon' | 'boleto' | 'kbc-cbc' | 'sepa-bank-transfer' | 'dankort' | 'belfius' | 'dwolla' | 'tensile' | 'forbrugsforeningen' | 'giropay' | 'google-pay' | 'google-wallet' | 'opay' | 'laser' | 'paypal' | 'venmo' | 'sofort' | 'maestro' | 'unionpay' | 'visa-electron' | 'payfast-instant-eft' | 'mobicred' | 'payd' | 'airtel-money' | 'freecharge' | 'ola-money' | 'paytm' | 'mobikwik' | 'payzapp' | 'netbanking' | 'paysera' | 'citadele' | 'danske-bank' | 'krediidipank' | 'lhv' | 'op' | 'nordea' | 'seb' | 'swedbank' | 'dnb' | 'pps' | 'pivo' | 'masterpass' | 'mobilepay' | 'viabill' | 'novuna' | 'divido' | 'duologi' | 'klarna' | 'klarna-pay-now' | 'klarna-pay-later' | 'klarna-slice-it' | 'santander' | 'flexiti' | 'elv' | 'astrapay' | 'ideal' | 'interac' | 'arvato' | 'swish' | 'ratepay' | 'przelew24' | 'epayments' | 'paysafecard' | 'laybuy' | 'sezzle' | 'familymart' | '7-eleven' | 'lawson' | 'circle-k' | 'ministop' | 'sunkus' | 'daily-yamazaki' | 'mondido' | 'collector-bank' | 'apple-pay' | 'shopify-pay' | 'trustly' | 'ambank' | 'cimb' | 'hong-leong-bank' | 'maybank' | 'public-bank' | 'rhb-bank' | 'paymark-online-eftpos' | 'esr-paymentslip-switzerland' | 'twint' | 'elo' | 'hyper' | 'hypercard' | 'fpx' | 'atm-bersama' | 'bancnet' | 'eghl' | 'unipay' | 'mash' | 'jousto' | 'vipps' | 'krungsri' | 'uob' | 'siam-commercial' | 'enets' | 'grabpay' | 'eft-secure' | 'mpesa' | 'ovo' | 'mode' | 'wechat-pay' | 'spraypay' | 'bancontact' | 'in3' | 'v-pay' | 'ebucks' | 'pagoefectivo' | 'ozow' | 'eps' | 'affin-bank' | 'alliance-bank' | 'atobaraidotcom' | 'bank-islam' | 'bank-muamalat' | 'bank-rakyat' | 'bsn' | 'cimb-clicks' | 'deutsche-bank' | 'hong-leong-connect' | 'hsbc' | 'kuwait-finance-house' | 'maybankm2u' | 'ocbc-bank' | 'publicbank-pbe' | 'rhb-now' | 'standard-chartered' | 'afterpay' | 'clearpay' | 'cash-app-pay' | 'smartpay' | 'zapper' | 'payconiq' | 'paidy' | 'twig-pay' | 'stc-pay' | 'paynow' | 'bc-card' | 'hana-card' | 'hyundai-card' | 'kb-card' | 'lotte-card' | 'nh-card' | 'samsung-card' | 'shinhan-card' | 'kakao-pay' | 'kakebaraidotcom' | 'naver-pay' | 'payco' | 'samsung-pay' | 'toss' | 'coop' | 'luminor' | 'bdo' | 'bpi' | 'gcash' | 'afterpay-paynl-version' | 'naps' | 'benefit' | 'sadad' | 'mada' | 'kfast' | 'knet' | 'uae-visa' | 'fps' | 'line-pay' | 'rakuten-pay' | 'pay-easy' | 'merpay' | 'softbank' | 'givacard' | 'ymobile' | 'mtn-mobile-money' | 'fashioncheque' | 'airteltigo-mobile-money' | 'tendopay' | 'coinsph' | 'payu' | 'd-barai' | 'docomo-barai' | 'pay-pay' | 'blik' | 'billink' | 'au-kantan-kessai' | 'mb-way' | 'latitude-creditline-au' | 'latitude-gem-au' | 'latitude-gem-nz' | 'latitude-go-au' | 'mb' | 'bogus-app-coin' | 'postfinance-card' | 'postfinance-efinance' | 'alipay' | 'alipay-hk' | 'ask' | 'paymaya' | 'maya' | 'maya-bank' | 'qr-promptpay' | 'rcs' | 'bangkok-bank' | 'kasikornbank' | 'krungthai-bank' | 'thanachart-bank' | 'uob-thai' | 'bigc' | 'boost' | 'ecpay' | 'maybank-qrpay' | 'mcash' | 'rabbit-line-pay' | 'tesco-lotus' | 'touch-n-go' | 'payme' | 'payflex' | 'maxima' | 'alfamart' | 'alfamidi' | 'dan-dan' | 'indomaret' | 'dana' | 'linkaja' | 'shopeepay' | 'gopay' | 'bca' | 'bni' | 'bri' | 'mandiri' | 'permata' | 'bri-direct-debit' | 'octo-clicks' | 'brimo' | 'danamon-online' | 'bca-klikpay' | 'akulaku' | 'satispay' | 'qrph' | 'arhaus' | 'generalfinancing' | 'ubp' | 'farmlands' | 'qris' | 'axs' | 'sam' | 'facebook-pay' | 'meta-pay' | 'kueski-pay' | 'bread' | 'bread-pay' | 'payplan' | 'nelo' | 'vvv-giftcard' | 'kunst-en-cultuur-cadeaukaart' | 'nationale-bioscoopbon' | 'nationale-entertainmentcard' | 'podium-cadeaukaart' | 'webshop-giftcard' | 'billease' | 'lku' | 'rietumu' | 'affirm' | 'splitit' | 'zip' | 'humm' | 'synchrony' | 'satisfi' | 'checkout-finance' | 'n26' | 'echelon-financing' | 'acima-leasing' | 'synchrony-pay' | 'truemoney-pay' | 'gmo-postpay' | 'giftcard' | 'siauliu-bankas' | 'medicinos-bankas' | 'epospay' | 'poli' | 'perlasfinance' | 'directpay' | 'latitudepay' | 'genoapay' | 'poppankki' | 'revolut' | 'aktia' | 'saastopankki' | 'spankki' | 'walley' | 'atone' | 'addi' | 'omasp' | 'handelsbanken' | 'alandsbanken' | 'siirto' | 'scalapay' | 'aplazo' | 'paybylink' | 'snap-checkout' | 'fairstone-payments' | 'upi' | 'sveaeramaksu' | 'svea-part-payment' | 'svea-delbetalning' | 'svea-lasku' | 'svea-invoice' | 'svea-faktura' | 'svea-yrityslasku' | 'svea-b2b-invoice' | 'svea-b2b-faktura' | 'pix' | 'wegetfinancing' | 'anyday' | 'cleverpay' | 'payid' | 'uangme' | 'grailpay' | 'payto' | 'zinia' | 'fortiva' | 'fintecture' | 'hello-clever' | 'credit-key' | 'palawa' | 'palawan' | 'kredivo' | 'uob-ez-pay' | 'akulaku-paylater' | 'tandympayment' | 'paytomorrow' | 'bsi' | 'clave-telered' | 'credix' | 'sinpe-movil' | 'laybuy-heart' | 'lydia' | 'atome' | 'creditclick-paynl-version' | 'dropp' | 'cebuana' | 'futurepay-mytab' | 'biercheque-paynl-version' | 'swiftpay' | 'linkpay' | 'riverty-paynl-version' | 'wechat-paynl-version' | 'vvv-cadeaukaart-paynl-version' | 'przelewy24-paynl-version' | 'paysafecard-paynl-version' | 'gezondheidsbon-paynl-version' | 'fashion-giftcard-paynlversion' | 'alipay-paynl-version' | 'aftee' | 'momopay' | 'zalopay' | 'finloup' | 'billink-method' | 'oxxo' | 'spei' | 'bbva-cie' | 'alma' | 'svea-ostukonto' | 'svea-credit-account' | 'biller-paynl-version' | 'swissbilling' | 'bizum' | 'rcbc' | 'inbank' | 'ivy' | 'zoodpay' | 'valu' | 'tabby' | 'cliq' | 'postpay' | 'urpay' | 'hypercash' | 'fawry' | 'spotii' | 'tamara' | 'aqsat' | 'careem-pay' | 'billie' | 'sbpl' | 'coppel-pay' | 'sequra' | 'aeropay' | 'catch-payments' | 'openpay' | 'lbc' | 'atrato' | 'bss' | 'gmo-bank-transfer' | 'trevipay' | 'paypo' | 'younited-pay' | 'tabit' | 'etika' | 'mokka' | 'myfatoorah' | 'meeza' | 'paysafecash' | 'tbi-bank' | 'skrill-digital-wallet' | 'pei' | 'rapid-transfer' | 'neteller' | 'cetelem' | 'paid'
PickupLocationListApi
- isLocationFormVisible
Whether the customer location input form is shown to the buyer.
StatefulRemoteSubscribable<boolean>
export interface PickupLocationListApi {
/**
* Whether the customer location input form is shown to the buyer.
*/
isLocationFormVisible: StatefulRemoteSubscribable<boolean>;
}
PickupPointListApi
- isLocationFormVisible
Whether the customer location input form is shown to the buyer.
StatefulRemoteSubscribable<boolean>
export interface PickupPointListApi {
/**
* Whether the customer location input form is shown to the buyer.
*/
isLocationFormVisible: StatefulRemoteSubscribable<boolean>;
}
ShippingOptionItemApi
- isTargetSelected
Whether the shipping option the extension is attached to is currently selected in the UI.
StatefulRemoteSubscribable<boolean>
- renderMode
The render mode of the shipping option.
ShippingOptionItemRenderMode
- target
The shipping option the extension is attached to.
StatefulRemoteSubscribable<ShippingOption>
export interface ShippingOptionItemApi {
/**
* The shipping option the extension is attached to.
*/
target: StatefulRemoteSubscribable<ShippingOption>;
/**
* Whether the shipping option the extension is attached to is currently selected in the UI.
*/
isTargetSelected: StatefulRemoteSubscribable<boolean>;
/**
* The render mode of the shipping option.
*/
renderMode: ShippingOptionItemRenderMode;
}
ShippingOptionItemRenderMode
The render mode of a shipping option.
- overlay
Whether the shipping option is rendered in an overlay.
boolean
export interface ShippingOptionItemRenderMode {
/**
* Whether the shipping option is rendered in an overlay.
*/
overlay: boolean;
}
ShippingOptionListApi
- deliverySelectionGroups
The list of selection groups available to the buyers. The property will be undefined when no such groups are available.
StatefulRemoteSubscribable< DeliverySelectionGroup[] | undefined >
- target
The delivery group list the extension is attached to. The target will be undefined when there are no groups for a given type.
StatefulRemoteSubscribable<DeliveryGroupList | undefined>
export interface ShippingOptionListApi {
/**
* The delivery group list the extension is attached to. The target will be undefined when there are no groups for a given type.
*/
target: StatefulRemoteSubscribable<DeliveryGroupList | undefined>;
/**
* The list of selection groups available to the buyers. The property will be undefined when no such groups are available.
*/
deliverySelectionGroups: StatefulRemoteSubscribable<
DeliverySelectionGroup[] | undefined
>;
}
DeliverySelectionGroup
A selection group for delivery options.
- associatedDeliveryOptions
The associated delivery option handles with the selection group. The handles will match the delivery group's delivery option handles.
DeliveryOptionReference[]
- cost
The sum of each delivery option's cost.
Money
- costAfterDiscounts
The sum of each delivery option's cost after discounts.
Money
- handle
The handle of the selection group.
string
- selected
If the selection group is selected.
boolean
- title
The localized title of the selection group.
string
export interface DeliverySelectionGroup {
/**
* The handle of the selection group.
*/
handle: string;
/**
* If the selection group is selected.
*/
selected: boolean;
/**
* The localized title of the selection group.
*/
title: string;
/**
* The associated delivery option handles with the selection group. The handles will match the delivery group's delivery option handles.
*/
associatedDeliveryOptions: DeliveryOptionReference[];
/**
* The sum of each delivery option's cost.
*/
cost: Money;
/**
* The sum of each delivery option's cost after discounts.
*/
costAfterDiscounts: Money;
}
DeliveryGroupList
The delivery group list the extension is associated to.
- deliveryGroups
The delivery groups that compose this list.
DeliveryGroup[]
- groupType
The group type of the delivery group list.
DeliveryGroupType
export interface DeliveryGroupList {
/**
* The group type of the delivery group list.
*/
groupType: DeliveryGroupType;
/**
* The delivery groups that compose this list.
*/
deliveryGroups: DeliveryGroup[];
}
OrderConfirmationApi
- orderConfirmation
Order information that's available post-checkout.
StatefulRemoteSubscribable<OrderConfirmation>
export interface OrderConfirmationApi {
/**
* Order information that's available post-checkout.
*/
orderConfirmation: StatefulRemoteSubscribable<OrderConfirmation>;
}
OrderConfirmation
- number
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.
string
- order
{ id: string; }
export interface OrderConfirmation {
order: {
/**
* The globally-uniqueID of the OrderConfirmation. This will be the ID of the Order once successfully created.
*/
id: 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.
*/
number?: string;
}
PickupLocationItemApi
- isTargetSelected
Whether the pickup location is currently selected.
StatefulRemoteSubscribable<boolean>
- target
The pickup location the extension is attached to.
StatefulRemoteSubscribable<PickupLocationOption>
export interface PickupLocationItemApi {
/**
* The pickup location the extension is attached to.
*/
target: StatefulRemoteSubscribable<PickupLocationOption>;
/**
* Whether the pickup location is currently selected.
*/
isTargetSelected: StatefulRemoteSubscribable<boolean>;
}
Accessing Properties
React
examples
Accessing Properties
description
The extension API is passed as a parameter to the extension target function. In React, you can access it from any component through the `useExtensionApi()` hook.
React
import { reactExtension, Text, useExtensionApi, } from '@shopify/ui-extensions-react/checkout'; export default reactExtension( 'purchase.checkout.block.render', () => <Extension />, ); function Extension() { const {shop} = useExtensionApi(); return <Text>Shop name: {shop.name}</Text>; }