# Create an invoice voucher template
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 English name: invoiceplatformcreatecard
Using this interface, you can configure custom columns on the invoice voucher template for a merchant to create that merchant. The card_id generated by the Create Invoice Card Template will be referenced when creating an invoice card, so the Create Invoice Card Template is the basis for creating an invoice card.
# 1. How to call
# HTTPS calls
POST https://api.weixin.qq.com/card/invoice/platform/createcard?access_token=ACCESS_TOKEN
# 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 | Introductions |
---|---|---|---|
access_token | string | yes | Interface invocation credentials, using access_token , authorizer_access_token |
# Request BodyRequest Payload
Parameter Name | type | Required to fill in | Introductions |
---|---|---|---|
invoice_info | object | yes | Invoice Template Object |
# Body.invoice_infoObject Payload
Invoice Template Object
Parameter Name | type | Required to fill in | Introductions |
---|---|---|---|
base_info | object | yes | Invoice voucher template basics information |
payee | string | yes | The full name of the recipient (invoicer) is shown in the invoice details. It is therefore proposed that one receiving party correspond to one invoice card template |
type | string | yes | Type of invoice |
# Body.invoice_info.base_infoObject Payload
Invoice voucher template basics information
Parameter Name | type | Required to fill in | Introductions |
---|---|---|---|
logo_url | string | yes | Invoice business LOGO, please use the permanent material interface |
title | string | yes | Recipients (shown in the list), maximum of 9 Chinese characters, which are recommended to be filled in the merchant's short title |
custom_url_name | string | no | Billing platform custom entrance name, and custom_url field used together, the length is limited to 5 Chinese characters |
custom_url | string | no | The invoicing platform customizes the address link of the portal to the external link, and the link to the external invoice will have the invoice parameter to identify the link from which invoice is jumped |
custom_url_sub_title | string | no | The tips displayed on the right side of the entrance are limited to 6 characters in length |
promotion_url_name | string | no | Custom entry points for marketing scenarios |
promotion_url | string | no | The entry jumps to the address link of the external link. The link that jumps out of an invoice will have the invoice parameter to identify the link that jumped out of that invoice |
promotion_url_sub_title | string | no | The tips displayed on the right side of the entrance are limited to 6 characters in length |
# 3. Return Parameters
# Response Payload
Parameter Name | type | Introductions |
---|---|---|
errcode | string | Error code |
errmsg | string | Error message |
card_id | string | When the error code is 0, the number of the invoice voucher template is returned, used as a mandatory parameter when invoking the plug-in interface after the merchant's invoice is generated |
# 4. Note
There are no special considerations for this interface
# 5. Code examples
Example Requests
{
"invoice_info": {
"base_info": {
"logo_url": "http://mmbiz.qpic.cn/mmbiz/iaL1LJM1mF9aRKPZJkmG8xXhiaHqkKSVMMWeN3hLut7X7hicFNjakmxibMLGWpXrEXB33367o7zHN0CwngnQY7zb7g/0",
"title": "xx公司",
"custom_url_name": "xyz",
"custom_url": "xyz",
"custom_url_sub_title": "xyz",
"promotion_url_name": "puname",
"promotion_url": "purl",
"promotion_url_sub_title": "ptitle",
},
"type": " 广东省增值税普通发票 ",
"payee": " 测试 - 收款方 ",
}
}
Return an example
{
"errcode": 0,
"errmsg": "ok",
"card_id": "pjZ8Yt9WoOePThU0NfUKz5-tBEWU"
}
# 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. |
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 |
# 7. Scope of application
Official Account | Service Account |
---|---|
Application required | Application required |
- Requires application: indicates that the account type needs to submit an application for this scenario and be approved before it can be invoked
- Other account types that are not expressly stated may not be called on this interface without special instructions;