Prompt
refund tax not recalculating api
Latest observation
Nov 3, 2026
OpenAI APIWeb search: off
If your refund tax isn’t recalculating through the API, the issue is usually one of these:
Common causes
-
Tax is being copied from the original transaction
- Some APIs reuse the original tax amount unless you explicitly request a recalculation.
-
Missing tax recalculation flag
- The refund request may need a parameter like:
recalculate_tax=truecalculate_tax=truetax_behavior=automatic
- The exact name depends on the API/provider.
- The refund request may need a parameter like:
-
Refund is partial
- For partial refunds, some systems prorate tax automatically, while others do not unless tax lines are sent in the request.
-
Refund endpoint does not support automatic tax
- Some payment APIs only refund the charged amount and don’t recompute tax; you must calculate it yourself.
-
Jurisdiction or rounding differences
- Tax may appear “wrong” because the original order and refund use different rounding rules or jurisdiction data.
What to check
- Whether the API supports automatic tax calculation on refunds
- Whether you need to pass:
- refund line items
- shipping refund details
- tax inclusive/exclusive flags
- Whether the refund is:
- full refund
- partial refund
- item-level refund
Example logic
If your system calculates tax separately, your refund should usually do:
- refund subtotal of returned items
- recalculate tax based on refunded items only
- include shipping tax only if shipping is refunded
If you’re using a specific platform
Tell me which API you mean, for example:
- Stripe
- Shopify
- WooCommerce
- Avalara
- TaxJar
- Square
- custom API
and I can give you the exact request format and why the tax isn’t recalculating.