---
# System prepended metadata

title: API規格

---

# API規格
## 電子序號

### excel匯入
`POST`/admin/bonus_serial_exchange/import
`request`
``` json!=

```
`response`
``` json!=
excel 
```

### excel匯出
`POST`/admin/bonus_serial_exchange/export
`request`
``` json!=
{
    "status":0,
    "store_id":"",
    "product_name":"",
    "serial":"",
    "order_no":"",
    "start_time":"",
    "end_time":""
}
```
`response`
``` json!=
狀態為未兌換的excel 
```


### 下單兌換電子序號
`POST`/apiweb/coupon/to_serial
`request`
``` json!=
{
    "profit_token":"29a453de12e60fd985c065a4bdf49e2f",
    "email":"444@ccc.ccc",
    "profit":100,
    "goods_info":[
        {"goods_id":"59","count":1}
      ],
    "delivery_type":3,
    "delivery_info":
        {"id":8,"name":"6666",
         "phone":"0933333333"
        }
 }

```
`response`
``` json!=
{
"status": 200,
"message": "操作成功",
"data": {
    "profit": 100,
    "point": 0,
    "email": "444@ccc.ccc",
    "bank_no": "",
    "order_no": "230519120639057508",
    "type": 2,
    "delivery_type": 3,
    "delivery_info": {
        "id": 8,
        "name": "6666",
        "phone": "0933333333"
    },
    "courier_price": 0,
    "bz": 0,
    "goods_info": [
        {
            "id": 59,
            "name": "11111",
            "pc_img": "https://beta.sunnygo.com.tw/storage/admin/i8t5HHyz3CpFqtaz5YWsNqpM65VscaH5SgerqKhA.jpg",
            "phone_img": "https://beta.sunnygo.com.tw/storage/admin/i8t5HHyz3CpFqtaz5YWsNqpM65VscaH5SgerqKhA.jpg",
            "bonus": 100,
            "count": 1
        }
    ],
    "gift_info": [],
    "status": 10,
    "count_face": 200,
    "count_num": 2,
    "updated_at": "2023-05-19 12:06:39",
    "created_at": "2023-05-19 12:06:39",
    "id": 322,
    "goods_gift": [
        {
            "id": 59,
            "name": "11111",
            "pc_img": "https://beta.sunnygo.com.tw/storage/admin/i8t5HHyz3CpFqtaz5YWsNqpM65VscaH5SgerqKhA.jpg",
            "phone_img": "https://beta.sunnygo.com.tw/storage/admin/i8t5HHyz3CpFqtaz5YWsNqpM65VscaH5SgerqKhA.jpg",
            "bonus": 100,
            "count": 1,
            "is_gift": false
        }
    ],
    "surplus_profit": 132571
}
}
```

### 撈取店家、商品名稱
`POST`/admin/bonus_serial_exchange/store
`request`
``` json!=

```
`response`
``` json!=
{
    "status": 200,
    "message": "操作成功",
    "data": [
        {
            "id": 7,
            "name": "米哥烘焙坊",
            "type": 2,
            "goods": [
                {
                    "id": 59,
                    "name": "11111"
                }
            ]
        }
    ]
}
```


### 全部list
`POST`  /admin/bonus_serial_exchange/list
`request`
``` json!=
 {
    "end_time": "2023-05-10 12:12:02",
    "limit": 10,
    "product_name" :"成功update拉",
    "store_name": "米哥",
    "serial" :"s",
    "status":0,
    "order_no": "",
    "page": 1,
    "start_time": "2023-05-09 17:12:02",
    "total": 0
 }
```
`response`
``` json!=
{
    "status": 200,
    "message": "操作成功",
    "data": {
        "list": [
            {
                "id": 9,
                "store_id": 7,
                "product_name": "成功update拉",
                "serial": "sdsdsdsd",
                "order_no": null,
                "status": 0,
                "created_at": "2023-05-10 10:47:29",
                "selled_at": "0000-00-00 00:00:00",
                "store_name": "米哥烘焙坊"
            }
        ],
        "total": 1
    }
}
```
### 個別資料
`POST`  /admin/bonus_serial_exchange/show
`request`
``` json!=
{
    "id":"4" //require
}
```
`response`
``` json!=
{
    "status": 200,
    "message": "操作成功",
    "data": {
        "id": 11,
        "store_id": 7,
        "product_name": "8888",
        "serial": "77777777",
        "order_no": null,
        "status": 1,
        "created_at": "2023-05-10 10:47:29",
        "selled_at": "0000-00-00 00:00:00",
        "store_name": "米哥烘焙坊"
        }
    }
}
```

### 新增
`POST`  /admin/bonus_serial_exchange/add
`request`
``` json!=
{
   "product_name" :"2小時酷時", //required|max:50
   "store_id" :"6",           //required|integer
   "serial" :"56789"         //required|max:50
}
```
`response`
``` json!=
{
    "status": 200,
    "message": "操作成功",
    "data": {}
}
```

### 更新
`POST`  /admin/bonus_serial_exchange/update
`request`
``` json!=
{
   "id":11,                //required|integer
   "product_name" :"0000", //required|max:50
   "store_id" :"7",        //required|integer
   "serial" :"56789",      //required|max:50
   "status":1              //required|integer
}
```
`response`
``` json!=
{
    "status": 200,
    "message": "操作成功",
    "data": {}
}
```

### 刪除
`POST`  /admin/bonus_serial_exchange/delete
`request`
``` json!=
{
   "id":11 //required|integer
}
```
`response`
``` json!=
{
    "status": 200,
    "message": "操作成功",
    "data": {}
}
```
## 兌換禮券
### https://beta.sunnygo.com.tw/web-front/BankdividendHomepage/bankdivHome