Post-purchase extensions API reference
About Post Purchase UI ExtensionsAnchor link to section titled "About Post Purchase UI Extensions"
This API reference describes the technical details of how to build your Post Purchase UI Extensions. It covers the available extension points, including their input and output types and their structure.
Extension pointsAnchor link to section titled "Extension points"
An App Bridge Checkout extension will register for one or more extension points using
The current extension points are available for post-purchase:
Checkout::PostPurchase::Render, used to build post-purchase interstitials for cross sell applications.
Configuration fileAnchor link to section titled "Configuration file"
Post-purchase extensions have a configuration file named
extension.config.yml in their root folder. This file is used for setting up dependencies that your extension needs to run.
When an extension is published to Shopify, the contents of this file are pushed alongside it. Currently, the configuration file only supports specifying the metafields that your extension needs to read. If your app needs to read metafields for various resources (Shop, Product, and ProductVariant), then you can specify these metafields using key value pairs in the config file. Any public metafield can be read. You can specify up to five key/namespace pairs in the config file. While executing the extensions, Shopify looks for the metafields in each resource and returns their contents.
DevelopmentAnchor link to section titled "Development"
The configuration file alone will not work in development as Shopify needs to know the file's contents before running the extension. In development, you must pass the configuration as the
config query parameter.
shopify serve outputs the complete string that you must add to a checkout URL, including the contents of the config file. If you use the browser extension, then it automatically appends the config query string to the checkout URL. For example,
The following example includes the URL-encoded version:
When updating the configuration file, it's important to note that you need to restart your local server for the changes to take effect. Similarly, the browser extension might take up to 60 seconds before appending the updated values. If you don't want to wait, then disabling and then re-enabling the extension forces a refresh.