Skip to main content
POST /v1/billing/portal
Creates a portal session with your payment provider (Stripe, Paystack, or Flutterwave). The portal lets your users update their payment method, view invoices, and manage their subscription without leaving the provider’s hosted UI.

Request body

return_url
string
required
URL to redirect the user to after they leave the billing portal.
provider
string
Payment provider to use (stripe, paystack, or flutterwave). Defaults to stripe if omitted.

Response

portal_url
string
The hosted billing portal URL. Redirect the user to this URL.
curl -X POST https://api.truthlocks.com/v1/billing/portal \
  -H "X-API-Key: tl_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "return_url": "https://console.truthlocks.com/settings/billing",
    "provider": "stripe"
  }'
{
  "portal_url": "https://billing.stripe.com/p/session/..."
}
Portal sessions expire after a short time. Generate a fresh URL each time the user clicks to manage their billing.