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

NomTypeDescription
emailstringEmail and Name are optional; the server resolves the billing contact when they are absent.
namestring
planstringPlan is the tier being bought. Only purchasable tiers are accepted: reaching the free tier is a cancellation, not a purchase.
successUrlstringSuccessURL 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

StatutDescriptionType
200OKstart_checkout.Result
400Bad Requestecho.HTTPError
401Unauthorizedecho.HTTPError
409already holds an entitling subscriptionecho.HTTPError
422plan is not purchasableecho.HTTPError
503billing is not configuredecho.HTTPError

Source machine : openapi.json · opération startBillingCheckout