Benjamin de Bos
Benjamin de Bos

Reputation: 4346

Paypal - Possible to refund through RESTFUL API using a web_accept

I'm currently looking into the possibility of refunding a web_accept type payment for PayPal.

We accept payments on our website and i'd like to automatically refund a transaction. For example:

I have a web_accept payment: Web Accept Payment Received (Unique Transaction ID #XXXXXXXXX)

$sale = Sale::get('XXXXXXXXX', $apiContext);

My refund Sale:get() argument returns: 'Got Http response code 404 when accessing https://api.paypal.com/v1/payments/sale/6LN17852AX690712B.'

Which obviously isn't working. Any chance someone can help me out?

Upvotes: 0

Views: 294

Answers (1)

Vimalnath
Vimalnath

Reputation: 6463

It is not possible to refund a web_accept transaction via REST API. You will get this error

name:INVALID_RESOURCE_ID

message:The requested resource ID was not found.

So, you will need to use RefundTransaction API to refund this transaction.

Upvotes: 1

Related Questions