### GET /v3/smartguide/guides Source: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/open/pay/chapter3_4_3.shtml 服务人员查询接口用于商户开发者查询已注册的服务人员ID等信息。 ```APIDOC ## GET /v3/smartguide/guides ### Description 服务人员查询接口用于商户开发者查询已注册的服务人员ID等信息。 ### Method GET ### Endpoint https://api.mch.weixin.qq.com/v3/smartguide/guides ### Parameters #### Query Parameters - **store_id** (string) - Optional - 门店ID - **sub_mchid** (string) - Optional - 子商户号 - **userid** (string) - Optional - 员工在商户企业微信通讯录使用的唯一标识 ``` -------------------------------- ### Partner API v3 Go Implementation Source: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/open/pay/chapter2_5_3.shtml Example of initializing merchant configuration and executing a prepay request using the wxpay_utility library. ```go package main import ( "bytes" "demo/wxpay_utility" // 引用微信支付工具库,参考 https://pay.weixin.qq.com/doc/v3/partner/4015119446 "encoding/json" "fmt" "net/http" "net/url" "time" ) func main() { // TODO: 请准备商户开发必要参数,参考:https://pay.weixin.qq.com/doc/v3/partner/4013080340 config, err := wxpay_utility.CreateMchConfig( "19xxxxxxxx", // 商户号,是由微信支付系统生成并分配给每个商户的唯一标识符,商户号获取方式参考 https://pay.weixin.qq.com/doc/v3/partner/4013080340 "1DDE55AD98Exxxxxxxxxx", // 商户API证书序列号,如何获取请参考 https://pay.weixin.qq.com/doc/v3/partner/4013058924 "/path/to/apiclient_key.pem", // 商户API证书私钥文件路径,本地文件路径 "PUB_KEY_ID_xxxxxxxxxxxxx", // 微信支付公钥ID,如何获取请参考 https://pay.weixin.qq.com/doc/v3/partner/4013038589 "/path/to/wxp_pub.pem", // 微信支付公钥文件路径,本地文件路径 ) if err != nil { fmt.Println(err) return } request := &PartnerApiv3CommonPrepayRequest{ SpAppid: wxpay_utility.String("wx8888888888888888"), SpMchid: wxpay_utility.String("1230000109"), SubAppid: wxpay_utility.String("wxd678efh567hg6999"), SubMchid: wxpay_utility.String("1900000109"), Description: wxpay_utility.String("Image形象店-深圳腾大-QQ公仔"), OutTradeNo: wxpay_utility.String("1217752501201407033233368018"), TimeExpire: wxpay_utility.Time(time.Now()), Attach: wxpay_utility.String("自定义数据说明"), NotifyUrl: wxpay_utility.String(" https://www.weixin.qq.com/wxpay/pay.php"), GoodsTag: wxpay_utility.String("WXG"), SettleInfo: &PartnerSettleInfo{ ProfitSharing: wxpay_utility.Bool(true), }, SupportFapiao: wxpay_utility.Bool(false), Amount: &CommonAmountInfo{ Total: wxpay_utility.Int64(100), Currency: wxpay_utility.String("CNY"), }, Detail: &CouponInfo{ CostPrice: wxpay_utility.Int64(608800), InvoiceId: wxpay_utility.String("微信123"), GoodsDetail: []GoodsDetail{ GoodsDetail{ MerchantGoodsId: wxpay_utility.String("1246464644"), WechatpayGoodsId: wxpay_utility.String("1001"), GoodsName: wxpay_utility.String("iPhoneX 256G"), Quantity: wxpay_utility.Int64(1), UnitPrice: wxpay_utility.Int64(528800), }, }, }, SceneInfo: &CommonSceneInfo{ PayerClientIp: wxpay_utility.String("14.23.150.211"), DeviceId: wxpay_utility.String("013467007045764"), StoreInfo: &StoreInfo{ Id: wxpay_utility.String("0001"), Name: wxpay_utility.String("腾讯大厦分店"), AreaCode: wxpay_utility.String("440305"), Address: wxpay_utility.String("广东省深圳市南山区科技中一道10000号"), }, }, } response, err := PartnerAppPrepay(config, request) if err != nil { fmt.Printf("请求失败: %+v\n", err) // TODO: 请求失败,根据状态码执行不同的处理 return } // TODO: 请求成功,继续业务逻辑 ``` -------------------------------- ### Go Implementation for Creating BusiFavorStock Source: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/open/pay/chapter5_2_4.shtml Example of initializing merchant configuration and constructing a CreateBusiFavorStockRequest using the wxpay_utility library. ```go package main import ( "bytes" "demo/wxpay_utility" // 引用微信支付工具库,参考 https://pay.weixin.qq.com/doc/v3/partner/4015119446 "encoding/json" "fmt" "net/http" "net/url" "time" ) func main() { // TODO: 请准备商户开发必要参数,参考:https://pay.weixin.qq.com/doc/v3/partner/4013080340 config, err := wxpay_utility.CreateMchConfig( "19xxxxxxxx", // 商户号,是由微信支付系统生成并分配给每个商户的唯一标识符,商户号获取方式参考 https://pay.weixin.qq.com/doc/v3/partner/4013080340 "1DDE55AD98Exxxxxxxxxx", // 商户API证书序列号,如何获取请参考 https://pay.weixin.qq.com/doc/v3/partner/4013058924 "/path/to/apiclient_key.pem", // 商户API证书私钥文件路径,本地文件路径 "PUB_KEY_ID_xxxxxxxxxxxxx", // 微信支付公钥ID,如何获取请参考 https://pay.weixin.qq.com/doc/v3/partner/4013038589 "/path/to/wxp_pub.pem", // 微信支付公钥文件路径,本地文件路径 ) if err != nil { fmt.Println(err) return } request := &CreateBusiFavorStockRequest{ StockName: wxpay_utility.String("8月1日活动券"), BelongMerchant: wxpay_utility.String("10000098"), Comment: wxpay_utility.String("活动使用"), GoodsName: wxpay_utility.String("填写商家券可适用的商品或服务"), StockType: BUSIFAVORSTOCKTYPE_NORMAL.Ptr(), CouponUseRule: &CouponUseRule{ CouponAvailableTime: &FavorAvailableTime{ AvailableBeginTime: wxpay_utility.Time(time.Now()), AvailableEndTime: wxpay_utility.Time(time.Now()), AvailableDayAfterReceive: wxpay_utility.Int64(3), AvailableWeek: &AvailableWeek{ WeekDay: []int64{int64(1)}, AvailableDayTime: []AvailableCurrentDayTime{AvailableCurrentDayTime{ BeginTime: wxpay_utility.Int64(3600), EndTime: wxpay_utility.Int64(86399), }}, }, IrregularyAvaliableTime: []IrregularAvailableTime{IrregularAvailableTime{ BeginTime: wxpay_utility.Time(time.Now()), EndTime: wxpay_utility.Time(time.Now()), }}, WaitDaysAfterReceive: wxpay_utility.Int64(7), }, FixedNormalCoupon: &FixedValueStockMsg{ DiscountAmount: wxpay_utility.Int64(5), TransactionMinimum: wxpay_utility.Int64(100), }, DiscountCoupon: &DiscountMsg{ DiscountPercent: wxpay_utility.Int64(88), TransactionMinimum: wxpay_utility.Int64(100), }, ExchangeCoupon: &ExchangeMsg{ ExchangePrice: wxpay_utility.Int64(100), TransactionMinimum: wxpay_utility.Int64(100), }, UseMethod: COUPONUSEMETHOD_OFF_LINE.Ptr(), MiniProgramsAppid: wxpay_utility.String("wx23232232323"), MiniProgramsPath: wxpay_utility.String("/path/index/index"), }, StockSendRule: &StockSendRule{ MaxAmount: wxpay_utility.Int64(100000), MaxCoupons: wxpay_utility.Int64(100), MaxCouponsPerUser: wxpay_utility.Int64(5), MaxAmountByDay: wxpay_utility.Int64(1000), MaxCouponsByDay: wxpay_utility.Int64(100), NaturalPersonLimit: wxpay_utility.Bool(false), PreventApiAbuse: wxpay_utility.Bool(false), Transferable: wxpay_utility.Bool(false), Shareable: wxpay_utility.Bool(false), }, OutRequestNo: wxpay_utility.String("100002322019090134234sfdf"), CustomEntrance: &CustomEntrance{ MiniProgramsInfo: &MiniAppInfo{ MiniProgramsAppid: wxpay_utility.String("wx234545656765876"), MiniProgramsPath: wxpay_utility.String("/path/index/index"), EntranceWords: wxpay_utility.String("欢迎选购"), GuidingWords: wxpay_utility.String("获取更多优惠"), }, Appid: wxpay_utility.String("wx324345hgfhfghfg"), HallId: wxpay_utility.String("233455656"), StoreId: wxpay_utility.String("233554655"), CodeDisplayMode: CODEDISPLAYMODE_NOT_SHOW.Ptr(), }, DisplayPatternInfo: &DisplayPatternInfo{ Description: wxpay_utility.String("xxx门店可用"), MerchantLogoUrl: wxpay_utility.String("https://xxx"), MerchantName: wxpay_utility.String("微信支付"), BackgroundColor: wxpay_utility.String("xxxxx"), CouponImageUrl: wxpay_utility.String("图片cdn地址"), FinderInfo: &FinderInfo{ FinderId: wxpay_utility.String("sph6Rngt2T4RlUf"), FinderVideoId: wxpay_utility.String("export/UzFfAgtgekIEAQAAAAAAb4MgnPInmAAAAAstQy6ubaLX4KHWvLEZgBPEwIEgVnk9HIP-zNPgMJofG6tpdGPJNg_ojtEjoT94"), FinderVideoCoverImageUrl: wxpay_utility.String("https://wxpaylogo.qpic.cn/xxx"), }, }, } ``` -------------------------------- ### Create BusiFavor Stock Request and Execution Source: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/open/pay/chapter5_2_4.shtml Example of preparing the request parameters and invoking the CreateBusifavorStock function. ```go 103 CouponCodeMode: COUPONCODEMODE_WECHATPAY_MODE.Ptr(), 104 NotifyConfig: &NotifyConfig{ 105 NotifyAppid: wxpay_utility.String("wx23232232323"), 106 }, 107 Subsidy: wxpay_utility.Bool(false), 108 } 109 110 response, err := CreateBusifavorStock(config, request) 111 if err != nil { 112 fmt.Printf("请求失败: %+v\n", err) 113 // TODO: 请求失败,根据状态码执行不同的处理 114 return 115 } 116 117 // TODO: 请求成功,继续业务逻辑 118 fmt.Printf("请求成功: %+v\n", response) 119} ``` -------------------------------- ### APIv3 Success Response Example Source: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/open/pay/chapter5_2_4.shtml Example of a successful 200 OK response containing the stock_id and creation timestamp. ```json { "stock_id" : "98065001", "create_time" : "2015-05-20T13:29:35+08:00" } ``` -------------------------------- ### Profit Sharing Order API Implementation in Go Source: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/open/pay/chapter4_4_4.shtml Example implementation of a profit sharing order request using the wxpay_utility library for configuration and request signing. ```go package main import ( "bytes" "demo/wxpay_utility" // 引用微信支付工具库,参考 https://pay.weixin.qq.com/doc/v3/partner/4015119446 "encoding/json" "fmt" "net/http" "net/url" "time" ) func main() { // TODO: 请准备商户开发必要参数,参考:https://pay.weixin.qq.com/doc/v3/partner/4013080340 config, err := wxpay_utility.CreateMchConfig( "19xxxxxxxx", // 商户号,是由微信支付系统生成并分配给每个商户的唯一标识符,商户号获取方式参考 https://pay.weixin.qq.com/doc/v3/partner/4013080340 "1DDE55AD98Exxxxxxxxxx", // 商户API证书序列号,如何获取请参考 https://pay.weixin.qq.com/doc/v3/partner/4013058924 "/path/to/apiclient_key.pem", // 商户API证书私钥文件路径,本地文件路径 "PUB_KEY_ID_xxxxxxxxxxxxx", // 微信支付公钥ID,如何获取请参考 https://pay.weixin.qq.com/doc/v3/partner/4013038589 "/path/to/wxp_pub.pem", // 微信支付公钥文件路径,本地文件路径 ) if err != nil { fmt.Println(err) return } request := &CreateOrderRequest{ BrandMchid: wxpay_utility.String("1900000108"), SubMchid: wxpay_utility.String("1900000109"), Appid: wxpay_utility.String("wx8888888888888888"), SubAppid: wxpay_utility.String("wx8888888888888889"), TransactionId: wxpay_utility.String("4208450740201411110007820472"), OutOrderNo: wxpay_utility.String("P20150806125346"), Receivers: []ReceiverEntity{ReceiverEntity{ Type: wxpay_utility.String("MERCHANT_ID"), Account: wxpay_utility.String("1900000109"), Amount: wxpay_utility.Int64(190), Description: wxpay_utility.String("分给商户1900000110"), Name: wxpay_utility.String("hu89ohu89ohu89o"), /*请传入wxpay_utility.EncryptOAEPWithPublicKey 加密结果*/ }}, Finish: wxpay_utility.Bool(true), } response, err := CreateOrder(config, request) if err != nil { fmt.Printf("请求失败: %+v\n", err) // TODO: 请求失败,根据状态码执行不同的处理 return } // TODO: 请求成功,继续业务逻辑 fmt.Printf("请求成功: %+v\n", response) } func CreateOrder(config *wxpay_utility.MchConfig, request *CreateOrderRequest) (response *CreateOrderResponse, err error) { const ( host = "https://api.mch.weixin.qq.com" method = "POST" path = "/v3/brand/profitsharing/orders" ) reqUrl, err := url.Parse(fmt.Sprintf("%s%s", host, path)) if err != nil { return nil, err } reqBody, err := json.Marshal(request) if err != nil { return nil, err } httpRequest, err := http.NewRequest(method, reqUrl.String(), bytes.NewReader(reqBody)) if err != nil { return nil, err } httpRequest.Header.Set("Accept", "application/json") httpRequest.Header.Set("Wechatpay-Serial", config.WechatPayPublicKeyId()) httpRequest.Header.Set("Content-Type", "application/json") authorization, err := wxpay_utility.BuildAuthorization(config.MchId(), config.CertificateSerialNo(), config.PrivateKey(), method, reqUrl.RequestURI(), reqBody) if err != nil { return nil, err } httpRequest.Header.Set("Authorization", authorization) client := &http.Client{} httpResponse, err := client.Do(httpRequest) if err != nil { return nil, err } respBody, err := wxpay_utility.ExtractResponseBody(httpResponse) if err != nil { return nil, err } if httpResponse.StatusCode >= 200 && httpResponse.StatusCode < 300 { // 2XX 成功,验证应答签名 err = wxpay_utility.ValidateResponse( config.WechatPayPublicKeyId(), config.WechatPayPublicKey(), &httpResponse.Header, respBody, ) if err != nil { return nil, err } response := &CreateOrderResponse{} ``` -------------------------------- ### Constructing Merchant Application Request Source: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/open/pay/chapter3_3_3.shtml Example of initializing the request structure with merchant credentials and business information. Sensitive fields like ID card and bank account information require encryption using wxpay_utility.EncryptOAEPWithPublicKey. ```go 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 := &SubmitReq{ 27 OutRequestNo: wxpay_utility.String("APPLYMENT_00000000001"), 28 OrganizationType: wxpay_utility.String("2"), 29 FinanceInstitution: wxpay_utility.Bool(true), 30 BusinessLicenseInfo: &BusinessLicense{ 31 CertType: CERTIFICATETYPE_CERTIFICATE_TYPE_2388.Ptr(), 32 BusinessLicenseCopy: wxpay_utility.String("47ZC6GC-vnrbEny__Ie_An5-tCpqxucuxi-vByf3Gjm7KE53JXvGy9tqZm2XAUf-4KGprrKhpVBDIUv0OF4wFNIO4kqg05InE4d2I6_H7I4"), 33 BusinessLicenseNumber: wxpay_utility.String("123456789012345678"), 34 MerchantName: wxpay_utility.String("腾讯科技有限公司"), 35 LegalPerson: wxpay_utility.String("张三"), 36 CompanyAddress: wxpay_utility.String("深圳南山区科苑路"), 37 BusinessTime: wxpay_utility.String("[\"2014-01-01\",\"长期\"]"), 38 }, 39 FinanceInstitutionInfo: &FinanceInstitutionInfo{ 40 FinanceType: FINANCETYPE_BANK_AGENT.Ptr(), 41 FinanceLicensePics: []string{"example_FinanceLicensePics"}, 42 }, 43 IdHolderType: IDHOLDERTYPE_LEGAL.Ptr(), 44 IdDocType: IDENTIFICATIONTYPE_IDENTIFICATION_TYPE_MACAO.Ptr(), 45 AuthorizeLetterCopy: wxpay_utility.String("47ZC6GC-vnrbEny_Ie_An5-tCpqxucuxi-vByf3Gjm7KEIUv0OF4wFNIO4kqg05InE4d2I6_H7I4"), 46 IdCardInfo: &IdCardInfo{ 47 IdCardCopy: wxpay_utility.String("jTpGmxUX3FBWVQ5NJTZvlKX_gdU4cRz7z5NxpnFuAxhBTEO_PvWkfSCJ3zVIn001D8daLC-ehEuo0BJqRTvDujqhThn4ReFxikqJ5YW6zFQ"), 48 IdCardNational: wxpay_utility.String("47ZC6GC-vnrbEny__Ie_An5-tCpqxucuxi-vByf3Gjm7KE53JXvGy9tqZm2XAUf-4KGprrKhpVBDIUv0OF4wFNIO4kqg05InE4d2I6_H7I4"), 49 IdCardName: wxpay_utility.String("pVd1HJ6zyvPedzGaV+X3qtmrq9bb9tPROvwia4ibL+F6mfjbzQIzfb3HHLEjZ4YiR/cJiCrZxnAqi+pjeKIEdkwzXRAI7FUhrfPK3SNjaBTEu9GmsugMIA9r3x887Q+ODuC8HH2nzAn7NGpE/e3yiHgWhk0ps5k5DP/2qIdGdONoDzZelrxCl/NWWNUyB93K9F+jC1JX2IMttdY+aQ6zBlw0xnOiNW6Hzy7UtC+xriudjD5APomty7/mYNxLMpRSvWKIjOv/69bDnuC4EL5Kz4jBHLiCyOb+tI0m2qhZ9evAM+Jv1z0NVa8MRtelw/wDa4SzfeespQO/0kjiwfqdfg=="), /*请传入 wxpay_utility.EncryptOAEPWithPublicKey 加密结果*/ 50 IdCardNumber: wxpay_utility.String("AOZdYGISxo4y44/UgZ69bdu9X+tfMUJ9dl+LetjM45/zMbrYu+wWZ8gn4CTdo+D/m9MrPg+V4sm73oxqdQu/hj7aWyDl4GQtPXVdaztB9jVbVZh3QFzV+BEmytMNQp9dt1uWJktlfdDdLR3AMWyMB377xd+m9bSr/ioDTzagEcGe+vLYiKrzcroQv3OR0p3ppFYoQ3IfYeU/04S4t9rNFL+kyblK2FCCqQ11NdbbHoCrJc7NV4oASq6ZFonjTtgjjgKsadIKHXtb3JZKGZjduGdtkRJJp0/0eow96uY1Pk7Rq79Jtt7+I8juwEc4P4TG5xzchG/5IL9DBd+Z0zZXkw=="), /*请传入 wxpay_utility.EncryptOAEPWithPublicKey 加密结果*/ 51 IdCardValidTimeBegin: wxpay_utility.String("2019-06-06"), 52 IdCardValidTime: wxpay_utility.String("2026-06-06"), 53 }, 54 IdDocInfo: &IdDocInfo{ 55 IdDocName: wxpay_utility.String("jTpGmxUX3FBWVQ5NJTZvlKX_gdU4cRz7z5NxpnFuAxhBTEO_PvWkfSCJ3zVIn001D8daLC-ehEuo0BJqRTvDujqhThn4ReFxikqJ5YW6zFQ"), /*请传入 wxpay_utility.EncryptOAEPWithPublicKey 加密结果*/ 56 IdDocNumber: wxpay_utility.String("jTpGmxUX3FBWVQ5NJTZvlKX_gdU4cRz7z5NxpnFuAxhBTEO_PvWkfSCJ3zVIn001D8daLC-ehEuo0BJqRTvDujqhThn4ReFxikqJ5YW6zFQ"), /*请传入 wxpay_utility.EncryptOAEPWithPublicKey 加密结果*/ 57 IdDocCopy: wxpay_utility.String("47ZC6GC-vnrbEny__Ie_An5-tCpqxucuxi-vByf3Gjm7KE53JXvGy9tqZm2XAUf-4KGprrKhpVBDIUv0OF4wFNIO4kqg05InE4d2I6_H7I4"), 58 IdDocCopyBack: wxpay_utility.String("47ZC6GC-vnrbEny__Ie_An5-tCpqxucuxi-vByf3Gjm7KE53JXvGy9tqZm2XAUf-4KGprrKhpVBDIUv0OF4wFNIO4kqg05InE4d2I6_H7I4"), 59 DocPeriodBegin: wxpay_utility.String("2019-06-06"), 60 DocPeriodEnd: wxpay_utility.String("2020-01-02"), 61 }, 62 Owner: wxpay_utility.Bool(true), 63 AccountInfo: &AccountInfo{ 64 BankAccountType: wxpay_utility.String("75"), 65 AccountBank: wxpay_utility.String("工商银行"), 66 AccountName: wxpay_utility.String("AOZdYGISxo4y44/UgZ69bdu9X+tfMUJ9dl+LetjM45/zMbrYu+wWZ8gn4CTdo+D/m9MrPg+V4sm73oxqdQu/hj7aWyDl4GQtPXVdaztB9jVbVZh3QFzV+BEmytMNQp9dt1uWJktlfdDdLR3AMWyMB377xd+m9bSr/ioDTzagEcGe+vLYiKrzcroQv3OR0p3ppFYoQ3IfYeU/04S4t9rNFL+kyblK2FCCqQ11NdbbHoCrJc7NV4oASq6ZFonjTtgjjgKsadIKHXtb3JZKGZjduGdtkRJJp0/0eow96uY1Pk7Rq79Jtt7+I8juwEc4P4TG5xzchG/5IL9DBd+Z0zZXkw=="), /*请传入 wxpay_utility.EncryptOAEPWithPublicKey 加密结果*/ 67 BankAddressCode: wxpay_utility.String("110000"), 68 BankBranchId: wxpay_utility.String("402713354941"), 69 BankName: wxpay_utility.String("施秉县农村信用合作联社城关信用社"), ``` -------------------------------- ### GET /v3/apply4subject/applyment Source: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/open/pay/chapter6_1_3.shtml 查询申请单审核结果接口,支持通过申请单编号或业务申请编号查询。 ```APIDOC ## GET /v3/apply4subject/applyment ### Description 查询申请单审核结果。申请单编号和业务申请编号至少传一个。 ### Method GET ### Endpoint https://api.mch.weixin.qq.com/v3/apply4subject/applyment ### Parameters #### Query Parameters - **applyment_id** (string) - Optional - 微信支付分配的申请单号 - **business_code** (string) - Optional - 服务商自定义的唯一业务申请编号 ``` -------------------------------- ### POST /v3/smartguide/guides/{guide_id}/assign Source: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/open/pay/chapter3_4_3.shtml 服务人员分配接口用于商户开发者在顾客下单后为顾客分配服务人员使用。调用此接口需在完成支付之前。 ```APIDOC ## POST /v3/smartguide/guides/{guide_id}/assign ### Description 服务人员分配接口用于商户开发者在顾客下单后为顾客分配服务人员使用。 ### Method POST ### Endpoint https://api.mch.weixin.qq.com/v3/smartguide/guides/{guide_id}/assign ### Parameters #### Path Parameters - **guide_id** (string) - Required - 服务人员ID #### Request Body - **out_trade_no** (string) - Required - 商户系统内部订单号 - **sub_mchid** (string) - Required - 子商户号 ### Request Example { "out_trade_no": "20150806125346", "sub_mchid": "1234567890" } ``` -------------------------------- ### Initialize PartnerAppPrepay Client Source: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/open/pay/chapter2_5_3.shtml Constructor for initializing the client with merchant credentials and security keys. ```java private final String mchid; private final String certificateSerialNo; private final PrivateKey privateKey; private final String wechatPayPublicKeyId; private final PublicKey wechatPayPublicKey; public PartnerAppPrepay(String mchid, String certificateSerialNo, String privateKeyFilePath, String wechatPayPublicKeyId, String wechatPayPublicKeyFilePath) { this.mchid = mchid; this.certificateSerialNo = certificateSerialNo; this.privateKey = WXPayUtility.loadPrivateKeyFromPath(privateKeyFilePath); this.wechatPayPublicKeyId = wechatPayPublicKeyId; this.wechatPayPublicKey = WXPayUtility.loadPublicKeyFromPath(wechatPayPublicKeyFilePath); } ``` -------------------------------- ### GET /v3/apply4subject/applyment/merchants/{sub_mchid}/state Source: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/open/pay/chapter6_1_3.shtml 查询特约商户的开户意愿确认状态。 ```APIDOC ## GET /v3/apply4subject/applyment/merchants/{sub_mchid}/state ### Description 查询微信支付子商户号的开户意愿确认状态。当服务商需要确认子商户是否完成确认时调用此接口,返回“已授权”状态说明商户号已完成开户意愿确认。 ### Method GET ### Endpoint https://api.mch.weixin.qq.com/v3/apply4subject/applyment/merchants/{sub_mchid}/state ### Parameters #### Path Parameters - **sub_mchid** (string) - Required - 特约商户号,微信支付分配的特约商户的唯一标识。 ``` -------------------------------- ### GET /v3/apply4sub/sub_merchants/{sub_mchid}/settlement Source: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/open/devguidelines/chapter3_3_2.shtml Queries the settlement account details for a specific sub-merchant. ```APIDOC ## GET /v3/apply4sub/sub_merchants/{sub_mchid}/settlement ### Description Allows a platform to query the settlement account information for a specific secondary merchant. ### Method GET ### Endpoint https://api.mch.weixin.qq.com/v3/apply4sub/sub_merchants/{sub_mchid}/settlement ### Parameters #### Path Parameters - **sub_mchid** (string) - Required - The unique identifier of the sub-merchant. ``` -------------------------------- ### Go Merchant Configuration Initialization Source: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/open/pay/chapter3_3_3.shtml Initializes merchant configuration using the wxpay_utility library. ```go package main import ( "bytes" "demo/wxpay_utility" // 引用微信支付工具库,参考 https://pay.weixin.qq.com/doc/v3/partner/4015119446 "encoding/json" "fmt" "net/http" "net/url" ) func main() { // TODO: 请准备商户开发必要参数,参考:https://pay.weixin.qq.com/doc/v3/partner/4013080340 config, err := wxpay_utility.CreateMchConfig( ``` -------------------------------- ### GET /v3/ecommerce/profitsharing/orders Source: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/open/devguidelines/chapter3_3_4.shtml Query the status of profit sharing requests and completion for a specific order. ```APIDOC ## GET /v3/ecommerce/profitsharing/orders ### Description Allows the platform to monitor profit sharing requests and completion status for an order in real-time. ### Method GET ### Endpoint https://api.mch.weixin.qq.com/v3/ecommerce/profitsharing/orders ### Parameters #### Query Parameters - **sub_mchid** (string) - Required - Sub-merchant ID - **transaction_id** (string) - Required - WeChat transaction ID - **out_order_no** (string) - Required - Out order number ``` -------------------------------- ### Ecommerce Sub-merchant Application Request Source: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/open/pay/chapter3_3_3.shtml Example of a POST request to the ecommerce sub-merchant application endpoint. ```curl curl -X POST \ https://api.mch.weixin.qq.com/v3/ecommerce/applyments/ \ -H "Authorization: WECHATPAY2-SHA256-RSA2048 mchid=\"1900000001\",..." \ -H "Accept: application/json" \ -H "Wechatpay-Serial: 5157F09EFDC096DE15EBE81A47057A7232F1B8E1" \ -H "Content-Type: application/json" \ -d '{ "out_request_no" : "APPLYMENT_00000000001", "organization_type" : "2", "finance_institution" : true, "business_license_info" : { "cert_type" : "CERTIFICATE_TYPE_2388", "business_license_copy" : "47ZC6GC-vnrbEny__Ie_An5-tCpqxucuxi-vByf3Gjm7KE53JXvGy9tqZm2XAUf-4KGprrKhpVBDIUv0OF4wFNIO4kqg05InE4d2I6_H7I4", "business_license_number" : "123456789012345678", "merchant_name" : "腾讯科技有限公司", "legal_person" : "张三", "company_address" : "深圳南山区科苑路", "business_time" : "[\"2014-01-01\",\"长期\"]" }, "finance_institution_info" : { "finance_type" : "BANK_AGENT", "finance_license_pics" : [ "example_finance_license_pics" ] }, "id_holder_type" : "LEGAL", "id_doc_type" : "IDENTIFICATION_TYPE_MACAO", "authorize_letter_copy" : "47ZC6GC-vnrbEny_Ie_An5-tCpqxucuxi-vByf3Gjm7KEIUv0OF4wFNIO4kqg05InE4d2I6_H7I4", "id_card_info" : { "id_card_copy" : "jTpGmxUX3FBWVQ5NJTZvlKX_gdU4cRz7z5NxpnFuAxhBTEO_PvWkfSCJ3zVIn001D8daLC-ehEuo0BJqRTvDujqhThn4ReFxikqJ5YW6zFQ", "id_card_national" : "47ZC6GC-vnrbEny__Ie_An5-tCpqxucuxi-vByf3Gjm7KE53JXvGy9tqZm2XAUf-4KGprrKhpVBDIUv0OF4wFNIO4kqg05InE4d2I6_H7I4", "id_card_name" : "pVd1HJ6zyvPedzGaV+X3qtmrq9bb9tPROvwia4ibL+F6mfjbzQIzfb3HHLEjZ4YiR/cJiCrZxnAqi+pjeKIEdkwzXRAI7FUhrfPK3SNjaBTEu9GmsugMIA9r3x887Q+ODuC8HH2nzAn7NGpE/e3yiHgWhk0ps5k5DP/2qIdGdONoDzZelrxCl/NWWNUyB93K9F+jC1JX2IMttdY+aQ6zBlw0xnOiNW6Hzy7UtC+xriudjD5APomty7/mYNxLMpRSvWKIjOv/69bDnuC4EL5Kz4jBHLiCyOb+tI0m2qhZ9evAM+Jv1z0NVa8MRtelw/wDa4SzfeespQO/0kjiwfqdfg==", "id_card_number" : "AOZdYGISxo4y44/UgZ69bdu9X+tfMUJ9dl+LetjM45/zMbrYu+wWZ8gn4CTdo+D/m9MrPg+V4sm73oxqdQu/hj7aWyDl4GQtPXVdaztB9jVbVZh3QFzV+BEmytMNQp9dt1uWJktlfdDdLR3AMWyMB377xd+m9bSr/ioDTzagEcGe+vLYiKrzcroQv3OR0p3ppFYoQ3IfYeU/04S4t9rNFL+kyblK2FCCqQ11NdbbHoCrJc7NV4oASq6ZFonjTtgjjgKsadIKHXtb3JZKGZjduGdtkRJJp0/0eow96uY1Pk7Rq79Jtt7+I8juwEc4P4TG5xzchG/5IL9DBd+Z0zZXkw==", "id_card_valid_time_begin" : "2019-06-06", "id_card_valid_time" : "2026-06-06" }, "id_doc_info" : { "id_doc_name" : "jTpGmxUX3FBWVQ5NJTZvlKX_gdU4cRz7z5NxpnFuAxhBTEO_PvWkfSCJ3zVIn001D8daLC-ehEuo0BJqRTvDujqhThn4ReFxikqJ5YW6zFQ", "id_doc_number" : "jTpGmxUX3FBWVQ5NJTZvlKX_gdU4cRz7z5NxpnFuAxhBTEO_PvWkfSCJ3zVIn001D8daLC-ehEuo0BJqRTvDujqhThn4ReFxikqJ5YW6zFQ" }' ``` -------------------------------- ### POST /v3/ecommerce/applyments/ Source: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/open/pay/chapter3_3_3.shtml Submits an application for e-commerce merchant onboarding. ```APIDOC ## POST /v3/ecommerce/applyments/ ### Description Submits an application for e-commerce merchant onboarding. ### Method POST ### Endpoint /v3/ecommerce/applyments/ ### Request Body - **out_request_no** (string) - Optional - Business application request number - **organization_type** (string) - Optional - Organization type - **finance_institution** (bool) - Optional - Whether it is a financial institution - **business_license_info** (object) - Optional - Business license information - **finance_institution_info** (object) - Optional - Financial institution information - **id_holder_type** (object) - Optional - ID holder type - **id_doc_type** (object) - Optional - ID document type - **authorize_letter_copy** (string) - Optional - Authorization letter copy - **id_card_info** (object) - Optional - ID card information - **id_doc_info** (object) - Optional - ID document information - **owner** (bool) - Optional - Whether it is the owner - **account_info** (object) - Optional - Account information - **contact_info** (object) - Optional - Contact information - **sales_scene_info** (object) - Optional - Sales scene information - **settlement_info** (object) - Optional - Settlement information - **merchant_shortname** (string) - Optional - Merchant short name - **qualifications** (string) - Optional - Qualifications - **business_addition_pics** (string) - Optional - Additional business pictures - **business_addition_desc** (string) - Optional - Additional business description - **ubo_info_list** (array) - Optional - List of Ultimate Beneficial Owner information ### Response #### Success Response (200) - **applyment_id** (int64) - Application ID - **out_request_no** (string) - Business application request number ```