--- title: "Create test cards" description: "Create custom card numbers to test your integration with Adyen." url: "https://docs.adyen.com/development-resources/test-cards-and-credentials/create-test-cards" source_url: "https://docs.adyen.com/development-resources/test-cards-and-credentials/create-test-cards.md" canonical: "https://docs.adyen.com/development-resources/test-cards-and-credentials/create-test-cards" last_modified: "2026-02-27T16:35:00+01:00" language: "en" --- # Create test cards Create custom card numbers to test your integration with Adyen. [View source](/development-resources/test-cards-and-credentials/create-test-cards.md) Adyen provides [generic test card numbers](/development-resources/testing/test-card-numbers), but you can also generate your own. On the Adyen test platform, you can use your generated test payment cards to simulate real-life payment scenarios and to verify the correct integration of your systems. Transactions carried out with these test cards do not result in actual credits or debits to live accounts. If your goal is to test failure scenarios, there is no need to generate your own test card. Instead, refer to [Testing result codes and refusal reasons](/development-resources/testing/result-codes/). ## Requirements | Requirement | Description | | ----------------------- | -------------------------------------------------------------------------------------------------------------------- | | **Customer Area roles** | You must have the **Manage test cards** role. For more information, see [user roles](/account/user-roles#developer). | ## Test card requirements 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 in Customer Area To generate ranges of test card numbers using the UI, do the following: 1. Log in to your [Customer Area](https://ca-test.adyen.com/). 2. Go to **Account** > **Test cards**. 3. Select **Add new range**. 4. Enter the necessary details in the **Test Card Range** form. 5. Select **Save**. ## Generating test cards via API To create test card ranges using the API, send a request to the `/createTestCardRanges` endpoint. ### Request #### JSON ```json { "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":"mypassword", "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":"mypassword", "threeDDirectoryServerResponse":"Y" } } ] } ``` #### Soap ```xml TestMerchant MerchantAccount 5232492670020681 5232492669190772 JANUARY 2020 123 S Hopper
1 Infinite Loop, Cupertino CA 95014
simonhopper mypassword Y
4596123434560780 4596123423450871 MARCH 2021 321
42, End of the Universe Rd., Los Alamos NM 87544
T Anderson thomasanderson mypassword Y
``` ### Response #### JSON ```json { "rangeCreationResults":[ { "TestCardRangeCreationResult":{ "cardNumberRangeStart":"5232492669190772", "cardNumberRangeEnd":"5232492670020681", "creationResultCode":"ALREADY_EXISTS" } }, { "TestCardRangeCreationResult":{ "cardNumberRangeStart":"4596123423450871", "cardNumberRangeEnd":"4596123434560780", "creationResultCode":"ALREADY_EXISTS" } } ] } ``` #### Soap ```xml 5232492669190772 5232492670020681 ALREADY_EXISTS 4596123423450871 4596123434560780 ALREADY_EXISTS ``` ### Response with an error #### JSON ```json { "errorType" : "security", "errorCode" : "901", "message" : "Invalid Merchant Account", "status" : "403" } ``` #### Soap ```xml soap:Server security 901 Invalid Merchant Account ``` If the operation does not complete successfully, a service exception is thrown. See Error handling for more details. ## Error handling After submitting a call, you receive a confirmation that the message was received, and if it was correctly processed. The API returns HTTP status codes and the response message. For a list of request and response fields, see [Response handling](/development-resources/response-handling). ### Test card response handling Test card generation fails, with a 4XX or 5XX HTTP response, in the following cases: * The range start test card number is larger than the end one. * The range start and the end test card numbers have different lengths, i.e. they do not have the same amount of digits. * The test card numbers are shorter than 6 digits or longer than 19 digits. * The test card numbers do not observe BIN code and AVS constraints (see Requirements). * If you use a generated test card number to carry out an actual payment, the test card number needs to be Luhn compliant because this check is part of standard behavior in a live environment. A Luhn compliance error is returned as a 101 Invalid card number fault code. When this happens, you receive a fault response with a description of the problem. In general, your toolkit handles this situation as an exception. Payment requests that are rejected with an error message are not charged. ### Service exceptions | Exception | Error Message | | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Invalid test card range | The length of the start of the card range needs to be between 6 and 19 digits long but was {specified\_start\_range\_length\_value}. | | Invalid test card range | The length of the end of the card range needs to be between 6 and 19 digits long but was {specified\_end\_range\_length\_value}. | | Invalid test card range | The length of the start of the card range ({specified\_start\_range\_length\_value}) needs to match the length of the end of the card range ({specified\_end\_range\_length\_value}). | | Invalid test card range | The specified range start value {specified\_start\_value} does not represent a valid number. | | Invalid test card range | The specified range end value {specified\_end\_value} does not represent a valid number. | | Invalid test card number | The specified card {specified\_test\_card\_number} number is invalid. |