查询申请单状态-使用业务单号和商户号

更新时间:2025.07.17

使用业务单号和商户号查询超级管理员修改申请单的状态

接口说明

支持商户:【平台商户】

请求方式:【GET】/v3/mchalterapply/mchcontactalterapplyment/merchant/{merchant_code}/out-request-no/{out_request_no}

请求域名:【主域名】https://api.mch.weixin.qq.com 使用该域名将访问就近的接入点

     【备域名】https://api2.mch.weixin.qq.com 使用该域名将访问异地的接入点 ,指引点击查看

请求参数

Header  HTTP头参数

 Authorization  必填 string

请参考签名认证生成认证信息


 Accept  必填 string

请设置为application/json


path  路径参数

 merchant_code  必填   string(32)

【微信支付商户号】 本服务商进件、已签约的特约商户/二级商户号。


 out_request_no  必填   string(64)

【业务申请编号】 1、只能由数字、字母或下划线组成,建议前缀为服务商商户号。
2、服务商自定义的唯一编号。

请求示例

Java
Go
curl

需配合微信支付工具库 WXPayUtility 使用,请参考 Java 

1package com.java.demo;
2
3import com.java.utils.WXPayUtility; // 引用微信支付工具库,参考:https://pay.weixin.qq.com/doc/v3/partner/4014985777
4
5import com.google.gson.annotations.SerializedName;
6import com.google.gson.annotations.Expose;
7import okhttp3.MediaType;
8import okhttp3.OkHttpClient;
9import okhttp3.Request;
10import okhttp3.RequestBody;
11import okhttp3.Response;
12
13import java.io.IOException;
14import java.io.UncheckedIOException;
15import java.security.PrivateKey;
16import java.security.PublicKey;
17import java.util.ArrayList;
18import java.util.HashMap;
19import java.util.List;
20import java.util.Map;
21
22/**
23 * 修改超级管理员信息:查询申请单-使用业务单号和商户号
24 */
25public class GetContactApplymentByOutRequestNo {
26  private static String HOST = "https://api.mch.weixin.qq.com";
27  private static String METHOD = "GET";
28  private static String PATH = "/v3/mchalterapply/mchcontactalterapplyment/merchant/{merchant_code}/out-request-no/{out_request_no}";
29
30  public static void main(String[] args) {
31    // TODO: 请准备商户开发必要参数,参考:https://pay.weixin.qq.com/doc/v3/partner/4013080340
32    GetContactApplymentByOutRequestNo client = new GetContactApplymentByOutRequestNo(
33      "19xxxxxxxx",                    // 商户号,是由微信支付系统生成并分配给每个商户的唯一标识符,商户号获取方式参考 https://pay.weixin.qq.com/doc/v3/partner/4013080340
34      "1DDE55AD98Exxxxxxxxxx",         // 商户API证书序列号,如何获取请参考 https://pay.weixin.qq.com/doc/v3/partner/4013058924
35      "/path/to/apiclient_key.pem",    // 商户API证书私钥文件路径,本地文件路径
36      "PUB_KEY_ID_xxxxxxxxxxxxx",      // 微信支付公钥ID,如何获取请参考 https://pay.weixin.qq.com/doc/v3/partner/4013038589
37      "/path/to/wxp_pub.pem",          // 微信支付公钥文件路径,本地文件路径
38    );
39
40    GetContactApplymentByOutRequestNoRequest request = new GetContactApplymentByOutRequestNoRequest();
41    request.merchantCode = "1900006491";
42    request.outRequestNo = "1900013511_10000";
43    try {
44      GetMchContactAlterApplymentResponse response = client.run(request);
45
46      // TODO: 请求成功,继续业务逻辑
47      System.out.println(response);
48    } catch (WXPayUtility.ApiException e) {
49      // TODO: 请求失败,根据状态码执行不同的逻辑
50      e.printStackTrace();
51    }
52  }
53
54  public GetMchContactAlterApplymentResponse run(GetContactApplymentByOutRequestNoRequest request) {
55    String uri = PATH;
56    uri = uri.replace("{merchant_code}", WXPayUtility.urlEncode(request.merchantCode));
57    uri = uri.replace("{out_request_no}", WXPayUtility.urlEncode(request.outRequestNo));
58
59    Request.Builder reqBuilder = new Request.Builder().url(HOST + uri);
60    reqBuilder.addHeader("Accept", "application/json");
61    reqBuilder.addHeader("Wechatpay-Serial", wechatPayPublicKeyId);
62    reqBuilder.addHeader("Authorization", WXPayUtility.buildAuthorization(mchid, certificateSerialNo, privateKey, METHOD, uri, null));
63    reqBuilder.method(METHOD, null);
64    Request httpRequest = reqBuilder.build();
65
66    // 发送HTTP请求
67    OkHttpClient client = new OkHttpClient.Builder().build();
68    try (Response httpResponse = client.newCall(httpRequest).execute()) {
69      String respBody = WXPayUtility.extractBody(httpResponse);
70      if (httpResponse.code() >= 200 && httpResponse.code() < 300) {
71        // 2XX 成功,验证应答签名
72        WXPayUtility.validateResponse(this.wechatPayPublicKeyId, this.wechatPayPublicKey,
73            httpResponse.headers(), respBody);
74
75        // 从HTTP应答报文构建返回数据
76        return WXPayUtility.fromJson(respBody, GetMchContactAlterApplymentResponse.class);
77      } else {
78        throw new WXPayUtility.ApiException(httpResponse.code(), respBody, httpResponse.headers());
79      }
80    } catch (IOException e) {
81      throw new UncheckedIOException("Sending request to " + uri + " failed.", e);
82    }
83  }
84
85  private final String mchid;
86  private final String certificateSerialNo;
87  private final PrivateKey privateKey;
88  private final String wechatPayPublicKeyId;
89  private final PublicKey wechatPayPublicKey;
90
91  public GetContactApplymentByOutRequestNo(String mchid, String certificateSerialNo, String privateKeyFilePath, String wechatPayPublicKeyId, String wechatPayPublicKeyFilePath) {
92    this.mchid = mchid;
93    this.certificateSerialNo = certificateSerialNo;
94    this.privateKey = WXPayUtility.loadPrivateKeyFromPath(privateKeyFilePath);
95    this.wechatPayPublicKeyId = wechatPayPublicKeyId;
96    this.wechatPayPublicKey = WXPayUtility.loadPublicKeyFromPath(wechatPayPublicKeyFilePath);
97  }
98
99  public static class GetContactApplymentByOutRequestNoRequest {
100    @SerializedName("merchant_code")
101    @Expose(serialize = false)
102    public String merchantCode;
103  
104    @SerializedName("out_request_no")
105    @Expose(serialize = false)
106    public String outRequestNo;
107  }
108  
109  public static class RejectInfo {
110    @SerializedName("param_name")
111    public String paramName;
112  
113    @SerializedName("reject_reason")
114    public String rejectReason;
115  }
116  
117  public static class GetMchContactAlterApplymentResponse {
118    @SerializedName("apply_id")
119    public String applyId;
120  
121    @SerializedName("out_request_no")
122    public String outRequestNo;
123  
124    @SerializedName("merchant_code")
125    public String merchantCode;
126  
127    @SerializedName("state")
128    public ApplymentState state;
129  
130    @SerializedName("audit_reject_reason")
131    public String auditRejectReason;
132  
133    @SerializedName("audit_reject_detail")
134    public List<RejectInfo> auditRejectDetail;
135  }
136  
137  public enum ApplymentState {
138    @SerializedName("APPLYMENT_STATE_AUDITING")
139    APPLYMENT_STATE_AUDITING,
140    @SerializedName("APPLYMENT_STATE_REJECTED")
141    APPLYMENT_STATE_REJECTED,
142    @SerializedName("APPLYMENT_STATE_MODIFING")
143    APPLYMENT_STATE_MODIFING,
144    @SerializedName("APPLYMENT_STATE_FINISHED")
145    APPLYMENT_STATE_FINISHED,
146    @SerializedName("APPLYMENT_STATE_CANCELED")
147    APPLYMENT_STATE_CANCELED
148  }
149  
150}
151

