# Changing 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.&#x20;

If a shopper needs to update the payment source for an existing subscription, use the [`POST /v1/subscriptions/{subscriptionId}/payment-source`](https://app.gitbook.com/s/drE2RCYBuoRpd2TC2sx2/subscription-mangement/manage-subscription-payments#v1-subscriptions-subid-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.&#x20;

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

{% tabs %}
{% tab title="cURL" %}

```http
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
}'
```

{% endtab %}
{% endtabs %}

In the request above:

1. Replace `{subscriptionId}` with the actual ID of the subscription you want to update.&#x20;
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](https://app.gitbook.com/s/oUderMtztdH7OKDXmYbI/warnings-and-error-codes/error-codes/error-codes-for-shopper-apis) section if you get an error.
