Skip to main content
Migrate to Polaris

Version 2025-07 is the last API version to support React-based UI components. Later versions use web components, native UI elements with built-in accessibility, better performance, and consistent styling with Shopify's design system. Check out the migration guide to upgrade your extension.

Buyer Journey API

The API for interacting with the buyer journey.

The base API object provided to purchase extension targets.

Anchor to buyerJourney
buyerJourney
required

Provides details on the buyer's progression through the checkout.

Refer to buyer journey examples for more information.

Anchor to useBuyerJourney
useBuyerJourney()

Returns the buyerJourney details on buyer progression in checkout.

BuyerJourney

Provides details on the buyer's progression through the checkout.

activeStep
StatefulRemoteSubscribable< | undefined>

What step of checkout the buyer is currently on.

completed
StatefulRemoteSubscribable<boolean>

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.

intercept
(interceptor: ) => Promise<() => void>

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 capability in your extension's configuration.

If you do, then you're expected to inform the buyer why navigation was blocked, either by passing validation errors to the checkout UI or rendering the errors in your extension.

It is good practice to show a warning in the checkout editor when the merchant has not given permission for your extension to block checkout progress.

steps
StatefulRemoteSubscribable<[]>

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.

Anchor to useBuyerJourneyCompleted
useBuyerJourneyCompleted()

Returns 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.

false | true

Installs a function for intercepting and preventing progress on checkout. To block checkout progress, you must set the block_progress capability in your extension's configuration. If you do, then you're expected to inform the buyer why navigation was blocked, either by passing validation errors to the checkout UI or rendering the errors in your extension. useBuyerJourneyIntercept() should be called at the top level of the extension, not within an embedded or child component, to avoid errors should the child component get destroyed. It is good practice to show a warning in the checkout editor when the merchant has not given permission for your extension to block checkout progress.

Anchor to interceptor
interceptor
required

Anchor to useBuyerJourneySteps
useBuyerJourneySteps()

Returns 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.

[]

Anchor to useBuyerJourneyActiveStep
useBuyerJourneyActiveStep()

Returns the buyer journey step that the buyer is currently on.

| undefined
Examples
import {
reactExtension,
Banner,
useBuyerJourneyIntercept,
useExtensionCapability,
useExtensionEditor,
useShippingAddress,
} from '@shopify/ui-extensions-react/checkout';

export default reactExtension(
'purchase.checkout.delivery-address.render-before',
() => <Extension />,
);

function Extension() {
const address = useShippingAddress();
const editorType = useExtensionEditor()?.type;
const blockProgressGranted =
useExtensionCapability('block_progress');

useBuyerJourneyIntercept(
({canBlockProgress}) => {
return canBlockProgress &&
address?.countryCode &&
address.countryCode !== 'CA'
? {
behavior: 'block',
reason: 'Invalid shipping country',
errors: [
{
message:
'Sorry, we can only ship to Canada',
// Show an error underneath the country code field
target:
'$.cart.deliveryGroups[0].deliveryAddress.countryCode',
},
{
// In addition, show an error at the page level
message:
'Please use a different address.',
},
],
}
: {
behavior: 'allow',
};
},
);

return editorType === 'checkout' &&
!blockProgressGranted ? (
<Banner
status="warning"
title="This app may be misconfigured"
>
To allow this app to block checkout, enable
this behavior in "Checkout behavior"
settings.
</Banner>
) : null;
}
Was this page helpful?