rubis/bruno/09-Billing/01 Get subscription.bru
ordinarthur 3bad1451a9
All checks were successful
Build & Deploy Web / build-and-deploy (push) Successful in 19s
docs(bruno): collection Billing + endpoints check-in in-app
Nouveau dossier `09-Billing/` avec :
  - folder.bru (overview : plans + flows upgrade/cancel/reactivate)
  - 01 Get subscription : state du plan, caps, grace period, cancel flag
  - 02 Start checkout   : crée une Checkout Session Stripe (Pro/Business
                          × monthly/yearly)
  - 03 Open portal      : Customer Portal pour gérer CB/annulation
  - 04 Reactivate       : annule l'annulation programmée (sans paiement
                          immédiat) — gère le conflit Stripe
                          cancel_at vs cancel_at_period_end

Aussi documenté les endpoints in-app check-in qui manquaient dans Bruno :
  - 03 In-app pending           : liste des factures awaiting_user_confirmation
  - 04 In-app respond paid      : équivalent du lien email "C'est payé"
  - 05 In-app respond pending   : équivalent "Toujours en attente"

README mis à jour avec le parcours étendu (signup → … → billing).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 17:25:55 +02:00

66 lines
1.7 KiB
Plaintext

meta {
name: 01 Get subscription
type: http
seq: 1
}
get {
url: {{baseUrl}}/api/v1/billing/subscription
body: none
auth: bearer
}
auth:bearer {
token: {{token}}
}
tests {
test("200 OK", function () {
expect(res.getStatus()).to.equal(200);
});
test("plan dans l'enum", function () {
expect(res.getBody().data.plan).to.be.oneOf(["free", "pro", "business"]);
});
test("caps présents", function () {
expect(res.getBody().data.caps).to.have.property("activeInvoicesLimit");
expect(res.getBody().data.caps).to.have.property("seatsLimit");
});
test("flags grace + cancel exposés", function () {
expect(res.getBody().data).to.have.property("inGracePeriod");
expect(res.getBody().data).to.have.property("cancelAtPeriodEnd");
});
}
docs {
GET /api/v1/billing/subscription — auth requise
Retourne l'état de la souscription pour l'org de l'user courant.
Réponse :
```json
{
"data": {
"plan": "free" | "pro" | "business",
"caps": {
"activeInvoicesLimit": 5 | null,
"seatsLimit": 1 | 5 | null,
"multiUsers": false | true,
"replyFromUserEmail": false | true,
"smsEnabled": false
},
"activeInvoicesCount": 12,
"inGracePeriod": true | false,
"gracePeriodEndsAt": "2026-08-06T..." | null,
"subscriptionStatus": "active" | "past_due" | "canceled" | null,
"billingCycle": "monthly" | "yearly" | null,
"currentPeriodEnd": "2026-06-07T..." | null,
"hasStripeCustomer": true | false,
"cancelAtPeriodEnd": false | true
}
}
```
Utilisé par `/parametres/abonnement` côté SPA pour afficher le plan
courant + les caps + l'état d'annulation.
}