Skip to main content

Payment Refund

This API handles full or partial refunds for completed transactions. This is typically used for payment methods (like Virtual Account or Mobile Payment) where immediate cancellation is not possible and funds must be transferred back to the customer's account.

Note
  • For cancelling Escrow approval transactions, please refer to Escrow Status Change.
  • Two types of refund services are available: Settlement Refund (D+1) and Real-time Refund. Please consult with your sales representative to enable the specific service you need.

Real-time Refund

The refund is processed immediately to the customer's refund account upon request.

Settlement Refund (D+1)

The refund is processed to the customer's account on D+1 (Next Business Day). Since the processing is asynchronous, you must register a Webhook URL to receive the final result via notification.

Request

Request URL
POST https://{API Domain}/api/trades/revise
Content-type: application/json; charset=utf-8
Note

Supports API Idempotency (See API Idempotency)

Caution

Since final cancellation/refund takes time, you must set the timeout to 30 seconds.

Parameters

Field NameTypeLengthRequiredDescription
mallIdString8ByteMerchant ID assigned by KICC
shopTransactionIdString60ByteMerchant Transaction ID (API Idempotency Key)
pgCnoString20ByteOriginal PG Transaction ID
reviseTypeCodeString2ByteChange Type Code (See Codes)
Settlement Full: “60”, Settlement Partial: “62”
reviseSubTypeCodeString4ByteChange Sub-Type Code (See Sub-Codes)
amountNumberRefund Amount. Required for Partial Refund.
remainAmountNumberRemaining Amount. Used for validation during Partial Refund.
clientIpString20ByteRequestor IP
clientIdString32ByteRequestor ID (Merchant Admin Login ID)
cancelReqDateString8ByteRefund Request Date (yyyyMMdd). Must use the current date.
msgAuthValueString200ByteMessage Integrity Verification Value (See Message Authentication)
Contact sales for the Secret Key.
reviseMessageString100ByteReason for Refund
refundQueryFlagString1ByteRefund Result Query Flag ('Y': Query).
Required for Real-time Refund timeout recovery. Retry if response is "VTIM" or "VT00".
refundInfoObjectRefund Account Info
See refundInfo below
taxInfoObjectComplex Tax Info (Required if using Complex Tax)
See taxInfo below
basketUsedString1ByteSplit Settlement Basket Used (Y/N)
basketInfoObjectBasket Info (Required if using Split Settlement)
See basketInfo below

refundInfo (Refund Account Info)

Field NameTypeLengthRequiredDescription
refundBankCodeString3ByteRefund Bank Code (See Bank Codes)
refundAccountNoString14ByteRefund Account Number
refundDepositNameString50ByteAccount Holder Name
depositPgCnoString20ByteDeposit Transaction ID (Required for multi-deposit account refunds)

taxInfo (Complex Tax Info)

Field NameTypeLengthRequiredDescription
taxationAmountNumberRefund Taxable Amount
taxFreeAmountNumberRefund Tax-free Amount
vatAmountNumberRefund VAT Amount

basketInfo (Basket Info for Split Settlement)

Field NameTypeLengthRequiredDescription
productPgCnoString20ByteIndividual Product PG Transaction ID
sellerIdString50ByteSeller ID
Request Example
{
"mallId": "{Merchant ID}",
"shopTransactionId": "{API Idempotency Key}",
"pgCno": "{Original PG Transaction ID}",
"reviseTypeCode": "40",
"cancelReqDate": "{Current Date}",
"msgAuthValue": "{Message Auth Value}",
"reviseMessage": "Customer Changed Mind",
"refundInfo": {
"refundBankCode": "003",
"refundAccountNo": "{Refund Account No}",
"refundDepositName": "John Doe",
"depositPgCno": "{Deposit Transaction ID}"
}
}

Response

Parameters

Field NameTypeLengthRequiredDescription
resCdString4ByteResponse Code (Success: “0000”)
resMsgString1000ByteResponse Message
shopTransactionIdString60ByteReturns the value sent in the request
mallIdString8ByteMerchant ID assigned by KICC
oriPgCnoString20ByteOriginal PG Transaction ID
cancelPgCnoString20ByteRefund PG Transaction ID
cancelAmountNumberCanceled Amount
remainAmountNumberRemaining Balance (Returned if requested)
transactionDateString14ByteTransaction Date/Time (yyyyMMddHHmmss)
statusCodeString4ByteTransaction Status Code (See Status Codes)
statusMessageString50ByteTransaction Status Message
escrowUsedString1ByteEscrow Usage (Y/N)
reviseInfoObjectRefund Response Info
See reviseInfo below

reviseInfo (Refund Response Info)

Field NameTypeLengthRequiredDescription
payMethodTypeCodeString2BytePayment Method Code (See Codes)
approvalNoString50ByteRefund Approval Number
approvalDateString14ByteRefund Date/Time (yyyyMMddHHmmss)
refundInfoObjectRefund Detail Info
See refundInfo below
cashReceiptInfoObjectCash Receipt Cancel Detail
See cashReceiptInfo below

reviseInfo > refundInfo (Refund Details)

Field NameTypeLengthRequiredDescription
refundDateString14ByteExpected Refund Date (yyMMddHHmmss)
depositPgCnoString20ByteVirtual Account Deposit Transaction ID

reviseInfo > cashReceiptInfo (Cash Receipt Cancel Details)

Field NameTypeLengthRequiredDescription
resCdString4ByteResponse Code
resMsgString1000ByteResponse Message
approvalNoString50ByteCancellation Approval Number
cancelDateString14ByteCancellation Date/Time (yyyyMMddHHmmss)
Response Example
{
"resCd": "0000",
"resMsg": "Refund Successful",
"mallId": "{Requested Merchant ID}",
"shopTransactionId": "{Requested API Idempotency Key}",
"oriPgCno": "{Original PG Transaction ID}",
"cancelPgCno": "{Refund PG Transaction ID}",
"shopOrderNo": "{Merchant Order No}",
"cancelAmount": "51004",
"remainAmount": "0",
"transactionDate": "20210326090200",
"statusCode": "RF01",
"statusMessage": "Refund Requested",
"reviseInfo": {
"payMethodTypeCode": "11",
"approvalDate": "20210326090200",
"refundInfo": {
"refundDate": "20210326090200",
"depositPgCno": "{Deposit Transaction ID}"
}
}
}

Change Type Codes (reviseTypeCode)

CodeService NameDescription
60Settlement Full RefundFull Refund for Virtual Account, Mobile Payment
62Settlement Partial RefundPartial Refund for Virtual Account, Mobile Payment
63Real-time RefundReal-time Refund for Virtual Account, Mobile Payment
(Full/Partial distinction is handled by Sub-Type Code)

Change Sub-Type Codes (reviseSubTypeCode)

TypeCodeService NameDescription
Settlement RefundRF01Refund RequestSame code applies for both Full and Partial refunds
Real-time Refund10Full Refund (Auth by KICC)KICC verifies the account then processes refund
11Partial Refund (Auth by KICC)KICC verifies the account then processes refund
20Full Refund (Auth by Merchant)Merchant verifies the account then KICC processes refund
21Partial Refund (Auth by Merchant)Merchant verifies the account then KICC processes refund

Message Authentication Value

The Message Authentication Value is constructed by combining the fields below and hashing the result using HmacSHA256. (See Message Authentication)

pgCno(PG Transaction ID) + “|” + shopTransactionId(Merchant Transaction ID)