收藏
回答

【物流助手】logistics.addOrder 报"errCode":9300501?

我使用的是云开发,在官方文档返回示例===》下单失败 https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/express/by-business/logistics.addOrder.html#%E4%BA%91%E8%B0%83%E7%94%A8

{
  "errCode": 9300501,
  "errMsg": "openapi.logistics.addOrder:fail delivery logic fail",
  "deliveryResultcode": 10002,
  "deliveryResultmsg": "客户密码不正确"

我发现在实际下单失败,却没有 deliveryResultcode 与 deliveryResultmsg 相关返回。

{"errCode":9300501,"errMsg":"openapi.logistics.addOrder:fail delivery logic fail rid: 624762bb-128693ac-06bca775"}

在关于 cloud.openapi.logistics.addOrder生成运单一直困扰着我,未能彻底解决。在调用该接口上存在上一个订单可以生成运单,而下一个订单直接报9300501。

首先怀疑是不是我提交的请求参数结构是否有问题如下:

waybill: {
  "addSource": 0,
  "bizId": "K755235493",
  "cargo": {
    "count": 2,
    "detailList": [
      {
        "count": 1,
        "name": "挪车贴"
      },
      {
        "count": 1,
        "name": "玻璃贴清洁套装"
      }
    ],
    "spaceX": 11,
    "spaceY": 11,
    "spaceZ": 3,
    "weight": 1
  },
  "customRemark": "易碎物品",
  "deliveryId": "YTO",
  "insured": {
    "insuredValue": 0,
    "useInsured": 0
  },
  "openid": "o6P3E4nBxzH7odlFPh_LhGgq2C24",
  "orderId": "Y1648474546031257047",
  "receiver": {
    "address": "塘汇街道和风丽园",
    "area": "秀洲区",
    "city": "嘉兴市",
    "mobile": "1**********",
    "name": "才****",
    "province": "浙江省"
  },
  "sender": {
    "address": "旱塘街3号圆通速递",
    "area": "大岭山",
    "city": "东莞市",
    "mobile": "1***********",
    "name": "杨**",
    "province": "广东省"
  },
  "service": {
    "serviceName": "普通快递",
    "serviceType": 0
  },
  "shop": {
    "detailList": [
      {
        "goodsDesc": "致力于为车主提供专业的挪车隐私保护",
        "goodsImgUrl": "cloud://cloud1-7g6qooij772e0cfc.636c-cloud1-7g6qooij772e0cfc-1307829367/upload/product.jpg",
        "goodsName": "云上挪车贴"
      },
      {
        "goodsDesc": "用于挪车贴更方便贴到挡风玻璃上",
        "goodsImgUrl": "cloud://cloud1-7g6qooij772e0cfc.636c-cloud1-7g6qooij772e0cfc-1307829367/upload/fujian.jpg",
        "goodsName": "玻璃贴清洁套装"
      }
    ],
    "wxaPath": "/pages/logistics/orderShow/orderShow?orderCode=Y1648474546031257047"
  }
}

以上为我提交的请求参数,该参数结构在之前一段时间是可以正常生成运单的,最近发现该接口不能正常生成运单,一直报错。

      const waybill=event.waybill //获取运单基础数据
    console.log("waybill:",waybill)
    try {
      const result = await cloud.openapi.logistics.addOrder(
        waybill
        )
      return result
    } catch (err) {
      return err
    }

以上为云函数,请问该如何彻底解决。

回答关注问题邀请回答
收藏
登录 后发表内容