BillKit/Docs Console
Billing portal

Create portal session

Mint a link that lets a customer manage their own subscription.

POST/v1/billing_portal/sessions
Operation create_portal_session · Scope subscriptions:write · Spec snapshot 2026-09-13

Parameters

ParameterDescription
return_urlstring (uri)requiredMust be an absolute URL. At most 2083 characters.
subscription_idstringrequiredAt most 64 characters.
deliver_emailbooleanoptionalDefaults to false.

Returns

Returns a BillingPortalSessionResponse object.

Errors

Status Cause
401 Missing or invalid API key.
403 Key is missing the subscriptions:write scope.
422 Validation Error
429 Rate limited. Back off and retry.
Request · curl
curl -X POST https://api.billkit.eu/v1/billing_portal/sessions \
  -H "Authorization: Bearer $BILLKIT_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{"return_url":"https://acme.example/welcome","subscription_id":"sub_9XKp2vQ1"}'
Request body · every field
{
  "deliver_email": false,
  "return_url": "https://acme.example/welcome",
  "subscription_id": "sub_9XKp2vQ1"
}
Response · 200 OK
{
  "created": 1789392000,
  "customer_id": "cus_9XKp2vQ1",
  "expires_at": 1789392000,
  "id": "obj_9XKp2vQ1",
  "livemode": false,
  "object": "billing_portal.session",
  "return_url": "https://acme.example/welcome",
  "subscription_id": "sub_9XKp2vQ1",
  "token": "string",
  "url": "https://acme.example/welcome"
}