Vexar API

Subscriptions

Manage your own plan subscription via Stripe: start a checkout, open the billing portal, cancel/resume, and read the current subscription and payment history. Authentication required.

POST /api/v1/subscription/checkout Auth

Create a Stripe checkout session for a plan. interval: month | year.

Request body
{ "plan": "pro", "interval": "month", "promo_code": "" }
Response
{ "success": true, "url": "https://checkout.stripe.com/…" }
POST /api/v1/subscription/validate-promo Auth

Validate a promo code for a plan/interval.

Request body
{ "code": "SAVE20", "plan": "pro", "interval": "month" }
Response
{ "success": true, "discount": { … } }
GET /api/v1/subscription/current Auth

Current subscription and plan.

Response
{ "success": true, "plan": "pro", "status": "active", "current_period_end": "2026-07-01" }
POST /api/v1/subscription/portal Auth

Open the Stripe customer billing portal.

Response
{ "success": true, "url": "https://billing.stripe.com/…" }
POST /api/v1/subscription/cancel Auth

Cancel at period end.

Response
{ "success": true }
POST /api/v1/subscription/resume Auth

Resume a cancelled subscription.

Response
{ "success": true }
GET /api/v1/subscription/payments Auth

Payment history.

Response
{ "success": true, "payments": [ … ] }