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_test_…obligatoire- Clé de serveur. Jamais dans un navigateur.
X-Merchant-IDstringobligatoire- L’espace marchand concerné (mrc_…).
X-Environment"test"obligatoire- Seule valeur acceptée tant que la production n’est pas ouverte.
Corps
plan_idstringobligatoirecustomerobjectobligatoirequantityintegertime_zonestring- Periods are counted from the start in this time zone: 31 January, 28 February, 31 March.
discount_bpintegerdiscount_cyclesinteger ou nulltest_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.