Partial refund error

lachlanj
Contributor
Contributor

Hi,

 

I'm getting the following error when attempting to do a partial refund using the REST API:

 

{
"name": "TRANSACTION_REFUSED",
"message": "Request was refused.You can not do a partial refund on this transaction",
"information_link": "https://developer.paypal.com/docs/api/payments/#errors",
"debug_id": "54a2a3d762511"
}

 

The request I am using is as follows:

 

URI:

https://api.sandbox.paypal.com/v1/payments/sale/2WW75684AA852373B/refund

 

BODY:

{
"amount": {
"total": "5.00",
"currency": "AUD"
},
"invoice_number": "INV-124",
"description": "test desc",
"reason": "test reason"
}

 

In my account settings I have payment review set to OFF.

 

Does anyone know what I might be doing wrong?

Login to Me Too
2 REPLIES 2

MTS_Andre
Moderator
Moderator

Hi, the transaction you are trying to refund is a Payment Received (Personal), but the transaction ID you pass to the REST API must be the one from your side. The sender has the transaction ID 2WW75684AA852373B while from your side is the 2S951471AE5547506 so your API call should be like this:

 

v1/payments/sale/2S951471AE5547506/refund

 

Also if it is a Personal Payment Received you can refund the total amount only (tested that).

Login to Me Too

MTS_Ciaran
Moderator
Moderator

looks like the ID you are trying to refund "2WW75684AA852373B" is actually the customers transaction ID, if the merchant is to refund they need to use their transaction ID. Keep in mind that the customers transaction ID is different to the merchants transaction ID. 

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.