Update the payment method

Pay a failed or unpaid rebill and change the card of a subscription on the hosted payment page.

Your customer's card expired, or a rebill failed? Send them a hosted payment page linked to their subscription. The card they pay with becomes the card used for the next rebills. This is the only way to change the card of a subscription: PATCH /subscriber/{id} does not accept a token.

Every link is created with POST /payment/checkout and a subscription_id. Do not send amount: the amount is always the one of the payment being made. The examples below show only the subscription fields of the request.

Pay a failed payment

{ "subscription_id": "6a1f3c9e8b2d4a7f1c0e5b93" }
  • On a past_due subscription: pays the rebill being retried. The retries stop and the subscription goes back to active.
  • On an incomplete subscription: pays the first payment that failed. The subscription starts.

Pay a specific unpaid rebill

{ "subscription_id": "6a1f3c9e8b2d4a7f1c0e5b93", "order_id": "6a2b7d1e4c9f0a3b8e6d2c71" }

Use it for a rebill the retry policy gave up on, with one link per unpaid rebill. It works whatever the status of the subscription, cancelled and completed included.

Only that rebill is paid: the status and the calendar do not change, and overdue_occurrences_count goes down by one. On a cancelled or completed subscription, the card is not stored.

The request is refused when the order is already paid, has a payment in progress, belongs to another subscription, or is a one-off charge.

Change the card

{ "subscription_id": "6a1f3c9e8b2d4a7f1c0e5b93", "subscription_update": "charge" }

Your customer pays the next rebill now, with the new card.

Status of the subscriptionWhat is paid
started or activeThe next rebill, taken early. The following one keeps its normal date.
past_dueThe rebill being retried.
paused because the platform could not attempt a rebillThe missed rebill. The pause is lifted.

The request is refused on a subscription you paused or that its retry policy paused (resume it first), and on created, incomplete, cancelled and completed subscriptions. subscription_update cannot be combined with order_id.

If the payment is refused, nothing changes: the subscription keeps its card and its calendar.

Never charged twice

If a retry and a customer payment of the same rebill happen at the same moment, the second one is refused with 111035.

Related pages