业务接口
介绍 卡游售卖机开放平台 提供的业务接口
抽卡机基础档案
分页获取城市列表
使用 client_credentials 模式,获取accessToken后进行接口调用
GET /api/city/list
- 请求参数
参数名称 | 参数值 | 是否必填 | 示例 | 备注 |
---|---|---|---|---|
Authorization | Bearer 12f7764bd76e4350bd87772390444d7c | 是 | Bearer 12f7764bd76e4350bd87772390444d7c | Bearer accessToken |
page | 1 | 否 | 1 | 页码从1开始 |
pageSize | 10 | 否 | 10 | 默认10 |
- 返回数据
名称 | 类型 | 是否必须 | 备注 |
---|---|---|---|
code | Number | 是 | 返回码 |
msg | String | 是 | 返回信息 |
timestamp | Number | 是 | 时间戳 |
result | object | ||
items | Array | ||
id | Integer | id | |
name | String | 城市名称 | |
code | String | 城市编码 | |
total | Integer | 总记录数 |
返回说明
- 正确的返回:
{ "result": { "items": [ { "id": 35, "name": "淮安", "code": "320800" }, { "id": 36, "name": "盐城", "code": "320900" }, { "id": 37, "name": "扬州", "code": "321000" }, { "id": 38, "name": "镇江", "code": "321100" }, { "id": 39, "name": "泰州", "code": "321200" }, { "id": 40, "name": "宿迁", "code": "321300" }, { "id": 41, "name": "杭州", "code": "330100" }, { "id": 42, "name": "宁波", "code": "330200" }, { "id": 43, "name": "温州", "code": "330300" }, { "id": 44, "name": "嘉兴", "code": "330400" } ], "total": 368 }, "code": 0, "type": "success", "message": "操作成功", "timestamp": 1676267565 }
- 错误的返回:
{ "code": 500, "msg": "token is timeout. please retry.", "timestamp": 1608008002 }
分页获取场地列表
使用 client_credentials 模式,获取accessToken后进行接口调用
GET /api/site/list
- 请求参数
参数名称 | 参数值 | 是否必填 | 示例 | 备注 |
---|---|---|---|---|
Authorization | Bearer 12f7764bd76e4350bd87772390444d7c | 是 | Bearer 12f7764bd76e4350bd87772390444d7c | Bearer accessToken |
page | 1 | 否 | 1 | 页码从1开始 |
pageSize | 10 | 否 | 10 | 默认10 |
- 返回数据
名称 | 类型 | 是否必须 | 备注 |
---|---|---|---|
code | Number | 是 | 返回码 |
msg | String | 是 | 返回信息 |
timestamp | Number | 是 | 时间戳 |
result | object | ||
items | Array | ||
code | String | 编码 | |
name | String | 名称 | |
state | Integer | 状态:1启用 0未启用 | |
openTime | Integer | 开始营业时间 | |
closeTime | Integer | 结束营业时间 | |
address | Integer | 地址 | |
addressExt | Integer | 扩展地址 | |
lng | Integer | 经度 | |
lat | Integer | 纬度 | |
imgs | Array | 门面图 | |
total | Integer |
返回说明
- 正确的返回:
{ "result": { "items": [{ "code": "CD000077", "name": "1010出货测试场地", "siteType": "default", "state": 1, "gradeType": 1, "openTime": "09:00:00", "closeTime": "22:00:00", "address": "上海市闵行区吴中路1588号", "addressExt": "", "lng": "121.372544", "lat": "31.174052", "imgs": [] }], "total": 62 }, "code": 0, "type": "success", "message": "操作成功", "timestamp": 1665970440 }
- 错误的返回:
{ "code": 500, "msg": "token is timeout. please retry.", "timestamp": 1608008002 }
分页获取场地列表(包含点位信息)
使用 client_credentials 模式,获取accessToken后进行接口调用
GET /api/site/list-with-points
- 请求参数
参数名称 | 参数值 | 是否必填 | 示例 | 备注 |
---|---|---|---|---|
Authorization | Bearer 12f7764bd76e4350bd87772390444d7c | 是 | Bearer 12f7764bd76e4350bd87772390444d7c | Bearer accessToken |
page | 1 | 否 | 1 | 页码从1开始 |
pageSize | 10 | 否 | 10 | 默认10 |
- 返回数据
名称 | 类型 | 是否必须 | 备注 |
---|---|---|---|
code | Number | 是 | 返回码 |
msg | String | 是 | 返回信息 |
timestamp | Number | 是 | 时间戳 |
result | object | 是 | |
items | Array | 是 | |
code | String | 是 | 场地编码 |
name | String | 是 | 场地名称 |
state | Integer | 是 | 场地状态:1启用 0未启用 |
openTime | String | 是 | 场地开始营业时间 |
closeTime | String | 是 | 场地结束营业时间 |
cityCode | String | 是 | 城市编码 |
cityName | String | 是 | 城市名称 |
address | String | 是 | 场地地址 |
addressExt | String | 否 | 场地扩展地址 |
lng | Float | 是 | 场地经度 |
lat | Float | 是 | 场地纬度 |
imgs | Array | 否 | 场地门面图 |
points | Array | 否 | 点位列表 |
code | String | 是 | 点位编码 |
name | String | 是 | 点位名称 |
gradeType | Integer | 订单系统类型:1浪沙 2术铂 | |
imei | String | 否 | 设备号 |
cargolanes | Array | 否 | 货道信息 |
goodsCode | String | 否 | 商品编号 |
productName | String | 否 | 商品名称 |
productPic | String | 否 | 商品封面图 |
stock | Integer | 否 | 商品库存 |
guidePrice | Integer | 零售价,单位分 | |
total | Integer | 是 |
返回说明
- 正确的返回:
{ "result": { "items": [{ "code": "CD000077", "name": "1010出货测试场地", "siteType": "default", "state": 1, "openTime": "09:00:00", "closeTime": "22:00:00", "cityCode": "300200", "cityName": "上海", "address": "上海市闵行区吴中路1588号", "addressExt": "", "lng": "121.372544", "lat": "31.174052", "imgs": ["http://xxxx/xxx.png"], "points": [{ "code": "DW00007", "name": "1010出货测试场地1号点位", "imei": "web1111", "gradeType": 1, "cargolanes": [{ "goodsCode": "SP111", "productName": "火影1", "productPic": "http://xxx/xxx.png", "stock": 100, "guidePrice": 1000 },{ "goodsCode": "SP111", "productName": "火影1", "productPic": "http://xxx/xxx.png", "stock": 100, "guidePrice": 1000 }] },{ "code": "DW00008", "name": "1010出货测试场地2号点位", "imei": "web11112", "gradeType": 1, "cargolanes": [{ "goodsCode": "SP1111", "productName": "火影2", "productPic": "http://xxx/xxx.png", "stock": 100, "guidePrice": 1000 },{ "goodsCode": "SP1121", "productName": "火影3", "productPic": "http://xxx/xxx.png", "stock": 100, "guidePrice": 1000 }] }] }], "total": 62 }, "code": 0, "type": "success", "message": "操作成功", "timestamp": 1665970440 }
- 错误的返回:
{ "code": 500, "msg": "token is timeout. please retry.", "timestamp": 1608008002 }
根据场地编码获取场地详情(包含点位信息)
使用 client_credentials 模式,获取accessToken后进行接口调用
GET /api/site/detail
- 请求参数
参数名称 | 参数值 | 是否必填 | 示例 | 备注 |
---|---|---|---|---|
Authorization | Bearer 12f7764bd76e4350bd87772390444d7c | 是 | Bearer 12f7764bd76e4350bd87772390444d7c | Bearer accessToken |
siteCode | CD111 | 是 | CD1111 | 场地编码 |
- 返回数据
名称 | 类型 | 是否必须 | 备注 |
---|---|---|---|
code | Number | 是 | 返回码 |
msg | String | 是 | 返回信息 |
timestamp | Number | 是 | 时间戳 |
result | object | 是 | |
code | String | 是 | 场地编码 |
name | String | 是 | 场地名称 |
state | Integer | 是 | 场地状态:1启用 0未启用 |
openTime | String | 是 | 场地开始营业时间 |
closeTime | String | 是 | 场地结束营业时间 |
address | String | 是 | 场地地址 |
addressExt | String | 否 | 场地扩展地址 |
lng | Float | 是 | 场地经度 |
lat | Float | 是 | 场地纬度 |
imgs | Array | 否 | 场地门面图 |
points | Array | 否 | 点位列表 |
code | String | 是 | 点位编码 |
name | String | 是 | 点位名称 |
gradeType | Integer | 订单系统类型:1浪沙 2术铂 | |
imei | String | 否 | 设备号 |
cargolanes | Array | 否 | 货道信息 |
goodsCode | String | 否 | 商品编号 |
productName | String | 否 | 商品名称 |
productPic | String | 否 | 商品封面图 |
stock | Integer | 否 | 商品库存 |
返回说明
- 正确的返回:
{ "result": { "code": "CD000077", "name": "1010出货测试场地", "siteType": "default", "state": 1, "openTime": "09:00:00", "closeTime": "22:00:00", "address": "上海市闵行区吴中路1588号", "addressExt": "", "lng": "121.372544", "lat": "31.174052", "imgs": ["http://xxxx/xxx.png"], "points": [{ "code": "DW00007", "name": "1010出货测试场地1号点位", "gradeType": 1, "imei": "web1111", "cargolanes": [{ "goodsCode": "SP111", "productName": "火影1", "productPic": "http://xxx/xxx.png", "stock": 100 },{ "goodsCode": "SP111", "productName": "火影1", "productPic": "http://xxx/xxx.png", "stock": 100 }] },{ "code": "DW00008", "name": "1010出货测试场地2号点位", "gradeType": 1, "imei": "web11112", "cargolanes": [{ "goodsCode": "SP1111", "productName": "火影2", "productPic": "http://xxx/xxx.png", "stock": 100 },{ "goodsCode": "SP1121", "productName": "火影3", "productPic": "http://xxx/xxx.png", "stock": 100 }] }] }, "code": 0, "type": "success", "message": "操作成功", "timestamp": 1665970440 }
- 错误的返回:
{ "code": 500, "msg": "token is timeout. please retry.", "timestamp": 1608008002 }
分页获取商品列表
使用 client_credentials 模式,获取accessToken后进行接口调用
GET /api/products/list
- 请求参数
参数名称 | 参数值 | 是否必填 | 示例 | 备注 |
---|---|---|---|---|
Authorization | Bearer 12f7764bd76e4350bd87772390444d7c | 是 | Bearer 12f7764bd76e4350bd87772390444d7c | Bearer accessToken |
page | 1 | 否 | 1 | 页码从1开始 |
pageSize | 10 | 否 | 10 | 默认10 |
- 返回数据
名称 | 类型 | 是否必须 | 备注 |
---|---|---|---|
code | Number | 是 | 返回码 |
msg | String | 是 | 返回信息 |
timestamp | Number | 是 | 时间戳 |
result | object | ||
items | Array | ||
ipId | Integer | ipId | |
ipName | String | ip名称 | |
productName | String | 商品名称 | |
skuCode | String | 商品SKU | |
goodsCode | String | 商品编号 | |
costPrice | Integer | 成本价,单位分 | |
guidePrice | Integer | 零售价,单位分 | |
orderPic | String | 订单图 | |
total | Integer | 总记录数 |
返回说明
- 正确的返回:
{ "result": { "items": [{ "ipId": 10001, "ipName": "奥特曼", "productName": "奥特曼第一弹", "skuCode": "sku1111", "goodsCode": "code1111", "costPrice": 1000, "guidePrice": 1500, "orderPic": "http://aa.com/a.jpg" },{ "ipId": 10002, "ipName": "奥特曼", "productName": "奥特曼第一弹", "skuCode": "sku1112", "goodsCode": "code1112", "costPrice": 1000, "guidePrice": 1500, "orderPic": "http://aa.com/a.jpg" }], "total": 2 }, "code": 0, "type": "success", "message": "操作成功", "timestamp": 1665970440 }
- 错误的返回:
{ "code": 500, "msg": "token is timeout. please retry.", "timestamp": 1608008002 }
根据商品编号查询商品详情
使用 client_credentials 模式,获取accessToken后进行接口调用
GET /api/product/detail
- 请求参数
参数名称 | 参数值 | 是否必填 | 示例 | 备注 |
---|---|---|---|---|
Authorization | Bearer 12f7764bd76e4350bd87772390444d7c | 是 | Bearer 12f7764bd76e4350bd87772390444d7c | Bearer accessToken |
goodsCode | 10001 | 是 | 10001 | 商品编码 |
- 返回数据
名称 | 类型 | 是否必须 | 备注 |
---|---|---|---|
code | Number | 是 | 返回码 |
msg | String | 是 | 返回信息 |
timestamp | Number | 是 | 时间戳 |
result | object | ||
ipId | Integer | ipId | |
ipName | String | ip名称 | |
productName | String | 商品名称 | |
skuCode | String | 商品SKU | |
goodsCode | String | 商品编号 | |
costPrice | Integer | 成本价,单位分 | |
guidePrice | Integer | 零售价,单位分 | |
orderPic | String | 订单图 |
返回说明
- 正确的返回:
{ "result": { "ipId": 10001, "ipName": "奥特曼", "productName": "奥特曼第一弹", "skuCode": "sku1111", "goodsCode": "code1111", "costPrice": 1000, "guidePrice": 1500, "orderPic": "http://aa.com/a.jpg" }, "code": 0, "type": "success", "message": "操作成功", "timestamp": 1665970440 }
- 错误的返回:
{ "code": 500, "msg": "token is timeout. please retry.", "timestamp": 1608008002 }