Abonnements
Choisir le moyen prélevé
PUT/v1/subscriptions/{id}/payment-methodpayments:write
Needs payments:write. The method must be active, consented for payments the merchant starts, belong to the same buyer, and sit on an account able to charge it without the buyer (the simulator today; 409 otherwise). Invoices still owed are then collected with it. A refusal is retried 5 days after the previous attempt was due, 4 attempts at most, then the subscription ends and the invoice stays owed. A bank asking for the buyer stops every retry: the invoice waits for the buyer. null: no saved method, invoices wait for the buyer.
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.
Paramètres
iddans le cheminobligatoire
Corps
payment_method_idstring ou nullobligatoire
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.