Skip to main content
POST /v1/billing/checkout
Creates a checkout session with the appropriate payment provider for your region. The response includes a URL where the user completes payment.

Request body

plan_key
string
required
The plan to subscribe to: STARTER, BUSINESS, or ENTERPRISE.
provider
string
Payment provider to use (stripe, paystack, or flutterwave). If omitted, the provider is selected automatically based on your region. See billing configuration to check your default provider.
success_url
string
required
URL to redirect the user to after successful payment.
cancel_url
string
required
URL to redirect the user to if they cancel the checkout.

Response

checkout_url
string
The hosted checkout page URL. Redirect the user to this URL to complete payment.
curl -X POST https://api.truthlocks.com/v1/billing/checkout \
  -H "X-API-Key: tl_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "plan_key": "STARTER",
    "provider": "stripe",
    "success_url": "https://console.truthlocks.com/settings/billing?success=true",
    "cancel_url": "https://console.truthlocks.com/settings/billing?canceled=true"
  }'
{
  "checkout_url": "https://checkout.stripe.com/c/pay/cs_..."
}