Make Orders API calls from your server
The standard payments integration provides client-side helper functions to call the PayPal Orders API. These functions make it easy to quickly integrate with PayPal for the first time. However, there are business reasons where making API calls from your server is necessary.
- You have data in a database that you need to look up before you make the API call.
- Your buyers' cards are stored on your server.
- You need to make another API call before you call PayPal.
- Anytime you have data on your server that you need to use for a specific call.
Server-side API calls
You can complete these tasks from your server.
|Use case||Server-side API call|
|You have parameters that you want to pass securely to PayPal without exposing them to the client-side.||Call PayPal from your server to create an order for immediate payment.|
|You want your server to decide which parameters to use when setting up the transaction, such as cart totals and line-items.||Call PayPal from your server to create an order for immediate payment or create an order authorization.|
|You want to retrieve transaction details on your server, validate those details, and save them to your database.||Call PayPal from your server to get order details.|
|You need to make calls to your database, user session, or other APIs or web services while setting up or capturing a transaction.||Call PayPal from your server to capture an order.|
|You need a PayPal feature for when the buyer is not present on your site, such as capturing the funds from an authorization.||Call PayPal from your server to capture an authorization for an order.|
|You need to get order details, capture an order, or authorize an order from a different page.||Call PayPal from your server to get order details, capture an order or authorize an order.|