Skip to main content
Upgrade to Polaris

Version 2025-07 is the last API version to support React-based UI components. Later versions use Polaris web components, native UI elements with built-in accessibility, better performance, and consistent styling with Shopify's design system. Check out the upgrade guide to upgrade your extension and avoid being blocked from updating your extension after October 1st 2026.

Cost API

The API for interacting with the cost of a checkout.

The base API object provided to purchase extension targets.

required

Details on the costs the buyer will pay for this checkout.

Anchor to useSubtotalAmount
useSubtotalAmount()

A Money value representing the subtotal value of the items in the cart at the current step of checkout.

Anchor to useTotalShippingAmount
useTotalShippingAmount()

A Money value representing the total shipping a buyer can expect to pay at the current step of checkout. This value includes shipping discounts. Returns undefined if shipping has not been negotiated yet, such as on the information step.

| undefined

Anchor to useTotalTaxAmount
useTotalTaxAmount()

A Money value representing the total tax a buyer can expect to pay at the current step of checkout or the total tax included in product and shipping prices. Returns undefined if taxes are unavailable.

| undefined

Anchor to useTotalAmount
useTotalAmount()

Returns a Money value representing the minimum a buyer can expect to pay at the current step of checkout. This value excludes amounts yet to be negotiated. For example, the information step might not have delivery costs calculated.



Was this page helpful?