Change the subscription payment method
Replaces the credit card used for the subscription's next charges.
The endpoint accepts only an already tokenized card: the card data never goes through your server. There are two steps:
- In the subscriber's browser, Appmax JS
receives the card data and returns a
tokenin theonSuccesscallback. This step requires theexternal-idof the app installation in the store. - On your backend, call this endpoint sending that
token.
The card brand and last four digits are derived from the token itself — you do not need to (and must not) send them.
This route requires the `subscription-payment-method` permission
Unlike the other subscription routes, the credential must carry
the subscription-payment-method permission. Without it, the call is rejected
by the gateway with 403. Contact the Appmax team to enable it on
your store's credential. See Authentication.
WARNING
The token must have been generated by the same store as the subscription, and the store
must use the same capture method in which the token was created. Otherwise
the response is 400.
If the subscription is overdue, suspended or canceled due to payment
failure, the outstanding charge is reprocessed immediately with the new card.
If approved, the subscription goes back to active and the next charge is
rescheduled — the response already carries the updated status. A subscription
canceled by the customer or by the store has no outstanding charge: reactivate
it first through
Reactivate subscription.
TIP
For now, the endpoint only switches between credit cards. A PIX subscription starts being charged on the card provided.
Authorizations
Bearer token of the merchant obtained via POST /oauth2/token using the
merchant's credentials (not the app's). See
Authentication.
Parameters
Path Parameters
Subscription identifier.
10Request Body
Responses
Payment method updated. Returns the updated subscription details,
already with the new brand and the new last four
digits in payment.payment_info.