Refund Transaction - API QRIS SNAP
About Refund Transaction - API QRIS SNAP
This API with SNAP standards uses to refund transactions on the QRIS payment method.
Refund Transaction Terms & Conditions
This section will explain related to refund terms & condition applies during transaction cancellation.
Refund Conditions for ShopeePay | Refund Terms |
|---|---|
Transaction cancellation before the payment process. | Status will changes into Expired (status 5). |
Online Refund for common transactions. | Only applies before the transaction reached 365 days. |
Refund requested during 00:00 - 05:00 WIB. | Automatically Rejected. |
Off-Us Transaction ≤ 7 days. | Online Refund available. |
Off-Us Transaction 8-365 days. | Turn into Manual Refund. |
Off-Us Transaction > 365 days. | Refund no longer available. |
Please visit the QRIS Integration & Testing page for more detailed information about the terms & conditions related to refund transaction.
Refund Transaction - API QRIS SNAP
Please request the access token firsthand before executing the Refund Transaction API through the Request Access Token API - SNAP section.
Service Code | 78 |
|---|---|
API Endpoint | /nicepay/api/v1.0/qr/qr-mpm-refund |
HTTP Method | POST |
Description | Refund Transaction QRIS API |
Content-type | application/json |
Request Header Parameter for Refund Transaction - API QRIS SNAP
Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
Content-Type | String (127) | Mandatory | Type of the content | Application/Json |
X-TIMESTAMP | String (25) | Mandatory | Using ISO 8601 as timestamp format. Transaction date time, in format YYYYMMDDTHH:mm:ss+07:00. Time must be in GMT+7 (Jakarta time). 2022-03-21T10:11:40+07:00. | |
Authorization | String (Variable) | Mandatory | "Bearer" + {access_token} | |
X-SIGNATURE | String (Variable) | Mandatory | Signature will be generated by Merchant. | |
X-PARTNER-ID | String (20) | Mandatory | NICEPAY Client ID (MID) | IONPAYTEST |
X-EXTERNAL-ID | String (40) | Mandatory | Unique messaging Reference ID generated by Merchant. Numeric String. Reference number that should be unique in every transaction in One Day. | |
CHANNEL-ID | String (5) | Mandatory | Unique Channel Merchant Credential ID Number. Client ID + "01" = Channel ID "IONPAYTEST" + "01" = "IONPAYTEST01" | IONPAYTEST01 |
Request Body Parameter for Refund Transaction - API QRIS SNAP
Parameter | Parameter Type | Required | NICEPAY Parameter | Description | Example |
|---|---|---|---|---|---|
originalReferenceNo | String (40) | Mandatory | tXId | NICEPAY Transaction ID or Identifier | IONPAYTEST08202106091121206416 |
originalPartnerReferenceNo | String (40) | Mandatory | referenceNo | Unique Transaction ID from Merchant | ncpy20221017161458 |
partnerRefundNo | String (40) | Mandatory | merReferenceRefundNo | Merchant Refund Reference Number | ncpy20221017161458 |
merchantId | String (10) | Mandatory | iMid | NICEPAY Merchant ID | IONPAYTEST |
externalStoreId | String (32) | Mandatory | storeCd | Merchant ID from Acquirer Pay Side | NICEPAY |
refundAmount | Object | Mandatory | "refundAmount": { "value": ..., "currency": ... }, | | |
- value | String (12) | Mandatory | amt | Transaction Amount Note: Amount Format, currently only supported IDR (Indonesian Currency Rupiah) then value includes 2 decimal digits which are seperated by a dot (.) | 10000.00 |
currency | String (3) | Mandatory | currency | Default Value: IDR | IDR |
reason | String (256) | Mandatory | cancelMsg | Reason of Cancel | Refund Trans |
additionalInfo | Object | Mandatory | "additionalInfo": { "cancelType" : "1" } | - | - |
cancelType | String (2) | Mandatory | cancelType | 1: Full Cancellation 2: Partial Cancellation | 1 |
Response Parameter for Refund Transaction - API QRIS SNAP
Parameter | Parameter Type | Required | NICEPAY Parameter | Description | Contoh |
|---|---|---|---|---|---|
responseCode | String (7) | Mandatory | responseCd | Error code to specify the error returned | 2007800 |
responseMessage | String (150) | Mandatory | responseMsg | Debug message to provide more information | Successful |
originalReferenceNo | String (40) | Mandatory | canceltXid | NICEPAY Transaction ID or Identifier that need to be cancelled | IONPAYTEST082021017161458 |
refundNo | String (40) | Mandatory | tXid | Unique Refund ID from NICEPAY | IONPAYTEST08202106091121206416 |
partnerRefundNo | String (40) | Mandatory | merReferenceRefundNo | Merchant refund reference number | ncpy20221017161458 |
refundAmount | Object | Mandatory | "refundAmount": { "value": "10000.00", "currency": "IDR" } | | |
- value | String (12) | Mandatory | amt | Transaction Amount Note: Amount Format, currently only supported IDR (Indonesian Currency Rupiah) then value includes 2 decimal digits which are seperated by a dot (.) | 10000.00 |
- currency | String (3) | Mandatory | currency | Default Value: IDR | IDR |
refundTime | String (25) | Mandatory | transDt, transTm | Update time of the individual Refund. The value will be returned for successful invalidate request. Using ISO-8601 Timestamp Format. (YYYY-MM-DDTHH:MM:SS) | 2022-07-20T07:15:00+07:00 |
additionalInfo | Object | Mandatory | - | "additionalInfo": { "cancelTrxSn": "07202210051341224326" } | - |
- cancelTrxSn | String (32) | Mandatory | - | Refund Transaction Number From Acquirer Side | 07202210051341224326 |
Sample Parameter for Refund Transaction - API QRIS SNAP
Request Parameter
const string NEW_CLIENT_ID = "IONPAYTEST";
const string NEW_EXTERNAL_ID = "eXid202402111402271707638098";
const string NEW_CHANNEL_ID = "IONPAYTEST";
const string REFUND_AMOUNT = "10000.00";
const string REFUND_CURRENCY = "IDR";
const string ORIGINAL_REF_NO = "ncpy20221017161458";
const string ORIGINAL_PARTNER_REF_NO = "IONPAYTEST08202106091121206416";
const string EXTERNAL_STORE_ID = "NICEPAY";
const string CANCEL_TYPE = "1";
const string REASON = "Refund Trans";
TestingConstant config = new TestingConstant();
string privateKey = ;
string timestamp = DateTimeOffset.Now.ToString("yyyy-MM-ddTHH:mm:sszzz");
string clientSecret = config.ClientSecret;
string channelId = NEW_CHANNEL_ID;
string random = SignatureGeneratorUtils.GenerateRandomNumberString(8);
bool isProduction = false;
bool isCloudServer = true;
string signature = SignatureGeneratorUtils.GenerateSignature(privateKey, NEW_CLIENT_ID, timestamp);
var tokenRequester = new AccessTokenRequester();
string accessTokenResponse = await tokenRequester.GetAccessTokenAsync(NEW_CLIENT_ID, signature, timestamp, isProduction, isCloudServer);
dynamic accessTokenObject = JObject.Parse(accessTokenResponse);
string accessToken = accessTokenObject.accessToken;
Console.WriteLine("Inquiry Ewallet Akses token: " + accessToken);
ApiEndpoints apiEndpoints = new ApiEndpoints();
APIService qrisService = new APIService(apiEndpoints, clientSecret, NEW_CLIENT_ID, channelId, isProduction, isCloudServer);
SnapQrisServices snapQrisServices = new SnapQrisServices(NEW_CLIENT_ID);
string createRequestBody = snapQrisServices.GenerateRefundQris(
originalReferenceNo: ORIGINAL_REF_NO,
originalPartnerReferenceNo: ORIGINAL_PARTNER_REF_NO,
merchantId: NEW_CLIENT_ID,
partnerRefundNo: "RFND" + random,
externalStoreId: EXTERNAL_STORE_ID,
value: REFUND_AMOUNT,
cancelType: CANCEL_TYPE,
currency: REFUND_CURRENCY,
reason : REASON
);
string externalId = NEW_EXTERNAL_ID;
string createResponse = await qrisService.SendPostRequest(apiEndpoints.RefundQris, accessToken, timestamp, createRequestBody, externalId);
Console.WriteLine("Refund Qris Response: " + createResponse);Response Parameter
{
"responseCode": "2007800",
"responseMessage": "Successful",
"originalReferenceNo": "IONPAYTEST082021017161458",
"refundNo": "IONPAYTEST08202106091121206416",
"partnerRefundNo": "ncpy20221017161458",
"refundAmount": {
"value": "10000.00",
"currency": "IDR"
},
"refundTime": "2022-07-20T07:15:00+07:00",
"additionalInfo": {
"cancelTrxSn": "07202210051341224326"
}
}