PayPal sandbox
Last updated: Aug 15th, 7:46am
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:
Component | Access through |
---|---|
Sandbox API base URL | https://api-m.sandbox.paypal.com/ |
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). |
API URLs
While you're developing code, your REST API calls use the sandbox base URL, https://api-m.sandbox.paypal.com/
.
1curl -v -X POST https://api-m.sandbox.paypal.com/v2/invoicing/generate-next-invoice-number \2-H "Content-Type: application/json" \3-H "Authorization: Bearer <Access-Token>"
When you go live, change the sandbox base URL to the production base URL, https://api-m.paypal.com/
.
Test site
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.
Get sandbox test site login
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.
Confirm an action in the sandbox test site
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).