# Query and set up authorization pages and merchant information
Interface should be called on the server side, not in the front end (Weixin Mini Program, web pages, APP, etc.) directly called, specific reference interface call guide
Interface name: invoicebizsetattr
This interface provides a series of functions for managing authorization pages and merchant information:
Authorized page field management:
- Set_auth_field: Used to set the information that the user needs to fill in on the type = 1 type authorization page, set to a one-time unless the field needs to be adjusted.
- Get_auth_field: Used to query the field settings of the authorization page.
Merchant-ticketing platform related management:
- Set_pay_mch: Used to associate the merchant number with the billing platform's identification number, set to be one-time, unless the identification number changes or the billing platform changes.
- Get_pay_mch: Used to check the binding of merchants and billing platforms. Merchant contact information management:
- Set_contact: Used to set the connection method of the merchant before obtaining the authorized link.
- Get_contact: Used to get the connection method of the merchant.
These interfaces use the get parameter to determine the specific usage, suitable for different scenarios and requirements, the specific parameters and applicable scenarios are as follows
Action | describe | Remarks |
---|---|---|
set_auth_field | Set up the information that the user needs to fill in on the authorization page.Only for license pages of type = 1 (you do not need to call this interface if you use license pages of type = 0 or type = 2).This is set once, unless you need to adjust the page field. | When using type = 1 type authorization page, the fields set to display status are required fields, if you do not fill in will not be able to enter the subsequent process. |
get_auth_field | Query the field settings of the authorization page. | Merchants need to know how the fields are set up on the current authorization page. |
set_pay_mch | Merchants who use post-payment invoicing need to first associate their merchant number with the invoicing platform's identification number, which is generated by the invoicing app according to the WeChat rule and informed by the invoking platform.This interface is a one-time setup, and subsequently it is usually required to call this interface to reset the correspondence when the billing platform identification number changes, or when the merchant changes the billing system. | If the merchant has implemented the WeChat card package delivery solution of electronic invoice, before calling this interface, it is recommended to confirm that the Official Account binding merchant number and the Official Account message template are the same in the Weixin Pay merchant platform.If it is not the same, you still need to re-use the Official Account message template. |
get_pay_mch | Check whether the merchant is connected to the ticketing platform. | Merchants need to know how they are currently bound to the billing platform when using it. |
set_contact | Set up a merchant's contact information. | Merchants need to set up contact details before obtaining an authorization link. |
get_contact | Get the contact details of the merchant. | Merchants need to know their currently set contact details when using them. |
# 1. How to call
# HTTPS calls
POST https://api.weixin.qq.com/card/invoice/setbizattr?access_token=ACCESS_TOKEN&action=ACTION
# Cloud Calls
- This interface does not support cloud calls
# Third party invocation
This interface supports Third Party Platform generation business call.
The permission set to which this interface belongs is: 26
When a service provider is authorized by one of the permissions set, it can call on behalf of the merchant by using authorizer_access_token , which can be viewed in the third-party call documentation.
# 2. Request parameters
# Query parametersQuery String parameters
Parameter Name | type | Required to fill in | Example | Introductions |
---|---|---|---|---|
access_token | string | yes | ACCESS_TOKEN | Interface invocation credentials, using access_token , authorizer_access_token |
action | string | yes | set_auth_field | Interface function type, need to fill in the allowed action, when for get_auth_field, get_pay_mch, the request body is empty (JSON format {}) |
# Request BodyRequest Payload
Parameter Name | type | Required to fill in | Introductions |
---|---|---|---|
auth_field | object | yes | Authorization page field (used by set_auth_field) |
paymch_info | object | yes | WeChat Merchant Number and Billing Platform Relationship Information (set_pay_mch used) |
contact | object | yes | Contact information (set_contact) |
# Body.auth_fieldObject Payload
Authorization page field (used by set_auth_field)
Parameter Name | type | Required to fill in | Introductions |
---|---|---|---|
user_field | object | yes | Personal Invoices Field on the Authorization Page |
biz_field | object | yes | Authorization page unit invoice field |
# Body.paymch_infoObject Payload
WeChat Merchant Number and Billing Platform Relationship Information (set_pay_mch used)
Parameter Name | type | Required to fill in | Introductions |
---|---|---|---|
mchid | string | yes | WeChat Payment Merchant Number |
s_pappid | string | yes | An invoicing platform id providing invoicing services for the merchant, which is provided by the invoicing platform to the merchant |
# Body.contactObject Payload
Contact information (set_contact)
Parameter Name | type | Required to fill in | Introductions |
---|---|---|---|
time_out | number | yes | Ticketing Overtime |
phone | string | yes | Contact telephone |
# Body.auth_field.user_fieldObject Payload
Personal Invoices Field on the Authorization Page
Parameter Name | type | Required to fill in | Introductions |
---|---|---|---|
show_title | number | no | Do you fill in a head up, 0 is no and 1 is yes? |
show_phone | number | no | Do you fill in the phone number, 0 is not, 1 is yes? |
show_email | number | no | Would you like to fill in the mailbox? 0 is not, 1 is yes |
require_phone | number | no | Is the phone number required? 0 is not, 1 is yes |
require_email | number | no | Is the mailbox required? 0 digits are not, 1 is Yes |
custom_field | objarray | no | Custom fields |
# Body.auth_field.user_field.custom_field(Array)Object Payload
Custom fields
Parameter Name | type | Required to fill in | Introductions |
---|---|---|---|
key | string | yes | Field Name |
is_require | number | no | 0: No, 1: Yes, default 0 |
notice | string | no | Tips on copywriting |
# Body.auth_field.biz_fieldObject Payload
Authorization page unit invoice field
Parameter Name | type | Required to fill in | Introductions |
---|---|---|---|
show_title | number | no | Do you fill in a head up, 0 is no and 1 is yes? |
show_tax_no | number | no | Do you fill in the tax number, 0 is no, 1 is yes? |
show_addr | number | no | Would you like to fill in the unit address, 0 is not, 1 is yes |
show_phone | number | no | Do you fill in the phone number, 0 is not, 1 is yes? |
show_bank_type | number | no | Do you fill in the bank to open your account? 0 is no, 1 is yes |
show_bank_no | number | no | Do you fill in your bank account number, 0 is no, 1 is yes? |
require_tax_no | number | no | Is the tax number required? 0 is not, 1 is |
require_addr | number | no | Whether the unit address is required, 0 is not, 1 is Yes |
require_phone | number | no | Is the phone number required? 0 is not, 1 is yes |
require_bank_type | number | no | Is the bank account required? 0 is not, 1 is Yes |
require_bank_no | number | no | Is the bank account required? 0 is not, 1 is |
require_tax_no | number | no | Is the tax number required? 0 is not, 1 is |
custom_field | objarray | no | Custom fields |
# Body.auth_field.biz_field.custom_field(Array)Object Payload
Custom fields
Parameter Name | type | Required to fill in | Introductions |
---|---|---|---|
key | string | yes | Field Name |
is_require | number | no | 0: No, 1: Yes, default 0 |
notice | string | no | Tips on copywriting |
# 3. Return Parameters
# Response Payload
Parameter Name | type | Introductions |
---|---|---|
errcode | number | Error code |
errmsg | string | Error Description |
auth_field | object | Authorization page field (set_auth_field, get_auth_field returns) |
paymch_info | object | WeChat Merchant number and billing platform relationship information (get_pay_mch returns) |
contact | object | Contact information (get_contact returns) |
# Res.auth_fieldObject Payload
Authorization page field (set_auth_field, get_auth_field returns)
Parameter Name | type | Introductions |
---|---|---|
user_field | object | Personal Invoices Field on the Authorization Page |
biz_field | object | Authorization page unit invoice field |
# Res.paymch_infoObject Payload
WeChat Merchant number and billing platform relationship information (get_pay_mch returns)
Parameter Name | type | Introductions |
---|---|---|
mchid | string | WeChat Payment Merchant Number |
s_pappid | string | An invoicing platform id providing invoicing services for the merchant, which is provided by the invoicing platform to the merchant |
# Res.contactObject Payload
Contact information (get_contact returns)
Parameter Name | type | Introductions |
---|---|---|
time_out | number | Ticketing Overtime |
phone | string | Contact telephone |
# Res.auth_field.user_fieldObject Payload
Personal Invoices Field on the Authorization Page
Parameter Name | type | Introductions |
---|---|---|
show_title | number | Do you fill in a head up, 0 is no and 1 is yes? |
show_phone | number | Do you fill in the phone number, 0 is not, 1 is yes? |
show_email | number | Would you like to fill in the mailbox? 0 is not, 1 is yes |
require_phone | number | Telephone number is required, 0 is no, 1 is yes (only get_auth_field returns) |
require_email | number | Email is required, 0 No, 1 Yes (only get_auth_field returns) |
custom_field | objarray | Custom fields |
# Res.auth_field.user_field.custom_field(Array)Object Payload
Custom fields
Parameter Name | type | Introductions |
---|---|---|
key | string | Field Name |
is_require | number | 0: No, 1: Yes, default 0 |
notice | string | Tips on copywriting |
# Res.auth_field.biz_fieldObject Payload
Authorization page unit invoice field
Parameter Name | type | Introductions |
---|---|---|
show_title | number | Do you fill in a head up, 0 is no and 1 is yes? |
show_tax_no | number | Do you fill in the tax number, 0 is no, 1 is yes? |
show_addr | number | Would you like to fill in the unit address, 0 is not, 1 is yes |
show_phone | number | Do you fill in the phone number, 0 is not, 1 is yes? |
show_bank_type | number | Do you fill in the bank to open your account? 0 is no, 1 is yes |
show_bank_no | number | Do you fill in your bank account number, 0 is no, 1 is yes? |
require_tax_no | number | Tax number is required, 0 is no, 1 is yes (only get_auth_field returns) |
require_addr | number | Unit address is required, 0 is no, 1 is yes (only get_auth_field returns) |
require_phone | number | Telephone number is required, 0 is no, 1 is yes (only get_auth_field returns) |
require_bank_type | number | Is an open account required, 0 is no, 1 is yes (only get_auth_field returns) |
require_bank_no | number | Is the Silver Bank account required, 0 is no, 1 is yes (only get_auth_field returns) |
require_tax_no | number | Tax number is required, 0 is no, 1 is yes (only get_auth_field returns) |
custom_field | objarray | Custom fields |
# Res.auth_field.biz_field.custom_field(Array)Object Payload
Custom fields
Parameter Name | type | Introductions |
---|---|---|
key | string | Field Name |
is_require | number | 0: No, 1: Yes, default 0 |
notice | string | Tips on copywriting |
# 4. Note
There are no special considerations for this interface
# 5. Code examples
# 5.1 Set authorization page field information
Example Requests
https://api.weixin.qq.com/card/invoice/setbizattr?action=set_pay_mch&access_token={access_token}
{
"auth_field" : {
"user_field" : {
"require_phone" : 1,
"custom_field" : [
{
"is_require" : 1,
"key" : "field1"
}
],
"show_email" : 1,
"show_title" : 1,
"show_phone" : 1,
"require_email" : 1
},
"biz_field" : {
"require_phone" : 0,
"custom_field" : [
{
"is_require" : 0,
"key" : "field2"
}
],
"require_bank_type" : 0,
"require_tax_no" : 0,
"show_addr" : 1,
"require_addr" : 0,
"show_title" : 1,
"show_tax_no" : 1,
"show_phone" : 1,
"show_bank_type" : 1,
"show_bank_no" : 1,
"require_bank_no" : 0
}
}
}
Return an example
{
"errcode": 0,
"errmsg": "ok"
}
# 5.2 Query the authorization page field information
Example Requests
https://api.weixin.qq.com/card/invoice/setbizattr?action=get_pay_mch&access_token={access_token}
{}
Return an example
{
"errcode": 0,
"errmsg": "ok",
"auth_field": {
"user_field": {
"show_title": 1,
"show_phone": 1,
"show_email": 1,
"custom_field": [{"key": "field1"}]
},
"biz_field": {
"show_title": 1,
"show_tax_no": 1,
"show_addr": 1,
"show_phone": 1,
"show_bank_type": 1,
"show_bank_no": 1,
"custom_field": [{"key": "field2"}]
}
}
}
# 5.3 Affiliated merchant numbers and billing platforms
Example Requests
https://api.weixin.qq.com/card/invoice/setbizattr?action=set_pay_mch&access_token={access_token}
{
"paymch_info": {
"mchid": "1234",
"s_pappid": "wxabcd"
}
}
Return an example
{
"errcode": 0,
"errmsg": "ok"
}
# 5.4 Find out how the merchant number is linked to the billing platform
Example Requests
https://api.weixin.qq.com/card/invoice/setbizattr?action=get_pay_mch&access_token={access_token}
{}
Return an example
{
"errcode": 0,
"errmsg": "ok",
"paymch_info":
{
"mchid": "1234",
"s_pappid": "wxabcd"
}
}
# 5.5 Set up a merchant contact details
Example Requests
https://api.weixin.qq.com/card/invoice/setbizattr?action=set_contact&access_token={access_token}
{
"contact" :
{
"phone" : "88888888",
"time_out" : 12345
}
}
Return an example
{
"errcode": 0,
"errmsg": "ok"
}
# 5.6 Find out merchant contact details
Example Requests
https://api.weixin.qq.com/card/invoice/setbizattr?action=get_contact&access_token={access_token}
{}
Return an example
{
"contact" : {
"phone" : "88888888",
"time_out" : 12345
},
"errcode" : 0,
"errmsg" : "ok"
}
# 6. Error code
The following is a list of error codes for this interface, other error codes can refer to General error codes
Error code | Error Description | Solutions |
---|---|---|
40078 | invalid card status | Card_id is not authorized.If the developer uses a sandbox environment to report this error, it is mainly because WeChat of the calling interface has not been added to the test list;If the developer uses a formal environment to report this error, the main reason may be that the calling interface Official Account does not open card voucher permissions, or the creation of card_id and the card insertion time is too short. |
40097 | invalid args | Type parameter values are not expected |
72015 | unauthorized create invoice | You do not have permission to operate, check if you have the appropriate permission turned on. |
72017 | invalid invoice title | Invoices are rising inconsistently |
72023 | invoice has been lock by others | Invoice has been locked by other Official Account.Generally, the invoice has entered the follow-up reimbursement process, and the Official Account message template / Enterprise Account / App has locked the invoice. |
72024 | invoice status error | Invoices are incorrectly registered |
72025 | invoice token error | Invalid wx_invoice_token |
72028 | invoice never set pay mch info | WeChat Payment Merchant Information Not Set |
72029 | invoice never set auth field | No authorization field was set |
72030 | invalid mchid | Invalid mchid |
72031 | invalid params | The parameter is wrong. It may include invalid parameter names in the request or include parameter values that are not validated in the background |
72035 | biz reject insert | Fiscal electronic notes have been denied access. If the order_id is used as a parameter to call the refuse collection interface, then the card machine will report this error using this order_id |
72036 | invoice is busy | The financial electronic note is being changed in status. Please try again later |
72038 | invoice order never auth | The order is not authorized, it may be the s_p AppID of the Finance and Politics Bureau, the receiving unit appid, and the order order_id do not match |
72039 | invoice must be lock first | The order was not locked |
72040 | invoice pdf error | PDF is invalid, please provide a true and valid pdf |
72042 | billing_code and billing_no repeated | Repeated ticket number and ticket code |
72043 | billing_code or billing_no size error | Error in ticket number and ticket code |
72044 | scan text out of time | Invoice headers QR code timeout |
72063 | biz contact is empty | The merchant contact details are not empty. Please call the interface first to set the merchant contact information |
73000 | sys error make out invoice failed | A logical error in the billing platform |
73001 | wxopenid error | OpenId error |
73002 | ddh orderid empty | Order number is empty |
73003 | fpqqlsh empty | The invoice flow number is empty |
73004 | kplx empty | The invoice flow number is empty |
73007 | nsrmc empty | The taxpayer name is empty |
73008 | nsrdz empty | Taxpayer addresses are empty |
73009 | nsrdh empty | Taxpayer phones are empty |
73010 | ghfmc empty | The purchaser's name is empty |
73011 | kpr empty | The teller was empty. |
73012 | jshj empty | The combined tax bill was empty |
73013 | hjje empty | The total amount is empty |
73014 | hjse empty | Total taxes are empty |
73015 | hylx empty | Industry type is empty |
73016 | nsrsbh empty | The taxpayer identification number is empty |
73100 | ka plat error | Error on the ticketing platform |
73101 | nsrsbh not cmp | Taxpayer identification number does not match, and the taxpayer identifier in the request is not consistent with the taxpayers identification filled out in the creation form |
73102 | sys error | WeChat Billing platform system error |
73105 | Kp plat make invoice timeout, please try again with the same fpqqlsh | In billing platform, use the same invoice request flow number to retry billing |
73106 | Fpqqlsh exist with different ddh | The invoice request flow number already exists and is occupied by other order numbers |
73107 | Fpqqlsh is processing, please wait and query later | The invoice request flow is being processed. Please obtain the results via the query interface |
73108 | This ddh with other fpqqlsh already exist | The order has been processed by flow of other invoice requests |
73110 | fpqqlsh first 6 byte not cmp | The first six digits of the invoices requested are incorrect |
# 7. Scope of application
Official Account | Service Account |
---|---|
✔ | ✔ |
- ✔: The account can call this interface
- Other account types that are not expressly stated may not be called on this interface without special instructions;