Manage subscription and billing information.
Method Endpoint Description GET/subscriptionGet current subscription POST/subscription/portalGet billing portal URL GET/subscription/invoicesList invoices GET/subscription/usageGet usage against plan limits
1 {
2 "id" : "sub_abc123" ,
3 "status" : "active" ,
4 "plan" : {
5 "id" : "pro" ,
6 "name" : "Pro" ,
7 "price" : 19 ,
8 "interval" : "month"
9 } ,
10 "currentPeriod" : {
11 "start" : "2024-01-01T00:00:00Z" ,
12 "end" : "2024-01-31T23:59:59Z"
13 } ,
14 "cancelAtPeriodEnd" : false ,
15 "features" : {
16 "projects" : 10 ,
17 "apiCalls" : 10000 ,
18 "agentInvocations" : 1000 ,
19 "skillApplications" : 500 ,
20 "teamMembers" : 1 ,
21 "prioritySupport" : true
22 } ,
23 "createdAt" : "2024-01-01T00:00:00Z"
24 }
curl https://api.bootspring.dev/v1/subscription \
-H "Authorization: Bearer bs_xxx"
1 {
2 "data" : {
3 "id" : "sub_abc123" ,
4 "status" : "active" ,
5 "plan" : {
6 "id" : "pro" ,
7 "name" : "Pro" ,
8 "price" : 19 ,
9 "interval" : "month" ,
10 "currency" : "usd"
11 } ,
12 "currentPeriod" : {
13 "start" : "2024-01-01T00:00:00Z" ,
14 "end" : "2024-01-31T23:59:59Z"
15 } ,
16 "cancelAtPeriodEnd" : false ,
17 "paymentMethod" : {
18 "type" : "card" ,
19 "last4" : "4242" ,
20 "brand" : "visa" ,
21 "expiresAt" : "2025-12"
22 } ,
23 "features" : {
24 "projects" : 10 ,
25 "apiCalls" : 10000 ,
26 "agentInvocations" : 1000 ,
27 "skillApplications" : 500 ,
28 "contextGenerations" : 500 ,
29 "teamMembers" : 1 ,
30 "prioritySupport" : true ,
31 "customAgents" : false ,
32 "sso" : false
33 } ,
34 "usage" : {
35 "projects" : { "used" : 3 , "limit" : 10 } ,
36 "apiCalls" : { "used" : 5420 , "limit" : 10000 } ,
37 "agentInvocations" : { "used" : 342 , "limit" : 1000 }
38 } ,
39 "createdAt" : "2024-01-01T00:00:00Z"
40 }
41 }
Status Description activeSubscription is active and paid trialingIn free trial period past_duePayment failed, grace period canceledSubscription canceled unpaidPayment failed, access restricted
POST /subscription/portal
Generates a URL to the Stripe billing portal where users can manage their subscription.
Field Type Required Description returnUrlstring No URL to redirect after portal
1 curl -X POST https://api.bootspring.dev/v1/subscription/portal \
2 -H "Authorization: Bearer bs_xxx" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "returnUrl": "https://bootspring.dev/dashboard/settings"
6 }'
1 {
2 "data" : {
3 "url" : "https://billing.stripe.com/session/xxx" ,
4 "expiresAt" : "2024-01-15T11:00:00Z"
5 }
6 }
GET /subscription/invoices
Parameter Type Description limitinteger Number of invoices (default: 10) statusstring Filter: paid, open, void
curl https://api.bootspring.dev/v1/subscription/invoices \
-H "Authorization: Bearer bs_xxx"
1 {
2 "data" : [
3 {
4 "id" : "inv_abc123" ,
5 "number" : "INV-2024-001" ,
6 "status" : "paid" ,
7 "amount" : 1900 ,
8 "currency" : "usd" ,
9 "description" : "Pro Plan - January 2024" ,
10 "pdfUrl" : "https://pay.stripe.com/invoice/xxx/pdf" ,
11 "paidAt" : "2024-01-01T00:05:00Z" ,
12 "periodStart" : "2024-01-01T00:00:00Z" ,
13 "periodEnd" : "2024-01-31T23:59:59Z" ,
14 "createdAt" : "2024-01-01T00:00:00Z"
15 }
16 ]
17 }
curl https://api.bootspring.dev/v1/subscription/usage \
-H "Authorization: Bearer bs_xxx"
1 {
2 "data" : {
3 "plan" : "pro" ,
4 "period" : {
5 "start" : "2024-01-01T00:00:00Z" ,
6 "end" : "2024-01-31T23:59:59Z"
7 } ,
8 "metrics" : {
9 "projects" : {
10 "used" : 3 ,
11 "limit" : 10 ,
12 "percentage" : 30
13 } ,
14 "apiCalls" : {
15 "used" : 5420 ,
16 "limit" : 10000 ,
17 "percentage" : 54.2
18 } ,
19 "agentInvocations" : {
20 "used" : 342 ,
21 "limit" : 1000 ,
22 "percentage" : 34.2
23 } ,
24 "skillApplications" : {
25 "used" : 89 ,
26 "limit" : 500 ,
27 "percentage" : 17.8
28 } ,
29 "contextGenerations" : {
30 "used" : 156 ,
31 "limit" : 500 ,
32 "percentage" : 31.2
33 }
34 } ,
35 "resetAt" : "2024-02-01T00:00:00Z"
36 }
37 }
Feature Free Pro Team Enterprise Price $0 $19/mo $49/user/mo Custom Projects 1 10 50 Unlimited API Calls/mo 1,000 10,000 50,000 Custom Agent Invocations/mo 50 1,000 5,000 Custom Team Members 1 1 Unlimited Unlimited Priority Support No Yes Yes Yes Custom Agents No No Yes Yes SSO No No No Yes SLA No No 99.9% 99.99%
Upgrading is done through the billing portal:
1 // Get portal URL
2 const { data } = await fetch ( '/api/subscription/portal' , {
3 method : 'POST' ,
4 headers : {
5 'Authorization' : ` Bearer ${ apiKey } ` ,
6 'Content-Type' : 'application/json' ,
7 } ,
8 body : JSON . stringify ( {
9 returnUrl : window . location . href ,
10 } ) ,
11 } ) . then ( r => r . json ( ) ) ;
12
13 // Redirect to portal
14 window . location . href = data . url ;
Cancellation is also done through the billing portal. The subscription remains active until the end of the current billing period.
1 {
2 "status" : "active" ,
3 "cancelAtPeriodEnd" : true ,
4 "currentPeriod" : {
5 "end" : "2024-01-31T23:59:59Z"
6 }
7 }
Subscribe to billing events:
Event Description subscription.createdNew subscription started subscription.updatedSubscription plan changed subscription.canceledSubscription canceled invoice.paidInvoice payment successful invoice.payment_failedInvoice payment failed
See Webhooks for setup.
Code Description no_subscriptionUser has no subscription subscription_canceledSubscription is canceled payment_requiredPayment method needed portal_errorFailed to create portal session