API / Billing
POST
/billing/checkout
Open a checkout for a paid plan
Opens a hosted payment that collects the first period and establishes the mandate future charges ride on. Returns the URL to redirect the customer to. Entitlement is granted only once the payment is confirmed by the provider webhook — this endpoint grants nothing.
Authentification : clé API Bearer requise.
Corps JSON
Plan to subscribe to
| Nom | Type | Description |
|---|---|---|
| string | Email and Name are optional; the server resolves the billing contact when they are absent. | |
| name | string | — |
| plan | string | Plan is the tier being bought. Only purchasable tiers are accepted: reaching the free tier is a cancellation, not a purchase. |
| successUrl | string | SuccessURL overrides where the customer lands after paying. |
Exemple curl
curl -X POST https://api.sporee.fr/billing/checkout \
-H "Authorization: Bearer $SPORE_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'Réponses
| Statut | Description | Type |
|---|---|---|
| 200 | OK | start_checkout.Result |
| 400 | Bad Request | echo.HTTPError |
| 401 | Unauthorized | echo.HTTPError |
| 409 | already holds an entitling subscription | echo.HTTPError |
| 422 | plan is not purchasable | echo.HTTPError |
| 503 | billing is not configured | echo.HTTPError |
Source machine : openapi.json · opération startBillingCheckout