Why did I get API error code 10422?
PayPal returned API error code 10422 – Customer must choose new funding sources.
Cause
Your customer must choose a new funding source because there was an issue with the previous payment method they selected (such as insufficient funds, bank decline, and so on). You'll receive a response from your API call as an array, as shown in the following example.
TIMESTAMP=2015-08-19T17:15:47Z
CORRELATIONID=da8a9559f04a7
ACK=Failure
VERSION=124.0
BUILD=000000
L_ERRORCODE0=10422
L_SHORTMESSAGE0=Customer must choose new funding sources.
L_LONGMESSAGE0=The customer must return to PayPal to select new funding sources.
L_SEVERITYCODE0=Error
CORRELATIONID=da8a9559f04a7
ACK=Failure
VERSION=124.0
BUILD=000000
L_ERRORCODE0=10422
L_SHORTMESSAGE0=Customer must choose new funding sources.
L_LONGMESSAGE0=The customer must return to PayPal to select new funding sources.
L_SEVERITYCODE0=Error
In the example:
- ACK=Failure indicates that the API call failed and the transaction didn't complete.
- L_ERRORCODE0 indicates the error number ("10422").
- L_LONGMESSAGE0 indicates the reason for the error ("The customer must return to PayPal to select new funding sources.")
If you're a developer, you can use the array to determine how to proceed. Otherwise, contact a developer or your third-party shopping cart provider (Magento, WooCommerce, and so on) for help in resolving this issue.
Solution
To resolve this issue, you can add a conditional statement to your code as follows.
Note: The following example is pseudo-code and language-agnostic, so you must adapt it for your specific integration.
if(response[‛ACK’] === “Failure”){
if(response[‘L_ERRORCODE0’] === 10422){
// send user back to a page which contains the checkout form and populate the fields that were filled out previously for proper UI experience (so the customer doesn’t have to retype everything)
// let the customer know that the payment method was not accepted and they need to choose another way to pay.
}
}
if(response[‘L_ERRORCODE0’] === 10422){
// send user back to a page which contains the checkout form and populate the fields that were filled out previously for proper UI experience (so the customer doesn’t have to retype everything)
// let the customer know that the payment method was not accepted and they need to choose another way to pay.
}
}
When you use this approach, your customer can continue their order without re-entering their information. They can also choose PayPal and pay with their account, or select another card or payment method that your site accepts.
Note: See the Developer Portal for a complete list of NVP/SOAP API error codes.
Was this article helpful?