PayPal provides a sandbox environment for you to test functionality. You can create sandbox accounts, view account notifications, view REST API calls, view webhook events, and simulate IPNs.
Use the dashboards to view the REST API call history for a specific app or all apps. Both dashboards list the REST API calls made by apps with related details. You can view the request and response messages of some REST API calls.
|1.||Required||Meet the prerequisites.|
|2.||Required||Test PayPal payments.|
Get an access token.
When you create an app, PayPal generates a set of OAuth client ID and secret credentials for your app for both the sandbox and live environments. You pass these credentials in the
Authorizationheader in a get access token request.
In exchange for these credentials, the PayPal authorization server issues access tokens called bearer tokens that you use for authorization when you make REST API requests. A bearer token enables you to complete actions on behalf of, and with the approval of, the resource owner.
For more information, see make your first call. If you are a non-US developer, see International Developer Questions. You can use your sandbox access token to try any of the code in the REST API reference.
Each API response includes HATEOAS links that enable you to construct a payment flow.
To receive payments in a currency that you do not hold, first configure your Payment Receiving Preferences in your PayPal account. Otherwise, your payment status might be pending until you manually approve the payment in your PayPal account.
To receive guest checkout payments, which allow credit cards, enable the PayPal Account Optional option in your account settings. The path to this option for US accounts is:
Profile > My selling tools > Website preferences > PayPal Account Optional
To test payments, create test buyer and merchant accounts in the PayPal sandbox. To create a test buyer account, select the Personal account type. To create a test merchant account, select the Business account type. See create sandbox accounts.
Test PayPal payments
To test PayPal payments, you must be able to see transactions from the perspective of the buyer.
Click Log In to log in to your PayPal account.
To approve the payment, enter the email address and password for your buyer account.
To review the details of the completed payment, log in to your buyer account on the sandbox site.
For more information about PayPal payments, see accept PayPal payments.