Checkout extension exporting api not working

Here is the export statement:

export default extension(
	"purchase.checkout.shipping-option-list.render-after",
	(root, {lines, applyCartLinesChange, query, i18n},api}) => {

but api is always null.

I can do (root,api) and it works fine but then I lose all my other options – lines, query, etc.

1 Like

I have the same issue

I figured it out. You don’t need to export all the Checkout components separately - you can just do this:

export default extension('purchase.checkout.contact.render-after', (root, api ) => {

and then you can access the components via the api object like so:

let bI = api.buyerIdentity;
let loc = api.localization;
let sA = api.shippingAddress;
// and so on

Yup. Thank you.

"export default extensio"n takes two arguments, the second being the complete api or else an object of of api objects: {shop, metafields, shippingAddress}, for example.