Refund payments

Whether accepting credit cards or PayPal payments, you can refund both direct and captured payments:

Refund a completed payment (sale)

If you must refund a completed payment, or sale, provide the sale id given to you in response to a completed payment along with an empty JSON payload for a full refund.

Tip: For partial refunds, you can instead include an amount object in the JSON payload.

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

Important: The sample requests in this guide are examples only. You cannot run them as-is. You should substitute all call-specific parameters, such as tokens and IDs, with your own.

Response

The response indicates that the refund is complete:

{
  "id": "04700149C07500921",
  "create_time": "2013-03-01T18:39:18Z",
  "update_time": "2013-03-01T18:39:18Z",
  "state": "completed",
  "amount":
  {
    "total": "7.47",
    "currency": "USD"
  },
  "sale_id": "67D22837NN7279935",
  "parent_payment": "PAY-8DW08487GN7528733KEYPITA",
  "links": [
  {
    "href": "https://api.sandbox.paypal.com/v1/payments/refund/04700149C07500921",
    "rel": "self",
    "method": "GET"
  },
  {
    "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-8DW08487GN7528733KEYPITA",
    "rel": "parent_payment",
    "method": "GET"
  },
  {
    "href": "https://api.sandbox.paypal.com/v1/payments/sale/67D22837NN7279935",
    "rel": "sale",
    "method": "GET"
  }]
}

The response shows the state of the refund. The value is:

  • pending. The refund is pending.
  • completed. The refund has successfully completed.
  • failed. The refund failed.

The response also shows HATEOAS links with information on the refund, the parent payment, or the previous sale.

Refund a captured payment

You can also refund a captured payment:

https://api.paypal.com/v1/payments/capture/{capture_id}/refund

You must provide an amount object for both full and partial refunds. This example includes an lower amount object for a partial refund:

curl -v https://api.sandbox.paypal.com/v1/payments/capture/8F148933LY9388354/refund \
  -H "Content-Type:application/json" \
  -H "Authorization: Bearer Access-Token" \
  -d '{
  "amount":
  {
    "currency": "USD",
    "total": "110.54"
  },
  "description": "This is the capture refund description."
}'

What's next