Files
supabase/packages/api-types
Ignacio Dobronich e6ca2766ff feat: show tax preview for credit top-ups (#45005)
## Summary

- Add tax preview to the credit top-up flow by integrating the new `POST
/organizations/{slug}/billing/credits/preview` endpoint
- Show a price breakdown (credit amount, tax line item, total) in the
top-up dialog before the user confirms payment
- Handle all three `tax_status` states: show tax when `calculated`, hide
the line when `not_applicable`, show an inline warning when `failed`


## Behavior

- Preview fires as soon as a valid amount (300–2000) is entered; address
and tax ID are optional and refine the estimate
- Amount and address changes are debounced at 1s to avoid excessive API
calls

## Test plan

- [ ]  Open credit top-up dialog - verify preview appears with default
$300 amount
- [ ]  Change amount within 300–2000 - verify preview updates after
debounce
- [ ]  Enter amount outside range (e.g. 100 or 3000) - verify preview
hides and validation error shows
- [ ]  Add a new payment method with a billing address in a taxed region
- verify tax line item appears
- [ ]  Add a new payment method with no tax jurisdiction - verify no tax
line, just total
- [ ]  Complete a top-up - verify the charge goes through and dialog
closes


<img width="571" height="551" alt="image"
src="https://github.com/user-attachments/assets/d3357752-f913-4a4a-b84a-f78e2f457c7b"
/>


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Credit top-up preview with charge breakdown (credit, tax or tax note,
total).
* Onboarding survey endpoint and ISO 27001 certificate availability for
organizations.

* **Updates**
* Improved top-up UX: debounced address/tax inputs, enforced min/max
amount validation, preview-driven form state, and submit disabled while
preview is loading/stale.
  * API docs wording changed to “temporary access configuration.”
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-04-23 12:16:57 -03:00
..