거래생성
결제 화면 호출을 하기 위해 주문정보를 등록하고 결제창 호출 URL을 응답으로 받을 수 있습니다.
요청
요청 URL
POST https://{API 도메인}/api/trades/wechatpay
Content-type: application/json; charset=utf-8
참고
API 멱등성 지원 대상 (API 멱등성 참조)
파라미터
| 필드명 | 타입 | 길이 | 필수여부 | 설명 |
|---|---|---|---|---|
| mallId | String | 8Byte | ✅ | KICC에서 부여한 상점ID |
| shopTransactionId | String | 60Byte | ✅ | 상점 거래고유번호 (API 멱등성 키) |
| shopOrderNo | String | 40Byte | ✅ | 상점 주문번호 반드시 Unique 값으로 생성 |
| goodsName | String | 100Byte | ✅ | 상품명(영문만 허용) |
| returnUrl | String | 256Byte | ✅ | 인증 완료 후 이동할 URL |
| tradeType | String | 3Byte | ✅ | 요청구분 QR결제: "native" WEB결제: "mweb" |
| notifyUrl | String | 256Byte | ✅ | 결제 완료 후 결제 정보를 받을 URL 상점 방화벽 INBOUND 등록 필요 |
| amountInfo | Object | ✅ | 결제금액 정보 (아래 amountInfo 참조) | |
| customerInfo | Object | 주문 고객 정보 (아래 customerInfo 참조) |
amountInfo(결제금액 정보)
| 필드명 | 타입 | 길이 | 필수여부 | 설명 |
|---|---|---|---|---|
| currency | String | 3Byte | ✅ | 통화코드 원화: "KRW", 달러: "USD" |
| totalAmount | Number | ✅ | 총 결제금액 USD일 경우 * 100으로 요청, $12.03 이면 1203으로 요청 |
customerInfo(주문 고객정보)
| 필드명 | 타입 | 길이 | 필수여부 | 설명 |
|---|---|---|---|---|
| customerId | String | 20Byte | 고객 ID | |
| customerName | String | 20Byte | 고객명 | |
| customerMail | String | 50Byte | 고객 Email | |
| customerContactNo | String | 11Byte | 고객 연락처(숫자만 허용) | |
| customerAddr | String | 200Byte | 고객 주소 |
요청 예시
{
"mallId": "{상점ID}",
"shopTransactionId": "{API 멱등성 키}",
"shopOrderNo": "{상점 주문번호}",
"goodsName": "예시 상품명",
"returnUrl": "{상점 리턴 URL}",
"tradeType": "native",
"notifyUrl": "{결제 완료 후 결제 정보를 받을 URL}",
"amountInfo": {
"currency": "KRW",
"totalAmount": 1000
},
"customerInfo": {
"customerId": "고객ID",
"customerName": "고객명",
"customerMail": "고객 Email",
"customerContactNo": "고객 연락처",
"customerAddr": "고객 주소"
}
}
응답
파라미터
| 필드명 | 타입 | 길이 | 설명 |
|---|---|---|---|
| resCd | String | 4Byte | 결과코드(정상 : “0000”) |
| resMsg | String | 1000Byte | 결과 메시지 |
| shopTransactionId | String | 60Byte | 발급요청 시 전송한 값 그대로 사용 |
| mallId | String | 8Byte | KICC에서 부여한 상점ID |
| pgCno | String | 20Byte | KICC 결제 거래고유번호 |
| paymentPageUrl | String | 2048Byte | 결제창 호출 URL QR결제 요청 시 해당 정보로 QR코드 생성 |
| resDetailMsg | String | 1024Byte | 오류 시 위쳇에서 내려주는 상세 메시지(URL encoding) |
응답 예시
{
"resCd": "0000",
"resMsg": "정상처리",
"mallId": "{상점ID}",
"shopTransactionId": "{API 멱등성 키}",
"pgCno": "KICC 결제 거래고유번호",
"paymentPageUrl": "{결제창 호출 URL}"
}