Skip to main content
POST
/
v1
/
billing
/
checkout
Create checkout session
curl --request POST \
  --url https://api.truthlocks.com/v1/billing/checkout \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "plan": "<string>",
  "success_url": "<string>",
  "cancel_url": "<string>"
}
'
{
  "checkout_url": "<string>",
  "session_id": "<string>",
  "expires_at": "<string>"
}
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.

Authorizations

X-API-Key
string
header
required

API key for machine-to-machine authentication

Body

application/json
plan
string
required

Plan identifier to subscribe to

success_url
string

URL to redirect after successful checkout

cancel_url
string

URL to redirect on checkout cancellation

Response

Checkout session

checkout_url
string
session_id
string
expires_at
string