应答参数

200 OK

 apply_id  必填   string(64)

【申请单号】 微信支付分配的申请单号


 out_request_no  必填   string(64)

【业务申请编号】 1、只能由数字、字母或下划线组成,建议前缀为服务商商户号。
2、服务商自定义的唯一编号。


 merchant_code  必填   string(32)

【微信支付商户号】 本服务商进件、已签约的特约商户/二级商户号。


 state  必填   string

【申请单状态】 APPLYMENT_STATE_AUDITING - 审核中,申请单正在审核中。
APPLYMENT_STATE_REJECTED - 已驳回,请按照驳回原因修改申请资料。
APPLYMENT_STATE_MODIFING - 资料修改中,系统修改资料中,请耐心等待。
APPLYMENT_STATE_FINISHED - 已完成,商户资料修改申请已完成。
APPLYMENT_STATE_CANCELED - 已作废,申请单已被撤销。

可选取值

  • APPLYMENT_STATE_AUDITING:  申请单正在审核中。

  • APPLYMENT_STATE_REJECTED:  请按照驳回原因修改申请资料。

  • APPLYMENT_STATE_MODIFING:  系统修改资料中,请耐心等待。

  • APPLYMENT_STATE_FINISHED:  商户资料修改申请已完成。

  • APPLYMENT_STATE_CANCELED:  申请单已被撤销。


 audit_reject_reason  选填   string

【总体驳回原因】 总体驳回原因,当申请状态为APPLYMENT_STATE_REJECTED时才返回。


 audit_reject_detail  选填   array[object]

【驳回原因详情】 各项资料的审核情况,当申请状态为APPLYMENT_STATE_REJECTED时才返回。

属性

应答示例

200 OK

1{
2  "apply_id" : "20220617143306000013906025001",
3  "out_request_no" : "1900013511_10000",
4  "merchant_code" : "1900006491",
5  "state" : "APPLYMENT_STATE_AUDITING",
6  "audit_reject_reason" : "身份证背面识别失败,请上传更清晰的身份证图片。",
7  "audit_reject_detail" : [
8    {
9      "param_name" : "ubo_info_list.card_number_0",
10      "reject_reason" : "身份证背面识别失败,请上传更清晰的身份证图片。"
11    }
12  ]
13}
14

 

错误码

公共错误码

状态码

错误码

描述

解决方案

400

PARAM_ERROR

参数错误

请根据错误提示正确传入参数

400

INVALID_REQUEST

HTTP 请求不符合微信支付 APIv3 接口规则

请参阅 接口规则

401

SIGN_ERROR

验证不通过

请参阅 签名常见问题

500

SYSTEM_ERROR

系统异常,请稍后重试

请稍后重试

 

 

更多技术问题
技术咨询
反馈
咨询
目录
置顶