Skip to content

门店

创建门店

接口说明

根据门店信息创建门店,门店code请勿重复。

请求信息

配置说明参数值
URL/store
MethodPOST
Content-Typeapplication/json

Body参数

参数名类型描述是否必填
codestring门店编号
namestring门店名
addressstring门店所在详细地址
longitudefloat64门店经度,需要的坐标系为WGS84
latitudefloat64门店纬度,需要的坐标系为WGS84
attributes[]object门店属性
+ typeint32属性类型。
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
+ codestring属性code,相同type下唯一
+ namestring属性名
contact_namestring联系人
mobilestring电话
images[]string门店照片
sales_repobject销售代表
+ usernamestring用户名,登录时的账户名,最长50位
+ real_namestring真实姓名,最长100位
+ passwordstring用户密码,最长200位
+ phonestring手机号
+ departmentstring部门,最长100位
+ ext_infostring其他额外信息,最大长度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数据格式

参数名类型描述
codestring门店code
sales_repobject销售代表,请求中有sales_rep值则有返回值,否则没有
+ idint64用户id
+ usernamestring用户名,登录时的账户名

响应数据样例

json
{
  "code": 0,
  "message": "success",
  "data": {
    "code": "TEST001",
    "sales_rep": {
      "id": 9837366,
      "username": "testname"
    }
  }
}

查询门店

接口说明

根据门店code查询门店信息

请求信息

配置说明参数值
URL/store?code=TEST001
MethodGET

请求参数

参数名类型描述是否必填
codestring门店编号

响应数据


data数据格式

参数名类型描述
codestring门店编号
namestring门店名
addressstring门店所在详细地址
longitudefloat64门店经度
latitudefloat64门店纬度
attributes[]object门店属性
+ typeint32属性类型
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
+ codestring属性code,相同type下唯一
+ namestring属性名
contact_namestring联系人
mobilestring电话
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
MethodPUT
Content-Typeapplication/json

Body参数

参数名类型描述是否必填
codestring门店编号
namestring门店名
addressstring门店所在详细地址
attributes[]object门店属性
+ typeint32属性类型。
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
+ codestring属性code,相同type下唯一
+ namestring属性名
contact_namestring联系人
mobilestring电话
images[]string门店照片
longitudefloat64门店经度,需要的坐标系为WGS84
latitudefloat64门店纬度,需要的坐标系为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数据格式

参数名类型描述
codestring门店code

响应数据样例

json
{
  "code": 0,
  "message": "success",
  "data": {
    "code": "TEST001"
  }
}