Paypal partial refund on sale transaction

blackbox1930
New Community Member

We are trying to implement paypal partial refund method using REST API. It doesn't seems to workeven when we have provided the needed arguments and have already implemented the method described in paypal docs. We need help for partial refund in node js.

 

Script: 

// get refund amount  l

et refund_details =

{      

"amount":

{        

total: "50.00",        

currency: “CAD”      

},      

"invoice_number": "INV-1234567"  

};  

// get sale id  

let saleId = “xxxx123”;  

paypal.sale.refund(saleId, refund_details, (error, refund) => {  

   if (error) {        

 console.log(error.response);    

 } else {        

 console.log("Get Refund Response");    

 }  

});

 

 

Response:

{
"response": {
"name": "TRANSACTION_REFUSED",
"message": "Request was refused.You can not do a partial refund on this transaction",
"information_link": "https://developer.paypal.com/webapps/developer/docs/api/#TRANSACTION_REFUSED",
"debug_id": "ac4cf1a2f1737",
"httpStatusCode": 400
},
"response_stringified": "{\"name\":\"TRANSACTION_REFUSED\",\"message\":\"Request was refused.You can not do a partial refund on this transaction\",\"information_link\":\"https://developer.paypal.com/webapps/developer/docs/api/#TRANSACTION_REFUSED\",\"debug_id\":\"ac4cf1...}",
"httpStatusCode": 400
}

Login to Me Too
1 REPLY 1

MTS_Ciaran
Moderator
Moderator

Hey, 

 

Can you post the REST API call URL you are using? Also is this on the sandbox or Live?

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.