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 returnedpaymentPageUrlis a code URL. You must generate a QR code image using this URL for the user to scan. - Web Payment (
mweb): The returnedpaymentPageUrlis 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 Name | Type | Length | Required | Description |
|---|---|---|---|---|
| mallId | String | 8Byte | ✅ | Merchant ID assigned by KICC |
| shopTransactionId | String | 60Byte | ✅ | Merchant Transaction ID (API Idempotency Key) |
| shopOrderNo | String | 40Byte | ✅ | Merchant Order No. Must be Unique. |
| goodsName | String | 100Byte | ✅ | Product Name (English Only) |
| returnUrl | String | 256Byte | ✅ | URL to redirect to after authentication completes |
| tradeType | String | 3Byte | ✅ | Payment Type QR Payment: "native" Web Payment: "mweb" |
| notifyUrl | String | 256Byte | ✅ | Webhook URL for Payment Completion Must whitelist KICC IPs (Inbound) |
| amountInfo | Object | ✅ | Payment Amount Info (See amountInfo below) | |
| customerInfo | Object | Customer Info (See customerInfo below) |
amountInfo (Payment Amount Info)
| Field Name | Type | Length | Required | Description |
|---|---|---|---|---|
| currency | String | 3Byte | ✅ | Currency Code (KRW: "KRW", USD: "USD") |
| totalAmount | Number | ✅ | Total Payment Amount For USD: Amount * 100 (e.g., $12.03 -> 1203) |
customerInfo (Customer Information)
| Field Name | Type | Length | Required | Description |
|---|---|---|---|---|
| customerId | String | 20Byte | Customer ID | |
| customerName | String | 20Byte | Customer Name | |
| customerMail | String | 50Byte | Customer Email | |
| customerContactNo | String | 11Byte | Customer Contact No. (Numbers only) | |
| customerAddr | String | 200Byte | Customer 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 Name | Type | Length | Required | Description |
|---|---|---|---|---|
| resCd | String | 4Byte | ✅ | Response Code (Success: “0000”) |
| resMsg | String | 1000Byte | ✅ | Response Message |
| shopTransactionId | String | 60Byte | ✅ | Returns the value sent in the request |
| mallId | String | 8Byte | Merchant ID assigned by KICC | |
| pgCno | String | 20Byte | KICC Payment Transaction ID | |
| paymentPageUrl | String | 2048Byte | Payment Page URL For QR ( native): Use this to generate a QR code.For Web ( mweb): Redirect to this URL. | |
| resDetailMsg | String | 1024Byte | Detailed 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=..."
}