Billing Portal Sessions

Create a short-lived URL the customer can open to manage cards, subscriptions, and download past invoices. Ching hosts the UI; you just hand the URL out.

Use cases: Add a "Manage billing" button in your own product without building cancellation, card-change, or invoice-history flows yourself.
POST/v1/billing_portal_sessions

Issue a portal session token and URL for a customer. The URL is valid for 24 hours.

Body Parameters

NameTypeDescription
customer
stringrequiredThe customer id the portal will render for.
return_url
stringURL shown in the portal's "Back to site" button and used after destructive actions.

Request

curl -X POST "https://api.ching.co.il/v1/billing_portal_sessions" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "customer": "example_customer",
  "return_url": "example_return_url"
}'

Response

Response
{
  "success": true,
  "data": {
    "url": "https://secured.ching.co.il/portal/eyJhbGciOi...",
    "expires_at": "2026-04-20T09:12:43.000Z",
    "return_url": "https://example.com/billing"
  }
}