门店
创建门店
接口说明
根据门店信息创建门店,门店code请勿重复。
请求信息
| 配置说明 | 参数值 |
|---|---|
| URL | /store |
| Method | POST |
| Content-Type | application/json |
Body参数
| 参数名 | 类型 | 描述 | 是否必填 |
|---|---|---|---|
| code | string | 门店编号 | 是 |
| name | string | 门店名 | 是 |
| address | string | 门店所在详细地址 | 否 |
| longitude | float64 | 门店经度,需要的坐标系为WGS84 | 否 |
| latitude | float64 | 门店纬度,需要的坐标系为WGS84 | 否 |
| attributes | []object | 门店属性 | 否 |
| + type | int32 | 属性类型。 0: 区域 1: 营业所 2: 销售线路 3: CHANNEL 4: G1 (省) 5: G2 (市) 6: G3 (区) 7: 零售商 8: 子零售商 9: 组织 101: 自定义属性1 102: 自定义属性2 103: 自定义属性3 104: 自定义属性4 105: 自定义属性5 106: 自定义属性6 | 是 |
| + code | string | 属性code,相同type下唯一 | 是 |
| + name | string | 属性名 | 是 |
| contact_name | string | 联系人 | 否 |
| mobile | string | 电话 | 否 |
| images | []string | 门店照片 | 否 |
| sales_rep | object | 销售代表 | 否 |
| + username | string | 用户名,登录时的账户名,最长50位 | 是 |
| + real_name | string | 真实姓名,最长100位 | 否 |
| + password | string | 用户密码,最长200位 | 否 |
| + phone | string | 手机号 | 否 |
| + department | string | 部门,最长100位 | 否 |
| + ext_info | string | 其他额外信息,最大长度1000。建议使用json格式字符串数据,如:{"lead_phone":"18888888888","lead_real_name":"王五","lead_username":"wangwu","area_manager":"张三"} | 否 |
Body数据样例
json
{
"code": "TEST001",
"name": "门店名",
"address": "xx街xx路xx号xx",
"longitude": 121.42394,
"latitude": 31.22024,
"contact_name": "contact name",
"mobile": "15699999999",
"images": ["https://f-dev.clobotics.cn/4/0040ca4d85f5e5ef7354102f486ef843.jpg","https://f-dev.clobotics.cn/4/0040ca4d85f5e5ef7354102f486ef844.jpg"],
"attributes": [
{
"type": 3,
"code": "hospital",
"name": "hospital name"
},
{
"type": 4,
"code": "上海市",
"name": "上海市"
},
{
"type": 5,
"code": "上海市",
"name": "上海市"
},
{
"type": 6,
"code": "长宁区",
"name": "长宁区"
}
],
"sales_rep":{
"username": "testname",
"real_name": "张三",
"password": "123456",
"phone": "15699999999",
"department":"销售部",
"ext_info":"{\"lead_phone\":\"18888888888\",\"lead_real_name\":\"王五\",\"lead_username\":\"wangwu\",\"area_manager\":\"张三\"}"
}
}响应数据
data数据格式
| 参数名 | 类型 | 描述 |
|---|---|---|
| code | string | 门店code |
| sales_rep | object | 销售代表,请求中有sales_rep值则有返回值,否则没有 |
| + id | int64 | 用户id |
| + username | string | 用户名,登录时的账户名 |
响应数据样例
json
{
"code": 0,
"message": "success",
"data": {
"code": "TEST001",
"sales_rep": {
"id": 9837366,
"username": "testname"
}
}
}查询门店
接口说明
根据门店code查询门店信息
请求信息
| 配置说明 | 参数值 |
|---|---|
| URL | /store?code=TEST001 |
| Method | GET |
请求参数
| 参数名 | 类型 | 描述 | 是否必填 |
|---|---|---|---|
| code | string | 门店编号 | 是 |
响应数据
data数据格式
| 参数名 | 类型 | 描述 |
|---|---|---|
| code | string | 门店编号 |
| name | string | 门店名 |
| address | string | 门店所在详细地址 |
| longitude | float64 | 门店经度 |
| latitude | float64 | 门店纬度 |
| attributes | []object | 门店属性 |
| + type | int32 | 属性类型 0: 区域 1: 营业所 2: 销售线路 3: CHANNEL 4: G1 (省) 5: G2 (市) 6: G3 (区) 7: 零售商 8: 子零售商 9: 组织 101: 自定义属性1 102: 自定义属性2 103: 自定义属性3 104: 自定义属性4 105: 自定义属性5 106: 自定义属性6 |
| + code | string | 属性code,相同type下唯一 |
| + name | string | 属性名 |
| contact_name | string | 联系人 |
| mobile | string | 电话 |
| images | []string | 门店照片 |
响应数据样例
json
{
"code": 0,
"message": "success",
"data": {
"code": "TEST001",
"name": "门店名",
"address": "xx街xx路xx号xx",
"longitude": 121.42394,
"latitude": 31.22024,
"contact_name": "contact name",
"mobile": "15699999999",
"images": ["https://f-dev.clobotics.cn/4/0040ca4d85f5e5ef7354102f486ef843.jpg","https://f-dev.clobotics.cn/4/0040ca4d85f5e5ef7354102f486ef844.jpg"],
"attributes": [
{
"type": 3,
"code": "hospital",
"name": "hospital name"
},
{
"type": 4,
"code": "上海市",
"name": "上海市"
},
{
"type": 5,
"code": "上海市",
"name": "上海市"
},
{
"type": 6,
"code": "长宁区",
"name": "长宁区"
}
]
}
}修改门店
接口说明
修改门店,字段全量更新,不支持更新部分字段。
请求信息
| 配置说明 | 参数值 |
|---|---|
| URL | /store |
| Method | PUT |
| Content-Type | application/json |
Body参数
| 参数名 | 类型 | 描述 | 是否必填 |
|---|---|---|---|
| code | string | 门店编号 | 否 |
| name | string | 门店名 | 是 |
| address | string | 门店所在详细地址 | 是 |
| attributes | []object | 门店属性 | 否 |
| + type | int32 | 属性类型。 0: 区域 1: 营业所 2: 销售线路 3: CHANNEL 4: G1 (省) 5: G2 (市) 6: G3 (区) 7: 零售商 8: 子零售商 9:组织 101: 自定义属性1 102: 自定义属性2 103: 自定义属性3 104: 自定义属性4 105: 自定义属性5 106: 自定义属性6 | 是 |
| + code | string | 属性code,相同type下唯一 | 是 |
| + name | string | 属性名 | 是 |
| contact_name | string | 联系人 | 否 |
| mobile | string | 电话 | 否 |
| images | []string | 门店照片 | 否 |
| longitude | float64 | 门店经度,需要的坐标系为WGS84 | 否 |
| latitude | float64 | 门店纬度,需要的坐标系为WGS84 | 否 |
Body数据样例
json
{
"id": 234,
"code": "TEST001",
"name": "门店名",
"address": "xx街xx路xx号xx",
"longitude": 121.42394,
"latitude": 31.22024,
"contact_name": "contact name",
"mobile": "15699999999",
"images": ["https://f-dev.clobotics.cn/4/0040ca4d85f5e5ef7354102f486ef843.jpg","https://f-dev.clobotics.cn/4/0040ca4d85f5e5ef7354102f486ef844.jpg"],
"attributes": [
{
"type": 3,
"code": "hospital",
"name": "hospital name"
},
{
"type": 4,
"code": "上海市",
"name": "上海市"
},
{
"type": 5,
"code": "上海市",
"name": "上海市"
},
{
"type": 6,
"code": "长宁区",
"name": "长宁区"
}
]
}响应数据
data数据格式
| 参数名 | 类型 | 描述 |
|---|---|---|
| code | string | 门店code |
响应数据样例
json
{
"code": 0,
"message": "success",
"data": {
"code": "TEST001"
}
}