How can I get the checkout and order details in checkout UI extension , to show a banner related to the total amount of the order ?
Topic summary
Goal: show a conditional banner in a Checkout UI Extension based on the order total and (ideally) merchant shipping settings.
Whatās been tried:
- Suggested APIs: useOrder() and useTotalAmount() from @shopify/ui-extensions-react/checkout (per Shopify āunstableā docs). Example given for retrieving amount and currency.
- OPās current approach: useSubtotalAmount(), useDeliveryGroups(), and useDeliveryGroup() to get subtotal, delivery groups, selectedDeliveryOption, and targetedCartLines.
Open issues:
- Access to merchant shipping settings: OP wants to read the shopās configured shipping settings (shown in an attached screenshot) from the Checkout UI Extension but hasnāt found how. No solution provided.
- Import error: Another user sees āReferenceError: useSubtotalAmount is not definedā when importing useSubtotalAmount. They ask if shopify.extension.toml needs changes; no fix posted.
Context/constraints:
- A Plus plan was queried; OP is using Checkout and Customer Accounts Extensibility preview, not Plus.
- Checkout UI Extensions = APIs/hooks to read checkout data (order totals, delivery groups) for UI customization.
Status: Unresolved. Guidance points to useOrder/useTotalAmount; questions about shipping settings access and the useSubtotalAmount import error remain open. Images (shipping settings, error screenshot) are central to understanding the requests.
Do you have a Shopify Plus plan?
Hi @MastersHub
No, Iām working on checkout and customer accounts extensibility preview to test my checkout UI extension app.
Thanks in Advance.
Not sure what youāre trying to do but you should be able to get it from the API:
- if you need the whole order, you can use this API: https://shopify.dev/docs/api/checkout-ui-extensions/unstable/apis/order
useOrder()
- or, if you just want the total, you can use this API: https://shopify.dev/docs/api/checkout-ui-extensions/unstable/apis/cost
useTotalAmount()
I havenāt used this specific API, but the code should be something along this line:
import {
useTotalAmount,
} from ā@shopify/ui-extensions-react/checkoutā;
function Extension() {
const {amount, currencyCode} = useTotalAmount();
}
Thank you for the reply, I have already found a way to get the order and shipping details in the checkout page through
let api = useSubtotalAmount();
const Amount = api.amount;
const deliveryGroups = useDeliveryGroups();
console.log(deliveryGroups);
const {
selectedDeliveryOption,
targetedCartLines,
} = useDeliveryGroup(deliveryGroups[0]);
But Iām stuck in getting the shipping settings by the shop owner in the checkout UI extension, Basically I want to get these settings (in the image ) details in my checkout UI extension. How can I get it?
Hi, Iām having an issue getting this to work. Iāve tried to import the useSubtotalAmount and i get the error:
ExtensionRenderError: ReferenceError: useSubtotalAmount is not defined
Screenshot attached. Do i need to adjust anything in the shopify.extension.toml file? api access is set to true.
Iām just trying to get the subtotal amount so i can conditionally display the banner if the cart total is greater than $50.

