Why does my recurring transaction give the error "invalid card number"?
If you are trying to do a recurring payment using tokenized payment details and get an error with errorCode 101 and message invalid card number, you are probably not passing in the payment details correctly. To do a recurring payment using a token, you need to pass both the shopperReference and the token in the request. Depending on which integration you are the names differ. Please check both scenarios below:
Checkout
If you are using Checkout API endpoint (/payments) and seeingerrorCode 101 and message invalid card number you are probably not including the storedPaymentMethodID:
- Include the storedPaymentMethodId: This is the recurringDetailReference returned in the response when you created the token. Before API v49 this is passed in as recurringDetailReference
Refer to this example for CardOnFile:
{
"amount":{
"value":2000,
"currency":"USD"
},
"paymentMethod":{
"type":"scheme",
"storedPaymentMethodId":"7219687191761347",
"encryptedSecurityCode": "adyenjs_0_1_18$MT6ppy0FAMVMLH..."
},
"reference":"YOUR_ORDER_NUMBER",
"shopperInteraction": "ContAuth",
"recurringProcessingModel": "CardOnFile",
"merchantAccount":"YOUR_MERCHANT_ACCOUNT",
"shopperReference":"YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j",
"returnUrl":"https://your-company.com/..."
}
For all details refer to our tokenization documentation: CardOnFile, Recurring and UnscheduledCardOnFile
Classic API
If you are using our Classic API endpoint (/authorise) and seeing errorCode 101 and message invalid card number you are probably not including the selectedRecurringDetailReference:
- Include the selectedRecurringDetailReference: Either the recurringDetailReference returned from the list of all stored details based on the shopperReference, or LATEST to use the most recent recurring detail
Refer to this example for ONECLICK:
{
"amount":{
"value":2000,
"currency":"EUR"
},
"card":{
"cvc":"737"
},
"reference":"Your Reference Here",
"merchantAccount":"TestMerchant",
"shopperEmail":"s.hopper@test.com",
"shopperIP":"61.294.12.12",
"shopperReference":"YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j",
"selectedRecurringDetailReference":"LATEST",
"recurring":{
"contract":"ONECLICK"
},
"shopperInteraction":"Ecommerce"
}
For all details refer to our tokenization documentation: One-click and Recurring
Was this article helpful?
Learn more
Find more details on this topic.
Go to Adyen Docs