Billing
Planos, assinatura, checkout/portal (status real 200) e — só no Dashboard — uso e faturas (JWT-only, decisão B9). Valores em centavos. Checkout/portal sem providerPriceId (ex. FREE) = 409. Webhook do gateway valida assinatura Stripe (sem JWT/API Key).
Tag no Swagger: Billing · Auth: JWT (Dashboard) + API Key (Public, parcial) + Stripe (gateway) · 4 endpoints
GET/api/v1/billing/plans
Catálogo.
Response
{ plans }Errors: 401 · 403
GET/api/v1/billing/subscription
Assinatura atual (ou null).
Response
Subscription | nullErrors: 401 · 403
POST/api/v1/billing/checkout
Checkout. Status real 200.
Request body
| Campo | Tipo | Obrigatório | Regras |
|---|---|---|---|
| planType | FREE|STARTER|PRO|BUSINESS | sim | — |
Response
{ url, providerCheckoutSessionId }Errors: 401 · 403 · 400 VALIDATION_ERROR
POST/api/v1/billing/portal
Portal. Status real 200.
Request body
| Campo | Tipo | Obrigatório | Regras |
|---|---|---|---|
| returnUrl | string (url) | não | — |
Response
{ url }Errors: 401 · 403 · 400 VALIDATION_ERROR