Skip to main content

Create Transaction

This API registers order information to invoke the payment screen and receives the Payment Page URL in the response.

Trade Type Behavior
  • QR Payment (native): The returned paymentPageUrl is a code URL. You must generate a QR code image using this URL for the user to scan.
  • Web Payment (mweb): The returned paymentPageUrl is a redirect URL. You must redirect the user's mobile browser to this URL.

Request

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

Supports API Idempotency (See API Idempotency)

Parameters

Field NameTypeLengthRequiredDescription
mallIdString8ByteMerchant ID assigned by KICC
shopTransactionIdString60ByteMerchant Transaction ID (API Idempotency Key)
shopOrderNoString40ByteMerchant Order No. Must be Unique.
goodsNameString100ByteProduct Name (English Only)
returnUrlString256ByteURL to redirect to after authentication completes
tradeTypeString3BytePayment Type
QR Payment: "native"
Web Payment: "mweb"
notifyUrlString256ByteWebhook URL for Payment Completion
Must whitelist KICC IPs (Inbound)
amountInfoObjectPayment Amount Info (See amountInfo below)
customerInfoObjectCustomer Info (See customerInfo below)

amountInfo (Payment Amount Info)

Field NameTypeLengthRequiredDescription
currencyString3ByteCurrency Code (KRW: "KRW", USD: "USD")
totalAmountNumberTotal Payment Amount
For USD: Amount * 100 (e.g., $12.03 -> 1203)

customerInfo (Customer Information)

Field NameTypeLengthRequiredDescription
customerIdString20ByteCustomer ID
customerNameString20ByteCustomer Name
customerMailString50ByteCustomer Email
customerContactNoString11ByteCustomer Contact No. (Numbers only)
customerAddrString200ByteCustomer Address
Request Example
{
"mallId": "{Merchant ID}",
"shopTransactionId": "{API Idempotency Key}",
"shopOrderNo": "{Merchant Order No}",
"goodsName": "Sample Product",
"returnUrl": "{Merchant Return URL}",
"tradeType": "native",
"notifyUrl": "{Webhook URL}",
"amountInfo": {
"currency": "KRW",
"totalAmount": 1000
},
"customerInfo": {
"customerId": "User123",
"customerName": "John Doe",
"customerMail": "test@email.com",
"customerContactNo": "01012345678",
"customerAddr": "Seoul, Korea"
}
}

Response

Parameters

Field NameTypeLengthRequiredDescription
resCdString4ByteResponse Code (Success: “0000”)
resMsgString1000ByteResponse Message
shopTransactionIdString60ByteReturns the value sent in the request
mallIdString8ByteMerchant ID assigned by KICC
pgCnoString20ByteKICC Payment Transaction ID
paymentPageUrlString2048BytePayment Page URL
For QR (native): Use this to generate a QR code.
For Web (mweb): Redirect to this URL.
resDetailMsgString1024ByteDetailed error message from WeChat (URL encoded)
Response Example
{
"resCd": "0000",
"resMsg": "Success",
"mallId": "{Merchant ID}",
"shopTransactionId": "{API Idempotency Key}",
"pgCno": "KICC Payment Transaction ID",
"paymentPageUrl": "weixin://wxpay/bizpayurl?pr=..."
}