Call Orders API from your Server


The basic Smart Payment Buttons 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.

Be sure to complete a Smart Payment Buttons integration before you add these advanced options.

Note: This integration uses the PayPal JavaScript SDK. If you're looking for the checkout.js integration, see the archived Checkout integration guide.

Use cases

As your use cases become more advanced, you can complete these tasks from your server instead. For example:

Use case Approach
You have parameters that you want to pass securely to PayPal without exposing them to the client-side. Call PayPal from your server to set up a transaction.
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 set up a transaction or set up an authorization transaction.
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 transaction 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 a transaction.
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.
You need to get transaction details, capture a transaction, or authorize a transaction from a different page to the Smart Payment Buttons Call PayPal from your server to get transaction details, capture a transaction or authorize a transaction.
You need an advanced feature not available on the client-side, such as capturing a different cart total. Follow the Integration Features guide to learn where to invoke your server.
You want to invoke negative testing in the sandbox. Follow the Simulate Negative Responses with Request Headers guide.

Payment processing demo

Try our PayPal Payment Processing Demo to see an end-to-end shopping cart experience. At the end of the demo, you'll see request calls and responses for the access token, order, and capture.