# e-Buy 收银一体化 英文

# Introduction

### Purpose

This is a integration system protocol between Cashier Terminal and Backend system.

To enable the Cashier Terminal and [e-Buy backend](https://book.e-buy.com/link/136#bkmrk-e-buy-backend "A group /set of equipment / server to process all the transaction from e-Buy POS") payment and redemption business real-time transaction process and synchronization, reduce reconciliation errors, facilitate business transaction in real-time integration to [e-Buy backend](https://book.e-buy.com/link/136#bkmrk-e-buy-backend "A group /set of equipment / server to process all the transaction from e-Buy POS") system, in order to support multiple business transaction demand, such as multiple payment method and redemption method.

### Physical Architecture

![Network](http://portal.e-buychina.com.cn/doc/Public/Uploads/2017-04-08/58e8f27eb9497.png "Network")

**Network illustration：**

- 1.Cashier POS and [MIS-POS](https://book.e-buy.com/link/136#bkmrk-mis-pos "Installed in merchants in-store POS machine, providing the operation activity to support and exchange function") integration is thru USB port or serial port, each Cashier Terminalis thru network connection.
- 2.Each store (include 1 or more cashier POS) is connected thru Public VPN back to [e-Buy Backend](https://book.e-buy.com/link/136#bkmrk-e-buy-backend "A group /set of equipment / server to process all the transaction from e-Buy POS").
- 3.[e-Buy Backend](https://book.e-buy.com/link/136#bkmrk-e-buy-backend "A group /set of equipment / server to process all the transaction from e-Buy POS") is connected to each Credit card banking system thru leased line.

### Logic Architecture

@startuml

skinparam monochrome reverse skinparam sequence { ParticipantFontSize 24 ActorFontSize 24 ArrowFontSize 22 GroupFontSize 20 }

participant "Cashier POS" participant "[e-Buy Backend](https://book.e-buy.com/link/136#bkmrk-e-buy-backend "A group /set of equipment / server to process all the transaction from e-Buy POS")" #99FF99

"Cashier POS" -&gt; "[e-Buy Backend](https://book.e-buy.com/link/136#bkmrk-e-buy-backend "A group /set of equipment / server to process all the transaction from e-Buy POS")" : 1.Request ||| "[e-Buy Backend](https://book.e-buy.com/link/136#bkmrk-e-buy-backend "A group /set of equipment / server to process all the transaction from e-Buy POS")" -&gt; "Cashier POS" : 2.Response ||| ||| @enduml

**Flow illustration:**

- 1.Cashier POS initiates the payment transaction, including the related transaction information to push to the [e-Buy Backend](https://book.e-buy.com/link/136#bkmrk-e-buy-backend "A group /set of equipment / server to process all the transaction from e-Buy POS").
- 2.[e-Buy Backend](https://book.e-buy.com/link/136#bkmrk-e-buy-backend "A group /set of equipment / server to process all the transaction from e-Buy POS") will process as per type of transaction provided. If required, corresponding data will send to the Card Issued Organization to process accordingly. At final, will return back the result to the Cashier POS.

# Glossory

#### Socket

Communication is based on TCP/IP

#### MIS-POS

Installed in merchants in-store POS machine, providing the operation activity to support and exchange function

#### e-Buy POSP

A group / set of network equipment and server to process [e-Buy POS](https://book.e-buy.com/link/136#bkmrk-e-buy-pos "Same as MIS-POS, the device is installed in merchant on-site, providing the operation activity to support and exchange function") all transaction activity

#### BCD

Binary numeric representation format, such as 0x99, it represents the value of 99

#### TLV

Communication protocol commonly used data formats, Comprise 3 parts: "Tag", "Length" &amp; "Value"

#### PINPAD

PIN entry device

#### e-Buy POS

Same as [MIS-POS](https://book.e-buy.com/link/136#bkmrk-mis-pos "Installed in merchants in-store POS machine, providing the operation activity to support and exchange function"), the device is installed in merchant on-site, providing the operation activity to support and exchange function

#### e-Buy Backend

A group /set of equipment / server to process all the transaction from [e-Buy POS](https://book.e-buy.com/link/136#bkmrk-e-buy-pos "Same as MIS-POS, the device is installed in merchant on-site, providing the operation activity to support and exchange function")

#### Middleware

Individual operation in cashier terminal, monitoring the local port, it will also download the key and auto sign in, auto update and prompt transaction options

# API Introduction



# Invoke Method

<table id="bkmrk-content-description-"><thead><tr><th>Content</th><th>Description</th></tr></thead><tbody><tr><td>Protocal</td><td>HTTP/HTTPS</td></tr><tr><td>HTTP Method</td><td>POST (application/json)</td></tr><tr><td>Message Type</td><td>JSON</td></tr><tr><td>Charset</td><td>UTF-8</td></tr><tr><td>Signature Algorithm</td><td>MD5</td></tr><tr><td>Signature Verify</td><td>Request and Response are both required</td></tr></tbody></table>

# Message Structure

**Request and response message are both use following structure**

<table id="bkmrk-no.-parameter-format"><thead><tr><th style="width: 46px;">No.</th><th style="width: 93px;">Parameter</th><th style="width: 84px;">Format</th><th style="width: 143px;">Reference</th><th style="width: 144px;">Description</th><th style="width: 299px;">Memo</th></tr></thead><tbody><tr><td style="width: 46px;">1</td><td style="width: 93px;">action</td><td style="width: 84px;">String</td><td style="width: 143px;">inquiry</td><td style="width: 144px;">Transaction Type</td><td style="width: 299px;">The specific interfaces with detail description</td></tr><tr><td style="width: 46px;">2</td><td style="width: 93px;">deviceNo</td><td style="width: 84px;">String</td><td style="width: 143px;">POS01</td><td style="width: 144px;">Cashier Terminal No.</td><td style="width: 299px;">To identify the Cashier Terminal used in this transaction</td></tr><tr><td style="width: 46px;">3</td><td style="width: 93px;">shopNo</td><td style="width: 84px;">String</td><td style="width: 143px;">CN123456</td><td style="width: 144px;">Shop No.</td><td style="width: 299px;">To identify the merchant / shop in this transaction</td></tr><tr><td style="width: 46px;">4</td><td style="width: 93px;">brand</td><td style="width: 84px;">String</td><td style="width: 143px;">663</td><td style="width: 144px;">Brand No.</td><td style="width: 299px;">To identify the Brand used in this transaction, allocated by e-Buy</td></tr><tr><td style="width: 46px;">5</td><td style="width: 93px;">body</td><td style="width: 84px;">String</td><td style="width: 143px;">BASE64</td><td style="width: 144px;">Message Detail</td><td style="width: 299px;">The specific interfaces with detail description</td></tr><tr><td style="width: 46px;">6</td><td style="width: 93px;">mwVersion</td><td style="width: 84px;">String</td><td style="width: 143px;">20161010</td><td style="width: 144px;">[Middleware](https://book.e-buy.com/link/136#bkmrk-middleware "Individual operation in cashier terminal, monitoring the local port, it will also download the key and auto sign in, auto update and prompt transaction options") Version</td><td style="width: 299px;">The [Middleware](https://book.e-buy.com/link/136#bkmrk-middleware "Individual operation in cashier terminal, monitoring the local port, it will also download the key and auto sign in, auto update and prompt transaction options") is compatible to process with different backend system</td></tr><tr><td style="width: 46px;">7</td><td style="width: 93px;">ptlVersion</td><td style="width: 84px;">String</td><td style="width: 143px;">20161010</td><td style="width: 144px;">Protocal Version</td><td style="width: 299px;">The protocol is compatible to process with different backend system</td></tr><tr><td style="width: 46px;">8</td><td style="width: 93px;">posVersion</td><td style="width: 84px;">String</td><td style="width: 143px;">20161010</td><td style="width: 144px;">[e-Buy POS](https://book.e-buy.com/link/136#bkmrk-e-buy-pos "Same as MIS-POS, the device is installed in merchant on-site, providing the operation activity to support and exchange function") Version</td><td style="width: 299px;">The [e-Buy POS](https://book.e-buy.com/link/136#bkmrk-e-buy-pos "Same as MIS-POS, the device is installed in merchant on-site, providing the operation activity to support and exchange function") is compatible to process with different backend system</td></tr><tr><td style="width: 46px;">9</td><td style="width: 93px;">timestamp</td><td style="width: 84px;">String</td><td style="width: 143px;">1483372334</td><td style="width: 144px;">Unix Format</td><td style="width: 299px;">Unit : second，中间件需要在收到返回时同步该时间</td></tr><tr><td style="width: 46px;">10</td><td style="width: 93px;">sign</td><td style="width: 84px;">String</td><td style="width: 143px;">7E65B60DCFA42B04</td><td style="width: 144px;">Signature</td><td style="width: 299px;">See detail : Signature Algorithm</td></tr></tbody></table>

**example**

```
 {
     "action" : "inquiry",
     "deviceNo" : "POS01",
     "shopNo" : "CN123456",
     "brand" : "663",
     "body" : "ewogICAgICAgICAidHJhY2VObyI6ICI5OTAwMDAwOTEwMDAxMDEwMTczMjEyMyIsCiAgICAgICAgICJvcmlnaW5hbFRyYWNlTm8iOiAiOTkwMDAwMDkxMDAwMTAxMDE3MzIxMjQiCiAgICAgfQ==",
     "mwVersion" : "20161010",
     "ptlVersion" : "20161010",
     "posVersion" : "20161010",
     "timestamp" : "1483372334",
     "sign" : "7E65B60DCFA42B04"
 }
```

# Signature process

- Combine message parameter All parameter must be by ASCII sequential order, except sign and body. Take the “ parameter number 1 = parameter value 1, parameter number 2 = parameter value 2” to connect all parameters.
- Combine mwMacKey Sign in KEY will place to the last parameter with agreed key “KEY=xxxxx”. Before downloadKey，we do not have mwMacKey，so we use assigned key when invoke downloadKey. Before signin，we do not have mwMacKey，so we use mwTmk when invoke signin.
- Signature Sign in value calculate per MD5-32 encryption and then converted to HEX in capital letter, named Sign-in value, as sign parameter.
- PS when parameter value is null or blank, the parameter is not required to stated

#### **example**

```
 {
     "action" : "inquiry",
     "deviceNo" : "POS01",
     "shopNo" : "CN123456",
     "brand" : "663",
     "body" : "ewogICAgICAgICAidHJhY2VObyI6ICI5OTAwMDAwOTEwMDAxMDEwMTczMjEyMyIsCiAgICAgICAgICJvcmlnaW5hbFRyYWNlTm8iOiAiOTkwMDAwMDkxMDAwMTAxMDE3MzIxMjQiCiAgICAgfQ==",
     "mwVersion" : "20161010",
     "ptlVersion" : "20161010",
     "posVersion" : "20161010",
     "timestamp" : "1483372334",
     "sign" : "F38545F4D74B5C10A9EBBC053ED9D1CF"
 }

```

#### **mwMacKey**

```
94365019BBF9CEEAB0DF658E67754A70

```

#### **Combine message parameter**

```
action=inquiry&body=ewogICAgICAgICAidHJhY2VObyI6ICI5OTAwMDAwOTEwMDAxMDEwMTczMjEyMyIsCiAgICAgICAgICJvcmlnaW5hbFRyYWNlTm8iOiAiOTkwMDAwMDkxMDAwMTAxMDE3MzIxMjQiCiAgICAgfQ==&brand=663&deviceNo=POS01&mwVersion=20161010&posVersion=20161010&ptlVersion=20161010&shopNo=CN123456&timestamp=1483372334

```

#### **Combine KEY**

```
action=inquiry&body=ewogICAgICAgICAidHJhY2VObyI6ICI5OTAwMDAwOTEwMDAxMDEwMTczMjEyMyIsCiAgICAgICAgICJvcmlnaW5hbFRyYWNlTm8iOiAiOTkwMDAwMDkxMDAwMTAxMDE3MzIxMjQiCiAgICAgfQ==&brand=663&deviceNo=POS01&mwVersion=20161010&posVersion=20161010&ptlVersion=20161010&shopNo=CN123456&timestamp=1483372334&KEY=94365019BBF9CEEAB0DF658E67754A70

```

**Signature** F38545F4D74B5C10A9EBBC053ED9D1CF

# Encryption Algorithm

#### **3DES Introduction**

- In cryptography, Triple DES (3DES), officially the Triple Data Encryption Algorithm (TDEA or Triple DEA), is a symmetric-key block cipher, which applies the Data Encryption Standard (DES) cipher algorithm three times to each data block.
- The original DES cipher's key size of 56 bits was generally sufficient when that algorithm was designed, but the availability of increasing computational power made brute-force attacks feasible. Triple DES provides a relatively simple method of increasing the key size of DES to protect against such attacks, without the need to design a completely new block cipher algorithm.

#### **Algorithm**

Triple DES uses a "key bundle" that comprises three DES keys, K1, K2 and K3, each of 56 bits (excluding parity bits). The encryption algorithm is:

ciphertext = EK3(DK2(EK1(plaintext))) I.e., DES encrypt with K1, DES decrypt with K2, then DES encrypt with K3.

Decryption is the reverse:

plaintext = DK1(EK2(DK3(ciphertext))) I.e., decrypt with K3, encrypt with K2, then decrypt with K1.

Each triple encryption encrypts one block of 64 bits of data.

In each case the middle operation is the reverse of the first and last. This improves the strength of the algorithm when using keying option 2, and provides backward compatibility with DES with keying option 3.

#### **Keying options**

The standards define three keying options:

Keying option 1 All three keys are independent. Keying option 2 K1 and K2 are independent, and K3 = K1. Keying option 3 All three keys are identical, i.e. K1 = K2 = K3. Keying option 1 is the strongest, with 3 × 56 = 168 independent key bits.

Keying option 2 provides less security, with 2 × 56 = 112 key bits. This option is stronger than simply DES encrypting twice, e.g. with K1 and K2, because it protects against meet-in-the-middle attacks.

Keying option 3 is equivalent to DES, with only 56 key bits. It provides backward compatibility with DES, because the first and second DES operations cancel out. It is no longer recommended by the National Institute of Standards and Technology (NIST),\[5\] and is not supported by ISO/IEC 18033-3.

Each DES key is nominally stored or transmitted as 8 bytes, each of odd parity,\[12\] so a key bundle requires 24 bytes for option 1, 16 for option 2, or 8 for option 3.

#### **Encryption example**

Set pinKey: `9D93D15D6A3913AB4151C456A80841EF`:

```
K1 = 9D93D15D6A3913AB
K2 = 4151C456A80841EF
K3 = 9D93D15D6A3913AB

```

Data M in HEX：`3132333435363738`，encryption process：

```
DES1_RESULT = Ek(M，K1)
DES2_RESULT = Dk(DES1_RESULT，K2)
C = Ek(DES2_RESULT，K3)

```

Result C：`C63AABF759BDE968`

#### **Decryption example**

Set pinKey: `9D93D15D6A3913AB4151C456A80841EF`:

```
K1 = 9D93D15D6A3913AB
K2 = 4151C456A80841EF
K3 = 9D93D15D6A3913AB

```

Data C in HEX：`C63AABF759BDE968`，decryption process：

```
DES1_RESULT = Dk(C，K3)
DES2_RESULT = Ek(DES1_RESULT，K2)
M = Dk(DES2_RESULT，K1)

```

Results M：`3132333435363738`

# Password Encryption

#### **ANSI X9.8 Format（带主帐号信息）**

- PIN BLOCK 格式：等于 PIN 按位异或主帐号
- PIN 格式：（个人识别码 Personal Identity Number）总共有8个byte长度，分为两个部分;（类似数据包的格式）
    
    ```
    Byte 1 PIN的长度
    Byte 2 – Byte 3/4/5/6/7    4--12个PIN(每个PIN占4个BIT)
    Byte4/5/6/7/8 – Byte 8 FILLER “F” (每个“F“占4个BIT)
    
    ```
- PAN（主帐号 Primary Account Number）同样包含8个byte，格式如下：
    
    ```
    Byte 1 — Byte 2 0x00 0x00
    Byte 3 — Byte 8 12个主帐号字符（最后一位为校验位）
    12位字符主帐号的取法：取主帐号的右12位（不包括最右边的校验位），不足12位左补“0X00”。
    
    ```

#### **加密举例**

- 明文 PIN：`123456`
- 主帐号 PAN：`123456789012345678`
- 截取下的主帐号为：`678901234567` （最后一位校验位8的前12位字符为截取的主帐号）
- 则用于PIN加密的主帐号为：`0x00 0x00 0x67 0x89 0x01 0x23 0x45 0x67`
- 则 PIN BLOCK （PIN按位异或主帐号PAN） ```
    即是为：  0x06 0x12 0x34 0x56 0xFF 0xFF 0xFF 0xFF
    异或上：  0x00 0x00 0x67 0x89 0x01 0x23 0x45 0x67
    结果为：  0x06 0x12 0x53 0xDF 0xFE 0xDC 0xBA 0x98
    ```

# Parameter Object



# Card Info

- JSON Key is `cardInfo`, only in Request message, not mandatory

<table id="bkmrk-field-type-mandatory"><thead><tr><th style="width: 80px;">Field</th><th style="width: 57px;">Type</th><th style="width: 94px;">Mandatory</th><th style="width: 94px;">Description</th><th style="width: 482px;">Memo</th></tr></thead><tbody><tr><td style="width: 80px;">cardNo</td><td style="width: 57px;">String</td><td style="width: 94px;">Yes</td><td style="width: 94px;">Card No</td><td style="width: 482px;">Mandated for Credit Card payment transaction</td></tr><tr><td style="width: 80px;">password</td><td style="width: 57px;">String</td><td style="width: 94px;">No</td><td style="width: 94px;">Password</td><td style="width: 482px;">Mandated when password is required, apply Financial encryption</td></tr><tr><td style="width: 80px;">valid</td><td style="width: 57px;">String</td><td style="width: 94px;">No</td><td style="width: 94px;">Valid Date</td><td style="width: 482px;">Mandated for Credit Card payment transaction, format : YYMM</td></tr><tr><td style="width: 80px;">track1</td><td style="width: 57px;">String</td><td style="width: 94px;">No</td><td style="width: 94px;">Track 1</td><td style="width: 482px;"> </td></tr><tr><td style="width: 80px;">track2</td><td style="width: 57px;">String</td><td style="width: 94px;">No</td><td style="width: 94px;">Track 2</td><td style="width: 482px;">Mandated for Credit Card payment transaction, apply financial encryption</td></tr><tr><td style="width: 80px;">track3</td><td style="width: 57px;">String</td><td style="width: 94px;">No</td><td style="width: 94px;">Track 3</td><td style="width: 482px;"> </td></tr><tr><td style="width: 80px;">cardSn</td><td style="width: 57px;">String</td><td style="width: 94px;">No</td><td style="width: 94px;">IC Serial</td><td style="width: 482px;">Mandated for credit card payment transaction, such as IC card, apply Financial encryption</td></tr><tr><td style="width: 80px;">icData</td><td style="width: 57px;">String</td><td style="width: 94px;">No</td><td style="width: 94px;">IC Data</td><td style="width: 482px;">Mandated for credit card payment transaction, such as IC card, apply Financial encryption</td></tr><tr><td style="width: 80px;">cardType</td><td style="width: 57px;">String</td><td style="width: 94px;">No</td><td style="width: 94px;">Card Type</td><td style="width: 482px;">See details</td></tr><tr><td style="width: 80px;">tc</td><td style="width: 57px;">String</td><td style="width: 94px;">No</td><td style="width: 94px;">Transaction Certificate</td><td style="width: 482px;">Transaction Certificate</td></tr></tbody></table>

**cardNo encryption**

- cardNo 3DES Encryption with pinKey，result format is HEX，see：[Encryption Algorithm](https://book.e-buy.com/books/e-buy/page/encryption-algorithm "Encryption Algorithm")

**password encryption**

- password ANSI X.98 Encryption with pinKey，result format is HEX，see：[Password Encryption](https://book.e-buy.com/books/e-buy/page/password-encryption "Password Encryption")

**track1 encryption**

- track1 3DES Encryption with pinKey，result format is HEX，see：[Encryption Algorithm](https://book.e-buy.com/books/e-buy/page/encryption-algorithm "Encryption Algorithm")

**track2 encryption**

- track2 3DES Encryption with pinKey，result format is HEX，see：[Encryption Algorithm](https://book.e-buy.com/books/e-buy/page/encryption-algorithm "Encryption Algorithm")

**track3 encryption**

- track3 3DES Encryption with pinKey，result format is HEX，see：[Encryption Algorithm](https://book.e-buy.com/books/e-buy/page/encryption-algorithm "Encryption Algorithm")

**cardType Details**

- 00 magnetic stripe card
- 01 IC card
- 02 NFC IC card
- 03 Manully enter card Number
- 04 scan qrcode
- 05 other type
- 06 collected by Cashier POS
- 07 Apple Pay
- 08 Samsung Pay
- 09 Huawei Pay
- 10 Mi Pay

# Goods Detail

- JSON Key为`goodsDetail`, mandatory

<table id="bkmrk-field-type-mandatory" style="width: 846px;"><thead><tr><th style="width: 112px;">Field</th><th style="width: 65px;">Type</th><th style="width: 88px;">Mandatory</th><th style="width: 118px;">Description</th><th style="width: 463px;">Memo</th></tr></thead><tbody><tr><td style="width: 112px;">goodsCategory</td><td style="width: 65px;">String</td><td style="width: 88px;">Yes</td><td style="width: 118px;">Goods Category</td><td style="width: 463px;"> </td></tr><tr><td style="width: 112px;">goodsId</td><td style="width: 65px;">String</td><td style="width: 88px;">Yes</td><td style="width: 118px;">Goods ID</td><td style="width: 463px;"> </td></tr><tr><td style="width: 112px;">goodsName</td><td style="width: 65px;">String</td><td style="width: 88px;">Yes</td><td style="width: 118px;">Goods Name</td><td style="width: 463px;">Used for report , receipt, slip printing</td></tr><tr><td style="width: 112px;">goodsSpec</td><td style="width: 65px;">String</td><td style="width: 88px;">No</td><td style="width: 118px;">Goods Spec</td><td style="width: 463px;">Shows in report or receipt</td></tr><tr><td style="width: 112px;">price</td><td style="width: 65px;">Price</td><td style="width: 88px;">Yes</td><td style="width: 118px;">Price</td><td style="width: 463px;">Unit : dollar</td></tr><tr><td style="width: 112px;">quantity</td><td style="width: 65px;">Integer</td><td style="width: 88px;">Yes</td><td style="width: 118px;">Quantity</td><td style="width: 463px;"> </td></tr><tr><td style="width: 112px;">rebateCode</td><td style="width: 65px;">String</td><td style="width: 88px;">No</td><td style="width: 118px;">Rebate Code</td><td style="width: 463px;">Cashier Terminal has pre-set the discount, mandated</td></tr><tr><td style="width: 112px;">activityNo</td><td style="width: 65px;">String</td><td style="width: 88px;">No</td><td style="width: 118px;">Activity No</td><td style="width: 463px;">Once [e-Buy backend](https://book.e-buy.com/link/136#bkmrk-e-buy-backend "A group /set of equipment / server to process all the transaction from e-Buy POS") system confirm transaction success, a transaction activity number will return back</td></tr><tr><td style="width: 112px;">memo</td><td style="width: 65px;">String</td><td style="width: 88px;">No</td><td style="width: 118px;">Memo</td><td style="width: 463px;">Once [e-Buy backend](https://book.e-buy.com/link/136#bkmrk-e-buy-backend "A group /set of equipment / server to process all the transaction from e-Buy POS") system confirm transaction success, some information will return such as electronic voucher number</td></tr><tr><td style="width: 112px;">voucherId</td><td style="width: 65px;">String</td><td style="width: 88px;">No</td><td style="width: 118px;">Voucher ID</td><td style="width: 463px;">Return when have voucher\_detail</td></tr></tbody></table>

# Fund Channel

- JSON Key is `fundChannel`, only in Response message, not mandatory

<table id="bkmrk-field-type-mandatory"><thead><tr><th style="width: 123px;">Field</th><th style="width: 83.9844px;">Type</th><th style="width: 86.9844px;">Mandatory</th><th style="width: 125px;">Description</th><th style="width: 379.031px;">Memo</th></tr></thead><tbody><tr><td style="width: 123px;">channelNo</td><td style="width: 83.9844px;">String</td><td style="width: 86.9844px;">Yes</td><td style="width: 125px;">Channel No</td><td style="width: 379.031px;">Channel No</td></tr><tr><td style="width: 123px;">channelName</td><td style="width: 83.9844px;">String</td><td style="width: 86.9844px;">Yes</td><td style="width: 125px;">Channel Name</td><td style="width: 379.031px;">Channel Name</td></tr><tr><td style="width: 123px;">channelAmount</td><td style="width: 83.9844px;">Price</td><td style="width: 86.9844px;">Yes</td><td style="width: 125px;">Channel Amount</td><td style="width: 379.031px;">Channel Amount</td></tr><tr><td style="width: 123px;">sectionNo</td><td style="width: 83.9844px;">String</td><td style="width: 86.9844px;">No</td><td style="width: 125px;">Section no</td><td style="width: 379.031px;">Distribution by financial staff, can be entry into the cash register after matching</td></tr></tbody></table>

- supported fund channel：

<table id="bkmrk-channelno-channelnam"><thead><tr><th style="width: 128px;">channelNo</th><th style="width: 229px;">channelName</th><th style="width: 452px;">Description</th></tr></thead><tbody><tr><td style="width: 128px;">user\_real\_money</td><td style="width: 229px;">User paid real money</td><td style="width: 452px;">Example：Alipay balance、Alipay Yuebao、Wechat balance、Debit Card or Credit card etc.</td></tr><tr><td style="width: 128px;">user\_balance</td><td style="width: 229px;">paid by user balance</td><td style="width: 452px;">Example：Alipay balance、Alipay Yuebao、Wechat balance etc.</td></tr><tr><td style="width: 128px;">user\_bank\_card</td><td style="width: 229px;">paid by user bank card</td><td style="width: 452px;">Example：Debit Card or Credit card</td></tr><tr><td style="width: 128px;">user\_credit</td><td style="width: 229px;">paid by user e-Wallet credit</td><td style="width: 452px;">Example：Alipay huabei，Jingdong credit</td></tr><tr><td style="width: 128px;">user\_points</td><td style="width: 229px;">paid by user points</td><td style="width: 452px;">Example：Credit card points，Tmall Points etc.</td></tr><tr><td style="width: 128px;">merchant\_benefit</td><td style="width: 229px;">the benifit provided by merchant</td><td style="width: 452px;">Example：Merchant discount，Merchant voucher etc.</td></tr><tr><td style="width: 128px;">platform\_benefit</td><td style="width: 229px;">the benifit provided by enterprise</td><td style="width: 452px;">Example：Payment platform discount, Payment platform voucher etc.</td></tr><tr><td style="width: 128px;">ebuy\_benefit</td><td style="width: 229px;">the benifit provided by e-Buy</td><td style="width: 452px;">Example：e-Buy discount, e-Buy voucher etc</td></tr></tbody></table>

# Print Detail

- JSON Key is `printDetail`, only in Response message, not mandatory

<table id="bkmrk-field-type-mandatory" style="width: 809px;"><thead><tr><th style="width: 128px;">Field</th><th style="width: 59px;">Type</th><th style="width: 88px;">Mandatory</th><th style="width: 164px;">Description</th><th style="width: 370px;">Memo</th></tr></thead><tbody><tr><td style="width: 128px;">cardNo64</td><td style="width: 59px;">String</td><td style="width: 88px;">No</td><td style="width: 164px;">The card number (first 6 digits and last 4 digits</td><td style="width: 370px;">The card number (first 6 digits and last 4 digits) is required to print as part of return message</td></tr><tr><td style="width: 128px;">bank</td><td style="width: 59px;">String</td><td style="width: 88px;">No</td><td style="width: 164px;">Credit Card issued organization</td><td style="width: 370px;">The Credit Card issued organization is required to print as part of return message</td></tr><tr><td style="width: 128px;">bankTid</td><td style="width: 59px;">String</td><td style="width: 88px;">No</td><td style="width: 164px;">Bank Terminal ID</td><td style="width: 370px;">Responsed when UnionPay with JLCashPay</td></tr><tr><td style="width: 128px;">bankMid</td><td style="width: 59px;">String</td><td style="width: 88px;">No</td><td style="width: 164px;">Bank Merchant ID</td><td style="width: 370px;">Responsed when UnionPay with JLCashPay</td></tr><tr><td style="width: 128px;">paymentOrderNo</td><td style="width: 59px;">String</td><td style="width: 88px;">No</td><td style="width: 164px;">Payment Order no.</td><td style="width: 370px;">Payment order no. is required to print as part of return message</td></tr><tr><td style="width: 128px;">paymentUser</td><td style="width: 59px;">String</td><td style="width: 88px;">No</td><td style="width: 164px;">User account</td><td style="width: 370px;">User account need be printed.</td></tr><tr><td style="width: 128px;">pointSale</td><td style="width: 59px;">String</td><td style="width: 88px;">No</td><td style="width: 164px;">Point deducted</td><td style="width: 370px;">Point deducted is required to print as part of return message</td></tr><tr><td style="width: 128px;">qrCode1</td><td style="width: 59px;">String</td><td style="width: 88px;">No</td><td style="width: 164px;">Print QR code 1</td><td style="width: 370px;">QR code 1 is required to print as part of return message</td></tr><tr><td style="width: 128px;">qrCode2</td><td style="width: 59px;">String</td><td style="width: 88px;">No</td><td style="width: 164px;">Print QR code 2</td><td style="width: 370px;">QR code 2 is required to print as part of return message</td></tr><tr><td style="width: 128px;">qrCode3</td><td style="width: 59px;">String</td><td style="width: 88px;">No</td><td style="width: 164px;">Print QR code 3</td><td style="width: 370px;">QR code 3 is required to print as part of return message</td></tr><tr><td style="width: 128px;">barCode1</td><td style="width: 59px;">String</td><td style="width: 88px;">No</td><td style="width: 164px;">Print Bar Code 1</td><td style="width: 370px;">Bar Code code 1 is required to print as part of return message</td></tr><tr><td style="width: 128px;">barCode2</td><td style="width: 59px;">String</td><td style="width: 88px;">No</td><td style="width: 164px;">Print Bar Code 2</td><td style="width: 370px;">Bar Code code 2 is required to print as part of return message</td></tr><tr><td style="width: 128px;">barCode3</td><td style="width: 59px;">String</td><td style="width: 88px;">No</td><td style="width: 164px;">Print Bar Code 3</td><td style="width: 370px;">Bar Code code 3 is required to print as part of return message</td></tr><tr><td style="width: 128px;">content</td><td style="width: 59px;">String</td><td style="width: 88px;">No</td><td style="width: 164px;">Print Content</td><td style="width: 370px;">[TLV](https://book.e-buy.com/link/136#bkmrk-tlv "Communication protocol commonly used data formats, Comprise 3 parts: "Tag", "Length" & "Value"") Format，1F=Receipt title，2F=Receipt transtype</td></tr><tr><td style="width: 128px;">printMode</td><td style="width: 59px;">String</td><td style="width: 88px;">No</td><td style="width: 164px;">Print Mode</td><td style="width: 370px;">1=1 Receipt，2=2 Receipts，3=3 Receipts</td></tr></tbody></table>

# Member Detail

- JSON Key is `memberDetail`, not mandatory

<table id="bkmrk-field-type-mandatory"><thead><tr><th>Field</th><th>Type</th><th>Mandatory</th><th>Description</th><th>Memo</th></tr></thead><tbody><tr><td>memberId</td><td>String</td><td>Yes</td><td>Member ID</td><td> </td></tr><tr><td>memberCode</td><td>String</td><td>Yes</td><td>Member Code</td><td> </td></tr><tr><td>memberName</td><td>String</td><td>Yes</td><td>Member Name</td><td> </td></tr><tr><td>memberPhone</td><td>String</td><td>No</td><td>Member Mobile</td><td> </td></tr><tr><td>grade</td><td>String</td><td>No</td><td>Member Grade</td><td> </td></tr><tr><td>status</td><td>String</td><td>No</td><td>Member Status</td><td> </td></tr><tr><td>balance</td><td>String</td><td>No</td><td>Balance</td><td> </td></tr><tr><td>pointBalance</td><td>String</td><td>No</td><td>Point Balance</td></tr></tbody></table>

# Settle Record

- JSON Key is `settleRecord`, not mandatory

<table id="bkmrk-field-type-mandatory"><thead><tr><th>Field</th><th>Type</th><th>Mandatory</th><th>Description</th><th>Memo</th></tr></thead><tbody><tr><td>activityNo</td><td>String</td><td>Yes</td><td>Activity No</td><td> </td></tr><tr><td>activityName</td><td>String</td><td>Yes</td><td>Activity Name</td><td> </td></tr><tr><td>productName</td><td>String</td><td>Yes</td><td>Product Name</td><td> </td></tr><tr><td>customer</td><td>String</td><td>Yes</td><td>Settle Customer</td><td> </td></tr><tr><td>isRefund</td><td>Boolean</td><td>Yes</td><td>Is Refund</td><td> </td></tr><tr><td>volume</td><td>Integer</td><td>Yes</td><td>Transaction Volume</td><td> </td></tr><tr><td>totalReceiptAmount</td><td>Price</td><td>Yes</td><td>Merchant Receipt Amount</td><td> </td></tr><tr><td>totalAmount</td><td>Price</td><td>Yes</td><td>Total Amount</td></tr></tbody></table>

# Trans Record

- JSON Key is `transRecord`, mandatory

<table id="bkmrk-field-type-mandatory"><thead><tr><th>Field</th><th>Type</th><th>Mandatory</th><th>Description</th><th>Memo</th></tr></thead><tbody><tr><td>traceNo</td><td>String</td><td>Yes</td><td>Cashier terminal trace no.</td><td> </td></tr><tr><td>paidAmount</td><td>String</td><td>Yes</td><td>Paid Amount</td><td> </td></tr><tr><td>status</td><td>String</td><td>Yes</td><td>Match status</td><td>See detail</td></tr></tbody></table>

**status**

- 0 Initial
- 1 paidAmount [e-Buy Backend](https://book.e-buy.com/link/136#bkmrk-e-buy-backend "A group /set of equipment / server to process all the transaction from e-Buy POS") = request
- 2 paidAmount [e-Buy Backend](https://book.e-buy.com/link/136#bkmrk-e-buy-backend "A group /set of equipment / server to process all the transaction from e-Buy POS") &gt; request
- 3 paidAmount [e-Buy Backend](https://book.e-buy.com/link/136#bkmrk-e-buy-backend "A group /set of equipment / server to process all the transaction from e-Buy POS") &lt; request
- 4 Does not exist in [e-Buy Backend](https://book.e-buy.com/link/136#bkmrk-e-buy-backend "A group /set of equipment / server to process all the transaction from e-Buy POS")
- 5 Failed in [e-Buy Backend](https://book.e-buy.com/link/136#bkmrk-e-buy-backend "A group /set of equipment / server to process all the transaction from e-Buy POS")
- 6 Reversed in [e-Buy Backend](https://book.e-buy.com/link/136#bkmrk-e-buy-backend "A group /set of equipment / server to process all the transaction from e-Buy POS")
- 7 Rollbacked in [e-Buy Backend](https://book.e-buy.com/link/136#bkmrk-e-buy-backend "A group /set of equipment / server to process all the transaction from e-Buy POS")
- 8 Refunded in [e-Buy Backend](https://book.e-buy.com/link/136#bkmrk-e-buy-backend "A group /set of equipment / server to process all the transaction from e-Buy POS")
- 9 [e-Buy Backend](https://book.e-buy.com/link/136#bkmrk-e-buy-backend "A group /set of equipment / server to process all the transaction from e-Buy POS") process failed
- 10 [e-Buy Backend](https://book.e-buy.com/link/136#bkmrk-e-buy-backend "A group /set of equipment / server to process all the transaction from e-Buy POS") has, but Does not exist in Cashier POS

# Activity Product List

- JSON Key is`activityProductList`, mandatory when prompt transaction options

<table id="bkmrk-field-type-mandatory" style="width: 693px;"><thead><tr><th style="width: 187px;">Field</th><th style="width: 75px;">Type</th><th style="width: 101px;">Mandatory</th><th style="width: 213px;">Description</th><th style="width: 117px;">Memo</th></tr></thead><tbody><tr><td class="align-center" style="width: 187px;">activityProductNo</td><td class="align-center" style="width: 75px;">String</td><td class="align-center" style="width: 101px;">Yes</td><td class="align-center" style="width: 213px;">Activity Product No.</td><td class="align-center" style="width: 117px;"> </td></tr><tr><td class="align-center" style="width: 187px;">activityProductName</td><td class="align-center" style="width: 75px;">String</td><td class="align-center" style="width: 101px;">Yes</td><td class="align-center" style="width: 213px;">Activity Product Name</td><td class="align-center" style="width: 117px;"> </td></tr><tr><td class="align-center" style="width: 187px;">command</td><td class="align-center" style="width: 75px;">String</td><td class="align-center" style="width: 101px;">No</td><td class="align-center" style="width: 213px;">responsed commands in menus</td></tr><tr><td class="align-center" style="width: 187px;">showOrder</td><td class="align-center" style="width: 75px;">String</td><td class="align-center" style="width: 101px;">Yes</td><td class="align-center" style="width: 213px;">Show order</td><td class="align-center" style="width: 117px;">Show as A-Z</td></tr></tbody></table>

# Trans Timestamp

- JSON Key is `transTimestamp`, mandatory

<table id="bkmrk-field-type-mandatory"><thead><tr><th>Field</th><th>Type</th><th>Mandatory</th><th>Description</th><th>Memo</th></tr></thead><tbody><tr><td>traceNo</td><td>String</td><td>Yes</td><td>Original trace no.</td><td> </td></tr><tr><td>send</td><td>String</td><td>Yes</td><td>Send timestamp</td><td>Unix Format,Unit：seconds</td></tr><tr><td>recv</td><td>String</td><td>Yes</td><td>Receive timestamp</td><td>Unix Format,Unit：seconds</td></tr></tbody></table>

# Trans Info

- JSON Key is `transInfo`, mandatory

<table id="bkmrk-field-type-mandatory" style="width: 866px;"><thead><tr><th style="width: 148px;">Field</th><th style="width: 64px;">Type</th><th style="width: 91px;">Mandatory</th><th style="width: 175px;">Description</th><th style="width: 388px;">Memo</th></tr></thead><tbody><tr><td style="width: 148px;">action</td><td style="width: 64px;">String</td><td style="width: 91px;">Yes</td><td style="width: 175px;">交易action</td><td style="width: 388px;"> </td></tr><tr><td style="width: 148px;">traceNo</td><td style="width: 64px;">String</td><td style="width: 91px;">Yes</td><td style="width: 175px;">Cashier terminal trace no.</td><td style="width: 388px;"> </td></tr><tr><td style="width: 148px;">orderNo</td><td style="width: 64px;">String</td><td style="width: 91px;">Yes</td><td style="width: 175px;">易百系统参考号</td><td style="width: 388px;"> </td></tr><tr><td style="width: 148px;">transDate</td><td style="width: 64px;">String</td><td style="width: 91px;">Yes</td><td style="width: 175px;">交易时间</td><td style="width: 388px;">格式：yyyyMMddHHmmss</td></tr><tr><td style="width: 148px;">returnCode</td><td style="width: 64px;">String</td><td style="width: 91px;">Yes</td><td style="width: 175px;">Return code</td><td style="width: 388px;">00 represent successful transaction, else represent fail</td></tr><tr><td style="width: 148px;">returnDesc</td><td style="width: 64px;">String</td><td style="width: 91px;">Yes</td><td style="width: 175px;">Return message</td><td style="width: 388px;">Detail explanation / error message per transaction result</td></tr><tr><td style="width: 148px;">paidAmount</td><td style="width: 64px;">String</td><td style="width: 91px;">Yes</td><td style="width: 175px;">交易成功金额</td><td style="width: 388px;"> </td></tr><tr><td style="width: 148px;">activityProductNo</td><td style="width: 64px;">String</td><td style="width: 91px;">Yes</td><td style="width: 175px;">活动产品编号</td><td style="width: 388px;"> </td></tr><tr><td style="width: 148px;">activityProductName</td><td style="width: 64px;">String</td><td style="width: 91px;">Yes</td><td style="width: 175px;">活动产品名称</td><td style="width: 388px;">活动名称+产品名称</td></tr><tr><td style="width: 148px;">bank</td><td style="width: 64px;">String</td><td style="width: 91px;">Yes</td><td style="width: 175px;">交易机构标识</td><td style="width: 388px;"> </td></tr><tr><td style="width: 148px;">cardNo64</td><td style="width: 64px;">String</td><td style="width: 91px;">Yes</td><td style="width: 175px;">卡号或串码</td><td style="width: 388px;"> </td></tr><tr><td style="width: 148px;">printContent</td><td style="width: 64px;">String</td><td style="width: 91px;">Yes</td><td style="width: 175px;">小票打印数据</td></tr></tbody></table>

# Function Menu

- JSON Key is`function`, only in Response message

<table id="bkmrk-field-type-mandatory"><thead><tr><th style="width: 106px;">Field</th><th style="width: 116px;">Type</th><th style="width: 95px;">Mandatory</th><th style="width: 175px;">Description</th><th style="width: 317px;">Memo</th></tr></thead><tbody><tr><td style="width: 106px;">iconUrl</td><td style="width: 116px;">String</td><td style="width: 95px;">Yes</td><td style="width: 175px;">icon URL</td><td style="width: 317px;">variable-length field</td></tr><tr><td style="width: 106px;">title</td><td style="width: 116px;">String</td><td style="width: 95px;">Yes</td><td style="width: 175px;">Function Name</td><td style="width: 317px;">variable-length field</td></tr><tr><td style="width: 106px;">action</td><td style="width: 116px;">String</td><td style="width: 95px;">Yes</td><td style="width: 175px;">Function Action</td><td style="width: 317px;">variable-length field</td></tr><tr><td style="width: 106px;">command</td><td style="width: 116px;">String</td><td style="width: 95px;">Yes</td><td style="width: 175px;">Commands in Menus</td><td style="width: 317px;">Such as:04|00|Please Swipe card|1|08|00|Product XXX(M)$HDCP00000000072578|0|</td></tr><tr><td style="width: 106px;">childrenFunc</td><td style="width: 116px;">List&lt;[function](https://book.e-buy.com/books/e-buy/page/function-menu)&gt;</td><td style="width: 95px;">No</td><td style="width: 175px;">Nodes in Menus</td><td style="width: 317px;">variable-length field</td></tr></tbody></table>

# Head Picture

- JSON Key is `headPicture`, only in Response message

<table id="bkmrk-field-type-mandatory" style="width: 611px;"><thead><tr><th style="width: 102px;">Field</th><th style="width: 94px;">Type</th><th style="width: 99px;">Mandatory</th><th style="width: 166px;">Description</th><th style="width: 150px;">Memo</th></tr></thead><tbody><tr><td style="width: 102px;">displayPicUrl</td><td style="width: 94px;">String</td><td style="width: 99px;">Yes</td><td style="width: 166px;">Picture URL in Banner</td><td style="width: 150px;">variable-length field</td></tr><tr><td style="width: 102px;">linkUrl</td><td style="width: 94px;">String</td><td style="width: 99px;">Yes</td><td style="width: 166px;">Link URL</td><td style="width: 150px;">variable-length field</td></tr></tbody></table>

# Package Detail

- JSON Key is `packageDetail`, only in Response message

<table id="bkmrk-field-type-mandatory"><thead><tr><th>Field</th><th>Type</th><th>Mandatory</th><th>Description</th><th>Memo</th></tr></thead><tbody><tr><td>packId</td><td>String</td><td>Yes</td><td>Package ID</td><td>variable-length field</td></tr><tr><td>packName</td><td>String</td><td>Yes</td><td>Package Name</td><td> </td></tr><tr><td>goodsInfoList</td><td>List&lt;[goodsDetail](https://book.e-buy.com/books/e-buy/page/goods-detail "goodsDetail")&gt;</td><td>Yes</td><td>Goods Detail List</td></tr></tbody></table>

# Order Info

- JSON Key is `orderInfo`, only in Response message, mandatory

<table id="bkmrk-field-type-mandatory"><thead><tr><th style="width: 135px;">Field</th><th style="width: 145px;">Type</th><th style="width: 88px;">Mandatory</th><th style="width: 132px;">Description</th><th style="width: 309px;">Memo</th></tr></thead><tbody><tr><td style="width: 135px;">appOrderNo</td><td style="width: 145px;">String</td><td style="width: 88px;">Yes</td><td style="width: 132px;">APP Order No</td><td style="width: 309px;">variable-length field</td></tr><tr><td style="width: 135px;">statusCode</td><td style="width: 145px;">String</td><td style="width: 88px;">Yes</td><td style="width: 132px;">Order Status Code</td><td style="width: 309px;">variable-length field</td></tr><tr><td style="width: 135px;">status</td><td style="width: 145px;">String</td><td style="width: 88px;">Yes</td><td style="width: 132px;">Order Status Desc</td><td style="width: 309px;">Order Status Desc</td></tr><tr><td style="width: 135px;">orderTime</td><td style="width: 145px;">String</td><td style="width: 88px;">Yes</td><td style="width: 132px;">Order Time</td><td style="width: 309px;">Format:HH:mm, shows in Order List</td></tr><tr><td style="width: 135px;">orderCreateTime</td><td style="width: 145px;">String</td><td style="width: 88px;">Yes</td><td style="width: 132px;">Order Create Time</td><td style="width: 309px;">Format:yyyy-MM-dd HH:mm:ss</td></tr><tr><td style="width: 135px;">orderAmount</td><td style="width: 145px;">Price</td><td style="width: 88px;">Yes</td><td style="width: 132px;">Order Amount</td><td style="width: 309px;"> </td></tr><tr><td style="width: 135px;">rcptName</td><td style="width: 145px;">String</td><td style="width: 88px;">Yes</td><td style="width: 132px;">Receiver</td><td style="width: 309px;"> </td></tr><tr><td style="width: 135px;">platformName</td><td style="width: 145px;">String</td><td style="width: 88px;">Yes</td><td style="width: 132px;">Tokeout Platform</td><td style="width: 309px;">variable-length field, Such as: Baidu, Meituan, less than 8 characters</td></tr><tr><td style="width: 135px;">packageDetailList</td><td style="width: 145px;">List&lt;[packageDetail](https://book.e-buy.com/books/e-buy/page/package-detail "packageDetail")&gt;</td><td style="width: 88px;">No</td><td style="width: 132px;">Package Detail</td><td style="width: 309px;">Responsed when Order Detail API called</td></tr></tbody></table>

# Voucher Detail

- JSON Key为`voucherDetail`, mandatory

<table id="bkmrk-field-type-mandatory"><thead><tr><th>Field</th><th>Type</th><th>Mandatory</th><th>Description</th><th>Memo</th></tr></thead><tbody><tr><td>voucherId</td><td>String</td><td>Yes</td><td>Voucher ID</td><td> </td></tr><tr><td>voucherName</td><td>String</td><td>Yes</td><td>Voucher Name</td><td>Used for reports, tickets, etc.</td></tr><tr><td>voucherType</td><td>String</td><td>Yes</td><td>Voucher Type</td></tr><tr><td>voucherAmount</td><td>Price</td><td>Yes</td><td>Price</td><td>Unit : dollar</td></tr><tr><td>voucherCode</td><td>String</td><td>Yes</td><td>Voucher Code</td></tr></tbody></table>