1
|
[KRS 판매처리 (sales process) API]
|
2
|
|
3
|
1.URL
|
4
|
POST https://api.storyway.co.kr/api/wssp/insertSaleInfo
|
5
|
|
6
|
2.RequestBody (JSON) - [sales type]
|
7
|
{
|
8
|
"orderNo":"100000023", // {st_order.order_no}
|
9
|
"deptCd":"999991", // {st_order.mall_code}
|
10
|
"saleDate":"20230901", // current date (YYYYMMDD, EX:20230901)
|
11
|
"saleTime":"132153", // current time (HH24MISS, EX:132153)
|
12
|
"orderType":"1", // "1" (store order)
|
13
|
"saleAmt":10000, // {st_order.order_amount}
|
14
|
"delvAmt":1000, // {st_order.delivery_amount}
|
15
|
"pointAmt":3000, // {st_order.use_point}
|
16
|
"mileageAmt":30, // {st_order.use_money}
|
17
|
"couponAmt":450, // {st_order.coupon_amount}
|
18
|
"orderStat":"2", // {st_order.smart_order_status}
|
19
|
"itemCds":[
|
20
|
{"itemCd":"8000001", // {st_product.krs_item_cd}
|
21
|
"itemNm":"TEST1", // {st_product.product_name}
|
22
|
"pluCd":"8809174211616",// {st_product.krs_bar_cd}
|
23
|
"salePrice":9000, // {st_order_product.sale_price}
|
24
|
"saleQty":1, // {st_order_product.order_count}
|
25
|
"saleAmt":9000, // {st_order_product.product_amount}
|
26
|
"saleAmtSup":8100, // refer to calculation formula
|
27
|
"saleAmtVat":900, // refer to calculation formula
|
28
|
"ovchSaleAmt":200, // {st_order_product.discount_amount}
|
29
|
"taxType":"1" // {st_product.krs_taxn_se_cd}
|
30
|
},
|
31
|
...
|
32
|
],
|
33
|
"payKey":"222", // {st_order_payment.payment_key} (if data is not existed (when payment_amount=0), set empty
|
34
|
"payType":"1", // {st_order.payment_method}
|
35
|
"payAmt":10000, // {st_order.payment_amount}
|
36
|
"cancelAmt":0, // 0
|
37
|
"payStat":"1", // "1" (결제완료: payment complete)
|
38
|
}
|
39
|
|
40
|
1) calculation formula
|
41
|
a) "saleAmtSup"
|
42
|
- if st_product.krs_taxn_se_cd = '1', saleAmtSup = ROUND(saleAmt/1.1, 2)
|
43
|
- else, saleAmtSup = saleAmt
|
44
|
b) "saleAmtVat"
|
45
|
- if st_product.krs_taxn_se_cd = '1', saleAmtVat = saleAmt - saleAmtSup
|
46
|
- else, saleAmtSup = 0
|
47
|
|
48
|
3.RequestBody (JSON) - [sales cancel type]
|
49
|
- same with No 2 - sales except
|
50
|
"cancelAmt": {st_order.payment_amount}
|
51
|
"payStat": "2" // 결제취소 (payment cancel)
|