{"title":"Create test cards","category":"default","creationDate":1772206500,"content":"<p>Adyen provides <a href=\"\/development-resources\/testing\/test-card-numbers\">generic test card numbers<\/a>, 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.<\/p>\n<div class=\"notices green\">\n<p>If your goal is to test failure scenarios, there is no need to generate your own test card. Instead, refer to <a href=\"\/development-resources\/testing\/result-codes\/\">Testing result codes and refusal reasons<\/a>.<\/p>\n<\/div>\n<h2>Requirements<\/h2>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Requirement<\/th>\n<th style=\"text-align: left;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><strong>Customer Area roles<\/strong><\/td>\n<td style=\"text-align: left;\">You must have the <strong>Manage test cards<\/strong> role. For more information, see <a href=\"\/account\/user-roles#developer\">user roles<\/a>.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Test card requirements<\/h2>\n<p>Generated test cards should meet the following requirements:<\/p>\n<ul>\n<li>Test card numbers should be between 6-19 digits long.<\/li>\n<li>All test card numbers in a generated test card range need to have the same number of digits.<\/li>\n<li>The first six digits of the test card numbers in any generated range need to be valid BIN numbers.<\/li>\n<li>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.<\/li>\n<li>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.<\/li>\n<li>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.<\/li>\n<li>The billing address check verifies only the numeric characters in the street address and Zip code (if available).<\/li>\n<\/ul>\n<h2 id=\"generating-test-cards-ca\">Generating test cards in Customer Area<\/h2>\n<p>To generate ranges of test card numbers using the UI, do the following:<\/p>\n<ol>\n<li>Log in to your\u00a0<a href=\"https:\/\/ca-test.adyen.com\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Customer Area<\/a>.<\/li>\n<li>Go to\u00a0<strong>Account<\/strong> &gt; <strong>Test cards<\/strong>.<\/li>\n<li>Select\u00a0<strong>Add new range<\/strong>.<\/li>\n<li>Enter the necessary details in the\u00a0<strong>Test Card Range<\/strong>\u00a0form.<\/li>\n<li>Select\u00a0<strong>Save<\/strong>.<\/li>\n<\/ol>\n<h2 id=\"generating-test-cards-api\">Generating test cards via API<\/h2>\n<p>To create test card ranges using the API, send a request to the\u00a0<code>\/createTestCardRanges<\/code>\u00a0endpoint.<\/p>\n<h3 id=\"request\">Request<\/h3>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"''\" :id=\"'346377974'\" :code-data='[{\"language\":\"json\",\"tabTitle\":\"JSON\",\"content\":\"{\\n  \\\"accountCode\\\":\\\"TestMerchant\\\",\\n  \\\"accountTypeCode\\\":\\\"MerchantAccount\\\",\\n  \\\"testCardRanges\\\":[\\n    {\\n      \\\"TestCardRange\\\":{\\n        \\\"rangeStart\\\":\\\"5232492669190772\\\",\\n        \\\"rangeEnd\\\":\\\"5232492670020681\\\",\\n        \\\"expiryMonth\\\":\\\"JANUARY\\\",\\n        \\\"expiryYear\\\":\\\"2020\\\",\\n        \\\"cvc\\\":\\\"123\\\",\\n        \\\"cardHolderName\\\":\\\"S Hopper\\\",\\n        \\\"address\\\":{\\n          \\\"streetAddress\\\":\\\"1 Infinite Loop, Cupertino\\\",\\n          \\\"zip\\\":\\\"CA 95014\\\"\\n        },\\n        \\\"threeDUsername\\\":\\\"simonhopper\\\",\\n        \\\"threeDPassword\\\":\\\"mypassword\\\",\\n        \\\"threeDDirectoryServerResponse\\\":\\\"Y\\\"\\n      }\\n    },\\n    {\\n      \\\"TestCardRange\\\":{\\n        \\\"rangeStart\\\":\\\"4596123423450871\\\",\\n        \\\"rangeEnd\\\":\\\"4596123434560780\\\",\\n        \\\"expiryMonth\\\":\\\"MARCH\\\",\\n        \\\"expiryYear\\\":\\\"2021\\\",\\n        \\\"cvc\\\":\\\"321\\\",\\n        \\\"cardHolderName\\\":\\\"T Anderson\\\",\\n        \\\"address\\\":{\\n          \\\"streetAddress\\\":\\\"42, End of the Universe Rd., Los Alamos\\\",\\n          \\\"zip\\\":\\\"NM 87544\\\"\\n        },\\n        \\\"threeDUsername\\\":\\\"thomasanderson\\\",\\n        \\\"threeDPassword\\\":\\\"mypassword\\\",\\n        \\\"threeDDirectoryServerResponse\\\":\\\"Y\\\"\\n      }\\n    }\\n  ]\\n}\"},{\"language\":\"xml\",\"tabTitle\":\"Soap\",\"content\":\"&lt;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\\\"&gt;\\n   &lt;soap:Body&gt;\\n      &lt;createTestCardRanges xmlns=\\\"http:\\\/\\\/testcard.services.adyen.com\\\"&gt;\\n         &lt;request&gt;\\n            &lt;accountCode&gt;TestMerchant&lt;\\\/accountCode&gt;\\n            &lt;accountTypeCode&gt;MerchantAccount&lt;\\\/accountTypeCode&gt;\\n            &lt;testCardRanges&gt;\\n               &lt;TestCardRange&gt;\\n                  &lt;rangeStart&gt;5232492670020681&lt;\\\/rangeStart&gt;\\n                  &lt;rangeEnd&gt;5232492669190772&lt;\\\/rangeEnd&gt;\\n                  &lt;expiryMonth&gt;JANUARY&lt;\\\/expiryMonth&gt;\\n                  &lt;expiryYear&gt;2020&lt;\\\/expiryYear&gt;\\n                  &lt;cvc&gt;123&lt;\\\/cvc&gt;\\n                  &lt;cardHolderName&gt;S Hopper&lt;\\\/cardHolderName&gt;\\n                  &lt;address&gt;\\n                     &lt;streetAddress&gt;1 Infinite Loop, Cupertino&lt;\\\/streetAddress&gt;\\n                     &lt;zip&gt;CA 95014&lt;\\\/zip&gt;\\n                  &lt;\\\/address&gt;\\n                  &lt;threeDUsername&gt;simonhopper&lt;\\\/threeDUsername&gt;\\n                  &lt;threeDPassword&gt;mypassword&lt;\\\/threeDPassword&gt;\\n                  &lt;threeDDirectoryServerResponse&gt;Y&lt;\\\/threeDDirectoryServerResponse&gt;\\n               &lt;\\\/TestCardRange&gt;\\n               &lt;TestCardRange&gt;\\n                  &lt;rangeStart&gt;4596123434560780&lt;\\\/rangeStart&gt;\\n                  &lt;rangeEnd&gt;4596123423450871&lt;\\\/rangeEnd&gt;\\n                  &lt;expiryMonth&gt;MARCH&lt;\\\/expiryMonth&gt;\\n                  &lt;expiryYear&gt;2021&lt;\\\/expiryYear&gt;\\n                  &lt;cvc&gt;321&lt;\\\/cvc&gt;\\n                  &lt;address&gt;\\n                     &lt;streetAddress&gt;42, End of the Universe Rd., Los Alamos&lt;\\\/streetAddress&gt;\\n                     &lt;zip&gt;NM 87544&lt;\\\/zip&gt;\\n                  &lt;\\\/address&gt;\\n                  &lt;cardHolderName&gt;T Anderson&lt;\\\/cardHolderName&gt;\\n                  &lt;threeDUsername&gt;thomasanderson&lt;\\\/threeDUsername&gt;\\n                  &lt;threeDPassword&gt;mypassword&lt;\\\/threeDPassword&gt;\\n                  &lt;threeDDirectoryServerResponse&gt;Y&lt;\\\/threeDDirectoryServerResponse&gt;\\n               &lt;\\\/TestCardRange&gt;\\n            &lt;\\\/testCardRanges&gt;\\n         &lt;\\\/request&gt;\\n      &lt;\\\/createTestCardRanges&gt;\\n   &lt;\\\/soap:Body&gt;\\n&lt;\\\/soap:Envelope&gt;\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<h3 id=\"response\">Response<\/h3>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"''\" :id=\"'1537689020'\" :code-data='[{\"language\":\"json\",\"tabTitle\":\"JSON\",\"content\":\"{  \\n   \\\"rangeCreationResults\\\":[  \\n      {  \\n         \\\"TestCardRangeCreationResult\\\":{  \\n            \\\"cardNumberRangeStart\\\":\\\"5232492669190772\\\",\\n            \\\"cardNumberRangeEnd\\\":\\\"5232492670020681\\\",\\n            \\\"creationResultCode\\\":\\\"ALREADY_EXISTS\\\"\\n         }\\n      },\\n      {  \\n         \\\"TestCardRangeCreationResult\\\":{  \\n            \\\"cardNumberRangeStart\\\":\\\"4596123423450871\\\",\\n            \\\"cardNumberRangeEnd\\\":\\\"4596123434560780\\\",\\n            \\\"creationResultCode\\\":\\\"ALREADY_EXISTS\\\"\\n         }\\n      }\\n   ]\\n}\"},{\"language\":\"xml\",\"tabTitle\":\"Soap\",\"content\":\"&lt;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\\\"&gt;\\n   &lt;soap:Body&gt;\\n      &lt;ns0:createTestCardsResponse&gt;\\n         &lt;ns0:result&gt;\\n            &lt;ns0:rangeCreationResults&gt;\\n               &lt;ns0:TestCardRangeCreationResult&gt;\\n                  &lt;ns0:cardNumberRangeEnd&gt;5232492669190772&lt;\\\/ns0:cardNumberRangeEnd&gt;\\n                  &lt;ns0:cardNumberRangeStart&gt;5232492670020681&lt;\\\/ns0:cardNumberRangeStart&gt;\\n                  &lt;ns0:creationResultCode&gt;ALREADY_EXISTS&lt;\\\/ns0:creationResultCode&gt;\\n               &lt;\\\/ns0:TestCardRangeCreationResult&gt;\\n               &lt;ns0:TestCardRangeCreationResult&gt;\\n                  &lt;ns0:cardNumberRangeEnd&gt;4596123423450871&lt;\\\/ns0:cardNumberRangeEnd&gt;\\n                  &lt;ns0:cardNumberRangeStart&gt;4596123434560780&lt;\\\/ns0:cardNumberRangeStart&gt;\\n                  &lt;ns0:creationResultCode&gt;ALREADY_EXISTS&lt;\\\/ns0:creationResultCode&gt;\\n               &lt;\\\/ns0:TestCardRangeCreationResult&gt;\\n            &lt;\\\/ns0:rangeCreationResults&gt;\\n         &lt;\\\/ns0:result&gt;\\n      &lt;\\\/ns0:createTestCardsResponse&gt;\\n   &lt;\\\/soap:Body&gt;\\n&lt;\\\/soap:Envelope&gt;\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<h3 id=\"response-with-an-error\">Response with an error<\/h3>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"''\" :id=\"'1614079837'\" :code-data='[{\"language\":\"json\",\"tabTitle\":\"JSON\",\"content\":\"{\\n    \\\"errorType\\\" : \\\"security\\\",\\n    \\\"errorCode\\\" : \\\"901\\\",\\n    \\\"message\\\" : \\\"Invalid Merchant Account\\\",\\n    \\\"status\\\" : \\\"403\\\"\\n}\"},{\"language\":\"xml\",\"tabTitle\":\"Soap\",\"content\":\"&lt;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\\\"&gt;\\n  &lt;soap:Body&gt;\\n    &lt;soap:Fault&gt;\\n      &lt;faultcode&gt;soap:Server&lt;\\\/faultcode&gt;\\n      &lt;faultstring&gt;security 901 Invalid Merchant Account&lt;\\\/faultstring&gt;\\n    &lt;\\\/soap:Fault&gt;\\n  &lt;\\\/soap:Body&gt;\\n&lt;\\\/soap:Envelope&gt;\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<p>If the operation does not complete successfully, a service exception is thrown. See\u00a0Error handling\u00a0for more details.<\/p>\n<h2 id=\"error-handling\">Error handling<\/h2>\n<p>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.<\/p>\n<p>For a list of request and response fields, see\u00a0<a href=\"\/development-resources\/response-handling\">Response handling<\/a>.<\/p>\n<h3 id=\"test-card-response-handling\">Test card response handling<\/h3>\n<p>Test card generation fails, with a 4XX or 5XX HTTP response, in the following cases:<\/p>\n<ul>\n<li>The range start test card number is larger than the end one.<\/li>\n<li>The range start and the end test card numbers have different lengths, i.e. they do not have the same amount of digits.<\/li>\n<li>The test card numbers are shorter than 6 digits or longer than 19 digits.<\/li>\n<li>The test card numbers do not observe BIN code and AVS constraints (see Requirements).<\/li>\n<li>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\u00a0in a live environment.<\/li>\n<\/ul>\n<p>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.<\/p>\n<div class=\"notices green\">\n<p>Payment requests that are rejected with an error message are not charged.<\/p>\n<\/div>\n<h3 id=\"service-exceptions\">Service exceptions<\/h3>\n<table>\n<thead>\n<tr>\n<th>Exception<\/th>\n<th>Error Message<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Invalid test card range<\/td>\n<td>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}.<\/td>\n<\/tr>\n<tr>\n<td>Invalid test card range<\/td>\n<td>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}.<\/td>\n<\/tr>\n<tr>\n<td>Invalid test card range<\/td>\n<td>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}).<\/td>\n<\/tr>\n<tr>\n<td>Invalid test card range<\/td>\n<td>The specified range start value {specified_start_value} does not represent a valid number.<\/td>\n<\/tr>\n<tr>\n<td>Invalid test card range<\/td>\n<td>The specified range end value {specified_end_value} does not represent a valid number.<\/td>\n<\/tr>\n<tr>\n<td>Invalid test card number<\/td>\n<td>The specified card {specified_test_card_number} number is invalid.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>","url":"https:\/\/docs.adyen.com\/development-resources\/test-cards-and-credentials\/create-test-cards","articleFields":{"description":"Create custom card numbers to test your integration with Adyen.","feedback_component":true,"id":"24217228","type":"page","_expandable":{"operations":""},"status":"current","last_edit_on":"27-02-2026 16:35","page_id":"f8bf73eb-f1d0-46e7-b14a-cdcf89ee577a","filters_component":false,"decision_tree":"[]"},"algolia":{"url":"https:\/\/docs.adyen.com\/development-resources\/test-cards-and-credentials\/create-test-cards","title":"Create test cards","content":"Adyen provides generic 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.\n\nIf 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.\n\nRequirements\n\n\n\nRequirement\nDescription\n\n\n\n\nCustomer Area roles\nYou must have the Manage test cards role. For more information, see user roles.\n\n\n\nTest card requirements\nGenerated test cards should meet the following requirements:\n\nTest card numbers should be between 6-19 digits long.\nAll test card numbers in a generated test card range need to have the same number of digits.\nThe first six digits of the test card numbers in any generated range need to be valid BIN numbers.\nTest 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.\nAlthough 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.\nThe 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.\nThe billing address check verifies only the numeric characters in the street address and Zip code (if available).\n\nGenerating test cards in Customer Area\nTo generate ranges of test card numbers using the UI, do the following:\n\nLog in to your\u00a0Customer Area.\nGo to\u00a0Account &gt; Test cards.\nSelect\u00a0Add new range.\nEnter the necessary details in the\u00a0Test Card Range\u00a0form.\nSelect\u00a0Save.\n\nGenerating test cards via API\nTo create test card ranges using the API, send a request to the\u00a0\/createTestCardRanges\u00a0endpoint.\nRequest\n\n    \n\nResponse\n\n    \n\nResponse with an error\n\n    \n\nIf the operation does not complete successfully, a service exception is thrown. See\u00a0Error handling\u00a0for more details.\nError handling\nAfter 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.\nFor a list of request and response fields, see\u00a0Response handling.\nTest card response handling\nTest card generation fails, with a 4XX or 5XX HTTP response, in the following cases:\n\nThe range start test card number is larger than the end one.\nThe range start and the end test card numbers have different lengths, i.e. they do not have the same amount of digits.\nThe test card numbers are shorter than 6 digits or longer than 19 digits.\nThe test card numbers do not observe BIN code and AVS constraints (see Requirements).\nIf 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\u00a0in a live environment.\n\nA 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.\n\nPayment requests that are rejected with an error message are not charged.\n\nService exceptions\n\n\n\nException\nError Message\n\n\n\n\nInvalid test card range\nThe length of the start of the card range needs to be between 6 and 19 digits long but was {specified_start_range_length_value}.\n\n\nInvalid test card range\nThe length of the end of the card range needs to be between 6 and 19 digits long but was {specified_end_range_length_value}.\n\n\nInvalid test card range\nThe 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}).\n\n\nInvalid test card range\nThe specified range start value {specified_start_value} does not represent a valid number.\n\n\nInvalid test card range\nThe specified range end value {specified_end_value} does not represent a valid number.\n\n\nInvalid test card number\nThe specified card {specified_test_card_number} number is invalid.\n\n\n","type":"page","locale":"en","boost":17,"hierarchy":{"lvl0":"Home","lvl1":"Development resources","lvl2":"Test cards and credentials","lvl3":"Create test cards"},"hierarchy_url":{"lvl0":"https:\/\/docs.adyen.com\/","lvl1":"https:\/\/docs.adyen.com\/development-resources","lvl2":"https:\/\/docs.adyen.com\/development-resources\/test-cards-and-credentials","lvl3":"\/development-resources\/test-cards-and-credentials\/create-test-cards"},"levels":4,"category":"Development Resources","category_color":"green","tags":["Create","cards"]},"articleFiles":{"346377974.json":"<p alt=\"\">346377974.json<\/p>","1537689020.json":"<p alt=\"\">1537689020.json<\/p>","1614079837.json":"<p alt=\"\">1614079837.json<\/p>"}}
