Billing Endpoints
GET /api/billing/session
Retrieve details of a completed Stripe checkout session.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
session_id | string | Yes | Stripe checkout session ID (cs_...) |
Authentication
Requires a valid session.
Response
Status: 200 OK
json
{
"session_id": "cs_live_...",
"amount_total": 3000,
"currency": "USD",
"tier": "pro",
"created": 1747123456
}Errors
| Status | Cause |
|---|---|
| 400 | Missing session_id or payment not completed |
| 401 | No valid session |
| 500 | Stripe error retrieving session |
GET /api/billing/portal
Create a Stripe billing portal session.
Authentication
Requires a valid session and an active Stripe customer.
Response
Status: 200 OK
json
{
"url": "https://billing.stripe.com/session/..."
}Redirect the user to this URL to manage their subscription.