# Copy payment info

Use the **copyPaymentInfo** method.

Copy card-on-file data available in the 2Checkout system from a source subscription to an imported target subscription. 2Checkout uses the existing payment information to charge customers as a part of the recurring billing (renewal) process.

## Requirements <a href="#requirements" id="requirements"></a>

The imported target subscription and the source subscription must belong to the same customer. The 2Checkout system checks to make sure that the 2Checkout Customer Reference (internal identifier) coincides for the customer accounts associated to the target and source subscriptions.

## Availability <a href="#availability" id="availability"></a>

Contact 2Checkout directly if you wish to take advantage of this feature.

<details>

<summary>How does this method work?</summary>

1. **Customer A** purchases **Subscription A** using a **VISA** credit card and you import **Subscription B** for the same customer with no data or with an **AMEX** card.
2. When 2Checkout renews **Subscription A**, it charges **Customer A** using the **VISA**, while using the **AMEX** (if the data was provided) for **Subscription B** charges.
3. When you copy the payment data from **Subscription A** to **Subscription B**, the 2Checkout system uses the **VISA** credit card to renew both subscriptions according with their respective recurring billing cycles. 2Checkout charges customers during the recurring billing process for the imported target subscription using the payment method they used to purchase the source subscription.

</details>

## Request parameters <a href="#parameters" id="parameters"></a>

| Parameter                     | Type / Description                                                                                                                                                                                                                                                                                      |
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `sessionID`                   | <p><strong>Required (string)</strong><br>Session identifier, the output of the <strong>Login</strong> method. Include <code>sessionID</code> into all your requests. 2Checkout throws an exception if the values are incorrect.  The <code>sessionID</code> expires in <strong>10 minutes</strong>.</p> |
| `TargetSubscriptionReference` | <p><strong>Required (string)</strong><br>The 2Checkout Subscription Reference of the imported target subscription, to which 2Checkout copies the payment on file data associated with the source subscription.</p>                                                                                      |
| `SubscriptionReference`       | <p><strong>Required (string)</strong><br>The 2Checkout Subscription Reference of the source subscription whose attached payment on file data 2Checkout copies to the target subscription.</p>                                                                                                           |

### Request sample

```php
<?php

require ('PATH_TO_AUTH');

$TargetSubscription = 'FFAE3C9429';
$SourceSubscription = '9F4154733C';

try {
    $payInfo = $client->copyPaymentInfo($sessionID, $TargetSubscription, $SourceSubscription);
}
catch (SoapFault $e) {
    echo "payInfo: " . $e->getMessage();
    exit;
}
var_dump("payInfo", $payInfo);
```

## Response parameters <a href="#response" id="response"></a>

| Type        | Description                                                                |
| ----------- | -------------------------------------------------------------------------- |
| **Boolean** | **true** or **false** depending on whether or not the operation succeeded. |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.2checkout.com/soap-api-reference/soap-api-6.0/api-requests/copy-payment-info.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
