1 背景介绍
商米巡店功能开放,支持H5实现的SDK调用
2 接口规范
2.1 协议说明
对接的openAPI接口目前只开放HTTPS方式,所有的消息一律采用POST方式。
注:消息体大小不得超过1M,超过1M的请求,直接拒绝!
Content-Type | application/x-www-form-urlencoded |
---|---|
数据格式 | 返回为JSON格式 |
字符编码 | UTF-8字符编码 |
授权方式 | Auth2.0 |
授权规则 | 参考商米OAuth2.0授权http://docs.test.sunmi.com/htmls/商米oauth2-0/ |
2.2 请求头设置
略,要带token
3 巡店业务接口
3.1 获取门店列表
接口描述:通过本接口调用,用户可以获取可查看的所有门店
请求链接:/patrol/org/getList
接口版本:v2.0
参数:
参数名称 | 是否必须 | 类型 | 说明 | 示例 |
sunmi_company_no | 是 | string | 商户编号 | |
inspection_user_id | 否 | string | 巡检人id | |
plan_start_time | 否 | integer | 巡店计划开始时间 | |
plan_end_time | 否 | integer | 巡店计划结束时间 |
请求示例:
略
返回值:
{
"code": 0,
"msg": "",
"data": {
"org_list": [{
"org_pid": 2945,
"org_tag": 442,
"level": 2,
"org_id":3812,
"org_name": "Lorem occaecat",
"sunmi_shop_no": "298374832745742387",
"org_status": 1,
"business_status": 1,
"type_one": 1,
"type_two": 1,
"type_name": "1",
"province": 1,
"city": 1,
"area": 1,
"lat": "38",
"lng": "98",
"address": "铁岭",
"business_area": 40854915,
"region": "aliqua",
"business_hours": "nulla",
"contact_person": "anim exercitation",
"contact_tel": "irure ut",
"contact_email": "mollit exerc",
"created_time": -98259710,
"modified_time": 15094789,
"patrol_service_status": -36606166,
"patrol_plan_status": 82471639,
"inspection_user_auth": 22425348,
"patrol_service_active_duration": -57840792,
"patrol_service_active_status": 2411480,
"children": [{
"org_pid": 86480169,
"org_tag": -62506489,
"level": 86737874,
"org_id": 99824037,
"org_status": -13855870,
"org_name": "do qui aute non",
"sunmi_shop_no": "occaecat id",
"business_status": -32078036,
"type_one": 98245914,
"type_two": 5120503,
"type_name": "et cillum ",
"province": 86019116,
"city": -26065136,
"area": "consequat in dolore",
"lat": "officia labore",
"lng": "eiusmod occaecat consequat et",
"address": "dolore officia cupidatat eiusmod et",
"business_area": 44639054,
"region": "Ut tempor ex ea laboris",
"business_hours": "sed mollit in",
"contact_person": "sint Lorem",
"contact_tel": "reprehenderit",
"created_time": 9669190,
"modified_time": 28811257,
"patrol_service_status": 67245690,
"patrol_plan_status": 46486322,
"inspection_user_auth": "consectetur",
"patrol_service_active_status": "id est non",
"patrol_service_active_duration": "consequat magna dolor ad"
}]
}]
}
}