The /refundTransaction
method is used to refund previously settled transactions.
The refund amount
may not exceed the original sale amount
.
The total of all previous partial refunds may not exceed the original sale amount
.
(This is one of the reasons why this method is not suitable for refunding payouts and winnings.)
The refund request currency
needs to match that of the original transaction.
You can process refunds for:
- Transactions that were processed by Nuvei by using
relatedTransactionId
(which is the original SaletransactionId
). - Transactions that were not processed by Nuvei.
Example /refundTransaction
Request
{ "merchantId": "<your merchantId>", "merchantSiteId": "<your merchantSiteId>", "clientUniqueId": "<unique transaction ID in merchant system>", "amount": "200", "currency": "USD", "relatedTransactionId": "<transactionId returned from /payment>", "timeStamp": "<YYYYMMDDHHmmss>", "checksum": "<calculated checksum>" }
//Initialize the SDK (see https://docs.safecharge.com/?p=53233) <?php //refundTransaction $refundResponse = $safeCharge->getPaymentService()->refundTransaction([ 'clientUniqueId' => '<unique transaction ID in merchant system>', 'amount' => '200', 'currency' => 'USD', 'relatedTransactionId' => '<transactionId returned from /payment>', ]); ?>
//Initialize the SDK (see https://docs.safecharge.com/?p=29433) { String clientUniqueId = "<unique transaction ID in merchant system>"; String clientRequestId = "<unique request ID in merchant system>"; String currency = "USD"; String amount = "200"; String relatedTransactionId = "<transactionId returned from /payment>"; Safecharge safecharge = new Safecharge(); SafechargeResponse response = safecharge.refundTransaction(clientUniqueId, clientRequestId, null, amount, null, null, currency, null, null, null, relatedTransactionId, null); }
//Initialize the SDK (see https://docs.safecharge.com/?p=48413) var response = safecharge.RefundTransaction( "US", "200", relatedTransactionId: "<transactionId returned from /payment>", clientRequestId: "<unique request ID in merchant system>", clientUniqueId: "<unique transaction ID in merchant system>");
//Initialize the SDK (see https://docs.safecharge.com/?p=53443) safecharge.paymentService.refundTransaction({ clientRequestId : "<unique request ID in merchant system>", clientUniqueId : "<unique transaction ID in merchant system>", amount : "200", currency : "USD", relatedTransactionId: "<transactionId returned from /payment>", }, function (stlErr, stlRes, reqData) { console.log(stlErr, stlRes); });
Example /refundTransaction
Response
{ "reason":"", "ccCardNumber":"4****1164", "bin":"407239", "ccExpYear":"22", "customData":"", "merchantSiteId":"126006", "gwExtendedErrorCode":0, "merchantId":"2502136204546424962", "externalTransactionId":"", "acquirerId":"103", "cardBrand":"VISA", "authCode":"169410", "transactionStatus":"APPROVED", "clientRequestId":"IV96ZBARW", "cardType":"Debit", "ccExpMonth":"12", "internalRequestId":17771151, "AVSCode":"", "version":"1.0", "transactionId":"2110000000004302220", "CVV2Reply":"", "transactionType":"Credit", "issuerCountry":"US", "gwErrorCode":0, "clientUniqueId":"695701003", "errCode":0, "last4Digits":"1164", "status":"SUCCESS" }