请求分账文档:微信分配的公众账号ID是选填,但实际是这个appid是必填项,感谢! appid 选填 string(32) 【微信分配的公众账号ID】微信分配的公众账号ID 因为文档写的选填,之前添加了后来请求接口报参数错误,又去掉后请求接口还是报参数参数。刚刚我又添加了appid。请求接口成功返回: { "status": 1000, "msg": "", "data": { "order_id": "30001909912025031183873449929", "out_order_no": "4343102484202503116409408407", "receivers": [ { "amount": 3, "description": "测试分账", "detail_id": "36001909912025031119786248039", "finish_time": "2025-03-11T13:24:54+08:00", "receiver_account": "1704664915", "receiver_mchid": "1704664915", "result": "SUCCESS", "type": "MERCHANT_ID" } ], "status": "FINISHED", "sub_mchid": "1709441164", "transaction_id": "4343102484202503116409408407" }, "refresh_ticket": "" }
微信平台收付通,请求分账接口一直报错:请求参数错误微信平台收付通(分账)-请求分账接口一直报错:请求参数错误。 严格按照文档要求的参数,严格按照官方提供PHP版本SDK, 已经添加分账接收方,已经添加合单支付标识。 为啥还一直报参数错误,我应该怎么排查错误 PHP代码如下: public function profitsharing($params){ try { // 硬编码测试数据 $requestData = [ 'sub_mchid' => '1709441164', // 二级商户号 'transaction_id' => '4343102484202503116409408407', // 微信支付订单号 'out_order_no' => '4343102484202503116409408407', // 系统自定义订单号 'receivers' => [ [ 'type' => 'MERCHANT_ID', 'receiver_account' => '1704664915', // 接收方商户号 'amount' => 3, // 3元=300分 'description' => '测试分账' ] ], 'finish' => false // 是否完成分账 ]; $debug = json_encode($requestData, JSON_UNESCAPED_UNICODE); // 添加调试日志 Log::debug('分账请求原始数据:'.$debug ); // 请求头配置 $headers = [ 'Wechatpay-Serial' => config('pay.wechatpay.platform_serial_no'), 'Accept' => 'application/json', 'Content-Type' => 'application/json' ]; // 发起请求 $response = $this->wechatPayClient ->chain('v3/ecommerce/profitsharing/orders') ->post([ 'json' => $requestData, 'headers' => $headers, 'verify' => false // 生产环境验证证书 ]); // Log::debug('分账响应详情', json_decode($response, true)); return json_decode((string)$response->getBody(), true); } catch (\Throwable $e) { // 解析具体错误 $errorInfo = [ 'message' => $e->getMessage(), 'code' => $e->getCode() ]; if ($e instanceof RequestException && $e->hasResponse()) { $response = $e->getResponse(); $errorInfo['status_code'] = $response->getStatusCode(); $errorInfo['headers'] = $response->getHeaders(); $errorInfo['response'] = (string)$response->getBody(); } Log::error('分账异常详情', $errorInfo); throw new Exception('分账请求失败: '.$e->getMessage()); } } apipost测试返回结果如下: [2025-03-11T11:40:19+08:00][debug] 分账请求原始数据:{"sub_mchid":"1709441164","transaction_id":"4343102484202503116409408407","out_order_no":"4343102484202503116409408407","receivers":[{"type":"MERCHANT_ID","receiver_account":"1704664915","amount":6,"description":"测试分账"}],"finish":false} [2025-03-11T11:40:19+08:00][error] 分账异常详情 [2025-03-11T11:40:19+08:00][error] [0]分账请求失败: Client error: `POST https://api.mch.weixin.qq.com/v3/ecommerce/profitsharing/orders` resulted in a `400 Bad Request` response: {"code":"PARAM_ERROR","message":"请求参数错误"}
03-11为啥一直报:[2025-03-11T11:40:19+08:00][debug] 分账请求原始数据:{"sub_mchid":"1709441164","transaction_id":"4343102484202503116409408407","out_order_no":"4343102484202503116409408407","receivers":[{"type":"MERCHANT_ID","receiver_account":"1704664915","amount":6,"description":"测试分账"}],"finish":false} [2025-03-11T11:40:19+08:00][error] 分账异常详情 [2025-03-11T11:40:19+08:00][error] [0]分账请求失败: Client error: `POST https://api.mch.weixin.qq.com/v3/ecommerce/profitsharing/orders` resulted in a `400 Bad Request` response: {"code":"PARAM_ERROR","message":"请求参数错误"}
平台收付通分账接口问题有几个问题需要帮忙解答一下: 1.平台收付通下的二级商户进行分账是否需要添加分账接收方? 2.平台收付通请求分账接口,单次请求分账,是否支持相同的商户号/openId 多次金额分账 比如500元 ,一次分账请求中 我需要分账给A用户总计80元,这个请求中我想把金额进行拆开 一个30元 一个50元,单次请求是否支持这种场景 3.平台收付通中请求分账接口传参的 finish参数 的含义是分账完结的意思吧,如果该参数为true,一次分账请求中,分账查询到有失败有成功的,是否可以重新进行请求分账? 比如有一个100元的需要分账订单,其中分账 A 用户5元,B用户 10元,我在平台收付通的请求分账接口传 finish=true进行请求接口,分账查询接口查到用户B的10元分账失败了 原因接收方未实名等异常情况,那么此时是否解冻商户金额,解冻金额为多少,失败的10元分账是否支持进行再一次分账
03-11