场景说明:
商家拥有多家线下门店,需要使用微商城的多网点功能,并在微商城中完成网点的创建、网点信息的更新、网点的删除等基础操作。
——商家在微商城后台手动添加网点信息,微商城后台-营销-配套工具-多网点,点击“新增网点”,填写网点基本信息,如果勾选了同城配送,需要设置同城配送相关信息,见下图;信息配置完成后点击保存,即可完成网点的添加;
——通过哪个接口可以快捷的完成网点的创建? (1)创建网点:youzan.multistore.offline.create (3)重要字段说明: 》》address:详细地址,网点的详细地址,建议精确到XX路XX号;有非法字符限制; 》》area:区名,比如杭州的西湖区、滨江区、余杭区等; 》》business_hours_advanced:营业时间,可按天设置;格式示例如下: [{ “open_time”:"00:10", “close_time":"16:00", “weekdays”:[“周一","周二","周三","周四","周五"] }, { “open_time":"00:10", “close_time":"20:00", “weekdays":["周六","周日"] 》》city:市名,比如杭州市、南京市等; 》》image:图片地址,逗号分隔,可通过接口youzan.materials.storage.platform.img.upload 上传图片获得图片URL地址和图片ID;也可以使用任何可以正常访问的图片URL地址; 》》lat和lng:经度和纬度,百度坐标系标准,多网点定位需要用到经纬度,因此参数属性为必传; 》》local_delivery_scope_type:开启同城配送时,同城配送范围的划定方式;1表示半径,2表示多边形; 》》local_delivery_polygon:同城配送多边形范围,只有当local_delivery_scope_type=2时生效。格式如:点1经度,点1纬度|点2经度,点2纬度|点3经度,点3纬度|点4经度,点4纬度…(百度坐标系) 》》name:网点名称,有违禁词限制; 》》phone1和phone2:前者为区号,如0571;后者为电话号码或手机号,如15088886668; 》》province:省名,如浙江省、江西省等; 》》tag_ids:标签ID列表,多个网点可以添加到同一个标签下,多用于网点较多时,将具有相似特征的网点添加到同一个标签下的场景; (4)调用格式,通过(2)中链接访问后: (5)HTTP调用示例: (6)JAVA调用示例: YZClientclient = newDefaultYZClient(new Token("token")); //new Sign(appKey, appSecret) YouzanMultistoreOfflineCreateParamsyouzanMultistoreOfflineCreateParams = new YouzanMultistoreOfflineCreateParams(); youzanMultistoreOfflineCreateParams.setAddress("黄龙万科中心"); youzanMultistoreOfflineCreateParams.setArea("西湖区"); youzanMultistoreOfflineCreateParams.setBusinessHoursAdvanced("[{"open_time":"00:00","close_time":"01:00","weekdays":["\u5468\u4e00"]}]"); youzanMultistoreOfflineCreateParams.setCity("杭州市"); youzanMultistoreOfflineCreateParams.setCountyId("330106"); youzanMultistoreOfflineCreateParams.setDescription("这是一段网点描述"); youzanMultistoreOfflineCreateParams.setImage("https://img.yzcdn.cn/public_files/2017/05/19/68863f28f4852607aa797cbcd741563d.png"); youzanMultistoreOfflineCreateParams.setIsSelfFetch(1L); youzanMultistoreOfflineCreateParams.setIsStore(1L); youzanMultistoreOfflineCreateParams.setLat("30.281374"); youzanMultistoreOfflineCreateParams.setLng("120.132657"); youzanMultistoreOfflineCreateParams.setLocalDeliveryScope("3000"); youzanMultistoreOfflineCreateParams.setLocalDeliveryStartAmount("2000"); youzanMultistoreOfflineCreateParams.setName("有赞云测试网点"); youzanMultistoreOfflineCreateParams.setPhone1("0571"); youzanMultistoreOfflineCreateParams.setPhone2("88990088"); youzanMultistoreOfflineCreateParams.setProvince("浙江省"); youzanMultistoreOfflineCreateParams.setSupportLocalDelivery(1L); youzanMultistoreOfflineCreateParams.setLocalDeliveryScopeType(2L); youzanMultistoreOfflineCreateParams.setLocalDeliveryPolygon("120.122257,30.290374|120.143057,30.290374|120.143057,30.272374|120.122257,30.272374"); YouzanMultistoreOfflineCreateyouzanMultistoreOfflineCreate = new YouzanMultistoreOfflineCreate(); youzanMultistoreOfflineCreate.setAPIParams(youzanMultistoreOfflineCreateParams); YouzanMultistoreOfflineCreateResultresult = client.invoke(youzanMultistoreOfflineCreate);
——当某个网点失效或取消时,在网点管理中的更多选项中,选择删除可以将该网点从微商城后台删除掉;
——通过哪个接口可以快速的删除不需要的网点? (1)删除网点:youzan.multistore.offline.delete (3)重要字段说明: 》》id:网点id,需要删除的网点id (4)调用格式,通过(2)中链接访问后: (5)HTTP请求示例: (6)JAVA调用示例: YZClientclient = newDefaultYZClient(new Token("token")); //new Sign(appKey, appSecret) YouzanMultistoreOfflineDeleteParamsyouzanMultistoreOfflineDeleteParams = new YouzanMultistoreOfflineDeleteParams(); youzanMultistoreOfflineDeleteParams.setId(2563736L); YouzanMultistoreOfflineDeleteyouzanMultistoreOfflineDelete = new YouzanMultistoreOfflineDelete(); youzanMultistoreOfflineDelete.setAPIParams(youzanMultistoreOfflineDeleteParams); YouzanMultistoreOfflineDeleteResultresult = client.invoke(youzanMultistoreOfflineDelete);
主帖>【多网点接口】五大场景接口对接说明 |