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
mallIdString8Byte✅Merchant ID assigned by KICC
shopTransactionIdString60Byte✅Merchant Transaction ID (API Idempotency Key)
shopOrderNoString40Byte✅Merchant Order No. Must be Unique.
approvalReqDateString8Byte✅Approval Request Date (yyyyMMdd)
amountNumber✅Payment Amount
currencyString2Byte✅Currency Code (KRW: “00”)
orderInfoObject✅Order Info (See orderInfo below)
payMethodInfoObject✅Payment Method Info (See payMethodInfo below)
taxInfoObjectComplex Tax Info (Required if using Complex Tax)
(See taxInfo below)

orderInfo (Order Information)​

Field NameTypeLengthRequiredDescription
goodsNameString50Byte✅Product 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
billKeyMethodInfoObject✅Billing Key Info (See billKeyMethodInfo below)
cardMethodInfoObject✅Credit Card Info (See cardMethodInfo below)

payMethodInfo > billKeyMethodInfo (Billing Key Info)​

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

payMethodInfo > cardMethodInfo (Credit Card Info)​

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

taxInfo (Complex Tax Info)​

Field NameTypeLengthRequiredDescription
taxAmountNumber✅Taxable Amount
freeAmountNumber✅Tax-free Amount
vatAmountNumber✅VAT 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
resCdString4Byte✅Response Code (Success: “0000”)
resMsgString1000Byte✅Response Message
shopTransactionIdString60Byte✅Same 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
payMethodTypeCodeString2Byte✅Payment Method Code (See Payment Method Codes)
approvalNoString100Byte✅Approval Number
approvalDateString14Byte✅Approval Date/Time (yyyyMMddHHmmss)
cpCodeString4ByteService Provider Code (Returned for Simple Pay or Points)
cardInfoObject✅Credit Card Result Info (See cardInfo below)

paymentInfo > cardInfo (Credit Card Result Info)​

Field NameTypeLengthRequiredDescription
cardNoString20Byte✅Card Number (Masked *)
issuerCodeString3Byte✅Issuer Code (See Card Codes)
issuerNameString50Byte✅Issuer Name
acquirerCodeString3Byte✅Acquirer Code (See Card Codes)
acquirerNameString50Byte✅Acquirer Name
installmentMonthNumber✅Installment Months
freeInstallmentTypeCodeString2Byte✅Interest-free Type
General: “00”, Merchant-paid: “02”, Card-company-paid: “03”
cardGubunString1Byte✅Card Type: Credit(“N”), Check(“Y”), Gift(“G”)
cardBizGubunString1Byte✅Card Owner Type: Personal(“P”), Corporate(“C”), Other(“N”)
partCancelUsedString1Byte✅Partial 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)