Checkout
Checkout callback
If your mini displays product links/cards or performs another action that could result in a checkout then you can use the useCheckoutSuccessfully
hook to listen for a completed checkout.
import { useCheckoutSuccessfully } from '@shopify/shop-minis-platform-sdk/events'
useCheckoutSuccessfully(orderId => {
// You might choose to keep your mini open and display something else or navigate away
shopActions.navigateToOrder({orderId: `gid://shopify/Order/${orderId}`})
}, [])
info
Users following the "buy now" flow within a mini will see an order conformation screen which they need to dismiss before returning to your mini. This means that the callback may fire before your mini is visible again.