1

I am working on paypal adaptive refund in paypal sandbox.

I am sending request as following:

curl https://svcs.sandbox.paypal.com/AdaptivePayments/Refund \
-s \
--insecure \
-H "X-PAYPAL-SECURITY-USERID: api_username" \
-H "X-PAYPAL-SECURITY-PASSWORD: api_password" \
-H "X-PAYPAL-SECURITY-SIGNATURE: api_signature" \
-H "X-PAYPAL-REQUEST-DATA-FORMAT: NV" \
-H "X-PAYPAL-RESPONSE-DATA-FORMAT: NV" \
-H "X-PAYPAL-APPLICATION-ID: your_app_id "   \
-d requestEnvelope.errorLanguage=en_US \
-d payKey=AP-95V43510SV018561T

But unfortunately I am getting a response with error "NO_API_ACCESS_TO_RECIEVER".

See my screenshot of response where "refundStatus" key option contains error "NO_API_ACCESS_TO_RECIEVER".

enter image description here

I have followed this discussion but I have not found such options as said here. I even cannot understand what API Caller is as said here to input API Caller in text box.

Please help someone.

Arshad Hussain
  • 765
  • 5
  • 22

1 Answers1

0

The official Paypal Refund API overview clearly states to make a refund using the Refund API operation, you must:

Have made a Pay request for which payment you want to refund the payment, or you must have received the part of the payment you want to refund, and

Have permission to make a refund on behalf of the receiver, unless you are also the receiver; in other words, each receiver whose account is the source of the refund must have granted you third-party access permission to call the Refund API operation.

So, it seems you have forgotten to set permission.

Login to www.paypal.com (For Sandbox: www.sandbox.paypal.com - Make sure you are already signed in https://developer.paypal.com) and login with the receiver account. Goto Profile -> API Access -> Grant API Permission -> Input the API Caller (Example: May6_1307031077_biz_api1.paypal.com) in Third Party Permission Username textbos and click Lookup button -> Enable checkbox for "Issue a refund for a specific transaction" and click Add button.

This is how receiver can grant permission to API Caller.

Once this is enabled, the refund should work.

Important Note:

The Adaptive Payments Refund API call does not support pay keys generated by the Mobile Payment Library (MPL).

A personal account holder cannot grant API access to a third party. A personal account holder must issue the refund by specifying the transaction ID, or by logging in to paypal.com to make the refund.

So there are many scenarios, one can encounter the above error, if the above do not resolve your issue, pay special attentions to some of the conditions here Refund API Overview

Amar Pratap
  • 1,000
  • 7
  • 20