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.While some PayPal features do not apply to the sandbox, such as closing an account, issuing monthly statements, and storing shipping preferences, the sandbox has the same PayPal API feature set as the live environment.
When you test 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 has these components:
|Sandbox API base URL||
|Sandbox test site||https://www.sandbox.paypal.com/.
You use the personal and business credentials you find on the Sandbox > Accounts page in the Developer Dashboard to log into the sandbox as either a buyer (personal) or seller (business).
While you're developing code, your REST API calls use the sandbox base URL,
curl -v -X POST https://api.sandbox.paypal.com/v2/invoicing/generate-next-invoice-number \ -H "Content-Type: application/json" \ -H "Authorization: Bearer Access-Token"
When you go live, change the sandbox base URL to the production base URL,
The sandbox site is a test version of the accounts on
paypal.com. Because you can log into
paypal.com as either a merchant or a buyer,
sandbox.paypal.com has the same functionality. You can log into
sandbox.paypal.com to confirm expected actions as you build out your integration, including:
- Money moving from the buyer's PayPal account when they purchase using their balance.
- Money moving into the merchant's account after funds are captured.
- Invoices created in the merchant's account.
To test purchases or other actions on
sandbox.paypal.com, you need login information for your personal and business sandbox accounts. To get that account information:
- In the Developer Dashboard, under SANDBOX, select Accounts.
- In the Manage Accounts column, hover over the (...) button and select View/Edit Account for the personal account. Copy the email ID and the system-generated password. You use the email ID and password to log into a sandbox account.
After you complete an action that affects a PayPal account, such as making a purchase using the PayPal balance or creating an invoice, you can confirm that the action completed as you expected by logging into the sandbox test site.
Use the sandbox account email IDs and passwords to log in as either a buyer (personal) or as a merchant (business).