# Trans Refund(card)

#### **Usage**

- Invoke this API to refund a transaction that dedicated by originalTraceNo.

#### **Transaction Flow**

- The requested transaction will firstly invoke [MIS-POS](https://book.e-buy.com/link/124#bkmrk-mis-pos "Installed in merchants in-store POS machine, providing the operation activity to support and exchange function") for Card swape and password input. Once [MIS-POS](https://book.e-buy.com/link/124#bkmrk-mis-pos "Installed in merchants in-store POS machine, providing the operation activity to support and exchange function") confirmed on both inputs, it will send back 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 to process.

#### **action**

- `refundCardSale`

**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"><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>No repeat</td></tr><tr><td>originalTraceNo</td><td>String</td><td>Yes</td><td>last Cashier terminal trace no.</td><td>Cashier terminal trace no. in last transaction</td></tr><tr><td>refundAmount</td><td>Price</td><td>Yes</td><td>Refund Amount</td><td>Unit：Dollar</td></tr><tr><td>acquirer</td><td>String</td><td>No</td><td>Acquirer Bank</td><td>Example：citicCashpay</td></tr></tbody></table>

#### **Request body example**

```
{
    "traceNo": "99000009100010101732123",
    "originalTraceNo": "99000009100010101732124",
    "refundAmount": 40.8,
    "acquirer": "citicCashpay"
}

```

**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" style="height: 484px;"><thead><tr style="height: 45px;"><th style="width: 108px; height: 45px;">Field</th><th style="width: 145px; height: 45px;">Type</th><th style="width: 60px; height: 45px;">Mandatory</th><th style="width: 174px; height: 45px;">Description</th><th style="width: 318px; height: 45px;">Memo</th></tr></thead><tbody><tr style="height: 45px;"><td style="width: 108px; height: 45px;">traceNo</td><td style="width: 145px; height: 45px;">String</td><td style="width: 60px; height: 45px;">Yes</td><td style="width: 174px; height: 45px;">Cashier terminal trace no.</td><td style="width: 318px; height: 45px;">No repeat</td></tr><tr style="height: 45px;"><td style="width: 108px; height: 45px;">orderNo</td><td style="width: 145px; height: 45px;">String</td><td style="width: 60px; height: 45px;">Yes</td><td style="width: 174px; height: 45px;">Order No. from e-Buy</td><td style="width: 318px; height: 45px;"> </td></tr><tr style="height: 29px;"><td style="width: 108px; height: 29px;">transDate</td><td style="width: 145px; height: 29px;">String</td><td style="width: 60px; height: 29px;">Yes</td><td style="width: 174px; height: 29px;">Transaction time</td><td style="width: 318px; height: 29px;">Format：yyyyMMddHHmmss</td></tr><tr style="height: 45px;"><td style="width: 108px; height: 45px;">returnCode</td><td style="width: 145px; height: 45px;">String</td><td style="width: 60px; height: 45px;">Yes</td><td style="width: 174px; height: 45px;">Return code</td><td style="width: 318px; height: 45px;">00 represent successful transaction, else represent fail</td></tr><tr style="height: 45px;"><td style="width: 108px; height: 45px;">returnDesc</td><td style="width: 145px; height: 45px;">String</td><td style="width: 60px; height: 45px;">Yes</td><td style="width: 174px; height: 45px;">Return message</td><td style="width: 318px; height: 45px;">Detail explanation / error message per transaction result</td></tr><tr style="height: 29px;"><td style="width: 108px; height: 29px;">refundAmount</td><td style="width: 145px; height: 29px;">Price</td><td style="width: 60px; height: 29px;">Yes</td><td style="width: 174px; height: 29px;">Refunded Amount</td><td style="width: 318px; height: 29px;">Unit：Dollar</td></tr><tr style="height: 29px;"><td style="width: 108px; height: 29px;">discountCode</td><td style="width: 145px; height: 29px;">String</td><td style="width: 60px; height: 29px;">No</td><td style="width: 174px; height: 29px;">Discount Code</td><td style="width: 318px; height: 29px;">assigned by Cashier POS</td></tr><tr style="height: 45px;"><td style="width: 108px; height: 45px;">tenderCode</td><td style="width: 145px; height: 45px;">String</td><td style="width: 60px; height: 45px;">No</td><td style="width: 174px; height: 45px;">Tender Code</td><td style="width: 318px; height: 45px;">assigned by Cashier POS,record payment method，like：2016120101|20.00 is payment 20yuan</td></tr><tr style="height: 35px;"><td style="width: 108px; height: 35px;">fundChannel</td><td style="width: 145px; height: 35px;">List&lt;[fundChannel](https://book.e-buy.com/link/333#bkmrk-fund-channel "fundChannel")&gt;</td><td style="width: 60px; height: 35px;">No</td><td style="width: 174px; height: 35px;">Channel of fund</td><td style="width: 318px; height: 35px;"> </td></tr><tr style="height: 35px;"><td style="width: 108px; height: 35px;">printDetail</td><td style="width: 145px; height: 35px;">Object&lt;[printDetail](https://book.e-buy.com/link/333#bkmrk-print-detail "printDetail")&gt;</td><td style="width: 60px; height: 35px;">No</td><td style="width: 174px; height: 35px;">Printing message</td><td style="width: 318px; height: 35px;">Provided if required to print on the receipt</td></tr><tr style="height: 57px;"><td style="width: 108px; height: 57px;">memberDetail</td><td style="width: 145px; height: 57px;">Object&lt;[memberDetail](https://book.e-buy.com/link/333#bkmrk-member-detail "memberDetail")&gt;</td><td style="width: 60px; height: 57px;">No</td><td style="width: 174px; height: 57px;">Member information</td><td style="width: 318px; height: 57px;">Member info return message on this transaction</td></tr></tbody></table>

#### **Response body example**

```
{
    "traceNo": "99000009100010101732123",
    "orderNo": "171698602301",
    "transDate": "20161231120533",
    "returnCode": "00",
    "returnDesc": "SUCCESS",
    "discountCode": "0001",
    "tenderCode": "8001",
    "refundAmount": 40.8,
    "fundChannel": [
        {
            "channelNo": "001",
            "channelName": "用户实付现金",
            "channelAmount": "20.8"
        },
        {
            "channelNo": "002",
            "channelName": "用户积分支付",
            "channelAmount": "20"
        }
    ],
    "printDetail": {
        "cardNo64": "622562****8888",
        "bank": "中信银行",
        "paymentOrderNo": "201612315689412157458787",
        "pointSale": "20000",
        "qrCode1": "htt://www.api-location-url.com/url",
        "qrCode2": "",
        "qrCode3": "",
        "barCode1": "12345679",
        "barCode2": "",
        "barCode3": ""
    },
    "memberDetail": {
        "memberId": "M000001545",
        "memberName": "TONY",
        "grade": "1",
        "status": "1",
        "balance": 1000.00,
        "pointBalance": 30000
    }
}

```

#### **Transaction support refund**

- cardPayment
- CardRedemption