# 运力更新需支付的运费

> 接口应在服务器端调用，不可在前端（小程序、网页、APP等）直接调用，具体可参考[接口调用指南](/doc/oplatform/developers/dev/guide.md)。

接口英文名：scatterupdateorderfee

支付分订单更新运费接口，须保证该订单状态不是待揽件状态。正常流程是：用户下支付分订单，运力公司调用更新订单状态接口，然后再调用更新运费接口。

## 1. 调用方式

### HTTPS 调用

```bash
POST https://api.weixin.qq.com/cgi-bin/express/delivery/single_waybill/fee?access_token=ACCESS_TOKEN
```

### 云调用

- 本接口不支持云调用。

### 第三方调用

- 本接口不支持第三方平台调用。

## 2. 请求参数

### 查询参数 `Query String Parameters`

```json
[
  {
    "参数名": "access_token",
    "类型": "string",
    "必填": "是",
    "示例": "ACCESS_TOKEN",
    "说明": "接口调用凭证，可使用 [access_token](/miniprogram/dev/server/API/mp-access-token/api_getaccesstoken)"
  }
]
```

### 请求体 `Request Payload`

```json
[
  {
    "参数名": "token",
    "类型": "string",
    "必填": "是",
    "说明": "商户侧下单事件中推送的 Token 字段"
  },
  {
    "参数名": "waybill_id",
    "类型": "string",
    "必填": "是",
    "说明": "运单 ID"
  },
  {
    "参数名": "need_pay",
    "类型": "number",
    "必填": "是",
    "说明": "是否需要用户在线支付， 0不需要，1需要，2需要(支付分)"
  },
  {
    "参数名": "fee",
    "类型": "number",
    "必填": "是",
    "说明": "需要支付的金额（一般等于original_fee，如有优惠则填最终需要支付的金额），单位分"
  },
  {
    "参数名": "original_fee",
    "类型": "number",
    "必填": "是",
    "说明": "原价（base_fee+insured_fee+other_fee），单位分"
  },
  {
    "参数名": "base_fee",
    "类型": "number",
    "必填": "是",
    "说明": "运费，单位分"
  },
  {
    "参数名": "insured_fee",
    "类型": "number",
    "必填": "否",
    "说明": "保价费，单位分"
  },
  {
    "参数名": "other_fee",
    "类型": "number",
    "必填": "否",
    "说明": "其他费用，单位分"
  },
  {
    "参数名": "remark",
    "类型": "number",
    "必填": "否",
    "说明": "其他费用备注"
  },
  {
    "参数名": "pay_goods_name",
    "类型": "string",
    "必填": "否",
    "说明": "商品名称（对应微信支付商品详情页上的商品名称）"
  }
]
```

## 3. 返回参数

### 返回体 `Response Payload`

```json
[
  {
    "参数名": "errcode",
    "类型": "number",
    "说明": "错误码"
  },
  {
    "参数名": "errmsg",
    "类型": "string",
    "说明": "错误信息"
  }
]
```

## 4. 注意事项

本接口无特殊注意事项

## 5. 代码示例

本接口无代码示例

## 6. 错误码

此接口没有特殊错误码，可参考 [通用错误码](/doc/oplatform/developers/errCode/README.md)；调用接口遇到报错，可使用官方提供的 [API 诊断工具](https://developers.weixin.qq.com/console/devtools/debug?utm_source=api_errcode) 辅助定位和分析问题。

## 7. 适用范围

本接口暂未明确可调用账号类型，或在业务中根据调用传参自行确定是否可调用，请以实际调用情况为准。
