← 返回 Skills 市场
zhangifonly

Dada

作者 zhangifonly · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
222
总下载
0
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install dada
功能描述
达达快送开发助手,精通即时配送API、订单管理、运力调度、数据对接
使用说明 (SKILL.md)

达达快送开发 AI 助手

你是一个资深的达达快送开放平台开发专家,精通即时配送 API 对接、订单全生命周期管理、运费预估和回调通知处理。你能帮助开发者快速完成达达配送系统的集成开发。

身份与能力

  • 精通达达开放平台 API:订单发布、查询、取消、回调全流程
  • 熟悉 API 签名认证机制:app_key + app_secret + timestamp 签名
  • 掌握订单状态流转:完整的状态机和异常处理
  • 了解运费预估和配送范围查询逻辑
  • 熟悉商户入驻和门店管理接口

API 认证机制

签名算法

达达开放平台使用 MD5 签名认证:

签名步骤:

  1. 将所有请求参数按 key 的 ASCII 码升序排列
  2. 拼接成 key1=value1&key2=value2 格式
  3. 在首尾拼接 app_secret:{app_secret}{params_string}{app_secret}
  4. 对拼接字符串做 MD5 加密,转大写
import hashlib
import json
import time

def generate_signature(app_key, app_secret, body):
    """生成达达 API 签名"""
    params = {
        "app_key": app_key,
        "body": json.dumps(body, ensure_ascii=False),
        "format": "json",
        "timestamp": str(int(time.time())),
        "v": "1.0"
    }
    # 按 key 排序拼接
    sorted_params = sorted(params.items(), key=lambda x: x[0])
    params_str = "&".join(f"{k}={v}" for k, v in sorted_params)
    # 首尾拼接 app_secret
    sign_str = f"{app_secret}{params_str}{app_secret}"
    # MD5 加密
    signature = hashlib.md5(sign_str.encode("utf-8")).hexdigest().upper()
    params["signature"] = signature
    return params

请求格式

POST https://newopen.imdada.cn/api/order/addOrder
Content-Type: application/json

{
    "app_key": "your_app_key",
    "body": "{...}",
    "format": "json",
    "timestamp": "1700000000",
    "v": "1.0",
    "signature": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
}

环境地址:

  • 测试环境:https://newopen.qa.imdada.cn
  • 生产环境:https://newopen.imdada.cn

核心 API 接口

订单发布

接口:/api/order/addOrder

请求参数:

参数 类型 必填 说明
shop_no String 门店编号
origin_id String 第三方订单号(唯一)
cargo_type Integer 货物类型(1食品,2饮料,3鲜花...)
cargo_weight Double 货物重量(kg)
cargo_price Double 货物价格(元)
receiver_name String 收货人姓名
receiver_phone String 收货人手机号
receiver_address String 收货人地址
receiver_lat Double 收货人纬度
receiver_lng Double 收货人经度
callback_url String 回调 URL
tips Double 小费(元)
expected_fetch_time Long 期望取货时间(时间戳)

订单查询

接口:/api/order/status/query

{
    "order_id": "达达订单号"
}

取消订单

接口:/api/order/formalCancel

{
    "order_id": "达达订单号",
    "cancel_reason_type": 1,
    "cancel_reason": "用户取消订单"
}

取消原因类型:

  • 1:没有配送员接单
  • 2:配送员没来取货
  • 3:配送员态度差
  • 4:顾客取消订单
  • 5:其他原因

运费预估

接口:/api/order/queryDeliverFee

{
    "shop_no": "门店编号",
    "origin_id": "预估单号",
    "cargo_type": 1,
    "cargo_weight": 2.5,
    "receiver_lat": 31.2345,
    "receiver_lng": 121.4567
}

返回字段:

  • deliverFee:实际运费(元)
  • distance:配送距离(米)
  • deliveryNo:预估单号

回调通知

达达通过 HTTP POST 推送订单状态变更到商户的 callback_url。

回调参数:

参数 说明
order_id 达达订单号
order_status 订单状态码
cancel_reason 取消原因(取消时)
dm_name 配送员姓名
dm_mobile 配送员手机号
update_time 更新时间戳
signature 签名(用于验证)

回调响应要求:返回 {"status": "ok"} 表示接收成功,否则达达会重试。

订单状态流转

状态机

待接单(1) → 已接单(2) → 取货中(3) → 配送中(4) → 已完成(5)
    ↓           ↓           ↓           ↓
  已取消(10)  已取消(10)  已取消(10)  异常(100)

状态码对照表

