有赞新零售社区

发帖
API使用问题»创建订单接口4.0 返回 价格计算异常

[API调用-美业] 创建订单接口4.0 返回 价格计算异常

三把刷子 2022-11-10 1057 浏览 1 评论 | 只看楼主 [打印]
curl -X POST -H 'content-type: application/json'  -d '{"type":"8","node_kdt_id":"112924250","order_buyer_info":{"yz_open_id":"11HCse7C1036963462049206272","address_id":"690244523","mobile":"13891327706"},"order_promotions":[null],"order_items":[{"salesmen":[null],"item_technicians":[null],"item_snapshot_id":"n90go7UrQeVbidNZbxdh8WmdvR9w","custom_card_info":{"scope_node_kdtIds":[null,null]},"num":"1","item_origin_price":"1000","sku_id":"11457806454","item_sum_price":"1000","item_id":"2150620498","item_type":"2"}],"order_gift_items":[null]}'  "https://open.youzanyun.com/api/youzan.mei.order.create/4.0.0?access_token=105f9745cdfdfca7dc41822447ad6f0"

使用有赞云提供的API调试,返回如下
{
  "trace_id": "yz7-0a350866-1667984181270-476104",
  "code": 101356004,
  "success": false,
  "message": "价格计算异常"
}

然后使用其生成的curl在命令行执行又返回:
{"trace_id":"yz7-0ad2690b-1667984293008-914505","code":230100003,"success":false,"message":"参数错误","error_data":{"orderType":"订单类型不能为空","orderItems":"may not be empty"}}


用手机打开
收藏 ··· 回复
    云帆   有赞云团队   2022-11-10 | 只看该作者
    开发者你好,通过你提供的请求数据
    我们进行了全流程测试

    对于这个商品:"item_id": 2150620498,"sku_id": 11457806454,
    经过查询:原价为:39800 分,请从接口 https://doc.youzanyun.com/detail/API/0/1377 获取正确数据传入订单创建接口

    {
      "trace_id": "yz7-0ad2690a-1667987162295-607353",
      "code": 200,
      "data": {
        "sku_img": {
          "spec_values": []
        },
        "skus": [
          {
            "sku_no": "A0000005227116",
            "price": 39800,
            "stock_num": 999,
            "sku_id": 11457806454,
            "sku_specs": [],
            "total_sold_num": 0,
            "cost_price": 0
          }
        ],
        "category_name": "产品分类",
        "item_tags": "口服产品",
        "item_id": 2150620498,
        "stock_num": 999,
        "title": "科龄明眸",
        "price_min": 39800,
        "item_status": 1,
        "item_no": "A0000005227116",
        "item_img_urls": [
          "https://img01.yzcdn.cn/upload_files/2022/10/29/FmtWrlu-1S0wyPJgIQh3zk5z68h9.jpg"
        ],
        "price": 39800,
        "goods_alias": "2fuhznqv6u2o6jd",
        "update_at": 1667026948000,
        "create_at": 1665669444000,
        "package_info": "",
        "price_max": 39800,
        "introduction": ""
      },
      "success": true,
      "message": "successful"
    }

    之后,通过更正的数据进行调用

    curl -X POST "https://open.youzanyun.com/api/youzan.mei.order.create/4.0.0?access_token=*****" \
    -H 'content-type: application/json'  \
    -d '{"type":8,"node_kdt_id":112924250,"order_buyer_info":{"yz_open_id":"11HCse7C1036963462049206272","address_id":"690244523","mobile":"13891327706"},"order_items":[{"item_snapshot_id":"n90go7UrQeVbidNZbxdh8WmdvR9w","num":1,"item_origin_price":39800,"sku_id":11457806454,"item_sum_price":39800,"item_id":2150620498,"item_type":2}]}'


    {"trace_id":"yz7-0ad26a58-1667987367917-78037","code":200,"data":{"yz_open_id":"11HCse7C1036963462049206272","order_price":39900,"tid":"M2022110917492874192615"},"success":true,"message":"successful"}


    已经成功得到订单创建成功的结果

    另: 1. 用于测试的订单 M2022110917492874192615 请自行处理取消/其他处理。

    2. 为保证安全,示例curl请求内 access_token 已做隐藏处理

    1跳至
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    复制链接
    新浪微博
    QQ空间
    微信扫码
    • 回复

    • 评分

    客服工作时间是9:00-18:00,客服妹子当前不在线,若不能及时回复请谅解。试试右上角的搜索吧,论坛有丰富的经验贴、公告贴,相信一定能够帮到您~

    复制成功