Changing the subscription's payment source

Learn how to change the subscription's payment source.

This guide walks you through changing the payment source for an existing subscription. It might be necessary if the shopper wants to change their card, their payment information has expired, or they prefer a different payment method.

If a shopper needs to update the payment source for an existing subscription, use the POST /v1/subscriptions/{subscriptionId}/payment-source request. This might be necessary if the shopper wants to change their card, their payment information has expired, or they prefer a different payment method.

The following example illustrates how to change the subscription's payment source:

curl --location --request POST 'https://api.digitalriver.com/v1/subscriptions/{subscriptionId}/payment-source' \
--header 'Authorization: Bearer {Your_Access_Token}' \
--data-raw '{
  "sourceId": "{Your_New_Payment_Source_ID}",
  "isShippingSameAsBilling": true
}'

In the request above:

  1. Replace {subscriptionId} with the actual ID of the subscription you want to update.

  2. Replace {Your_Access_Token} with your actual authorization key. This key is necessary for authentication.

  3. Specify the new payment source ID by replacing {Your_New_Payment_Source_ID} in the request body.

  4. Set isShippingSameAsBilling to true if the shipping address is the same as the billing address; otherwise false.

You will receive a 202 Accepted response upon successfully associating the new payment source with the subscription. See the Error codes for shopper APIs section if you get an error.

Last updated