Test REST API transactions

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.

The Sandbox API Calls dashboard lists REST API calls that are tied to your sandbox account. The Live API Calls dashboard lists REST API calls in the live environment.

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.

Integration steps

1. Required Meet the prerequisites.
2. Required Test PayPal payments.

Prerequisites

  1. 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 Authorization header 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.

  2. 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.

  3. 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

  4. 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.

  1. Click Log In to log in to your PayPal account.

  2. Create a PayPal payment.

  3. To approve the payment, enter the email address and password for your buyer account.

  4. Execute the payment.

  5. 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.

Additional information