Passa al contenuto principale

Stripe-billing API

Auto-generated from the OpenAPI spec. Run node docs-site/scripts/fetch-openapi.js to regenerate.

GET /api/billing/settings

Get Billing Settings

Return current Stripe connection status. Never returns the secret key.

Responses

  • 200 — Successful Response

POST /api/billing/settings

Post Billing Settings

Validate a Stripe secret key and persist all Stripe credentials.

Request body

FieldRequiredTypeDescription
secret_keyYesstring
publishable_keyYesstring
webhook_secretNostring

Responses

  • 200 — Successful Response
  • 422 — Validation Error

POST /api/billing/checkout-session

Create Checkout Session

Create a Stripe Checkout Session for a membership purchase.

Supports both one-off (mode="payment") and recurring (mode="subscription") purchases depending on the membership type.

Accessible by authenticated clients (who may only purchase for themselves) and by managers (who may initiate on behalf of any client).

Request body

FieldRequiredTypeDescription
client_idYesinteger
membership_type_idYesinteger
success_urlYesstring
cancel_urlYesstring
promo_codeNostring
gift_card_codeNostring

Responses

  • 200 — Successful Response
  • 422 — Validation Error

POST /api/billing/webhook

Stripe Webhook

Stripe webhook receiver. No auth — Stripe signs the payload.

Responses

  • 200 — Successful Response

GET /api/billing/members/{client_id}/subscription

Get Subscription Status

Return the most recent Stripe subscription for a client.

Accessible by managers, instructors, or the client themselves.

Parameters

NameInRequiredTypeDescription
client_idpathYesinteger

Responses

  • 200 — Successful Response
  • 422 — Validation Error

POST /api/billing/members/{client_id}/subscription/cancel

Cancel Subscription

Cancel a client's active subscription at period end. Manager-only.

Parameters

NameInRequiredTypeDescription
client_idpathYesinteger

Responses

  • 200 — Successful Response
  • 422 — Validation Error

POST /api/billing/members/{client_id}/subscription/cancel/override

Cancel Subscription Override

Cancel a client's subscription locally in the DB without calling Stripe.

Safety valve for when Stripe is unreachable or webhooks fail. Manager-only. Does NOT make any network calls to Stripe.

Parameters

NameInRequiredTypeDescription
client_idpathYesinteger

Responses

  • 200 — Successful Response
  • 422 — Validation Error