Skip to main content

Cost API

The Cost API provides read-only access to the cost breakdown of an order on the Order status page. Use this API to read the subtotal, total shipping, total tax, and total amounts, each returned as a Money object with an amount and currencyCode.

  • Display an order summary: Show a breakdown of the order cost, including the subtotal, shipping, tax, and total.
  • Highlight shipping costs: Display the shipping cost for the order, accounting for any shipping discounts that were applied.
  • Show tax details: Display the total tax amount for the order, or indicate when tax information is unavailable.

The shopify global object provides the cost breakdown for the order. Access the following properties on shopify to read the subtotal, total shipping, total tax, and total amounts.

required

A breakdown of the costs for the order, including the subtotal, shipping, tax, and total amounts.


  • Format currency using the Localization API: Use the Order Status Localization API to determine the buyer's currency and format money values appropriately.
  • Show a complete cost summary: Combine the Cost API with the Discounts API and the Gift Cards API to display a full breakdown of the order's pricing.

  • The Cost API doesn't include refund amounts. If the order has been partially or fully refunded, those adjustments aren't reflected in the cost properties.

Was this page helpful?