Skip to main content
POST
/
v2
/
payments
/
captures
/
{capture_id}
/
refund
Refund captured payment
curl --request POST \
  --url https://api-m.sandbox.paypal.com/v2/payments/captures/{capture_id}/refund \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "amount": {
    "value": "10.00",
    "currency_code": "USD"
  },
  "invoice_id": "INVOICE-123",
  "note_to_payer": "DefectiveProduct",
  "payment_instruction": {
    "platform_fees": [
      {
        "amount": {
          "currency_code": "USD",
          "value": "1.00"
        }
      }
    ]
  }
}'
{
  "status": "CANCELLED",
  "status_details": {
    "reason": "ECHECK"
  },
  "id": "<string>",
  "amount": {
    "currency_code": "<string>",
    "value": "<string>"
  },
  "invoice_id": "<string>",
  "custom_id": "<string>",
  "acquirer_reference_number": "<string>",
  "note_to_payer": "<string>",
  "seller_payable_breakdown": {
    "gross_amount": {
      "currency_code": "<string>",
      "value": "<string>"
    },
    "paypal_fee": {
      "currency_code": "<string>",
      "value": "<string>"
    },
    "paypal_fee_in_receivable_currency": {
      "currency_code": "<string>",
      "value": "<string>"
    },
    "net_amount": {
      "currency_code": "<string>",
      "value": "<string>"
    },
    "net_amount_in_receivable_currency": {
      "currency_code": "<string>",
      "value": "<string>"
    },
    "platform_fees": [
      {
        "amount": {
          "currency_code": "<string>",
          "value": "<string>"
        },
        "payee": {
          "email_address": "<string>",
          "merchant_id": "<string>"
        }
      }
    ],
    "net_amount_breakdown": [
      {
        "payable_amount": {
          "currency_code": "<string>",
          "value": "<string>"
        },
        "converted_amount": {
          "currency_code": "<string>",
          "value": "<string>"
        },
        "exchange_rate": {
          "source_currency": "<string>",
          "target_currency": "<string>",
          "value": "<string>"
        }
      }
    ],
    "total_refunded_amount": {
      "currency_code": "<string>",
      "value": "<string>"
    }
  },
  "payer": {
    "email_address": "<string>",
    "merchant_id": "<string>"
  },
  "links": [
    {
      "href": "<string>",
      "rel": "<string>",
      "method": "GET"
    }
  ],
  "create_time": "<string>",
  "update_time": "<string>"
}

Authorizations

Authorization
string
header
required

OAuth 2.0 authentication

Headers

PayPal-Request-Id
string

The server stores keys for 45 days.

Prefer
string
default:return=minimal

The preferred server response upon successful completion of the request. Value is:<ul><li><code>return=minimal</code>. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the <code>id</code>, <code>status</code> and HATEOAS links.</li><li><code>return=representation</code>. The server returns a complete resource representation, including the current state of the resource.</li></ul>

PayPal-Auth-Assertion
string

An API-caller-provided JSON Web Token (JWT) assertion that identifies the merchant. For details, see PayPal-Auth-Assertion.<blockquote><strong>Note:</strong>For three party transactions in which a partner is managing the API calls on behalf of a merchant, the partner must identify the merchant using either a PayPal-Auth-Assertion header or an access token with target_subject.</blockquote>

Path Parameters

capture_id
string
required

The PayPal-generated ID for the captured payment to refund.

Body

application/json

Refunds a captured payment, by ID. For a full refund, include an empty request body. For a partial refund, include an <code>amount</code> object in the request body.

amount
object

The amount to refund. To refund a portion of the captured amount, specify an amount. If amount is not specified, an amount equal to <code>captured amount - previous refunds</code> is refunded. The amount must be a positive number and in the same currency as the one in which the payment was captured.

custom_id
string

The API caller-provided external ID. Used to reconcile API caller-initiated transactions with PayPal transactions. Appears in transaction and settlement reports. The pattern is defined by an external party and supports Unicode.

Required string length: 1 - 127
invoice_id
string

The API caller-provided external invoice ID for this order. The pattern is defined by an external party and supports Unicode.

Required string length: 1 - 127
note_to_payer
string

The reason for the refund. Appears in both the payer's transaction history and the emails that the payer receives. The pattern is defined by an external party and supports Unicode.

Required string length: 1 - 255
payment_instruction
object

Any additional refund instructions to be set during refund payment processing. This object is only applicable to merchants that have been enabled for PayPal Commerce Platform for Marketplaces and Platforms capability. Please speak to your account manager if you want to use this capability.

Response

A successful request returns the HTTP <code>200 OK</code> status code and a JSON response body that shows refund details.

The refund information. The refund status with details. The date and time stamps that are common to authorized payment, captured payment, and refund transactions.

status
enum<string>

The status of the refund.

Available options:
CANCELLED,
FAILED,
PENDING,
COMPLETED
status_details
object

The details of the refund status.

create_time
string<ppaas_date_time_v3>

The date and time when the transaction occurred, in Internet date and time format.

Required string length: 20 - 64
update_time
string<ppaas_date_time_v3>

The date and time when the transaction was last updated, in Internet date and time format.

Required string length: 20 - 64
id
string

The PayPal-generated ID for the refund.

amount
object

The amount that the payee refunded to the payer.

invoice_id
string

The API caller-provided external invoice number for this order. Appears in both the payer's transaction history and the emails that the payer receives.

custom_id
string

The API caller-provided external ID. Used to reconcile API caller-initiated transactions with PayPal transactions. Appears in transaction and settlement reports.

Required string length: 1 - 255
acquirer_reference_number
string

Reference ID issued for the card transaction. This ID can be used to track the transaction across processors, card brands and issuing banks.

Required string length: 1 - 36
note_to_payer
string

The reason for the refund. Appears in both the payer's transaction history and the emails that the payer receives.

seller_payable_breakdown
object

The breakdown of the refund.

payer
object

The details associated with the merchant for this transaction.

An array of related HATEOAS links.

I