Skip to main content

Payment Approval

This API requests approval for Recurring Payments.

Critical Warnings
  • Timeout & Network Errors: If you do not receive a response due to a timeout or network error, you MUST verify the status using the Transaction Status Check API and cancel the transaction if a valid PG Transaction ID exists.
  • Amount Mismatch: If the payment amount in the approval result differs from your merchant's requested amount, you MUST cancel the transaction immediately.
  • DB Update Failure: If you fail to update your internal database after receiving a successful approval result, you MUST cancel the transaction to prevent data inconsistency.

Request

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

Supports API Idempotency (See API Idempotency)

Caution

Since final payment approval takes time, you must set the timeout to 30 seconds.

Parameters

Field NameTypeLengthRequiredDescription
mallIdString8ByteMerchant ID assigned by KICC
shopTransactionIdString60ByteMerchant Transaction ID (API Idempotency Key)
shopOrderNoString40ByteMerchant Order No. Must be Unique.
approvalReqDateString8ByteApproval Request Date (yyyyMMdd)
amountNumberPayment Amount
currencyString2ByteCurrency Code (KRW: “00”)
orderInfoObjectOrder Info (See orderInfo below)
payMethodInfoObjectPayment Method Info (See payMethodInfo below)
taxInfoObjectComplex Tax Info (Required if using Complex Tax)
(See taxInfo below)

orderInfo (Order Information)

Field NameTypeLengthRequiredDescription
goodsNameString50ByteProduct Name
customerInfoObjectCustomer Info (See customerInfo below)

orderInfo > customerInfo (Customer Information)

Field NameTypeLengthRequiredDescription
customerIdString20ByteCustomer ID
customerNameString20ByteCustomer Name
customerMailString50ByteCustomer Email
customerContactNoString11ByteContact Number (Numbers only)
customerAddrString200ByteCustomer Address

payMethodInfo (Payment Method Info)

Field NameTypeLengthRequiredDescription
billKeyMethodInfoObjectBilling Key Info (See billKeyMethodInfo below)
cardMethodInfoObjectCredit Card Info (See cardMethodInfo below)

payMethodInfo > billKeyMethodInfo (Billing Key Info)

Field NameTypeLengthRequiredDescription
batchKeyString60ByteBilling Key. Use the cardNo value returned in the Billing Key Issuance response.

payMethodInfo > cardMethodInfo (Credit Card Info)

Field NameTypeLengthRequiredDescription
installmentMonthNumberInstallment Months
freeInstallmentUsedBooleanInterest-free Usage (true: Use, false: Do not use)
joinCdString4ByteAffiliate Service Code

taxInfo (Complex Tax Info)

Field NameTypeLengthRequiredDescription
taxAmountNumberTaxable Amount
freeAmountNumberTax-free Amount
vatAmountNumberVAT Amount
Request Example
{  
"mallId": "T5102001",
"shopOrderNo": "{Merchant Order No}",
"shopTransactionId": "{API Idempotency Key}",
"approvalReqDate": "{Request Date}",
"amount": 1000,
"currency": "00",
"orderInfo": {
"goodsName": "Sample Product Name"
},
"payMethodInfo": {
"billKeyMethodInfo": {
"batchKey": "{Issued Billing Key}"
},
"cardMethodInfo":{
"installmentMonth": 12
}
}
}

Response

Parameters

Field NameTypeLengthRequiredDescription
resCdString4ByteResponse Code (Success: “0000”)
resMsgString1000ByteResponse Message
shopTransactionIdString60ByteSame value sent in request.
Not sent for Webhook (Notify) requests.
mallIdString8ByteMerchant ID assigned by KICC
shopOrderNoString40ByteMerchant Order No. Same value sent in request.
pgCnoString20BytePG Transaction ID
amountNumberTotal Payment Amount
transactionDateString14ByteTransaction Date/Time (yyyyMMddHHmmss)
statusCodeString4ByteTransaction Status Code (See Status Codes)
statusMessageString50ByteTransaction Status Message
msgAuthValueString200ByteUsed to verify response integrity (See Message Authentication)
Contact sales for the Secret Key.
escrowUsedString1ByteEscrow Usage (Y/N)
paymentInfoObjectApproval Info by Payment Method (See paymentInfo below)

paymentInfo (Approval Info by Payment Method)

Field NameTypeLengthRequiredDescription
payMethodTypeCodeString2BytePayment Method Code (See Payment Method Codes)
approvalNoString100ByteApproval Number
approvalDateString14ByteApproval Date/Time (yyyyMMddHHmmss)
cpCodeString4ByteService Provider Code (Returned for Simple Pay or Points)
cardInfoObjectCredit Card Result Info (See cardInfo below)

paymentInfo > cardInfo (Credit Card Result Info)

Field NameTypeLengthRequiredDescription
cardNoString20ByteCard Number (Masked *)
issuerCodeString3ByteIssuer Code (See Card Codes)
issuerNameString50ByteIssuer Name
acquirerCodeString3ByteAcquirer Code (See Card Codes)
acquirerNameString50ByteAcquirer Name
installmentMonthNumberInstallment Months
freeInstallmentTypeCodeString2ByteInterest-free Type
General: “00”, Merchant-paid: “02”, Card-company-paid: “03”
cardGubunString1ByteCard Type: Credit(“N”), Check(“Y”), Gift(“G”)
cardBizGubunString1ByteCard Owner Type: Personal(“P”), Corporate(“C”), Other(“N”)
partCancelUsedString1BytePartial Cancellation Availability (Y/N)
vanSnoString12ByteVAN Serial Number
Response Example
{
"resCd": "0000",
"resMsg": "Payment Successful",
"mallId": "{Requested Merchant ID}",
"pgCno": "{PG Transaction ID}",
"shopTransactionId": "{Requested API Idempotency Key}",
"shopOrderNo": "{Merchant Order No}",
"amount": "51004",
"transactionDate": "20210326090200",
"statusCode": "TS03",
"statusMessage": "Capture Requested",
"msgAuthValue": "e06540df5ac28ac877fb4f063d06d5f9c3ee2a3a8820a888bfc8db1577a7fe",
"escrowUsed": "N",
"paymentInfo": {
"payMethodTypeCode": "11",
"approvalNo": "00017177",
"approvalDate": "20210326090200",
"cardInfo": {
"cardNo": "45184211******81",
"issuerCode": "029",
"issuerName": "Shinhan Card",
"acquirerCode": "029",
"acquirerName": "Shinhan Card",
"installmentMonth": 0,
"freeInstallmentTypeCode": "00",
"cardGubun": "N",
"cardBizGubun": "P",
"partCancelUsed": "Y"
}
}
}

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) + “|” + amount(Payment Amount) + “|” + transactionDate(Transaction Date/Time)