五品牌共用一条通道:brand 取 luckin / star / cotti / chagee / mdl(麦当劳)(同一聚合网关与密钥,中控按品牌路由路径前缀)。查询与下单五品牌全量开放。点餐为动态报价业务: 菜单价格实时变动,中控不落商品目录。API 调用不区分应用类别(任意类型应用的 ta_id/api_secret 均可调用全部业务端点;应用类别仅用于客户应用的自动化部署画像)。

点餐接入流程

  1. 前置查询(透传,不落库不扣费):城市 → 附近/关键字门店 → 门店菜单 → 商品 SKU。 中控注入上游密钥签名后转发,响应为上游原文 JSON 字符串(data 字段),品牌间报文字段 差异请按中控提供的各品牌对接文档处理(麦当劳的门店/关键字门店/套餐详情接口与咖啡品牌不同名, query 参数见下表与前置查询参数矩阵)。
  2. 统一下单:POST /openapi/v1/order/submit,biz_type=FOOD、product_code=品牌专属商品(平台 DC 编码,见[统一下单契约](#统一下单契约biz_typefood))、 quantity=1(平台侧恒为 1,购物车在 ext_data.products 数组表达,最多 20 行)、 cost_quote=Σ明细(元)、ext_data 携带门店+购物车明细(见下方示例)。 中控落库扣费后异步调上游下单(四品牌 submitAllOrder 批量、mdl 逐行 submitOrder): 一单限同品牌(商品 schema 锁定 brand),上游每行生成一个子订单。中控负责子单聚合(见统一下单契约)。
  3. 状态通知:上游出餐状态回调推送中控,中控按订单状态变更回推客户回调地址 (签名 / 重试机制见回调通知)。
  4. 取餐码:随上游回调整写入订单供应商凭证字段 ret_para——单商品订单为纯字符串(如 T1010); 多商品订单为 JSON 行号映射(如 {"1":"T1010","2":"T7777"},超长退化为最后到达行纯码)。 每行权威来源:/order/detail 的 ext_data.diancan_progress.{apiOrderNo}.pick_code(含各行 order_no/status)。 GET /openapi/v1/order/query 与 /order/detail 均返回 ret_para。 取餐凭证在回调与查询双通道透出:ORDER_STATUS 回调携带 pick_code=取餐码 (与 ret_para 同源)、pick_up_code=取餐二维码内容(上游 pickUpCode 原文,可据此渲染取餐 二维码供用户扫码取餐;部分品牌取餐码与取餐二维码二者齐发);GET /order/query 与 /order/detail 出参同样携带 pick_code/pick_up_code 字段(口径与回调一致,其他业务为 null),不便处理回调的 接入方可直接轮询查询接口取码。单商品订单为原文字符串、多商品订单为 JSON 行号映射字符串, 未取得时为 null/键缺省。回调字段表见订单状态事件。

点餐前置查询端点

路径 query 参数 说明
/openapi/v1/diancan/{brand}/cities 无 城市列表(star 无此接口)
/openapi/v1/diancan/{brand}/current-city longitude/latitude 经纬度获取当前城市(mdl 专属)
/openapi/v1/diancan/{brand}/nearby-shops 四品牌 lon/lat/cityId/keyword?;mdl longitude/latitude 附近门店
/openapi/v1/diancan/{brand}/place-shops luckin/star keyWords/lon/lat/cityId;mdl keyword/cityCode 关键字门店(cotti/chagee 无)
/openapi/v1/diancan/{brand}/menus 四品牌 storeId/storeName;mdl storeCode/dateType(1早餐 2正餐) 门店菜单
/openapi/v1/diancan/{brand}/skus 四品牌 storeId/productId;mdl storeCode/productCode 商品详情/SKU(mdl 为套餐组合详情,上游 getProductInfo)
/openapi/v1/diancan/{brand}/balance type(1瑞幸 2星巴克 3麦当劳 4霸王茶姬 5库迪) 上游账户余额

前置查询参数矩阵

中控端点 luckin star cotti chagee mdl(麦当劳)
/{brand}/cities 无业务参数 无此接口(上游 404 透传) 无业务参数 无业务参数 无业务参数
/{brand}/current-city — — — — longitude、latitude 必填(mdl 专属)
/{brand}/nearby-shops lon、lat 必填;cityId 选填;keyword 选填 lon、lat lon、lat、cityId 必填;keyword 选填 lon、lat、cityId 必填 longitude、latitude 必填
/{brand}/place-shops keyWords、lon、lat、cityId 必填 keyWords 必填 无此接口 无此接口 keyword、cityCode 必填
/{brand}/menus storeId、storeName 必填 storeId 必填 无业务参数 无业务参数 storeCode、dateType 必填(1 早餐 / 2 正餐)
/{brand}/skus storeId、productId 必填 storeId、productId 必填 storeId、productId 必填 storeId、productId 必填 storeCode、productCode 必填(套餐组合详情,上游 getProductInfo;2026-09-11 前 packageId 口径已废)
/{brand}/balance type 必填 type 必填 type 必填 type 必填 type 必填(3=麦当劳)
  • lon/lat 为字符串经纬度;cityId 来自 cities 响应;storeId/productId 来自门店/菜单响应。
  • mdl 的 cityCode/storeCode 来自 current-city/nearby-shops(门店列表 code/cityCode 字段), productCode 来自 menus 响应商品行;dateType 区分早餐(1)/正餐(2)菜单。
  • 请求体固定为 {"query": {...}},query 内即上表业务参数;响应 data 为上游原文。

响应关键字段

门店列表 nearby-shops / place-shops(data 为数组或对象包裹,按品牌):

字段 luckin star cotti chagee mdl(麦当劳)
门店ID storeId storeId data.nearbyShopList[].shopMdCode data[].shopDetail.id code(=storeCode,下单用)
门店名 storeName name nearbyShopList[].shopName shopDetail.name name(shortName 短名)
地址 address address nearbyShopList[].address shopDetail.address address
经纬度 lat/lon lat/lon latitude/longitude(在门店对象内) shopDetail.lat/shopDetail.lng latitude/longitude
营业状态 businessStatus(1=营业中) businessStatus(1=营业中) closed/status businessStatus(10=营业中)/operateStatus businessStatus(1=营业中)/onlineBusinessStatus
营业时间 businessTime businessTime(JSON 串,按周) currentSaleTime businessTimes startTime/endTime(如 07:00-23:00)
城市 — — — — cityCode(=下单 city_code)/cityName
距离/电话 — — — — distance(distanceText 米)/telephone

菜单 menus(价格字段是下单金额的来源,单位分):

字段 luckin star cotti chagee mdl(麦当劳)
分组 category_name/category_id 无分组(扁平商品列表) categoryName categoryName/categoryCode categoryName/categoryCode 两级树(children[] 递归)
商品ID products[].product_id data[].product_id products[].productCode products[].productCode products[].productCode(下单 product_code)
商品名 products[].name data[].name products[].productName products[].productName products[].productName
图片 products[].image data[].image products[].image products[].image products[].image
结算价(分) products[].sellingPrice(不分杯型) tallSellingPrice/grandeSellingPrice/ventiSellingPrice tallSellingPrice/grandeSellingPrice/ventiSellingPrice smallSellingPrice/mediumSellingPrice/largeSellingPrice(0=该杯型不可售) products[].sellingPrice(mdl 详情查询用 productCode,见 skus 行)
原价(分) products[].originalPrice tallOriginalPrice/… tallPrice/… smallPrice/mediumPrice/largePrice products[].originalPrice(另有 discountPrice 优惠价)

SKU skus(下单规格来源):

字段 luckin cotti chagee
规格组 spec_groups[].group_name + options[].option_id/option_name specItems[].specItemNo/specItemName + specValueList[].value/name sortedSpecList[].specName + sortedPracticeList[].practiceName/practiceValueList
SKU 编码 sku_list[].sku_code(如 SP2077-00261) 由 specItemNo-value 拼接(下单 skuInfo 用) goodsSkuList[].skuId(杯型 SKU)+ 做法值 practiceValueId
价格 sellingPrice(分) firstSku.*Price 系列 goodsSkuList[].salePrice(分为单位注意核对)/showPriceLow

star 的商品详情为 customization_data(定制分组)+ coffee_sku_mapping(规格键→SKU,如 Grande_Cold)+ rules(数量规则)体系。 下单所需的 spec_sku/spec_id/cup_size/temperature 取自 coffee_sku_mapping(键 = ${cupsize}_${temperature}), add_extra 各项取自定制分组的选中项(id=选项 id、extra_sku=选项 code、qty=数量,bar 类型取规则 default_count), customization_str 为选中项按展示顺序 / 拼接(如 大杯/冰/燕麦奶/标准甜)。

mdl(麦当劳)的 skus 为套餐组合详情(上游 getProductInfo,2026-09-11 起参数 storeCode+productCode):响应 data.product 为 套餐对象。下单所需字段的取值路径:

  • product_code = product.code(与菜单 productCode 一致);
  • combo_items(组合选择)= product.comboItems[] 逐轮选取:round(轮次)、 该轮 comboProducts[] 中选中商品的 code → product_code;
  • 选中商品的定制项:customization.options[].code(勾选项,如麦香鸡酱 100136)→ options 数组; customization.items / comboProducts 级加购 → items 映射(编码→数量);
  • 组合加价:候选商品 diffPrice(分,如 +¥2)需计入 selling_price; isSoldOut/soldOutMsg 售罄校验;priceType=fixed 为一口价套餐(无组合选择)。