Test and go live

DOCS

Last updated: Aug 15th, 7:49am

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

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.

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

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 methodToolWhy use it?
PayPal buttonPersonal sandbox accountThe 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
Credit cardCredit card generatorThe credit card generator quickly creates card information you can use in checkout flow or in a REST API integration to test a purchase.

Credit Card Generator
Alternative payment methodSimulation serverThe 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 CreditPersonal sandbox accountThe 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

Webhooks

Use the following methods to test webhooks in your integration:

Testing methodWhy use it?
Developer DashboardAfter you subscribe to a webhook, confirm the event triggered by the webhook displays on the Sandbox Webhooks Events page.
On your listener URLConfirm your listener URL received the webhook when you completed a test transaction.
In your webhook handlerRun 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

2. Go live

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-m.sandbox.paypal.com to https://api-m.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.

  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.

We use cookies to improve your experience on our site. May we use marketing cookies to show you personalized ads? Manage all cookies