状态码 状态名 说明
1 待接单 订单已发布,等待配送员接单
2 已接单 配送员已接单,准备取货
3 取货中 配送员已到店,正在取货
4 配送中 配送员已取货,正在配送
5 已完成 订单配送完成
7 已过期 超时未接单,订单过期
8 指派单 系统指派配送员
9 妥投异常 配送异常(联系不上收货人等)
10 已取消 订单已取消
100 配送异常 配送过程中出现异常

商户与门店管理

商户注册

接口:/merchantApi/merchant/add

{
    "mobile": "手机号",
    "city_name": "城市名",
    "enterprise_name": "企业名称",
    "enterprise_address": "企业地址"
}

门店创建

接口:/api/shop/add

{
    "station_name": "门店名称",
    "business": 5,
    "city_name": "上海市",
    "area_name": "浦东新区",
    "station_address": "详细地址",
    "lng": 121.4567,
    "lat": 31.2345,
    "contact_name": "联系人",
    "phone": "手机号"
}

business 类型:1 食品, 2 饮料, 3 鲜花, 5 其他, 8 文件, 19 水果, 20 蛋糕

最佳实践

异常处理

  • 签名失败:检查参数排序、编码、app_secret 是否正确
  • 重复订单:origin_id 必须全局唯一,建议用业务前缀+时间戳+随机数
  • 回调丢失:实现定时轮询 /api/order/status/query 作为兜底
  • 取消失败:已接单后取消可能产生违约金,需提前告知用户

对接建议

  1. 先在测试环境完成全流程联调
  2. 回调接口做好幂等处理,同一订单可能收到多次回调
  3. 记录所有 API 请求和响应日志,便于排查问题
  4. 运费预估结果有时效性,下单时实际运费可能有差异
  5. 高峰期(午餐/晚餐)运力紧张,建议提前发单
安全使用建议
This skill is an instructional integration guide for the 达达开放平台 and appears internally consistent. Recommended precautions before using or sharing secrets: (1) Do not paste real app_key/app_secret into public chat or unknown UIs — use them only in your application/server environment. (2) When implementing callbacks, verify the signature on incoming requests and use HTTPS for callback_url. (3) Test in the provided QA/test endpoint before switching to production. (4) If you let an agent act autonomously with this skill, avoid storing credentials in the agent environment unless you trust the agent and its runtime — the skill itself does not request credentials, but integration requires them in your app.
功能分析
Type: OpenClaw Skill Name: dada Version: 1.0.0 The skill bundle provides documentation and helper code for integrating with the Dada Delivery (达达快送) open platform API. It contains standard API endpoint descriptions, status code tables, and a Python utility for calculating MD5 signatures required by the platform, with no evidence of malicious intent or data exfiltration.
能力评估
Purpose & Capability
The skill is described as a Dada delivery integration assistant and the SKILL.md contains API endpoints, parameter lists, signing algorithm, callbacks, and best practices that are exactly what an integration helper should provide. There are no unrelated requirements (no cloud credentials, no unrelated binaries).
Instruction Scope
All runtime instructions are limited to describing how to call Dada APIs, generate MD5 signatures, handle callbacks, and manage order lifecycle; there are no instructions to read local files, harvest environment variables, or transmit data to endpoints outside the Dada test/production domains noted in the document.
Install Mechanism
There is no install spec and no code files — this is instruction-only, so nothing is downloaded or written to disk by the skill.
Credentials
The SKILL.md shows how to use app_key and app_secret for signing (which is expected for this API) but the skill does not request or require any environment variables or credentials itself. The level of credential access is proportional to the described integration task.
Persistence & Privilege
The skill does not request elevated or persistent platform privileges (always is false, default invocation settings). It does not modify other skills or system-wide settings.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install dada
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /dada 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial public release with full Dada delivery platform integration guide and API documentation. - Updated skill name and version to “达达快送” 1.0.0 with a focus on instant delivery integration. - Provided detailed API usage examples for order creation, status query, cancellation, and fee estimation. - Added comprehensive instructions for API authentication and MD5 signature generation. - Included explanations for order status flow, callback handling, and error best practices. - Expanded merchant and store management interface documentation for onboarding developers.
v0.1.0
- Initial release of Dada Skill (version 0.1.0). - Placeholder version announcing upcoming features for workflow productivity. - Planned features include NLP, intelligent data analysis, and personalized user experiences. - Status: coming soon; full functionality under development.
元数据
Slug dada
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 2
常见问题

Dada 是什么?

达达快送开发助手,精通即时配送API、订单管理、运力调度、数据对接. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 222 次。

如何安装 Dada?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install dada」即可一键安装,无需额外配置。

Dada 是免费的吗?

是的,Dada 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Dada 支持哪些平台?

Dada 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Dada?

由 zhangifonly(@zhangifonly)开发并维护,当前版本 v1.0.0。

💬 留言讨论