Change subscription card

Switches the card a subscription renews with to one of the shopper's saved cards, for example from the shopper's profile page on your site. Every later renewal is charged to the new card.

Call this from your server with your merchant credentials — never from a browser or app. The shopper is identified by email in the X-Customer-Email header; you only see that shopper's subscriptions.

card_id is a card from GET /api/v1/customers/saved-payment-methods; a card the shopper did not save at your store is 404. If you minted with the shopper's phone (POST /api/v2/checkout/subscription/init), list the cards with GET /api/v2/customers/saved-payment-methods and send the same phone in X-Customer-Phone: the card is then looked up in that phone's wallet, and a malformed phone is 400. The subscription is still found by X-Customer-Email. A new card cannot be entered here: the shopper saves it first through a checkout with save_card.

Only an active or past_due subscription can change its card; any other status is 409. A past_due subscription retries its unpaid renewal on the new card at once. If that charge succeeds, subscription.renewed is sent and the subscription becomes active again; a decline does not undo the switch. The response does not wait for that outcome.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
string
required

The subscription_id (sub_…).

Body Params
string
required
length ≥ 1

The saved card's id (pvc_…) from GET /api/v1/customers/saved-payment-methods: a card of this shopper saved at your store.

Headers
string
required
length ≥ 3

The shopper's email, as sent to POST /api/v1/checkout/init (case-insensitive).

string

Optional. The shopper's phone, as sent to POST /api/v2/checkout/subscription/init: the card is then looked up in that phone wallet, as GET /api/v2/customers/saved-payment-methods lists it, instead of by email. The subscription is still found by X-Customer-Email.

Responses

Language
Credentials
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json