5. Refund Request

API to request the refund for the paid transactions.

API Endpoints

Base URL /api/GenToken/Refund

Sample Request & Response

{
    "merchantCode":"xxxxx",
    "authKey":"xxxxxxxxx",
    "ReferenceID":"(15 digit number passing during the payment creation)",
    "hash":"ComputedHash(To be calculated as described below)",
    "Amount":1,
    "Description":"optional",
    "RequestedBy":"optional"
}

Hash Creation

use the below string format to generate a hash value using Hashing Key.

Amount+AuthenticationKey+MerchantCode+ReferenceID

Response Parameters

Parameters
Data Type
Description

errorCode

Integer

1 is success 0 is failed

errorMessagee

String

result -> isRefunded

Integer

1 is refunded | 2 is under process | 0 is rejected

Merchant will receive an Email from OG regarding the updates (under process cancelled and refunded) of refund

Sample Code to post data

public async Task> RefundPayment(RefundPaymentRequest obj)
  {
  Output dto = new Output();
  var url = {Provided End Point};
  var client = new HttpClient();
  client.BaseAddress = new Uri(url);
  try
  {
  obj.hash = ComputeHash(obj);
  var resultser = JsonConvert.SerializeObject(obj);
  client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
  client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json; charset=utf-8");
  var response = client.PostAsJsonAsync(url, obj).Result;
  if (response.IsSuccessStatusCode)
  {
  var ss = response.Content.ReadAsStringAsync();
  var result = JsonConvert.DeserializeObject>(ss.Result);
  dto = result;
  }
  else
  {
  var ss = response.Content.ReadAsStringAsync();
  var resps = ss.Result.ToString();
  }
  }
  catch (HttpRequestException ex)
  {
  }
  return dto;
  }

Last updated