ForHosting KIT · Developer Utilities

Free shipping threshold calculator

The free shipping threshold calculator turns two order values into one immediately useful answer: the additional amount a shopper must add to qualify.

● BetaFree · in your browser
Use it from WebAPIEmailTelegramApp soon

Enter the current cart total and the store's free-shipping threshold, and the calculator returns the remaining gap. When the cart has already reached or passed the target, it returns zero instead of treating success as an error. The result can power cart messages, checkout prompts, support replies, experiments, and reporting without copying pricing logic across every channel.

Calculate the remaining spend from two totals

Provide the cart's current merchandise total as current_total and the qualifying order value as free_shipping_threshold. The calculator subtracts the current total from the threshold and returns the difference as amount_needed. For example, a cart at 42.50 with a threshold of 60 has 17.50 remaining. Both inputs must be finite, non-negative numbers. Use amounts expressed in the same currency and on the same accounting basis; do not compare a tax-inclusive cart with a tax-exclusive threshold. The capability intentionally does not accept a currency code because subtraction is identical for every currency, but that means your application remains responsible for formatting the result with the correct symbol and decimal conventions. It also means you should decide upstream whether discounts, taxes, gift cards, subscriptions, or excluded products count toward the current total. Send the eligible total after applying those store rules, and the returned gap will be ready for display or further automation. No network request, exchange-rate conversion, catalog lookup, or hidden rounding policy changes the supplied values.

Handle carts that already qualify

A cart at or above the free-shipping threshold produces an amount_needed of zero. This is a normal successful result, not an error condition. That behavior keeps checkout logic simple: display an encouragement message only when the value is greater than zero, and show the store's qualified state when it is zero. The same rule covers an exact match, an order that exceeds the target, and a zero threshold. Negative inputs, missing fields, strings, null values, infinities, and values that are not numbers are rejected because they cannot represent valid totals. This separation matters in production. A zero result describes a valid cart that needs no additional spend; an invalid-input response tells the caller that its data contract is broken and should not be shown to a shopper as a purchasing recommendation. Since the operation is deterministic, identical numeric inputs always produce identical output. You can therefore reuse it safely in storefront UI, server-side checkout validation, automated tests, event pipelines, and customer-service tools without reconciling different interpretations of an already-qualified cart.

Integrate the result into a useful cart message

Treat the returned number as a calculation, then apply presentation and merchandising policy in your own interface. A positive gap can become a message such as “Add 12.00 more for free shipping,” formatted in the cart's currency and locale. A zero can switch the component to “You qualify for free shipping.” Before calling the calculator, derive current_total from products that are eligible under the promotion. Some stores exclude oversized goods, digital items, taxes, tips, or delivery fees; others evaluate the subtotal before coupons. Keeping those rules outside this focused capability makes the result transparent and prevents an arithmetic helper from pretending to understand a store catalog it has never received. For analytics, record the threshold and current total alongside the gap so later reports retain the context behind each result. For experiments, vary the threshold upstream and compare conversion outcomes while leaving the calculation unchanged. The API price is $0.002 per request, while the browser implementation uses the same pure solver. This narrow contract makes the capability easy to audit, cache, test, and embed wherever a consistent remaining-spend value is needed.

Cart progress messaging

Show shoppers the exact additional eligible spend needed before free shipping becomes available.

Checkout eligibility checks

Convert cart and threshold totals into a consistent zero-or-positive gap for checkout logic.

Customer support answers

Give agents a quick, repeatable calculation when customers ask why delivery is not yet free.

What happens when the cart already qualifies?

The calculator returns amount_needed as zero. Meeting or exceeding the threshold is a successful result, not an error.

Does the calculator include taxes or discounts?

It uses the current_total exactly as supplied. Apply your store's eligibility, tax, discount, and product-exclusion rules before calling it.

Can I use any currency?

Yes. Both values must use the same currency and accounting basis. Format the numeric result with the appropriate currency in your application.

Which inputs are rejected?

Missing values, strings, nulls, negative totals, infinities, and non-numeric values are rejected as invalid input.

How much does an API calculation cost?

Each API request costs $0.002. The browser version runs free using the same deterministic calculation.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/ecom/free-shipping-threshold-gap

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/ecom/free-shipping-threshold-gap \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"current_total":42.5,"free_shipping_threshold":60}'
{
  "current_total": 42.5,
  "free_shipping_threshold": 60
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "ecom.free_shipping_threshold_gap",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Read the full KIT documentation →