# useBuyerJourney Returns the `buyerJourney` details on buyer progression in checkout. ## ### UseBuyerJourneyGeneratedType Returns the `buyerJourney` details on buyer progression in checkout. #### Returns: BuyerJourney export function useBuyerJourney< Target extends RenderExtensionTarget = RenderExtensionTarget, >(): BuyerJourney { const api = useApi(); if ('buyerJourney' in api) { return api.buyerJourney; } throw new ExtensionHasNoMethodError( 'applyAttributeChange', api.extension.target, ); } ### BuyerJourney Provides details on the buyer's progression through the checkout. ### intercept value: `(interceptor: 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](https://shopify.dev/docs/api/checkout-ui-extensions/configuration#block-progress) capability in your extension's configuration. ### completed value: `StatefulRemoteSubscribable` 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. ### InterceptorProps ### canBlockProgress value: `boolean` 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. ### InterceptorRequestAllow ### behavior value: `"allow"` Indicates that the interceptor will allow the buyer's journey to continue. ### perform value: `(result: InterceptorResult) => void | Promise` 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. ### InterceptorResultAllow ### behavior value: `"allow"` Indicates that the buyer was allowed to progress through checkout. ### InterceptorResultBlock ### behavior value: `"block"` 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. ### InterceptorRequestBlock ### behavior value: `"block"` Indicates that the interceptor will block the buyer's journey from continuing. ### reason value: `string` 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. ### errors value: `ValidationError[]` Used to pass errors to the checkout UI, outside your extension's UI boundaries. ### perform value: `(result: InterceptorResult) => void | Promise` 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. ### ValidationError ### message value: `string` Error message to be displayed to the buyer. ### target value: `string` The checkout UI field that the error is associated with. Example: `$.cart.deliveryGroups[0].deliveryAddress.countryCode` See the [supported targets](https://shopify.dev/docs/api/functions/reference/cart-checkout-validation/graphql#supported-targets) for more information. ## Related - [StandardApi](https://shopify.dev/docs/api/checkout-ui-extensions/apis/standardapi) - [CheckoutApi](https://shopify.dev/docs/api/checkout-ui-extensions/apis/checkoutapi) - [OrderStatusApi](https://shopify.dev/docs/api/checkout-ui-extensions/apis/orderstatusapi) - [CartLineItemApi](https://shopify.dev/docs/api/checkout-ui-extensions/apis/cartlineitemapi) - [PickupPointListApi](https://shopify.dev/docs/api/checkout-ui-extensions/apis/pickuppointlistapi) - [PickupLocationListApi](https://shopify.dev/docs/api/checkout-ui-extensions/apis/pickuplocationlistapi) - [ShippingOptionItemApi](https://shopify.dev/docs/api/checkout-ui-extensions/apis/shippingoptionitemapi) - [ExtensionTargets](https://shopify.dev/docs/api/checkout-ui-extensions/apis/extensiontargets)