Create test cards

Adyen provides generic test card numbers, but you can also generate your own. On the Adyen test platform, you can use the generated test payment cards and request/response messages to simulate real-life traffic scenarios, and to verify the correct integration of your systems with Adyen's platform and services. Transactions carried out with these test cards do not result in actual credits/debits to live accounts.

Generated test cards should meet the following requirements:

  • Test card numbers should be between 6-19 digits long.
  • All test card numbers in a generated test card range need to have the same number of digits.
  • The first six digits of the test card numbers in any generated range need to be valid BIN numbers.
  • Test card numbers should comply with standard payment card number constraints. For example, to test a system with Visa you should create a test card range with a valid Visa BIN.
  • Although the created test card start and end range numbers are not checked for Luhn compliance, if you carry out a test payment the test card is handled like a standard payment card. It undergoes the standard card checks that take place in live environments, including Luhn verification.
  • The billing address details you define for a test card range need to be AVS (Address Verification Service) compliant, i.e. you always need to include at least the street address. Zip code is optional.
  • The billing address check verifies only the numeric characters in the street address and Zip code (if available).

Generating test cards

Adyen also offers an easy and simple way to add test cards:

  • Log into the Adyen Customer Area (CA) and go to Settings → Test Cards.
  • Click Add New Range.
  • Enter the necessary details in the Test Card Range form.
  • Click Save.

Using API

Contact Adyen Support Team to request access to use this. Send a request to the createTestCardRanges endpoint containing the information required to create a test card range. 

Code examples

Call createTestCardRanges to generate one or more ranges of test cards.

Request:
{
   "accountCode":"TestMerchant",
   "accountTypeCode":"MerchantAccount",
   "testCardRanges":[
      {
         "TestCardRange":{
            "rangeStart":"5232492669190772",
            "rangeEnd":"5232492670020681",
            "expiryMonth":"JANUARY",
            "expiryYear":2020,
            "cvc":"123",
            "cardHolderName":"S Hopper",
            "address":{
               "streetAddress":"1 Infinite Loop, Cupertino",
               "zip":"CA 95014"
            },
            "threeDUsername":"simonhopper",
            "threeDPassword":"mypa$$word",
            "threeDDirectoryServerResponse":"Y"
         }
      },
      {
         "TestCardRange":{
            "rangeStart":"4596123423450871",
            "rangeEnd":"4596123434560780",
            "expiryMonth":"MARCH",
            "expiryYear":2021,
            "cvc":"321",
            "cardHolderName":"T Anderson",
            "address":{
               "streetAddress":"42, End of the Universe Rd., Los Alamos",
               "zip":"NM 87544"
            },
            "threeDUsername":"thomasanderson",
            "threeDPassword":"IamN3o",
            "threeDDirectoryServerResponse":"Y"
         }
      }
   ]
}

Response:

{  
   "rangeCreationResults":[  
      {  
         "TestCardRangeCreationResult":{  
            "cardNumberRangeStart":"5232492669190772",
            "cardNumberRangeEnd":"5232492670020681",
            "creationResultCode":"ALREADY_EXISTS"
         }
      },
      {  
         "TestCardRangeCreationResult":{  
            "cardNumberRangeStart":"4596123423450871",
            "cardNumberRangeEnd":"4596123434560780",
            "creationResultCode":"ALREADY_EXISTS"
         }
      }
   ]
}
 

Request:
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soap:Body>
      <createTestCardRanges xmlns="http://testcard.services.adyen.com">
         <request>
            <accountCode>TestMerchant</accountCode>
            <accountTypeCode>MerchantAccount</accountTypeCode>
            <testCardRanges>
               <TestCardRange>
                  <rangeStart>5232492670020681</rangeStart>
                  <rangeEnd>5232492669190772</rangeEnd>
                  <expiryMonth>JANUARY</expiryMonth>
                  <expiryYear>2020</expiryYear>
                  <cvc>123</cvc>
                  <cardHolderName>S Hopper</cardHolderName>
                  <address>
                     <streetAddress>1 Infinite Loop, Cupertino</streetAddress>
                     <zip>CA 95014</zip>
                  </address>
                  <threeDUsername>simonhopper</threeDUsername>
                  <threeDPassword>mypa$$word</threeDPassword>
                  <threeDDirectoryServerResponse>Y</threeDDirectoryServerResponse>
               </TestCardRange>
               <TestCardRange>
                  <rangeStart>4596123434560780</rangeStart>
                  <rangeEnd>4596123423450871</rangeEnd>
                  <expiryMonth>MARCH</expiryMonth>
                  <expiryYear>2021</expiryYear>
                  <cvc>321</cvc>
                  <address>
                     <streetAddress>42, End of the Universe Rd., Los Alamos</streetAddress>
                     <zip>NM 87544</zip>
                  </address>
                  <cardHolderName>T Anderson</cardHolderName>
                  <threeDUsername>thomasanderson</threeDUsername>
                  <threeDPassword>IamN3o</threeDPassword>
                  <threeDDirectoryServerResponse>Y</threeDDirectoryServerResponse>
               </TestCardRange>
            </testCardRanges>
         </request>
      </createTestCardRanges>
   </soap:Body>
</soap:Envelope>

Response:

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns0="http://testcard.services.adyen.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soap:Body>
      <ns0:createTestCardsResponse>
         <ns0:result>
            <ns0:rangeCreationResults>
               <ns0:TestCardRangeCreationResult>
                  <ns0:cardNumberRangeEnd>5232492669190772</ns0:cardNumberRangeEnd>
                  <ns0:cardNumberRangeStart>5232492670020681</ns0:cardNumberRangeStart>
                  <ns0:creationResultCode>ALREADY_EXISTS</ns0:creationResultCode>
               </ns0:TestCardRangeCreationResult>
               <ns0:TestCardRangeCreationResult>
                  <ns0:cardNumberRangeEnd>4596123423450871</ns0:cardNumberRangeEnd>
                  <ns0:cardNumberRangeStart>4596123434560780</ns0:cardNumberRangeStart>
                  <ns0:creationResultCode>ALREADY_EXISTS</ns0:creationResultCode>
               </ns0:TestCardRangeCreationResult>
            </ns0:rangeCreationResults>
         </ns0:result>
      </ns0:createTestCardsResponse>
   </soap:Body>
</soap:Envelope>

If the operation does not complete successfully, a service exception is thrown. See Error handling for more details.

For information on available fields, refer to CreateTestCardRangesRequest.

Questions

Can't find something you are looking for? Look at our FAQ for answers or send an email to support.