Skip to main content

Payment Approval

This API requests payment approval using the Authorization ID (authorizationId) received from the payment window.

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.
  • UnionPay (China UnionPay): For UnionPay transactions, you must request approval within 30 minutes of receiving the authentication response at your returnUrl. Otherwise, the provider will force cancellation.
  • Test Transactions (KakaoPay, TossPay): Test transactions for KakaoPay and TossPay (Carrier Billing) may result in actual charges. You MUST cancel them immediately after testing.

Request

Request URL
POST https://{API Domain}/api/v2/trades/approval
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)
authorizationIdString60ByteAuthorization ID received after calling the payment window. Use the value exactly as received.
shopOrderNoString40ByteMerchant Order No. Use the value exactly as requested during registration.
approvalReqDateString8ByteApproval Request Date (yyyyMMdd)
Request Example
{  
"mallId": "T5102001",
"shopOrderNo": "{Merchant Order No}",
"shopTransactionId": "{API Idempotency Key}",
"authorizationId": "{Authorization ID}",
"approvalReqDate": "{Approval Request Date}"
}

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. Returns the value sent during registration.
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
basketInfoListArrayBasket List (Returned for Split Settlement)
See basketInfoList 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) (See CP Codes)
multiCardAmountNumberCard Amount for Payco/KakaoPay/NaverPay
multiPntAmountNumberPoint Amount for Payco/KakaoPay/NaverPay
multiCponAmountNumberCoupon Amount for Payco/KakaoPay/NaverPay
cardInfoObjectCredit Card Result Info
See cardInfo below
bankInfoObjectBank Transfer Result Info
See bankInfo below
virtualAccountInfoObjectVirtual Account Issuance Info
See virtualAccountInfo below
mobInfoObjectMobile Payment Info
See mobInfo below
cashReceiptInfoObjectCash Receipt Info
See cashReceiptInfo 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)
subCardCdString3ByteBC Affiliate Card Code (Returned for Billing Key Issuance)
couponAmountNumberInstant Discount Amount
vanSnoString12ByteVAN Serial Number

paymentInfo > bankInfo (Bank Transfer Result Info)

Field NameTypeLengthRequiredDescription
bankCodeString3ByteBank Code (See Bank Codes)
bankNameString20ByteBank Name

paymentInfo > virtualAccountInfo (Virtual Account Issuance Info)

Field NameTypeLengthRequiredDescription
bankCodeString3ByteBank Code (See Bank Codes)
bankNameString20ByteBank Name
accountNoString20ByteIssued Account Number
depositNameString20ByteDepositor Name
expiryDateString14ByteExpiration Date

paymentInfo > mobInfo (Mobile Payment Info)

Field NameTypeLengthRequiredDescription
authIdString20ByteAuth ID
billIdString20ByteBill ID
mobileNoString11ByteMobile Number
mobileCdString3ByteCarrier Code

paymentInfo > cashReceiptInfo (Cash Receipt Info)

Field NameTypeLengthRequiredDescription
resCdString4ByteResponse Code
resMsgString1000ByteResponse Message
approvalNoString50ByteApproval Number
approvalDateString14ByteApproval Date/Time (yyyyMMddHHmmss)

basketInfoList (Basket List for Split Settlement)

Field NameTypeLengthRequiredDescription
productNoString20ByteUnique Product No. Same value sent during registration.
sellerIdString50ByteSeller ID
productPgCnoString20ByteProduct PG Transaction ID (Used for partial/product cancellation)
Response Example
{
// Credit Card Payment Approval Response
"resCd": "0000",
"resMsg": "Success",
"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",
"couponAmount": 0
}
}
}

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)