Post-purchase extension points API

ExtensionPoints

Post-purchase checkout extensions allow developers and Plus merchants to add a post-purchase page directly into the Shopify checkout. The page appears after the order is confirmed, but before the thank you page. Post-purchase checkout extensions can use the ShouldRender and Render extension points. For more information, refer to the post-purchase checkout extensions overview.

Name Type Description
Checkout::PostPurchase::Render RenderExtension<PostPurchaseRenderApi, AllComponents> The Render extension point is used to render the section in the post-purchase page. Also, it provides additional functionality, such as communicating with Shopify to add items to the initial purchase.
Checkout::PostPurchase::ShouldRender (api: PostPurchaseShouldRenderApi) => PostPurchaseShouldRenderResult The ShouldRender extension point is used to determine whether a post-purchase page should be shown to the customer. It also allows data to be pre-cached and used when the page renders.

PostPurchaseShouldRenderApi

Input given to the ShouldRender extension point (Checkout::PostPurchase::ShouldRender).

Name Type Description
inputData InputData Input data given to the extension point.
storage Storage General purpose storage for extensions.
version "unstable"
locale string
extensionPoint "Checkout::KitchenSink" | "Checkout::PostPurchase::Render" | "Checkout::PostPurchase::ShouldRender"

RenderExtension

A type of extension point that is capable of rendering UI into Checkout natively. This type of extension point receives an object to manipulate the UI as its first argument, and additional data and methods as a second argument. The object that can manipulate the UI is referred to as a RemoteRoot, and is provided by the remote-ui library on which UI Extensions' rendering capabilities are built.

Type Description
(root: RemoteRoot<AllowedComponents, true>, input: Input): RenderResult<Input> | void Input type for RenderExtension.

RenderResult

The output expected from the ShouldRender extension point.

Name Type Description
update? (input: Partial<Input>) => void Whether the post-purchase page is requested.

PostPurchaseRenderApi

Input given to the render extension point (Checkout::PostPurchase::Render).

Name Type Description
inputData InputData Input data given to the extension point.
storage Storage General purpose storage for extensions.
calculateChangeset (changeset: Readonly<Changeset> | string) => Promise<CalculateChangesetUnprocessedResult | CalculateChangesetProcessedResult> Returns the calculations that would result from the provided changeset being applied. Used to provide cost-clarity for buyers.
applyChangeset (changeset: string) => Promise<ApplyChangesetResult> Requests a changeset to be applied to the initial purchase, and to charge the buyer with the difference in total price, if any.
done () => Promise<void> Indicates that the extension has finished running. Currently, effectively redirects buyers to the thank you page.
version "unstable"
locale string
extensionPoint "Checkout::KitchenSink" | "Checkout::PostPurch