Invoices
Get pay URL
Resolve a fresh Stripe-hosted pay URL for an open invoice.
GET
Returns a freshly-resolved Stripe-hosted pay URL for an
open invoice.
Stripe-hosted invoice URLs rotate occasionally — embedding the cached
hostedInvoiceUrl from
GET /v1/billing/invoices/:id in a
button is fine for display, but the dashboard’s Pay ↗ action calls this
endpoint immediately before opening the URL so the user never lands on a
stale 404.
Invoice id (
inv_…). Must belong to the authenticated user.Fresh Stripe-hosted pay URL.
null if the Stripe-side invoice was never
finalized (rare — only happens when the Stripe API call failed at creation
time and the local row is still in draft state).When to call
- Right before opening the pay page (most common use)
- Polling for a “still open” check after the user said they paid — Stripe’s
webhook handler may take a beat to flip our copy to
paid - Auditing — comparing Stripe’s current URL against the one we stored at creation