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/billingcurl https://api.riscly.com/api/billing \
-H "Authorization: Bearer $RISCLY_TOKEN" \
-H "x-org-id: $RISCLY_ORG_ID"Invoices & payment method
GET
/api/billing/detailsReturns recent invoices (with download URLs) and the card on file.
Start a checkout
POST
/api/billing/checkoutReturns 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/portalReturns a Stripe customer-portal url to change plan, update the card or cancel.
Confirm a checkout
POST
/api/billing/confirmCall on return from Checkout with the sessionId so access is granted immediately rather than waiting for the webhook.