REST API URLs

To communicate with the PayPal REST APIs, you'll pass JSON-formatted HTTP requests to the API endpoint in either the sandbox or production environment.

Environment Base URL
Sandbox https://api.sandbox.paypal.com
Production https://api.paypal.com

This following sample call, which generates a the next available invoice number in the merchant's account, is made to the sandbox environment for testing.

curl -v -X POST https://api.sandbox.paypal.com/v2/invoicing/generate-next-invoice-number \
-H "Content-Type: application/json" \
-H "Authorization: Bearer Access-Token"

When you're ready to take your code live, change the base URL.

curl -v -X POST https://api.paypal.com/v2/invoicing/generate-next-invoice-number \
-H "Content-Type: application/json" \
-H "Authorization: Bearer Access-Token"

See also

  • PayPal sandbox — Learn more about how to use the PayPal sandbox as a testing resource.
  • Test and go live — Learn more about how to successfully move your transaction from the sandbox to the production environment.