API / Billing

POST

/billing/upgrade

Upgrade to a larger plan

Moves the tenant to a larger tier, effective immediately. The prorated difference is charged on the existing mandate BEFORE the tier is applied: a declined charge leaves the tier untouched. Requires explicit consent to the amount returned by the quote endpoint.

Authentification : clé API Bearer requise.

Corps JSON

Target plan and accepted amount

NomTypeDescription
acceptedCentsintegerAcceptedCents is the prorated amount the customer agreed to, from a prior quote. It is verified against a freshly computed amount: a stale quote must not authorise a different charge.
consentedbooleanConsented records that the amount was shown and agreed to. Required for any charge above the proration floor.
planstringPlan is the larger tier to move to.

Exemple curl

curl -X POST https://api.sporee.fr/billing/upgrade \
  -H "Authorization: Bearer $SPORE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

Réponses

StatutDescriptionType
200OKupgrade_subscription.Result
400Bad Requestecho.HTTPError
401Unauthorizedecho.HTTPError
402the payment was declinedecho.HTTPError
404no subscription — open a checkout insteadecho.HTTPError
409the quoted amount was not consented toecho.HTTPError
422not an upgrade, or the subscription cannot change tierecho.HTTPError
503billing is not configuredecho.HTTPError

Source machine : openapi.json · opération upgradeBillingSubscription