Refund a Transaction

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


There are two ways to refund transactions: on the PayPal website and with the Payments API /refund resource.

Refunds with the PayPal website

  1. Log in to paypal.com to search transactions.
  2. Go to Activities and view transaction details.
  3. Process the refund by clicking Issue a refund. You can return a partial amount or leave the amount unchanged to issue full refund.
  4. Click Continue to review the refund, then click Issue Refund.

Refunds with the Payments API

Process refunds by calling the Payments API /refund resource with the capture ID. The capture ID is returned from any client-side actions.order.capture() call or server-side captures call.

The following request processes a partial refund for $20. Issue a full refund by leaving the request body empty.

  1. Set up your server to make calls to PayPal.
  2. Get the capture ID from your database.
  3. Call PayPal to refund the transaction.
  4. Handle any errors from the call.

The response creates a refund resource with amount and fee break-up details.

{
  "id": "28R62814C3999453N",
  "amount":
  {
    "currency_code": "USD",
    "value": "20.00"
  },
  "seller_payable_breakdown":
  {
    "gross_amount":
    {
      "currency_code": "USD",
      "value": "20.00"
    },
    "paypal_fee":
    {
      "currency_code": "USD",
      "value": "0.58"
    },
    "net_amount":
    {
      "currency_code": "USD",
      "value": "19.42"
    },
    "total_refunded_amount":
    {
      "currency_code": "USD",
      "value": "20.00"
    }
  },
  "invoice_id": "INV-HighFashions",
  "status": "COMPLETED",
  "create_time": "2018-05-31T20:08:19-07:00",
  "update_time": "2018-05-31T20:08:19-07:00",
  "links": [
  {
    "href": "https://api-m.sandbox.paypal.com/v2/payments/refunds/28R62814C3999453N",
    "rel": "self",
    "method": "GET"
  },
  {
    "href": "https://api-m.sandbox.paypal.com/v2/payments/captures/1HW32023TU4585620",
    "rel": "up",
    "method": "GET"
  }]
}

Read about Refunding a captured payment, including sample responses, in the Payments API reference.

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