• Documentation
  • API Reference
  • Documentation
  • API Reference
Expand All Collapse All
  • Payment Overview
    • Introduction
    • Choosing an Integration Method
  • Accept Payment
    • Payment Page
      • Quick Start
      • Input Parameters
      • Output Parameters
    • Web SDK
      • Quick Start
      • Nuvei Fields
        • Styling
      • Additional Functions
      • APM Payments
      • Tokenization-Only Flow
      • Scenarios
      • Using ReactJS
        • Full Samples
        • Sandbox Examples
      • FAQs
    • Checkout
      • Quick Start
      • UI Customization
      • Payment Customization
      • Advanced Controls
      • Checkout Examples
    • Server-to-Server
    • Payment Scenarios
    • Mobile SDKs (Beta Release)
      • Android Mobile SDK (Beta Release)
      • iOS Mobile SDK (Beta Release)
    • Flow Diagrams
    • Plugins
      • Magento
        • Rebilling with Magento
      • WooCommerce
        • Rebilling with WooCommerce
      • PrestaShop
        • Rebilling with PrestaShop
      • OpenCart
      • Shopify (via AsiaBill)
      • Mirakl
      • Salesforce
      • SAP
      • WIX
    • Marketplaces
  • Features
    • Authentication
    • Financial Operations
      • Refund
      • Void
      • Auth and Settle
      • Partial Approval
      • Currency Conversion (DCC and MCP)
    • Card Operations
      • Card-on-File
      • PCI and Tokenization
      • Zero-Authorization
      • Merchant-Initiated Transactions (MIT)
      • Blocking Cards
    • Subscription (Rebilling)
    • 3D-Secure
      • 3D-Secure Explained
      • 3DS Implementations
        • 3DS MPI-Only Web SDK
        • 3DS MPI-Only REST
        • 3DS External MPI
        • 3DS Responses
      • 3DS Functions
        • 3D-Secure Fingerprinting
        • 3D-Secure Authentication Challenge
    • Callbacks (DMNs)
      • Configuring the Events API
  • Guides
    • Testing Cards, APIs and APMs
      • Testing Cards
      • Testing APIs with Postman
      • Testing APMs
    • Response Handling
    • Alternative Payment Guides (APMs)
    • Airline Ticket Guides
      • Airline Addendum
      • External Authorization Addendum
    • Payment Facilitators (PayFac)
    • Cashier
      • Cashier Events Guide
      • Cashier Features
    • Withdrawal Guide
    • Risk Guide
      • Appendix 1: Transaction Types
      • Appendix 2: Credits and Payouts
      • Appendix 3: Fraud to Sale Programs
      • Appendix 4: Compliance Programs
      • Appendix 5: Chargebacks
    • eKYC Guide
    • Server SDKs
      • Java SDK
      • .NET SDK
      • PHP SDK
      • Node.JS SDK
    • Fast Track Onboarding Developer Guide
    • Currency Conversion Guides
      • Multiple Currency Pricing (MCP)
      • Dynamic Currency Conversion (DCC)
        • DCC in Cashier or Payment Page
        • DCC in REST API Workflows
        • DCC in Web SDK Workflows
    • Website Compliance Guides
  • Additional Links
    • FAQs
    • API Reference
    • Release Notes
    • Country and Currency Codes

Refund

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 Sale transactionId).
  • Transactions that were not processed by Nuvei.

    For unrelated refunds, please contact your Account manager.

Performing partial refunds requires a specific Nuvei account configuration. Contact your Nuvei Account Manager for details.

You can work with a full workflow using the “Simple Sale Payment and Partial Refund” scenario example.
To access the example, import the JSON file (provided in this link: Nuvei Postman collection) into Postman, and follow the additional instructions in Testing APIs with Postman.

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"
}
2022 Nuvei. All rights reserved.