Skip to main content
When a customer’s payment method fails, or when the customer wants to switch payment methods, you can update the payment method associated with a subscription. The update affects future billing cycles only. It does not charge open invoices. Collect open invoices separately using each invoice’s hosted_invoice_url, one per invoice. Two flows let you update a subscription’s payment method:
  • Case A (user-initiated): Send the customer a new enrollment link. Use this when the customer must authorize a new Chilean automatic debit (PAC) mandate or enter new card details.
  • Case B (merchant-initiated): Associate an already-active payment method directly through the API, with no customer interaction.
Create a CheckoutSession with flow: "setup" and pass the existing subscription ID in subscription. The customer opens the link and enrolls a new payment method. For cards, Fintoc associates the payment method with the subscription when enrollment completes. For PAC, Fintoc associates the payment method once the mandate activates. Server
Node
Fintoc responds with the CheckoutSession object:
Redirect the customer to redirect_url so the customer completes the enrollment.

PAC activation window

For PAC, bank confirmation takes approximately 5 business days. The new payment method stays in pending status during this window, and Fintoc has not yet executed the swap. checkout_session.finished signals that the customer completed the enrollment flow, not that the swap occurred. Wait for subscription.payment_method_updated before you treat the new payment method as active. To check the activation state while the mandate is pending, call GET /v2/payment_methods/{id} and read pac.status:

Handle re-enrollment events

Subscribe to the following events when you update a subscription’s payment method through a re-enrollment link:

Case B: Associate an existing payment method

If the customer already has an active payment method on file, associate the payment method with a subscription directly, without a new enrollment link.

Swap the payment method on an existing subscription

Call PATCH /v2/subscriptions/{id} with the ID of the active payment method. The payment method must belong to the same customer as the subscription. Server
Node
Fintoc returns the updated Subscription:
The payment method’s mandate is already active, so the swap is immediate. The payment_method value in the response points to the new payment method. Fintoc also emits subscription.payment_method_updated.

Create a new subscription with an existing payment method

Creating a subscription against a payment method the customer already has is not an update, so it lives with the rest of subscription creation. Pass the payment_method to Create a subscription, as described in Charge automatically against a payment method.

Updating the payment method on a subscription does not pay open invoices

Updating the payment method changes which method Fintoc charges for future billing cycles. It does not pay open invoices from previous cycles. If the subscription has open invoices when the swap occurs, collect them separately using each invoice’s hosted_invoice_url, one per invoice.

Edge cases

One update at a time: Only one payment method update can be in progress per subscription. A second attempt while a PAC mandate is pending returns a payment_method_update_in_progress error (409 Conflict). Billing cycle during the activation window: If a billing cycle anchor falls while a new PAC mandate is still pending, Fintoc creates the invoice in open status without an automatic charge. Collect the invoice using its hosted_invoice_url. Cancellation during activation: If you cancel the subscription while a PAC mandate awaits bank confirmation, the swap does not execute. Fintoc creates and stores the new payment method on the customer’s record, but does not associate the payment method with any subscription.

Test your integration

Using your test mode Secret Key, run both flows against a test subscription without moving money. Create the setup Checkout Session with the subscription of an existing test subscription, then complete the enrollment on the Fintoc-hosted page with the test credentials listed in Save a payment method for future charges. Verify that:
  • You receive checkout_session.finished, carrying the new payment_method ID.
  • You receive subscription.payment_method_updated, and your integration treats the new payment method as active only after this event.
  • Get a subscription reports the new payment_method.
Do not treat the swap as done on checkout_session.finished alone. That is the failure the PAC activation window describes.

2) Test the API swap

Enroll a second payment method for the same test customer, then swap it in with Update a subscription. Verify that:
  • The response reports the new payment_method and keeps the subscription active.
  • You receive subscription.payment_method_updated.
  • A second update while another one is still in progress returns payment_method_update_in_progress with 409 Conflict.