Refund payments

A sale is a completed PayPal payment.

A captured payment is an authorized and captured PayPal payment.

You can refund sales and captured payments.

Integration steps

1. Required Meet the prerequisites.
2. Optional Either fully refund a sale or partially refund a sale.
3. Optional Fully or partially refund a captured payment.

Prerequisites

  1. To receive payments in a currency that you do not hold, first configure your Payment Receiving Preferences in your PayPal account. Otherwise, your payment status might be pending until you manually approve the payment in your PayPal account.

  2. To receive guest checkout payments, which allow credit cards, enable the PayPal Account Optional option in your account settings. The path to this option for US accounts is:

    Profile > My selling tools > Website preferences > PayPal Account Optional

Fully refund a sale

For a full refund, include the sale ID of the completed payment in the URI and include an empty JSON request body.

This example requests a full refund:

curl -v https://api.sandbox.paypal.com/v1/payments/sale/67D22837NN7279935/refund \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer Access-Token" \
  -d '{}'

The response shows the refund details, indicates that the refund is complete, and includes request-related HATEOAS links:

{
  "id": "1JU08902781691411",
  "status": "COMPLETED",
  "links": [
    {
      "rel": "self",
      "method": "GET",
      "href": "https://api.paypal.com/v1/payments/refunds/1JU08902781691411"
    },
    {
      "rel": "up",
      "method": "GET",
      "href": "https://api.paypal.com/v1/payments/captures/2GG279541U471931P"
    }
  ]
}

Partially refund a sale

For a partial refund, include an amount object in the JSON request body.

This example partially refunds a sale:

curl -v -X POST https://api.sandbox.paypal.com/v1/payments/sale/2MU78835H4515710F/refund \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer Access-Token" \
  -d '{
  "amount": {
    "total": "10.99",
    "currency": "USD"
  },
  "invoice_number": "INVOICE-123",
  "description": "Defective product"
}'

The response shows the refund details:

{
  "id": "2MU78835H4515710F",
  "status": "COMPLETED",
  "links": [
    {
      "rel": "self",
      "method": "GET",
      "href": "https://api.paypal.com/v1/payments/refunds/2MU78835H4515710F"
    },
    {
      "rel": "up",
      "method": "GET",
      "href": "https://api.paypal.com/v1/payments/captures/2GG279541U471931P"
    }
  ]
}

Refund a captured payment

To refund a captured payment, include the ID of the captured payment in the URI and an amount object in the JSON request body. You must include the amount object for both full and partial refunds:

curl -v -X POST https://api.sandbox.paypal.com/v1/payments/capture/2MU78835H4515710F/refund \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer Access-Token" \
  -d '{
  "amount": {
    "currency": "USD",
    "total": "110.54"
  }
}'

The response shows the refund details:

{
  "id": "0P209507D6694645N",
  "create_time": "2017-05-06T22:11:51Z",
  "update_time": "2017-05-06T22:11:51Z",
  "state": "completed",
  "amount": {
    "total": "110.54",
    "currency": "USD"
  },
  "capture_id": "8F148933LY9388354",
  "parent_payment": "PAY-8PT597110X687430LKGECATA",
  "invoice_number": "INV-1234567",
  "links": [{
    "href": "https://api.sandbox.paypal.com/v1/payments/refund/0P209507D6694645N",
    "rel": "self",
    "method": "GET"
  }, {
    "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-8PT597110X687430LKGECATA",
    "rel": "parent_payment",
    "method": "GET"
  }, {
    "href": "https://api.sandbox.paypal.com/v1/payments/capture/8F148933LY9388354",
    "rel": "capture",
    "method": "GET"
  }]
}

Next

You can show refund details.

Also, learn how to use the Payment Experience API to create web experience profiles to customize payment flow experiences.

Additional information

Feedback