errand_add_tip
给已下单的跑腿订单加小费催单。小费是独立的支付单:本工具只返回小费收银台链接,需要用户打开链接完成支付,小费才会生效并累计进订单的tip_fee。仅在骑手接单前可加,可多次调用累计加小费。
参数
| 参数 | 类型 | 必填 | 默认 | 说明 |
|---|---|---|---|---|
consent_grant_id | string | 是 | — | 用户授权 ID(cg_ 前缀,来自 errand_verify_user_bind),标识已授权用户 |
order_id | string | 是 | — | 订单 ID(err_ 前缀) |
tip_fee | integer | 是 | — | 本次要加的小费金额(分),必须大于 0 |
with_pay_qr | boolean | 否 | false | 为 true 时,在 cashier_url 旁多一个 cashier_qr_url(小费付款二维码的图片地址),用户用手机扫码即可进入同一个支付页 |
返回
金额字段
tip_fee 单位为分(整数)。| 字段 | 类型 | 说明 |
|---|---|---|
order_id | string | 订单 ID |
tip_fee | integer | 本次加的小费金额(分) |
status | string | 恒为 pending_payment,表示这笔小费单待支付 |
cashier_url | string | 小费收银台支付链接,交给用户打开完成支付 |
cashier_qr_url | string | 仅传 with_pay_qr: true 时才有:小费支付链接的二维码图片地址(https,PNG),码里就是 cashier_url。15 分钟内有效,过期后打开是 404;没生成成功时没有这个键(不是 null),小费单照常创建,请让用户直接打开 cashier_url |
{
"order_id": "err_1f5108ee7dc54730aee29d20db789d64",
"tip_fee": 100,
"status": "pending_payment",
"cashier_url": "https://g.clawdot.ai/xk2IP"
}
with_pay_qr: true 时的返回:
{
"order_id": "err_demo0000000000000000000000000001",
"tip_fee": 100,
"status": "pending_payment",
"cashier_url": "https://console.hicaspian.com/errand/pay?orderNo=demo0001&tip=1",
"cashier_qr_url": "https://paotui.hicaspian.com/qr/act_DEMO9876zyxw5432vuts.png"
}
骑手已接单后调用会返回
ERRAND_TIP_NOT_ALLOWED;tip_fee 小于等于 0 会返回 ERRAND_TIP_INVALID。错误码
| code | 说明 |
|---|---|
CONSENT_GRANT_REQUIRED | 缺少用户授权(未传 consent_grant_id) |
CONSENT_GRANT_INVALID | 用户授权无效 |
CONSENT_GRANT_EXPIRED | 用户授权已过期,需重新授权 |
CAP_NOT_BOUND | 该 Agent 未开通跑腿能力 |
CONSENT_GRANT_WRONG_CAP | 授权属于其它能力,不可用于本工具 |
ERRAND_ORDER_NOT_FOUND | 订单不存在或不属于当前授权用户 |
ERRAND_TIP_NOT_ALLOWED | 当前状态不允许加小费(骑手已接单) |
ERRAND_TIP_INVALID | 小费金额不合法,须为大于 0 的整数(单位分) |
调用示例
{
"name": "errand_add_tip",
"arguments": {
"consent_grant_id": "cg_your_consent_grant",
"order_id": "<来自 errand_create / errand_list_orders>",
"tip_fee": 100
}
}
{
"name": "errand_add_tip",
"arguments": {
"consent_grant_id": "cg_your_consent_grant",
"order_id": "<来自 errand_create / errand_list_orders>",
"tip_fee": 100,
"with_pay_qr": true
}
}

