Skip to main content
POST
/
v1
/
billing
/
portal
Create billing portal session
curl --request POST \
  --url https://api.truthlocks.com/v1/billing/portal \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "return_url": "<string>"
}
'
{
  "portal_url": "<string>",
  "expires_at": "<string>"
}
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.
Portal sessions expire after a short time. Generate a fresh URL each time the user clicks to manage their billing.

Authorizations

X-API-Key
string
header
required

API key for machine-to-machine authentication

Body

application/json
return_url
string

URL to redirect after portal session

Response

Portal session

portal_url
string
expires_at
string