When a subscriber needs to change the card used for their subscription, the flow has two steps:
payment_method_id via webhook and use it to update the subscription.Create a checkout with mode: "setup". This checkout only tokenizes the card without charging anything.
Response:
Send the checkout_url to your customer (via email, WhatsApp, within your app, etc.) so they can enter their new card.
Include the subscriber’s user_id so the checkout pre-fills their information (name, email, etc.).
When the customer completes the checkout, Recurrente sends a setup_intent.succeeded webhook to your configured endpoint. The payload includes the new card’s payment_method_id:
Save the payment_method.id — you’ll need it in the next step.
If you don’t have webhooks configured, you can also get the payment_method_id by doing a GET /api/checkouts/{id} on the checkout once it’s been paid. The payment_method.id field will be in the response.
Use the payment_method_id obtained to update the subscription:
Response:
From this point on, all future automatic charges for the subscription will use the new card.
If the subscription has a pending payment (e.g., a failed charge), Recurrente will automatically attempt to charge it with the new card when you update it.