Process a Refund
To make a full or partial refund, you must make a POST request to the refunds endpoint.
Only completed payments – i.e., those with the status of COMPLETED – can be refunded. You can issue a series of refunds as long as the combined total does not exceed the original payment amount.
curl -X POST https://api.test.paysafe.com/alternatepayments/v1/accounts/1001070130/payments/eda8ab88-4962-4c58-9c46-5dd73d305eee/refunds \
-u testuser:B-qa2-0-53625f86-302c021476f52bdc9deab7aea876bb28762e62f92fc6712d0214736abf501e9675e55940e83ef77f5c304edc7968 \
-H 'Content-Type: application/json' \
Prior to trying the example above, you should:
- Provide a unique merchant reference number (merchantRefNum) for each transaction.
- Replace the account number (1001070130) in the URL with the Test account number you received for the alternate payments method you are testing.
- Replace the payment ID (eda8ab88-4962-4c58-9c46-5dd73d305eee) with the payment ID you received in the response to your Payment request.
- Replace the API key (after the -u) with the Test API key you have received.
For completed payments in the manual settlement flow, merchants can issue refunds against either the payment or the settlement (see settlement refunds for information on issuing refunds to a settlement). However, note the following:
- If you have issued a partial refund against a settlement using the settlements endpoint, you cannot then issue a subsequent refund against the associated payments endpoint.
- If you have issued a partial refund against a settlement using the payments endpoint, you cannot then issue a subsequent refund against the associated settlements endpoint.
"description": "Request successfully processed",
The settlement response contains the following parameters:
|id||string||This is a unique ID for this refund operation. You can use it, e.g., to look up a refund request.|
|merchantRefNum||string||This is the merchant reference number created by the merchant and submitted as part of the request.|
true indicates this is not a duplicate transaction.
A request is considered a duplicate if the merchantRefNum has already been used in a previous request within the past 90 days.
|amount||integer||This is the amount of the request, in minor units.|
This is the three-digit currency code for the currency of the merchant account specified by the account_id in the request URL.
|paymentType||enum||This is the payment type used for the request (e.g., NETELLER).|
|txnTime||dateTime||This is the transaction time and date in UTC format.|
true indicates this is a real transaction.
false indicates this is a test transaction.
This is the status of the refund.
|gatewayResponse||object||This contains the response from the payment provider and varies depending on the payment method used.|
|links||array of link objects|| |
The array contains a self link that can be used to look up details about the request.