Capture an Authorization

SDKLegacyLast updated: June 20th 2023, @ 6:44:12 pm


Note: This guide assumes you have completed a basic Smart Payment Buttons integration.

Complete these steps on the server:

This code:

  1. Sets up your server to make calls to PayPal.
  2. Gets the authorization ID from your database.
  3. Calls PayPal to capture the authorization.
  4. Saves the order ID to your database.
  5. Handles any errors from the call.
{`

The capture request generates a response with a capture ID that you can use for refunding transactions:

For the full list of parameters and example responses, see capturing authorized payments in the Payments API reference.

Note: Remember to swap the credentials and API URL from sandbox to production when going live with your integration.

You can now call the PayPal Orders API to capture an authorization.