API reference

Billing

Read the current plan, usage and limits, start a checkout, or open the Stripe customer portal to manage the subscription.

Current plan & usage

GET/api/billing
curl https://api.riscly.com/api/billing \
  -H "Authorization: Bearer $RISCLY_TOKEN" \
  -H "x-org-id: $RISCLY_ORG_ID"

Invoices & payment method

GET/api/billing/details

Returns recent invoices (with download URLs) and the card on file.

Start a checkout

POST/api/billing/checkout

Returns a Stripe Checkout url to redirect the user to for upgrading.

const { url } = await riscly("/billing/checkout", {
  method: "POST",
  body: JSON.stringify({ plan: "pro" }),
}).then((r) => r.json());

window.location.href = url;

Customer portal

POST/api/billing/portal

Returns a Stripe customer-portal url to change plan, update the card or cancel.

Confirm a checkout

POST/api/billing/confirm

Call on return from Checkout with the sessionId so access is granted immediately rather than waiting for the webhook.