Skip to main content

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.

Was this section helpful?

Anchor to useSubtotalAmount
useSubtotalAmount()

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

Money

amount
number

The price amount.

currencyCode

The ISO 4217 format for the currency.

Was this section helpful?

Anchor to useTotalShippingAmount
useTotalShippingAmount()

Returns 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
Was this section helpful?

Anchor to useTotalTaxAmount
useTotalTaxAmount()

Returns 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
Was this section helpful?

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.

Money

amount
number

The price amount.

currencyCode

The ISO 4217 format for the currency.

Was this section helpful?