# Qrcode Sale

#### **Usage**

- Alipay
- Wechat Payment
- QR-Code Payment from Bank
- QR-Code point redeem from Bank
- QR-Code Payment from China UnionPay
- Baidu Payment
- Bestpay
- Other QR-Code Payment
- Product coupon/cash coupon/discount coupon/Buy M Get N Free coupon /Deduct coupon
- Take out or Self booking order

#### **Transaction Flow**

- The transaction process will collect QR code message thru scanning or direct input through keypad, and it will send to [e-Buy backend](https://book.e-buy.com/link/124#bkmrk-e-buy-backend "A group /set of equipment / server to process all the transaction from e-Buy POS") server after collection to further process.

#### **action**

- `qrcodeSale`

**Request body，Cashier POS===&gt;[e-Buy Backend](https://book.e-buy.com/link/124#bkmrk-e-buy-backend "A group /set of equipment / server to process all the transaction from e-Buy POS")**

<table id="bkmrk-field-type-mandatory" style="height: 241px;"><thead><tr style="height: 29px;"><th style="width: 142px; height: 29px;">Field</th><th style="width: 168px; height: 29px;">Type</th><th style="width: 90px; height: 29px;">Mandatory</th><th style="width: 175px; height: 29px;">Description</th><th style="width: 234px; height: 29px;">Memo</th></tr></thead><tbody><tr style="height: 29px;"><td style="width: 142px; height: 29px;">traceNo</td><td style="width: 168px; height: 29px;">String</td><td style="width: 90px; height: 29px;">Yes</td><td style="width: 175px; height: 29px;">Cashier terminal trace no.</td><td style="width: 234px; height: 29px;">No repeat</td></tr><tr style="height: 29px;"><td style="width: 142px; height: 29px;">totalAmount</td><td style="width: 168px; height: 29px;">Price</td><td style="width: 90px; height: 29px;">Yes</td><td style="width: 175px; height: 29px;">Total transaction amount</td><td style="width: 234px; height: 29px;">Unit : Dollar</td></tr><tr style="height: 29px;"><td style="width: 142px; height: 29px;">undiscountAmount</td><td style="width: 168px; height: 29px;">Price</td><td style="width: 90px; height: 29px;">Yes</td><td style="width: 175px; height: 29px;">Undiscountable Amount</td><td style="width: 234px; height: 29px;">Unit : Dollar</td></tr><tr style="height: 29px;"><td style="width: 142px; height: 29px;">qrcode</td><td style="width: 168px; height: 29px;">String</td><td style="width: 90px; height: 29px;">Yes</td><td style="width: 175px; height: 29px;">QR-Code</td><td style="width: 234px; height: 29px;">串号、一维码或二维码内容</td></tr><tr style="height: 48px;"><td style="width: 142px; height: 48px;">goodsDetail</td><td style="width: 168px; height: 48px;">List&lt;[goodsDetail](https://book.e-buy.com/link/333#bkmrk-goods-detail "goodsDetail")&gt;</td><td style="width: 90px; height: 48px;">Yes</td><td style="width: 175px; height: 48px;">Goods detail</td><td style="width: 234px; height: 48px;">Mandated on goods detail verification</td></tr><tr style="height: 48px;"><td style="width: 142px; height: 48px;">memberDetail</td><td style="width: 168px; height: 48px;">Object&lt;[memberDetail](https://book.e-buy.com/link/333#bkmrk-member-detail "memberDetail")&gt;</td><td style="width: 90px; height: 48px;">No</td><td style="width: 175px; height: 48px;">Member information</td><td style="width: 234px; height: 48px;">Mandated for member payment</td></tr></tbody></table>

#### **Request body example**

```
{
    "traceNo": "99000009100010101732123",
    "totalAmount": 40.8,
    "undiscountAmount": 0,
    "qrcode": "280123121234567890",
    "goodsDetail": [
        {
            "goodsCategory": "001",
            "goodsId": "P00001",
            "goodsName": "牙膏",
            "price": 8,
            "quantity": 2,
            "rebateCode": "000"
        },
        {
            "goodsCategory": "101",
            "goodsId": "P00002",
            "goodsName": "洗发水",
            "price": 24.8,
            "quantity": 1,
            "rebateCode": "000"
        }
    ],
    "memberDetail": {
        "memberId": "M000001545",
        "memberName": "TONY",
        "grade": "1",
        "status": "1",
        "balance": 1000.00,
        "pointBalance": 30000
    }
}

```

**Response body，[e-Buy Backend](https://book.e-buy.com/link/124#bkmrk-e-buy-backend "A group /set of equipment / server to process all the transaction from e-Buy POS")===&gt;Cashier POS**

<table id="bkmrk-field-type-mandatory-0"><thead><tr><th style="width: 148px;">Field</th><th style="width: 145px;">Type</th><th style="width: 54px;">Mandatory</th><th style="width: 184px;">Description</th><th style="width: 274px;">Memo</th></tr></thead><tbody><tr><td style="width: 148px;">traceNo</td><td style="width: 145px;">String</td><td style="width: 54px;">Yes</td><td style="width: 184px;">Cashier terminal trace no.</td><td style="width: 274px;">No repeat</td></tr><tr><td style="width: 148px;">orderNo</td><td style="width: 145px;">String</td><td style="width: 54px;">Yes</td><td style="width: 184px;">Order No. from e-Buy</td><td style="width: 274px;">made by Ebuy</td></tr><tr><td style="width: 148px;">transDate</td><td style="width: 145px;">String</td><td style="width: 54px;">Yes</td><td style="width: 184px;">Transaction time</td><td style="width: 274px;">Format：yyyyMMddHHmmss</td></tr><tr><td style="width: 148px;">returnCode</td><td style="width: 145px;">String</td><td style="width: 54px;">Yes</td><td style="width: 184px;">Return code</td><td style="width: 274px;">00 represent successful transaction, else represent fail</td></tr><tr><td style="width: 148px;">returnDesc</td><td style="width: 145px;">String</td><td style="width: 54px;">Yes</td><td style="width: 184px;">Return message</td><td style="width: 274px;">Detail explanation / error message per transaction result</td></tr><tr><td style="width: 148px;">paidAmount</td><td style="width: 145px;">Price</td><td style="width: 54px;">Yes</td><td style="width: 184px;">Total amount paid</td><td style="width: 274px;">Face Value. Unit : Dollar</td></tr><tr><td style="width: 148px;">receiptAmount</td><td style="width: 145px;">Price</td><td style="width: 54px;">No</td><td style="width: 184px;">Merchant actual received amount</td><td style="width: 274px;">Net Value. Unit : Dollar</td></tr><tr><td style="width: 148px;">invoiceAmount</td><td style="width: 145px;">Price</td><td style="width: 54px;">No</td><td style="width: 184px;">Merchant invoice amount</td><td style="width: 274px;">Unit : Dollar</td></tr><tr><td style="width: 148px;">exchangeRate</td><td style="width: 145px;">Number(8,6)</td><td style="width: 54px;">No</td><td style="width: 184px;">Exchange Rate</td><td style="width: 274px;">The rate of conversion the currency given in the request to CNY.</td></tr><tr><td style="width: 148px;">currency</td><td style="width: 145px;">String</td><td style="width: 54px;">No</td><td style="width: 184px;">Currency</td><td style="width: 274px;">For example: CNY</td></tr><tr><td style="width: 148px;">discountCode</td><td style="width: 145px;">String</td><td style="width: 54px;">No</td><td style="width: 184px;">Discount Code</td><td style="width: 274px;">assigned by Cashier POS</td></tr><tr><td style="width: 148px;">discountNum</td><td style="width: 145px;">Number</td><td style="width: 54px;">No</td><td style="width: 184px;">numbers of discountCode</td><td style="width: 274px;">用于入账计折扣类型的数量</td></tr><tr><td style="width: 148px;">tenderCode</td><td style="width: 145px;">String</td><td style="width: 54px;">No</td><td style="width: 184px;">Tender Code</td><td style="width: 274px;">assigned by Cashier POS,record payment method，like：2016120101|20.00 is payment 20yuan</td></tr><tr><td style="width: 148px;">activityProductNo</td><td style="width: 145px;">String</td><td style="width: 54px;">No</td><td style="width: 184px;">Activity Product no.</td><td style="width: 274px;"> </td></tr><tr><td style="width: 148px;">activityProductName</td><td style="width: 145px;">String</td><td style="width: 54px;">No</td><td style="width: 184px;">Activity Product name</td><td style="width: 274px;"> </td></tr><tr><td style="width: 148px;">goodsDetail</td><td style="width: 145px;">List&lt;[goodsDetail](https://book.e-buy.com/link/333#bkmrk-goods-detail "goodsDetail")&gt;</td><td style="width: 54px;">No</td><td style="width: 184px;">Paid product detail</td><td style="width: 274px;">Backend response paid product detail</td></tr><tr><td style="width: 148px;">fundChannel</td><td style="width: 145px;">List&lt;[fundChannel](https://book.e-buy.com/link/333#bkmrk-fund-channel "fundChannel")&gt;</td><td style="width: 54px;">No</td><td style="width: 184px;">Channel of fund</td><td style="width: 274px;"> </td></tr><tr><td style="width: 148px;">printDetail</td><td style="width: 145px;">Object&lt;[printDetail](https://book.e-buy.com/link/333#bkmrk-print-detail "printDetail")&gt;</td><td style="width: 54px;">No</td><td style="width: 184px;">Printing message</td><td style="width: 274px;">Provided if required to print on the receipt</td></tr><tr><td style="width: 148px;">memberDetail</td><td style="width: 145px;">Object&lt;[memberDetail](https://book.e-buy.com/link/333#bkmrk-member-detail "memberDetail")&gt;</td><td style="width: 54px;">No</td><td style="width: 184px;">Member information</td><td style="width: 274px;">Member info return message on this transaction</td></tr></tbody></table>

#### **Response body example**

```
{
    "traceNo": "99000009100010101732123",
    "orderNo": "171698602301",
    "transDate": "20161231120533",
    "returnCode": "00",
    "returnDesc": "SUCCESS",
    "paidAmount": 40.8,
    "receiptAmount": 40.8,
    "invoiceAmount": 40.8,
    "exchangeRate": 6.0939,
    "currency": "CNY",
    "discountCode": "0001",
    "discountNum": 20,
    "tenderCode": "8001",
    "activityProductNo": "2016123102",
    "activityProductName": "支付宝支付",
    "goodsDetail": [
        {
            "goodsCategory": "001",
            "goodsId": "P00001",
            "goodsName": "牙膏",
            "price": 8,
            "quantity": 2,
            "rebateCode": "000",
            "activityNo": "2016123101",
            "memo": "100123456789"
        },
        {
            "goodsCategory": "101",
            "goodsId": "P00002",
            "goodsName": "洗发水",
            "price": 24.8,
            "quantity": 1,
            "rebateCode": "000",
            "activityNo": "2016123101",
            "memo": "100123456789"
        }
    ],
    "fundChannel": [
        {
            "channelNo": "001",
            "channelName": "用户实付现金",
            "channelAmount": "20.8"
        },
        {
            "channelNo": "002",
            "channelName": "用户积分支付",
            "channelAmount": "20"
        }
    ],
    "printDetail": {
        "cardNo64": "622562****8888",
        "bank": "中国银行",
        "paymentOrderNo": "201612315689412157458787",
        "paymentUser": "139****@163.com",
        "pointSale": "20000",
        "qrCode1": "htt://www.xxx.com/url",
        "qrCode2": "",
        "qrCode3": "",
        "barCode1": "12345679",
        "barCode2": "",
        "barCode3": ""
    },
    "memberDetail": {
        "memberId": "M000001545",
        "memberName": "TONY",
        "grade": "1",
        "status": "1",
        "balance": 1000.00,
        "pointBalance": 30000
    }
}
```