Actualiza el método de pago de una suscripción
Reemplaza la tarjeta de una suscripción. Cambiar la tarjeta es una CIT y puede necesitar 3D Secure — registra una tarjeta que ya CIT’aste, o ejecuta una CIT de valor cero aquí.
POST /subscription/{id}/payment-method reemplaza la tarjeta de una suscripción y su mandato
de credencial almacenada, de modo que cada futura renovación (una Merchant Initiated Transaction, MIT)
cite el networkTransactionId / networkReferenceId correcto.
Cambiar la tarjeta de una suscripción es siempre una Cardholder Initiated Transaction (CIT),
y una CIT puede requerir 3D Secure. Hay dos formas de suministrar la nueva tarjeta:
Modo record — card.tokenData
/payment/authorization o /payment/purchase, luego
adjuntas el token resultante aquí. Sin llamada al gateway, sin 3DS en este endpoint.
Usa esto para cualquier tarjeta que necesite 3D Secure.Modo CIT — card.nonceData / card.cardData
suspended. Esta CIT no puede llevar a cabo un desafío de 3D Secure
— una tarjeta que requiere 3DS fallará.subscription.payment_method_updated.
Modo record (recomendado)
Como la propia CIT de este endpoint no puede hacer un desafío de 3DS, la forma confiable de cambiar una tarjeta es ejecutar tú mismo la CIT donde 3DS sí está soportado, luego registrarla:Ejecuta una CIT con capacidad 3DS
/payment/authorization (una autorización de valor cero o pequeña) o /payment/purchase con
card.nonceData.tokenize: true (o card.cardData.tokenize: true) y un shopper.id.
Maneja cualquier actionRequired / desafío de 3DS con el SDK JS exactamente como lo harías para un
pago normal. En caso de éxito la respuesta devuelve un vault token y
card.networkTransactionId / card.networkReferenceId.Adjunta el token a la suscripción
POST /subscription/{id}/payment-method con card.tokenData.token establecido en ese vault
token. Therius lee el mandato que el token almacenó en su CIT — no necesitas pasar
networkTransactionId tú mismo. (Pásalo explícitamente solo cuando la tarjeta fue CIT’ada
fuera de Therius.)suspended — no ejecuta ningún cobro para
confirmar que la nueva tarjeta funciona. Para una suscripción suspendida, usa el modo CIT (abajo), o ejecuta un
cobro de recuperación tú mismo primero.tokenData.token para modo record; nonceData/cardData para modo CIT; networkTransactionId/networkReferenceId opcionales para una tarjeta CIT’ada fuera de Therius).
Respuesta
Devuelve200 OK con el objeto de suscripción actualizado.
Eventos de webhook disparados
Errores
Autorizaciones
Your secret API key: Bearer prv_production_xxx (production) or Bearer prv_sandbox_xxx (sandbox).
Parámetros de ruta
Cuerpo
Your merchant account identifier.
Card input for replacing the card on a subscription. Changing the card is always a CIT and a CIT may require 3D Secure — pick the mode that fits:
• Record mode (tokenData): the token is a card that already completed a CIT elsewhere. Run your own 3DS-capable CIT via /payment/authorization or /payment/purchase (with card.<x>.tokenize: true + shopper.id), then attach the resulting vt_... token here. No gateway call, no 3DS. The mandate is read from the token; pass networkTransactionId / networkReferenceId explicitly only for a card CIT'd outside Therius. Cannot reactivate a suspended subscription.
• CIT mode (nonceData / cardData): runs a zero-value CIT here and can reactivate a suspended subscription — but this CIT cannot carry out a 3D Secure challenge, so a card that requires 3DS will fail. Use record mode for those.
Provide exactly ONE of cardData, nonceData, or tokenData.
- Raw card (PCI DSS)
- SDK nonce
- Vault token
Respuesta
Payment method updated
A customer enrollment in a plan. plan is embedded on single-subscription responses. Invoice/event history is not included here - use the invoice endpoints.
Subscription UUID.
The merchant account that owns the subscription.
ID of the plan this subscription is enrolled in.
Subscriber email, used for billing and dunning notifications.
Subscriber name as it appears on invoices.
Subscriber national ID / tax document, where a market requires it (e.g. Brazil CPF/CNPJ).
Brand of the card on the mandate, e.g. visa.
pending - awaiting first charge; trialing - in a free trial; active - billing normally; past_due - a renewal failed and dunning is running; suspended - dunning exhausted, needs a new CIT (POST /subscription/{id}/payment-method in CIT mode) to recover; paused - billing stopped on request, resumable; cancelled - terminated; completed - reached maxBillingCycles.
pending, trialing, active, past_due, suspended, paused, cancelled, completed Start of the current billing period.
End of the current billing period.
When the next renewal charge is scheduled.
Trial start, when the plan has a trial.
Trial end - the first real charge date.
Failed-renewal retry attempts made in the current dunning sequence.
When the subscription first became active.
Deferred start, when creation set a future startAt.
Number of billing cycles charged so far.
When the subscription reached maxBillingCycles.
Parent subscription UUID, for add-on hierarchies.
Whether pause/cancel on the parent cascades to this subscription.
Plan the subscription will switch to at the next cycle, set by a next_billing change-plan.
A reusable billing plan. amount is a flat integer in the currency minor units (with separate currency + exponent) - not an Amount object.

