How to Make a Basic Refund Using the Merchant API
Important: This integration method is deprecated as of January 1, 2017. PayPal continues to support existing merchants using this method, but please be advised new features and enhancements will not be applied to these integrations. For new integrations, see the PayPal Subscriptions Integration Guide.
You can use the
RefundTransaction call, which is part of the Merchant API, to make a full or partial refund to a customer.
Step 1: Process a Payment and Store the Transaction ID
In the RefundTransaction call, you will use a PayPal transaction ID from a payment that has been processed.
The following documents show examples of how to process a payment and obtain a PayPal transaction ID:
- How to Authorize and Process a Credit Card Payment Using Direct Payment. Use the value of
TRANSACTIONID, returned by the
- How to Create One-Time Payments Using Express Checkout. Use the value of
PAYMENTINFO_0_TRANSACTIONID, returned by the
Step 2: Refund the Customer
To use a transaction ID in a
RefundTransaction call, replace the value of
transaction_ID in the example below with a transaction ID from Step 1.
The following example shows how to make a full refund. (To make a partial refund, see the "Issuing Refunds" section of Related API Operations.)
Request ------- Endpoint URL: https://api-3t.sandbox.paypal.com/nvp HTTP method: POST POST data: USER=merchant_user_name &PWD=merchant_password &SIGNATURE=merchant_signature &METHOD=RefundTransaction &VERSION=94 &TRANSACTIONID=transaction_ID #ID of the transaction for which the refund is made &REFUNDTYPE=Full #Specifies a full refund; a partial refund requires more input fields Response -------- REFUNDTRANSACTIONID=7XH234440V8691234 #New transaction ID, for the refund &FEEREFUNDAMT=0%2e03 &GROSSREFUNDAMT=1%2e00 &NETREFUNDAMT=0%2e97 &CURRENCYCODE=USD &TOTALREFUNDEDAMOUNT=1%2e00 &ACK=Success &REFUNDSTATUS=Instant &PENDINGREASON=None ...