# Add / import test subscriptions with credit / debit card data

Use the **addSubscription** method to import a test subscription into the 2Checkout system.

Import **test** subscription and data from your or a third-party system with payment information assigned, and test advanced renewal and upgrade scenarios in the 2Checkout platform. Contact 2Checkout directly for additional details.

## Requirements

Test subscriptions can be imported only for **eStore** orders. Only dummy credit card data can be assigned to subscriptions. [Check here](https://verifone.cloud/docs/2checkout/Documentation/09Test_ordering_system/01Test_payment_methods/) the list of credit cards that can be used for import.

{% hint style="info" %}
Cardholder name is composed as FirstName + " " + LastName.
{% endhint %}

## Request parameters

| Parameters                                                                                                                         | Type/Description                                                                                                                                                                                                                                                                                               |
| ---------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **sessionID**                                                                                                                      | <p><strong>Required (string)</strong><br>Session identifier, the output of the <strong>Login</strong> method. Include <strong>sessionID</strong> into all your requests. 2Checkout throws an exception if the values are incorrect. The <strong>sessionID</strong> expires in <strong>10 minutes</strong>.</p> |
| [**Subscription import**](https://verifone.cloud/docs/2checkout/API-Integration/SOAP_API_6.0/API-Requests/047Subscription-import/) | <p><strong>Required (Object)</strong><br>Object designed to provide 2Checkout with all the information to create a subscription.</p>                                                                                                                                                                           |
| **Test**                                                                                                                           | <p><strong>Optional (integer)</strong><br>To add test subscriptions, set the <strong>Test</strong> parameter to 1. Default value is 0, and belongs to regular subscriptions.</p>                                                                                                                               |
| [**CardPayment**](https://verifone.cloud/docs/2checkout/API-Integration/SOAP_API_6.0/API-Requests/047Subscription-import/)         | <p><strong>Optional (Object)</strong><br>Object containing card details. <a href="https://verifone.cloud/docs/2checkout/Documentation/09Test_ordering_system/01Test_payment_methods/">Check here</a> the list of credit cards that can be used for import.</p>                                                 |

## Response parameters

| Parameters                | Type/Description                                                                    |
| ------------------------- | ----------------------------------------------------------------------------------- |
| **SubscriptionReference** | <p><strong>String</strong><br>Unique, system-generated subscription identifier.</p> |

### Request sample

```php
<?php

require ('PATH_TO_AUTH');

$Product = new stdClass ();
$Product->ProductCode = 'my_subscription_1';
$Product->ProductId = 4639321;
$Product->ProductName = '2Checkout Subscription Imported';
$Product->ProductVersion = 1.0;
$Product->ProductQuantity = 3;
$Product->PriceOptionCodes = array();

$EndUser = new stdClass ();
$EndUser->Address1 = 'Address line 1';
$EndUser->Address2 = 'Address line 2';
$EndUser->City = 'LA';
$EndUser->Company = 'Company Name';
$EndUser->CountryCode = "US";
$EndUser->Email = 'customerAPI@2Checkout.com';
$EndUser->FirstName = 'Customer'; // first name and last name are used for determining the CardHolder Name
$EndUser->Language = 'en';
$EndUser->LastName = '2Checkout'; // first name and last name are used for determining the CardHolder Name
$EndUser->Phone = '1234567890';
$EndUser->State = 'California';
$EndUser->Fax = NULL;
$EndUser->Zip = '90210';

$Subscription = new stdClass();
$Subscription->ExternalSubscriptionReference = '12345678912ImportedSubscription';
$Subscription->SubscriptionCode= NULL;
$Subscription->StartDate = '2013-01-01';
$Subscription->ExpirationDate = '2017-12-30';
$Subscription->Product = $Product;
$Subscription->EndUser = $EndUser;
$Subscription->ExternalCustomerReference = '12354678ExtCustRef';
$Subscription->Test = 1; // send 1 for test subscription, 0 for regular subscriptions.

$PaymentCard = new stdClass ();
$PaymentCard->CardNumber = '4111111111111111' ;
$PaymentCard->CardType = 'VISA';
$PaymentCard->ExpirationYear = '2018';
$PaymentCard->ExpirationMonth = '12';
$PaymentCard->CCID = '123';
$PaymentCard->HolderNameTime = '15';
$PaymentCard->CardNumberTime = '15';
$PaymentCard->AutoRenewal = true;

try {
    $importedSubscriptionNoPayData = $client->addSubscription($sessionID, $Subscription, $PaymentCard);
}
catch (SoapFault $e) {
    echo "importedSubscriptionNoPayData: " . $e->getMessage();
    exit;
}
var_dump("importedSubscriptionNoPayData", $importedSubscriptionNoPayData);
```


---

# 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/subscription-import/add-import-test-subscriptions-with-credit-debit-card-data.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.
