RiskPilot API
RiskPilot customer API

Plans, subscription state, and Stripe Checkout and portal URLs (JSON; return pages from an allow-list).


Subscription state and whether access is allowed

GET
/api/v1/customer/billing

Subscription state and whether access is allowed › Responses

OK

status
​string · enum · required
Enum values:
manual
checkout
active
past_due
canceled
packageId
​string · required
access
​string · enum · required

Whether the paid routes answer now, else why not.

Enum values:
allowed
checkout
canceled
payment_overdue
subscription_expired
canManage
​boolean · required

The Stripe billing portal can be opened.

paymentsConfigured
​boolean · required
paidUntil
​string | null · date-time
graceUntil
​string | null · date-time

past_due: until when access continues.

email
​string | null

A Stripe Checkout URL (JSON; open it yourself)

POST
/api/v1/customer/billing/checkout

successUrl and cancelUrl must match an entry of RP_BILLING_RETURN_URLS (scheme, host and path; any query, e.g. ?session={CHECKOUT_SESSION_ID}), else 400 return_url_not_allowed; without them Stripe returns to the web app's billing page. 409 subscription_active: use the portal. 503 when payments are not configured.

A Stripe Checkout URL (JSON; open it yourself) › Request Body optional

packageId
​string

Default: the account's package.

successUrl
​string · uri
cancelUrl
​string · uri

A Stripe Checkout URL (JSON; open it yourself) › Responses

OK

url
​string · uri · required

The Stripe page to open (in a browser or an in-app browser).


A Stripe billing portal URL (card, plan, cancel)

POST
/api/v1/customer/billing/portal

returnUrl like checkout's return pages (RP_BILLING_RETURN_URLS). 409 when the account has no Stripe customer yet.

A Stripe billing portal URL (card, plan, cancel) › Request Body optional

returnUrl
​string · uri

A Stripe billing portal URL (card, plan, cancel) › Responses

OK

url
​string · uri · required

The Stripe page to open (in a browser or an in-app browser).


Packages for sale

GET
/api/v1/customer/plans

Packages for sale › Responses

OK

paymentsConfigured
​boolean · required
​Plan[] · required

Every current package, for a pricing page

GET
/api/v1/public/packages

Every current package, for a pricing page › Responses

OK

paymentsConfigured
​boolean · required
​PublicPackage[] · required