Skip to content

feat(billing): charge UK VAT on subscriptions#1560

Merged
mattwoberts merged 1 commit into
mainfrom
vat
Jun 2, 2026
Merged

feat(billing): charge UK VAT on subscriptions#1560
mattwoberts merged 1 commit into
mainfrom
vat

Conversation

@mattwoberts

@mattwoberts mattwoberts commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Following Fider's switch from Paddle to Stripe (where we became the merchant of record), this adds UK VAT collection for UK-domiciled customers. Uses Stripe Tax Rates (the free legacy feature) — not the paid Stripe Tax — keeping ongoing cost at zero.

  • Stripe Checkout is moved to mode: setup so the customer's billing address is captured before the first invoice is generated.
  • The webhook then creates the Subscription server-side via the Stripe API and attaches a UK VAT tax rate (20%, inclusive) when the address country is GB. VAT appears on invoice secure the API #1, not just from invoice configure branches and its deployment pipeline #2.
  • New env var STRIPE_UK_VAT_TAX_RATE_ID points at a Tax Rate object that needs to be created in the Stripe dashboard (live + test).

Notes

  • All UK customers get 20% VAT — UK→UK is never reverse-charged, so no VAT-ID collection is needed.
  • The legacy mode: subscription webhook path is retained to drain any in-flight Checkout sessions created before the deploy.
  • Subscription creation uses session.ID as the Stripe idempotency key, so webhook retries are safe and won't create duplicates.
  • The UX shifts slightly: Stripe Checkout in setup mode shows "Add a payment method" rather than "Subscribe to Pro — $25/month". A custom_text.submit.message is set so the customer still sees what they're committing to inside Checkout.

Test plan

  • Test mode: create the Tax Rate, set env var, run through Checkout with UK test card 4000 0082 6000 0000 and confirm first invoice has VAT line.
  • Test mode: run through Checkout with non-UK test card 4242 4242 4242 4242 and confirm no VAT applied.
  • Verify webhook retries are idempotent (replay a checkout.session.completed event via Stripe CLI; only one subscription created).
  • Verify cancellation still flips the tenant back to free.

🤖 Generated with Claude Code

Switch Checkout to setup mode so the customer's billing address is
captured before the first invoice is generated. The webhook then
creates the Subscription server-side and attaches a UK VAT tax rate
when the address country is GB, ensuring VAT appears on invoice #1.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@mattwoberts mattwoberts merged commit de9d635 into main Jun 2, 2026
5 checks passed
@mattwoberts mattwoberts deleted the vat branch June 2, 2026 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant