SureshakeDocs
ApiEndpoints

Billing Endpoints

Manage subscriptions, checkout sessions, and the billing portal.

The Billing family manages your Sureshake subscription and payment settings via Stripe.

Create Checkout Session

Generate a unique Stripe Checkout URL to subscribe to a specific plan.

POST/api/v1/billing/checkout
curl -X POST \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"planId": "individual_professional", "billingCycle": "monthly"}' \
https://api.sureshake.com/api/v1/billing/checkout
201 Created
{
"data": {
  "id": "cs_test_...",
  "url": "https://checkout.stripe.com/...",
  "expiresAt": 1710518400,
  "planId": "individual_professional",
  "billingCycle": "monthly"
},
"meta": {
  "timestamp": "2024-03-15T10:00:00Z"
}
}

Get Current Subscription

Retrieve details about your active subscription.

GET/api/v1/billing/subscription
curl -H "Authorization: Bearer $TOKEN" https://api.sureshake.com/api/v1/billing/subscription

Billing Portal

Generate a link to the Stripe Customer Portal where you can manage payment methods and view invoices.

POST/api/v1/billing/portal
curl -X POST -H "Authorization: Bearer $TOKEN" https://api.sureshake.com/api/v1/billing/portal

Cancel Subscription

Disable auto-renewal for your current subscription. It will remain active until the end of the current period.

POST/api/v1/billing/subscription/cancel
curl -X POST \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"subscriptionId": "sub_..."}' \
https://api.sureshake.com/api/v1/billing/subscription/cancel

On this page