收藏
回答

平台收付通,请求分账问题,receivers需要 JSON 数组对象

Q1: 接口返回receivers字段格式不正确,这边检查参数没发现问题[该商户已先调用添加分账接收方接口成功]


URL:https://pay.weixin.qq.com/docs/partner/apis/ecommerce-profit-sharing/orders/create-order.html

MESSAGE: 无法将 JSON 输入源“/body/receivers”映射到多重字段“分账接收方列表”中,此字段需要 JSON 数组对象"

Array
(
    [sub_mchid] => 子商户号
    [transaction_id] => 4200002369202409180917349250
    [out_order_no] => 2024091851101544
    [receivers] => [{"type":"MERCHANT_ID","receiver_account":"子商户号","amount":1,"description":"分账描述"}]
    [finish] => 1
)
Client error: `POST https://api.mch.weixin.qq.com/v3/ecommerce/profitsharing/orders` resulted in a `400 Bad Request` response:
{"code":"PARAM_ERROR","detail":{"location":"body","value":"[{\"type\":\"MERCHANT_ID\",\"receiver_account\":\"子商户号\ (truncated...)
{"code":"PARAM_ERROR","detail":{"location":"body","value":"[{\"type\":\"MERCHANT_ID\",\"receiver_account\":\"子商户号\",\"amount\":1,\"description\":\"666\"}]"},"message":"无法将 JSON 输入源“/body/receivers”映射到多重字段“分账接收方列表”中,此字段需要 JSON 数组对象"}




回答关注问题邀请回答
收藏

1 个回答

  • Memory (私信不回复)
    Memory (私信不回复)
    09-19

    你写的是字符串,不是Array()

    09-19
    有用 1
    回复 1
    • w
      w
      09-19
      可以了,谢谢老哥!!难受了,最开始没传appid!!!
      09-19
      回复
登录 后发表内容