Test and go live

When you’re ready to take your integration live, use this page to move your integration from your test environment to your live production.

On this page

Know before you code

  • Complete the steps in Get started to get your sandbox account information from the Developer Dashboard:
    • Client ID
    • Access token
    • Business account credentials: Create a few PayPal Business accounts to test merchant accounts.
    • Personal account credentials: Create a few personal accounts to test buyer-side functionality.

Step 1: Test your integration

Complete end-to-end testing in your sandbox to make sure the entire integration functions as you expect from both merchant and buyer-side functionality.

Test REST API requests and responses

During your development, use the sandbox API base URL, https://api.sandbox.paypal.com/, so you can safely test all the REST API requests without affecting live PayPal accounts.

Log into the sandbox test site, sandbox.paypal.com, to see the result of a REST API call that creates an action in a PayPal account, such as creating an order or an invoice.

Test the Checkout flow

Use your personal sandbox login information during the checkout flow to complete a transaction and then log into the sandbox test site, sandbox.paypal.com, to see the money movement out of the buyer's account.

Use the business sandbox login information to log into sandbox.paypal.com to see the money move into the merchant's account.

Learn more about the PayPal sandbox: PayPal sandbox.

As you're testing your APIs and flows, refer to the following sections, which provide tips for testing specific integration functionality. Use what applies to your integration and skip those that don't.

Payment methods

Use the following tools to test payments in the sandbox.

Payment method Tool Why use it?
PayPal button Personal sandbox account The personal sandbox account information in the Developer Dashboard contains account login information you can use in the checkout flow for a test purchase.

Sandbox test accounts:
https://developer.paypal.com/developer/accounts/
Credit card Credit card generator The credit card generator quickly creates card information you can use in checkout flow or in a REST API integration to test a purchase.
https://developer.paypal.com/developer/creditCardGenerator/
Alternative payment method Simulation server The simulation server runs the APM experience on the sandbox and allows you to add mock buyer information to test the APM flow. To add mock buyer information, click the pre-fill button available after you select an APM in the checkout flow. You can also simulate successful authorizations or failed authorizations.
PayPal Credit Personal sandbox account The personal sandbox account information in the Developer Dashboard contains account login information you can use in the checkout flow for a test purchase.

Sandbox test accounts:
https://developer.paypal.com/developer/accounts/

Webhooks

Use the following methods to test webhooks in your integration:

Testing method Why use it?
Developer Dashboard After you subscribe to a webhook, confirm the event triggered by the webhook displays on the Sandbox > Webhooks Events page.

Sandbox webhooks events: https://developer.paypal.com/developer/dashboard/webhooks/sandbox/
On your listener URL Confirm your listener URL received the webhook when you completed a test transaction.
In your webhook handler Run any tests that you've developed for your webhook handler script to confirm code updates you've made for handling the webhook.

See also

Webhooks

Idempotent API requests

Occasionally, network outages or other service issues can disrupt REST API requests. Use Idempotent API requests to retry a request multiple times without creating a duplicate action. Enable API idempotency by using the PayPal-Request-Id headers in the POST calls that support it.

Make sure you test the calls that you want to be idempotent to ensure they don't create duplicate actions.

See also

API idempotency

Error handling and simulation testing

Make sure all API errors are handled correctly. In addition to your tests, you can use our test scenarios to trigger different flows in your integration and make sure they're handled appropriately for customizations you’ve made. We provide test scenarios for the following APIs:

  • Disputes
  • Invoicing
  • Subscription
  • Payouts

See also

Step 2: Go live with your integration

Deploying your code to the live environment takes only a few steps.

  1. Change the base URL for all your REST API calls from https://api.sandbox.paypal.com to https://api.paypal.com.

  2. Change the references to your sandbox API credentials to the live credentials. To get live API credentials, create a live REST API.

    Tip: Remember to change the sandbox client ID in the JavaScript SDK call in your HTML.

  3. If you created or updated pages on a website, move that code from the test environment to the live environment.

  4. If you completed the advanced credit and debit card integration, complete the PayPal production onboarding for your live PayPal account.

  5. Once your code is live, you can:

    • Test the button and movement of funds using real (non-sandbox) PayPal accounts. When making a live test purchase, consider:
      • The business account receiving money can’t also make the purchase.
      • If you create a personal account with the same information as the business account, those accounts might experience restrictions.
    • Test any other integrations such as the creation of invoices or completion of payouts.