# Create an invoice voucher template

Debugging Tools

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 NametypeRequired to fill inIntroductions
access_tokenstringyesInterface invocation credentials, using access_token , authorizer_access_token

# Request BodyRequest Payload

Parameter NametypeRequired to fill inIntroductions
invoice_infoobjectyesInvoice Template Object

# Body.invoice_infoObject Payload

Invoice Template Object

Parameter NametypeRequired to fill inIntroductions
base_infoobjectyesInvoice voucher template basics information
payeestringyesThe 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
typestringyesType of invoice

# Body.invoice_info.base_infoObject Payload

Invoice voucher template basics information

Parameter NametypeRequired to fill inIntroductions
logo_urlstringyesInvoice business LOGO, please use the permanent material interface
titlestringyesRecipients (shown in the list), maximum of 9 Chinese characters, which are recommended to be filled in the merchant's short title
custom_url_namestringnoBilling platform custom entrance name, and custom_url field used together, the length is limited to 5 Chinese characters
custom_urlstringnoThe 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_titlestringnoThe tips displayed on the right side of the entrance are limited to 6 characters in length
promotion_url_namestringnoCustom entry points for marketing scenarios
promotion_urlstringnoThe 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_titlestringnoThe tips displayed on the right side of the entrance are limited to 6 characters in length

# 3. Return Parameters

# Response Payload

Parameter NametypeIntroductions
errcodestringError code
errmsgstringError message
card_idstringWhen 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 codeError DescriptionSolutions
40078invalid 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.
72015unauthorized create invoiceYou do not have permission to operate, check if you have the appropriate permission turned on.
72017invalid invoice titleInvoices are rising inconsistently
72023invoice 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.
72024invoice status error Invoices are incorrectly registered
72025invoice token errorInvalid wx_invoice_token
72028invoice never set pay mch infoWeChat Payment Merchant Information Not Set
72029invoice never set auth field No authorization field was set
72030invalid mchid Invalid mchid
72031invalid 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
72035biz 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
72036invoice is busyThe financial electronic note is being changed in status. Please try again later
72038invoice order never authThe 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
72039invoice must be lock firstThe order was not locked
72040invoice pdf errorPDF is invalid, please provide a true and valid pdf
72042billing_code and billing_no repeatedRepeated ticket number and ticket code
72043billing_code or billing_no size errorError in ticket number and ticket code
72044scan text out of timeInvoice headers QR code timeout

# 7. Scope of application

How this interface can be invoked under different account types:
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;