Issue a refund

How to issue a refund.

Overview

In the event of a customer returning a purchase, you have two approaches you can take to issue them with a refund. One is through the viva banking app and the other is through our Payment API.

Same-day partial refunds are now supported. This applies to transactions performed with cards (except for CB network) across Android devices, PAX terminals and e-Commerce

Enable refunds

You first have to ensure that you enable refunds between accounts in the viva banking app. To do this:

  1. Log in to Viva, demo or live , and select the required account

  2. From your dashboard go to Settings > API Access.
    Select the Allow refunds checkbox as shown below:

    Allow refunds checkbox
    The new setting is saved automatically

Refunds via banking app

You are able to Cancel/Reverse a payment which occurred within the same calendar day or Refund/Void a successful payment - either partial or full.

To perform a cancellation or refund, please follow the process below:

  1. Log in to Viva, demo or live , and select the required account

  2. From your dashboard go to Sales > Sales Transactions.

  3. Find the payment you wish to refund and click on the Cancel button (for payments which occurred within the same calendar day) or the Refund button:

    Cancel/Refund
    A pop-up box will then be displayed:

    Cancel/Refund Pop-up

  4. Do one of the following:

    • For a full cancellation/refund
      Leave the Amount to be canceled/refunded field populated with the full amount
    • For a Partial cancellation/refund
      Enter an amount smaller than the total in the Amount to be canceled/refunded field
  5. Optional: Enter a meaningful description in the Merchant Reference field

  6. Click on the OK button.
    A confirmation message is displayed:

    Refund successful popup
    A new entry is displayed in the transaction list as follows, depending on the refund type:

    Full refund
    Full refund
    Partial refund Partial refund
    You will note that in the case of a partial refund, the Refund button is still available. This is because, if required, you can perform multiple partial refunds until the full amount is paid back.

Refunds via API

API refunds can be done via a simple Cancel transaction API call.

If you do not specify the sourceCode parameter within the query, the refund will automatically go to the “Default” payment source. If a particular payment source is required simply append the details to the query as shown below.

You are able to cancel or refund a payment - either partially or fully - made on the same calendar day (before clearance) or on a previous calendar day (after clearance)

Example request

DELETE    /api/transactions/[transactionId]/?amount=XXX&sourceCode=XXX

Environment URL
Production https://www.vivapayments.com/api/transactions/{transactionId}/?amount={Amount}&sourceCode={SourceCode}
Demo https://demo.vivapayments.com/api/transactions/{transactionId}/?amount={Amount}&sourceCode={SourceCode}
curl -L -X DELETE '[Environment URL]'
-H 'Authorization: Basic [Base64-encoded Merchant ID and API key]'

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => '[Environment URL]',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'DELETE',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Basic [Base64-encoded Merchant ID and API key (escrow account)]'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Example response (successful)

A successful refund is identified by “statusId”:”F” (finished or finalised) in the response as shown in the example below.

{
    "Emv": null,
    "Amount": 100.00,
    "StatusId": "F",
    "RedirectUrl": null,
    "CurrencyCode": "826",
    "TransactionId": "1289e200-6891-4739-afe5-5c13e839545b",
    "ReferenceNumber": 839335,
    "AuthorizationId": "839335",
    "RetrievalReferenceNumber": "109110839335",
    "Loyalty": null,
    "ThreeDSecureStatusId": 2,
    "ErrorCode": 0,
    "ErrorText": null,
    "TimeStamp": "2021-04-01T13:48:23.5665277+03:00",
    "CorrelationId": null,
    "EventId": 0,
    "Success": true
}

An unsuccessful refund is identified by “statusId”:”E” (error) in the response as shown in the example below. This happens if:

Example response (unsuccessful)

{
    "Emv": null,
    "Amount": null,
    "StatusId": "E",
    "RedirectUrl": null,
    "CurrencyCode": null,
    "TransactionId": null,
    "ReferenceNumber": null,
    "AuthorizationId": null,
    "RetrievalReferenceNumber": null,
    "Loyalty": null,
    "ThreeDSecureStatusId": null,
    "ErrorCode": 400,
    "ErrorText": "PaymentsInvalidAmountForVoid",
    "TimeStamp": "2021-07-20T11:30:00.5522532+03:00",
    "CorrelationId": null,
    "EventId": 2056,
    "Success": false
}

Further information

Check out the following tutorials for more details about some of the above topics:

Get Support

If you would like to integrate with Viva, or if you have any queries about our products and solutions, please see our Contact & Support page to see how we can help!