1
votes

I am working on paypal adaptive payment & i need to refund with API , i am able to refund full amount but i also need to refund partial amount
reference url which i am using:https://developer.paypal.com/docs/classic/api/adaptive-payments/Refund_API_Operation/
eg- total amount made at time of payment is 100 & i need to refund only 50.00

i try following code/api parameters

-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 "  https://svcs.sandbox.paypal.com/AdaptivePayments/Refund  -d  
"requestEnvelope.errorLanguage=en_US 
&transactionId=AP-95V43510SV018561T0"

& try these inputs to set refund amount

&amount = 50.0

&

&amount = XS:50.0

but none of these working just refund the full amount

1

1 Answers

4
votes

A little correction on your request payload, "AP-95V43510SV018561T0" is a pay-key value (obtained from the Pay api response), the name pair should be payKey = AP-95V43510SV018561T0

A partial refund payload with minimum parameters would be like this, say if you have just made a $100 transaction and is about to do a $50 refund:

requestEnvelope.errorLanguage = en_US
detailLevel = ReturnAll 
payKey = AP-95V43510SV018561T0
receiverList.receiver(0).email = [email protected]
receiverList.receiver(0).amount = 50.00
currencyCode = USD

And the API response:

responseEnvelope.timestamp=2015-08-06T07:39:08.861-07:00
responseEnvelope.ack=Success
responseEnvelope.correlationId=2e7007b68f85b
responseEnvelope.build=17603431
currencyCode=USD
refundInfoList.refundInfo(0).receiver.amount=50.00
refundInfoList.refundInfo(0)[email protected]
refundInfoList.refundInfo(0).refundStatus=REFUNDED
refundInfoList.refundInfo(0).refundNetAmount=48.05
refundInfoList.refundInfo(0).refundFeeAmount=1.95
refundInfoList.refundInfo(0).refundGrossAmount=50.00
refundInfoList.refundInfo(0).totalOfAllRefunds=50.00
refundInfoList.refundInfo(0).refundHasBecomeFull=false
refundInfoList.refundInfo(0).encryptedRefundTransactionId=96U15993F0258151X
refundInfoList.refundInfo(0).refundTransactionStatus=COMPLETED