PayPal sandbox testing guide
APICurrentLast updated: April 6th 2022, @ 4:06:12 pm
The PayPal sandbox is a self-contained, virtual testing environment that simulates the live PayPal production environment. The sandbox provides a shielded space where you can initiate and watch while your apps process PayPal API requests without touching any live PayPal accounts.
The PayPal sandbox mirrors the features on the PayPal production servers. While some PayPal features do not apply to the sandbox, such as closing an account, issuing monthly statements, storing shipping preferences, and PayPal Shops support, the sandbox has the same PayPal API feature set as the live environment. You can test your PayPal processes in the sandbox. Processes behave the same in the sandbox environment as they do on production servers.
When you initiate a transaction through a sandbox account, PayPal creates a mock transaction that behaves exactly like a transaction in the live environment. By using fictitious sandbox accounts with their associated authentication credentials in your PayPal API calls, you can test and debug your apps without referencing any real PayPal users or live PayPal accounts.
The sandbox lets you operate your application in a safe environment and provides a way to fine-tune your PayPal routines before you move your product into production.
The PayPal sandbox is made up of these components:
|Sandbox test site||https://www.sandbox.paypal.com/|
|Sandbox > Accounts page||https://developer.paypal.com/developer/accounts|
During the test phase, use the sandbox endpoints and your sandbox account details in each PayPal API request that you make. Create and manage your set of sandbox accounts from the sandbox Accounts page. Use the Sandbox test site to review the transactions associated with the calls you make using your sandbox accounts.
Tip: To review the status of the mock transactions associated with a sandbox account, log in to the sandbox test site with the credentials from any of your sandbox accounts.
The testing process
Test your application by creating a sandbox account for each user entity represented in your PayPal transactions. When testing, use the sandbox accounts in place of all the live accounts you will use while processing live transactions.
- Use your existing PayPal account to log in to the Developer website at developer.paypal.com, or create a new PayPal account by clicking the Sign Up button on this site.
- Create a set of virtual sandbox accounts.
- Format your PayPal API requests using the details from your sandbox accounts and run them against the sandbox endpoints.
- Review the responses and modify your application as necessary.
- When your application is fully functional and free of bugs, go live by updating the API credentials and endpoint targets.
Tips on creating your PayPal developer account
When you create your developer account, PayPal does a verification check by sending an email to the address you specified. Enable your account by responding to PayPal's email. If you don't receive the verification email within a few minutes after signing up, check to see that it hasn't been blocked or diverted to a spam folder.
Once your account is enabled, access the sandbox functionality by logging in to the PayPal Developer website using your developer account credentials.
When creating your PayPal developer account, consider creating an account that you don't mind sharing with others on your development team. This way, you can share your sandbox accounts without compromising the security of your personal PayPal account.
Important: When coding your PayPal application, make sure that it behaves in accordance with the PayPal application policies and guidelines.
Learn about sandbox accounts.