查询品牌门店
更新时间:2025.12.02根据品牌门店ID,查询品牌门店。
频率限制:5/s
接口说明
支持商户:【普通服务商】
请求方式:【GET】/v3/brand/partner/store/brandstores/{store_id}
请求域名:【主域名】https://api.mch.weixin.qq.com 使用该域名将访问就近的接入点
【备域名】https://api2.mch.weixin.qq.com 使用该域名将访问异地的接入点 ,指引点击查看
请求参数
Header HTTP头参数
Authorization 必填 string
请参考签名认证生成认证信息
Accept 必填 string
请设置为application/json
path 路径参数
store_id 必填 string
【品牌门店ID】 创建品牌门店后,系统为该门店分配的唯一ID。
query 查询参数
brand_id 必填 string
【品牌ID】 商家进驻微信支付品牌商家后获得的品牌ID。
请求示例
GET
1curl -X GET \ 2 https://api.mch.weixin.qq.com/v3/brand/partner/store/brandstores/1234567890123456?brand_id=123456789 \ 3 -H "Authorization: WECHATPAY2-SHA256-RSA2048 mchid=\"1900000001\",..." \ 4 -H "Accept: application/json" 5
需配合微信支付工具库 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 GetBrandStore { 26 private static String HOST = "https://api.mch.weixin.qq.com"; 27 private static String METHOD = "GET"; 28 private static String PATH = "/v3/brand/partner/store/brandstores/{store_id}"; 29 30 public static void main(String[] args) { 31 // TODO: 请准备商户开发必要参数,参考:https://pay.weixin.qq.com/doc/v3/partner/4013080340 32 GetBrandStore client = new GetBrandStore( 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 GetBrandStoreRequest request = new GetBrandStoreRequest(); 41 request.storeId = "1234567890123456"; 42 request.brandId = "123456789"; 43 try { 44 BrandStoresEntity response = client.run(request); 45 // TODO: 请求成功,继续业务逻辑 46 System.out.println(response); 47 } catch (WXPayUtility.ApiException e) { 48 // TODO: 请求失败,根据状态码执行不同的逻辑 49 e.printStackTrace(); 50 } 51 } 52 53 public BrandStoresEntity run(GetBrandStoreRequest request) { 54 String uri = PATH; 55 uri = uri.replace("{store_id}", WXPayUtility.urlEncode(request.storeId)); 56 Map<String, Object> args = new HashMap<>(); 57 args.put("brand_id", request.brandId); 58 String queryString = WXPayUtility.urlEncode(args); 59 if (!queryString.isEmpty()) { 60 uri = uri + "?" + queryString; 61 } 62 63 Request.Builder reqBuilder = new Request.Builder().url(HOST + uri); 64 reqBuilder.addHeader("Accept", "application/json"); 65 reqBuilder.addHeader("Wechatpay-Serial", wechatPayPublicKeyId); 66 reqBuilder.addHeader("Authorization", WXPayUtility.buildAuthorization(mchid, certificateSerialNo, privateKey, METHOD, uri, null)); 67 reqBuilder.method(METHOD, null); 68 Request httpRequest = reqBuilder.build(); 69 70 // 发送HTTP请求 71 OkHttpClient client = new OkHttpClient.Builder().build(); 72 try (Response httpResponse = client.newCall(httpRequest).execute()) { 73 String respBody = WXPayUtility.extractBody(httpResponse); 74 if (httpResponse.code() >= 200 && httpResponse.code() < 300) { 75 // 2XX 成功,验证应答签名 76 WXPayUtility.validateResponse(this.wechatPayPublicKeyId, this.wechatPayPublicKey, 77 httpResponse.headers(), respBody); 78 79 // 从HTTP应答报文构建返回数据 80 return WXPayUtility.fromJson(respBody, BrandStoresEntity.class); 81 } else { 82 throw new WXPayUtility.ApiException(httpResponse.code(), respBody, httpResponse.headers()); 83 } 84 } catch (IOException e) { 85 throw new UncheckedIOException("Sending request to " + uri + " failed.", e); 86 } 87 } 88 89 private final String mchid; 90 private final String certificateSerialNo; 91 private final PrivateKey privateKey; 92 private final String wechatPayPublicKeyId; 93 private final PublicKey wechatPayPublicKey; 94 95 public GetBrandStore(String mchid, String certificateSerialNo, String privateKeyFilePath, String wechatPayPublicKeyId, String wechatPayPublicKeyFilePath) { 96 this.mchid = mchid; 97 this.certificateSerialNo = certificateSerialNo; 98 this.privateKey = WXPayUtility.loadPrivateKeyFromPath(privateKeyFilePath); 99 this.wechatPayPublicKeyId = wechatPayPublicKeyId; 100 this.wechatPayPublicKey = WXPayUtility.loadPublicKeyFromPath(wechatPayPublicKeyFilePath); 101 } 102 103 public static class GetBrandStoreRequest { 104 @SerializedName("brand_id") 105 @Expose(serialize = false) 106 public String brandId; 107 108 @SerializedName("store_id") 109 @Expose(serialize = false) 110 public String storeId; 111 } 112 113 public static class BrandStoresEntity { 114 @SerializedName("brand_id") 115 public String brandId; 116 117 @SerializedName("store_id") 118 public String storeId; 119 120 @SerializedName("store_state") 121 public StoreState storeState; 122 123 @SerializedName("audit_state") 124 public AuditState auditState; 125 126 @SerializedName("review_reject_reason") 127 public String reviewRejectReason; 128 129 @SerializedName("store_basics") 130 public StoreBase storeBasics; 131 132 @SerializedName("store_address") 133 public StoreLocation storeAddress; 134 135 @SerializedName("store_business") 136 public StoreBusiness storeBusiness; 137 138 @SerializedName("store_recipient") 139 public List<StoreRecipient> storeRecipient; 140 } 141 142 public enum StoreState { 143 @SerializedName("OPEN") 144 OPEN, 145 @SerializedName("CREATING") 146 CREATING, 147 @SerializedName("CLOSED") 148 CLOSED 149 } 150 151 public enum AuditState { 152 @SerializedName("SUCCESS") 153 SUCCESS, 154 @SerializedName("PROCESSING") 155 PROCESSING, 156 @SerializedName("REJECTED") 157 REJECTED 158 } 159 160 public static class StoreBase { 161 @SerializedName("store_reference_id") 162 public String storeReferenceId; 163 164 @SerializedName("branch_name") 165 public String branchName; 166 } 167 168 public static class StoreLocation { 169 @SerializedName("address_code") 170 public String addressCode; 171 172 @SerializedName("address_detail") 173 public String addressDetail; 174 175 @SerializedName("address_complements") 176 public String addressComplements; 177 178 @SerializedName("longitude") 179 public String longitude; 180 181 @SerializedName("latitude") 182 public String latitude; 183 } 184 185 public static class StoreBusiness { 186 @SerializedName("service_phone") 187 public String servicePhone; 188 189 @SerializedName("business_hours") 190 public String businessHours; 191 } 192 193 public static class StoreRecipient { 194 @SerializedName("mchid") 195 public String mchid; 196 197 @SerializedName("company_name") 198 public String companyName; 199 200 @SerializedName("recipient_state") 201 public RecipientState recipientState; 202 } 203 204 public enum RecipientState { 205 @SerializedName("CONFIRMED") 206 CONFIRMED, 207 @SerializedName("ADMIN_REJECTED") 208 ADMIN_REJECTED, 209 @SerializedName("CONFIRMING") 210 CONFIRMING, 211 @SerializedName("TIMEOUT_REJECTED") 212 TIMEOUT_REJECTED 213 } 214 215} 216
需配合微信支付工具库 wxpay_utility 使用,请参考Go
1package main 2 3import ( 4 "demo/wxpay_utility" // 引用微信支付工具库,参考 https://pay.weixin.qq.com/doc/v3/partner/4015119446 5 "encoding/json" 6 "fmt" 7 "net/http" 8 "net/url" 9 "strings" 10) 11 12func main() { 13 // TODO: 请准备商户开发必要参数,参考:https://pay.weixin.qq.com/doc/v3/partner/4013080340 14 config, err := wxpay_utility.CreateMchConfig( 15 "19xxxxxxxx", // 商户号,是由微信支付系统生成并分配给每个商户的唯一标识符,商户号获取方式参考 https://pay.weixin.qq.com/doc/v3/partner/4013080340 16 "1DDE55AD98Exxxxxxxxxx", // 商户API证书序列号,如何获取请参考 https://pay.weixin.qq.com/doc/v3/partner/4013058924 17 "/path/to/apiclient_key.pem", // 商户API证书私钥文件路径,本地文件路径 18 "PUB_KEY_ID_xxxxxxxxxxxxx", // 微信支付公钥ID,如何获取请参考 https://pay.weixin.qq.com/doc/v3/partner/4013038589 19 "/path/to/wxp_pub.pem", // 微信支付公钥文件路径,本地文件路径 20 ) 21 if err != nil { 22 fmt.Println(err) 23 return 24 } 25 26 request := &GetBrandStoreRequest{ 27 BrandId: wxpay_utility.String("123456789"), 28 StoreId: wxpay_utility.String("1234567890123456"), 29 } 30 31 response, err := GetBrandStore(config, request) 32 if err != nil { 33 fmt.Printf("请求失败: %+v\n", err) 34 // TODO: 请求失败,根据状态码执行不同的处理 35 return 36 } 37 38 // TODO: 请求成功,继续业务逻辑 39 fmt.Printf("请求成功: %+v\n", response) 40} 41 42func GetBrandStore(config *wxpay_utility.MchConfig, request *GetBrandStoreRequest) (response *BrandStoresEntity, err error) { 43 const ( 44 host = "https://api.mch.weixin.qq.com" 45 method = "GET" 46 path = "/v3/brand/partner/store/brandstores/{store_id}" 47 ) 48 49 reqUrl, err := url.Parse(fmt.Sprintf("%s%s", host, path)) 50 if err != nil { 51 return nil, err 52 } 53 reqUrl.Path = strings.Replace(reqUrl.Path, "{store_id}", url.PathEscape(*request.StoreId), -1) 54 query := reqUrl.Query() 55 if request.BrandId != nil { 56 query.Add("brand_id", *request.BrandId) 57 } 58 reqUrl.RawQuery = query.Encode() 59 httpRequest, err := http.NewRequest(method, reqUrl.String(), nil) 60 if err != nil { 61 return nil, err 62 } 63 httpRequest.Header.Set("Accept", "application/json") 64 httpRequest.Header.Set("Wechatpay-Serial", config.WechatPayPublicKeyId()) 65 authorization, err := wxpay_utility.BuildAuthorization(config.MchId(), config.CertificateSerialNo(), config.PrivateKey(), method, reqUrl.RequestURI(), nil) 66 if err != nil { 67 return nil, err 68 } 69 httpRequest.Header.Set("Authorization", authorization) 70 71 client := &http.Client{} 72 httpResponse, err := client.Do(httpRequest) 73 if err != nil { 74 return nil, err 75 } 76 respBody, err := wxpay_utility.ExtractResponseBody(httpResponse) 77 if err != nil { 78 return nil, err 79 } 80 if httpResponse.StatusCode >= 200 && httpResponse.StatusCode < 300 { 81 // 2XX 成功,验证应答签名 82 err = wxpay_utility.ValidateResponse( 83 config.WechatPayPublicKeyId(), 84 config.WechatPayPublicKey(), 85 &httpResponse.Header, 86 respBody, 87 ) 88 if err != nil { 89 return nil, err 90 } 91 response := &BrandStoresEntity{} 92 if err := json.Unmarshal(respBody, response); err != nil { 93 return nil, err 94 } 95 96 return response, nil 97 } else { 98 return nil, wxpay_utility.NewApiException( 99 httpResponse.StatusCode, 100 httpResponse.Header, 101 respBody, 102 ) 103 } 104} 105 106type GetBrandStoreRequest struct { 107 BrandId *string `json:"brand_id,omitempty"` 108 StoreId *string `json:"store_id,omitempty"` 109} 110 111func (o *GetBrandStoreRequest) MarshalJSON() ([]byte, error) { 112 type Alias GetBrandStoreRequest 113 a := &struct { 114 BrandId *string `json:"brand_id,omitempty"` 115 StoreId *string `json:"store_id,omitempty"` 116 *Alias 117 }{ 118 // 序列化时移除非 Body 字段 119 BrandId: nil, 120 StoreId: nil, 121 Alias: (*Alias)(o), 122 } 123 return json.Marshal(a) 124} 125 126type BrandStoresEntity struct { 127 BrandId *string `json:"brand_id,omitempty"` 128 StoreId *string `json:"store_id,omitempty"` 129 StoreState *StoreState `json:"store_state,omitempty"` 130 AuditState *AuditState `json:"audit_state,omitempty"` 131 ReviewRejectReason *string `json:"review_reject_reason,omitempty"` 132 StoreBasics *StoreBase `json:"store_basics,omitempty"` 133 StoreAddress *StoreLocation `json:"store_address,omitempty"` 134 StoreBusiness *StoreBusiness `json:"store_business,omitempty"` 135 StoreRecipient []StoreRecipient `json:"store_recipient,omitempty"` 136} 137 138type StoreState string 139 140func (e StoreState) Ptr() *StoreState { 141 return &e 142} 143 144const ( 145 STORESTATE_OPEN StoreState = "OPEN" 146 STORESTATE_CREATING StoreState = "CREATING" 147 STORESTATE_CLOSED StoreState = "CLOSED" 148) 149 150type AuditState string 151 152func (e AuditState) Ptr() *AuditState { 153 return &e 154} 155 156const ( 157 AUDITSTATE_SUCCESS AuditState = "SUCCESS" 158 AUDITSTATE_PROCESSING AuditState = "PROCESSING" 159 AUDITSTATE_REJECTED AuditState = "REJECTED" 160) 161 162type StoreBase struct { 163 StoreReferenceId *string `json:"store_reference_id,omitempty"` 164 BranchName *string `json:"branch_name,omitempty"` 165} 166 167type StoreLocation struct { 168 AddressCode *string `json:"address_code,omitempty"` 169 AddressDetail *string `json:"address_detail,omitempty"` 170 AddressComplements *string `json:"address_complements,omitempty"` 171 Longitude *string `json:"longitude,omitempty"` 172 Latitude *string `json:"latitude,omitempty"` 173} 174 175type StoreBusiness struct { 176 ServicePhone *string `json:"service_phone,omitempty"` 177 BusinessHours *string `json:"business_hours,omitempty"` 178} 179 180type StoreRecipient struct { 181 Mchid *string `json:"mchid,omitempty"` 182 CompanyName *string `json:"company_name,omitempty"` 183 RecipientState *RecipientState `json:"recipient_state,omitempty"` 184} 185 186type RecipientState string 187 188func (e RecipientState) Ptr() *RecipientState { 189 return &e 190} 191 192const ( 193 RECIPIENTSTATE_CONFIRMED RecipientState = "CONFIRMED" 194 RECIPIENTSTATE_ADMIN_REJECTED RecipientState = "ADMIN_REJECTED" 195 RECIPIENTSTATE_CONFIRMING RecipientState = "CONFIRMING" 196 RECIPIENTSTATE_TIMEOUT_REJECTED RecipientState = "TIMEOUT_REJECTED" 197) 198
应答参数
200 OK
brand_id 必填 string
【品牌ID】 商家进驻微信支付品牌商家后获得的品牌ID。
store_id 选填 string
【品牌门店ID】 创建品牌门店后,系统为该门店分配的唯一ID。
store_state 选填 string
【门店状态】 用于描述门店当前状态
可选取值
OPEN: 门店生效中。门店审核通过创建成功后即为生效中,后续更新门店信息只会影响审核状态,不会改变门店状态,如门店暂停营业可调用“暂停门店营业 API”,如门店关闭可调用“删除品牌门店 API”。门店营业时间不影响门店状态。CREATING: 门店创建中。在创建门店后,门店资料正在审核。审核详情请查看审核状态。CLOSED: 门店停业中。不可用于微信支付生态中的其他业务,可删除该门店,删除后将无法恢复,请谨慎操作。
audit_state 选填 string
【审核状态】 创建、修改门店时,通过此字段可得知当前审核状态
可选取值
SUCCESS: 门店资料审核通过。PROCESSING: 门店资料审核中,请等待审核结果。REJECTED: 门店资料被驳回,请根据驳回原因进行修改。
review_reject_reason 选填 string
【审核失败原因】 门店资料审核失败的原因
store_basics 选填 object
【门店基础信息】 用于描述门店编码,名称等基本情况。
| 属性 | |
store_reference_id 选填 string(32) 【商家门店编号】 商家内部的门店编号,最长32位字符;商家自行保证该编码在商家内部的唯一性。不允许有符号表情。 此字段为免审字段(仅修改免审字段时,将会直接更新门店,无需审核)。 branch_name 选填 string(50) 【门店名称】 只需填写纯粹的分店名称,例如:"南山店"、"朝阳门店"、"天河城店"
|
store_address 选填 object
【门店地址信息】 用于描述门店地址,经纬度等地理位置相关情况。
| 属性 | |
address_code 必填 string(20) 【门店省市编码】 门店所在省市区编码,只能由数字组成;详细参见微信支付提供的省市对照表。 address_detail 必填 string(200) 【门店地址】 门店地址为核心重要信息,请准确填写并精确到门牌号,该信息涉及到地址核实、营销活动等业务,说明:不要重复填写省市区信息。 address_complements 选填 string(50) 【门店地址辅助描述】 门店周围标志性建筑,用于辅助定位。 longitude 选填 string(32) 【门店经度】 经度,取值在[-180,180]之间的数字,经度长度不能超过32个字符,腾讯地图经纬度查询:https://lbs.qq.com/tool/getpoint/index.html latitude 选填 string(32) 【门店纬度】 纬度,取值在[-90,90]之间的数字,纬度长度不能超过32个字符,腾讯地图经纬度查询:https://lbs.qq.com/tool/getpoint/index.html |
store_business 选填 object
【门店经营信息】 用于描述门店联系电话,经营时间等经营状况。
| 属性 | |
service_phone 选填 string(32) 【门店服务电话】 支持座机和手机,只支持数字和“-”符号,最多支持两个电话,两个电话间用英文竖线“|”区隔。 此字段为免审字段(仅修改免审字段时,将会直接更新门店,无需审核)。 business_hours 选填 string(256) 【门店经营时间】 经营时间需要使用指定格式,如下:
|
store_recipient 选填 array[object]
【门店收款信息】 门店收款商户列表。
| 属性 | |
mchid 选填 string(16) 【门店收款商户号】 门店的收款商户号,仅支持绑定品牌已关联的商户号。 company_name 选填 string(256) 【门店收款主体】 门店收款的主体信息,支持企业,个体户,小微。 recipient_state 选填 string 【收款绑定状态】 门店收款商户号的绑定状态 可选取值
|
应答示例
200 OK
1{ 2 "brand_id" : "123456789", 3 "store_id" : "1234567890123456", 4 "store_state" : "OPEN", 5 "audit_state" : "SUCCESS", 6 "review_reject_reason" : "通过核实,您提交的电话错误,请核实手机号码或座机号码是否正确", 7 "store_basics" : { 8 "store_reference_id" : "MDL001", 9 "branch_name" : "海岸城店" 10 }, 11 "store_address" : { 12 "address_code" : "440305", 13 "address_detail" : "深南大道10000号腾讯大厦1楼", 14 "address_complements" : "地铁A口右侧100米", 15 "longitude" : "112.63484", 16 "latitude" : "37.75464" 17 }, 18 "store_business" : { 19 "service_phone" : "0755-86013388|0755-86013399", 20 "business_hours" : "周一至周五 09:00-20:00|周六至周日 10:00-次日22:00" 21 }, 22 "store_recipient" : [ 23 { 24 "mchid" : "1230000109", 25 "company_name" : "腾讯科技(深圳)有限公司", 26 "recipient_state" : "CONFIRMED" 27 } 28 ] 29} 30
错误码
以下是本接口返回的错误码列表。详细错误码规则,请参考微信支付接口规则-错误码和错误提示

