Resolve sagepay error code 4020

Toll Free: 800-942-0215

How to Resolve SagePay Error Code 4020

When dealing with online transactions, facing technical issues can be quite common. One such frustrating issue is the SagePay Error Code 4020, which typically indicates that information sent from the merchant’s website to SagePay is missing or incorrect. This error can halt transactions, leading to potential loss of sales and customer dissatisfaction. Understanding the causes and implementing the right solutions are crucial to resuming normal operations.

Causes of SagePay Error Code 4020

Several factors could trigger the Error Code 4020 when using SagePay. Identifying the exact cause is the first step towards resolving the issue effectively.

  • Reason #1: Incorrect Vendor Name: The most common cause is entering an incorrect vendor name in the API request to SagePay.
  • Reason #2: Invalid IP Address: If the IP address from which the request is made is not listed in your SagePay account, the transaction will be blocked.
  • Reason #3: Incorrect Integration Protocol: Using an outdated or incorrect version of the SagePay integration protocol can also lead to this error.
  • Reason #4: Missing Information: Certain fields that are mandatory for the transaction might be missing in the request.

Solutions for SagePay Error Code 4020

Implementing the correct solution based on the identified cause is crucial. Follow these detailed steps for each solution:

Solution #1: Verify and Correct the Vendor Name

  1. Log in to your SagePay account.
  2. Navigate to Settings > Vendor Name.
  3. Verify the vendor name listed and compare it with the one in your API request.
  4. If incorrect, update your request with the correct vendor name.
  5. Reattempt the transaction.

Solution #2: Add IP Address to Allowed List

  1. Identify the IP address from which the transaction is initiated.
  2. Log in to your SagePay Panel.
  3. Navigate to Settings > Valid IPs.
  4. Click on Add New IP.
  5. Enter the identified IP address and Save.
  6. Retest the transaction to ensure connectivity.

Solution #3: Update Integration Protocol

  1. Check the current protocol version you are using against the latest version on SagePay’s documentation.
  2. If outdated, download the latest SDK or library for your platform.
  3. Update your integration code to utilize the new version.
  4. Ensure all mandatory fields for the newer version are correctly filled.
  5. Retry the transaction to check if the update resolves the error.

Solution #4: Ensure Mandatory Information is Complete

  1. Review SagePay’s documentation to verify all required fields for your transaction type.
  2. Inspect your request to ensure no mandatory fields are missing or incorrect.
  3. Add or correct any missing or incorrect information in your request.
  4. Resubmit your transaction to see if this rectification clears the issue.


How can I check if my IP address is already allowed in SagePay?

In your SagePay Panel, under Settings > Valid IPs, you can find a list of all IP addresses that are currently allowed. Compare your current IP with this list to ensure it’s added.

What should I do if I keep getting error 4020 even after following all solutions?

Double-check each step you’ve taken, especially ensuring that you’re correctly applying the solutions based on the exact cause of your issue. Sometimes, minor oversights like typos in the vendor name or IP address can persist. If the problem continues, reviewing the integration documentation again for any updates or additional requirements might uncover overlooked details.

Is it necessary to update the integration protocol regularly?

While not always necessary, it’s highly recommended to keep your integration protocol up to date. SagePay regularly updates its protocols to enhance security, add new features, or improve transaction efficiency. Using outdated protocols might not only lead to errors like 4020 but could also expose transactions to security vulnerabilities.

Can missing information sometimes not trigger error 4020 but another error?

Yes. While Error Code 4020 is most commonly associated with missing or incorrect information, depending on what exact data is missing or incorrect, SagePay might trigger different error codes. Always consult SagePay’s error code list in their documentation for precise troubleshooting based on the error code received.

In conclusion, resolving SagePay Error Code 4020 involves identifying the exact cause of the error and applying the appropriate solutions accurately. Verifying vendor names, ensuring IP address whitelisting, updating integration protocols, and checking for complete mandatory information are crucial steps. By following these structured solutions, most instances of Error Code 4020 can be effectively resolved, restoring smooth transaction processes.

    Enquiry Form

    Get help with Sage Accounting Solutions

    • Assistance for Sage 50, Sage 100, Sage 300
    • Solutions to common Sage 50 errors.
    • Data recovery and data migration.
    sage 50 accounting services and solutions


    Toll Free: 800-942-0215