Before issuing a partial refund, retrieve the original charge's tax breakdown (from Stripe Tax metadata or your own tax calculation record) to determine the tax rate applied.
Calculate the refundable tax component: refund_tax = (refund_amount / original_taxable_amount) * original_tax_collected; add this to the net refund for the total refund amount.
Create the refund using the Stripe Refunds API with the total calculated amount (net + proportional tax); do not refund tax and net separately as two refunds — use a single combined refund amount.
Record the tax-portion of the refund in your accounting system as a tax liability reversal; the net portion is a revenue reversal.
Issue a corrected or credit tax receipt to the customer where required by jurisdiction (e.g., EU VAT credit note requirements).
For multi-line-item partial refunds (refunding only some items), calculate tax prorated per line item rather than applying a flat proportion to the total.
Known gotchas
Stripe Tax does not automatically issue credit notes for partial refunds — you must generate credit notes via the Stripe Invoicing API or your own billing system if tax receipts are required.
Rounding differences between the original tax calculation and a prorated refund tax amount can accumulate at scale; use the same rounding mode (round-half-up vs. round-half-even) as the original charge.
Some jurisdictions require the full tax amount to be refunded whenever a refund is issued, even for partial refunds — check local tax rules before prorating.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp