DocsTableau de bord

Abonnements

Abonner un acheteur

POST/v1/subscriptionspayments:write

Needs payments:write. On the current price of a published plan. Without a trial, the first invoice is issued at once for a price billed in advance; usage is billed once its period is over. With test_clock, the subscription lives on that clock only and moves when the clock is advanced.

En-têtes

AuthorizationBearer pos_key_…obligatoire
Clé de serveur, pour tout l’espace. Jamais dans un navigateur.
X-Merchant-IDstringobligatoire
L’espace marchand concerné (mrc_…).
Idempotency-Keystring
Optional. The same key with the same request returns the same subscription and creates nothing more; the same key with another request: 409 idempotency_conflict. 1 to 128 visible ASCII characters (400 invalid_idempotency_key otherwise). Keys never mix between spaces.

Corps

plan_idstringobligatoire
customerobjectobligatoire
quantityinteger
time_zonestring
Periods are counted from the start in this time zone: 31 January, 28 February, 31 March.
discount_bpinteger
discount_cyclesinteger ou null
test_clockstring ou null

Réponses

200Réussi
400Requête invalide
401Clé absente ou invalide
403Autorisation ou espace refusé
404Ressource introuvable
409Conflit avec une demande existante
429Trop de demandes, réessayez plus tard
503Service momentanément indisponible

Une erreur ne vaut jamais paiement. Le corps donne code, message, request_id et retry_action ; renvoyez la même Idempotency-Key si retry_action le propose.