Buyer JourneyAPI
The API for interacting with the buyer journey.
Anchor to standardapiStandardApi
The base API object provided to purchase
extension targets.
Provides details on the buyer's progression through the checkout.
Refer to buyer journey examples for more information.
Anchor to useBuyerJourneyuse Buyer Journey()
Returns the buyerJourney details on buyer progression in checkout.
BuyerJourney
What step of checkout the buyer is currently on.
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.
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.
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 useBuyerJourneyCompleteduse Buyer Journey Completed()
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.
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.
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.
Anchor to useBuyerJourneyIntercept-returnsReturnsvoid
Anchor to useBuyerJourneyStepsuse Buyer Journey Steps()
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 useBuyerJourneyActiveStepuse Buyer Journey Active Step()
Returns the buyer journey step that the buyer is currently on.
Block progress and show error for a checkout UI field
Anchor to examplesExamples
In addition to targeting checkout UI fields, you can also pass errors to the page level or render the error in your extension.
Anchor to example-block-progress-and-show-error-at-page-levelBlock progress and show error at page level
Intercept and prevent a buyer's progress through checkout while displaying an error message at the page level. See the validation tutorial for more examples and best practices.
Anchor to example-block-progress-and-show-error-in-your-extensionBlock progress and show error in your extension
Intercept and prevent a buyer's progress through checkout while displaying an error message in your extension. See the validation tutorial for more examples and best practices.