REST API URLs
Last updated: Aug 15th, 7:23am
To communicate with the PayPal REST APIs, you'll pass JSON-formatted HTTP requests to the API endpoint in either the sandbox (test) or live environment.
Environment | Base URL |
---|---|
Sandbox | https://api-m.sandbox.paypal.com |
Live | https://api-m.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.
1curl -v -X POST https://api-m.sandbox.paypal.com/v2/invoicing/generate-next-invoice-number \2-H "Content-Type: application/json" \3-H "Authorization: Bearer <Access-Token>"
When you're ready to take your code live, change the base URL.
1curl -v -X POST https://api-m.paypal.com/v2/invoicing/generate-next-invoice-number \2-H "Content-Type: application/json" \3-H "Authorization: Bearer <Access-Token>"
IP addresses
There is no list of IP addresses for api-m
. The IP addresses are located behind content delivery network (CDN) providers, and all our zones are DNSSec signed. When merchants do a lookup for api-m.paypal.com
, they can use the signature to verify PayPal provides the IP.
If you need to allowlist an IP address, you can use api.paypal.com
. Expect higher latency and lower availability than api-m.paypal.com
.
Don't hard-code IP addresses.
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 live environment