China Invoice Field Verification API
Check a Chinese VAT invoice from its printed fields. Choose the right amount, send the API request, and reconcile the verification result with your purchase.
Verify a Chinese invoice using its printed details.

Send "1130.00", not "1000.00", for the 20-digit digital fapiao in this example. Both numbers are printed on the invoice, but they describe different amounts. The first is 价税合计, the tax-inclusive total. The second is 金额, the amount before tax. Looking up the right invoice with the wrong one can turn a clean purchasing record into an exception.
Use the ChinaValidate invoice field verification API when you have readable invoice details and want to verify them through POST /v1/invoices/verify. The endpoint accepts JSON fields rather than the original file. The request starts with the full invoice number and issue date, then adds the amount, invoice code or verification code required for the document type. The result can support an accounts payable review while the invoice, order and payment evidence stay in your records.
Choose the invoice and the amount basis
Start from the Chinese VAT invoice, commonly called a fapiao. Check the document title and field labels before copying a value from the supplier’s attachment. A quotation, packing list or commercial invoice may show the same seller and a similar total. It can still carry a different document number, issue date or amount basis. Take the lookup fields from the VAT invoice rather than combining values across the supplier’s paperwork.
The national VAT invoice verification platform instructions distinguish the input sets by document type. They show a 20-digit number, issue date and tax-inclusive total for digital ordinary and special VAT invoices. Older-format special VAT invoices use a separate invoice code, a number and date, and the amount excluding tax. For several older ordinary VAT formats the relevant additional value is the suffix of the verification code rather than an amount. These are examples of how to read the document. Check the API reference for the route’s supported fields rather than assuming that every document the official portal handles is accepted by this endpoint.
| Document pattern | Fields after number and date | A common wrong value |
|---|---|---|
| 20-digit digital VAT invoice | Tax-inclusive total (价税合计) in total_amount
|
The amount before tax printed above the VAT line. |
| Older special VAT invoice | Separate invoice_code and the amount excluding tax in net_amount, where applicable |
The tax-inclusive total, or the seller’s tax ID in the invoice code field. |
| Older ordinary VAT invoice requiring a verification code | Separate invoice_code and document verification value in verification_code as required for that type |
A CAPTCHA from an official website, or the suffix of the invoice number copied without checking the type. |
For a special VAT invoice, translate 开具金额(不含税) as the issued amount excluding tax. For a 20-digit digital invoice, use the amount printed next to 价税合计. The two numbers can happen to have the same value on some invoices. Their labels still matter. Keep the amount basis in your source record so a later reviewer can tell the difference between zero VAT and a field chosen by mistake.
Preserve identifiers from intake to request
- Invoice number and invoice code
- 发票号码 is the complete invoice number. 发票代码 is a separate field on relevant older invoices. Keep identifiers as strings. A spreadsheet can remove leading zeros, and a JavaScript number cannot represent every 20-digit integer exactly.
- Printed issue date
- Send 开票日期 as
YYYYMMDD. Keep it as a calendar date through intake. The days you received the file, posted it or paid the supplier are different values. - Document verification code
- 校验码 is the document’s verification code. For the older ordinary VAT formats covered by the official portal’s suffix requirement, read the required final six characters under that rule. 验证码 on a verification website is its challenge for the browser session. The API request does not take that challenge value.
- Money
- Enter the applicable printed value as a decimal string, without a currency label or thousands separator. Submit one amount field when the type calls for an amount. The API rejects requests with both
net_amountandtotal_amountpopulated.
Let reviewers see original values beside the normalized request. A form that displays 2025-03-18 and submits "20250318" is easy to explain. A form that converts an invoice date through a timezone can quietly shift it to the previous day. Likewise, left-padding a rounded invoice number cannot restore digits lost to a spreadsheet’s numeric precision. When the original value is uncertain, go back to the invoice instead of trying likely-looking combinations.
Keep the printed amount independent of downstream calculations. An invoice can be for a partial shipment while the purchase order shows the full contract. The bank transfer may be less because it applies a deposit, or it may show a converted currency value. Even when all parties agree about the purchase, the request needs the value printed on the invoice rather than the amount you are about to pay. If a field extractor stores both a pre-tax and tax-inclusive amount, make the invoice type determine which one enters the request. Do not use whichever one happens to be present first.
Send a worked digital invoice request
The response fixture shows an amount before tax of RMB 1,000.00 and VAT of RMB 130.00, producing a total of RMB 1,130.00. The request sends that printed total in total_amount. The number and date below mirror the public documentation fixture and illustrate the shape of a digital invoice request. A live check needs invoice details you are authorized to verify. Put the API key in a server-side environment variable and use the documented test environment when checking your integration against fixtures.
curl --silent --show-error 'https://api.chinavalidate.com/v1/invoices/verify' \
--header "Authorization: Bearer ${CHINAVALIDATE_API_KEY:?Set CHINAVALIDATE_API_KEY}" \
--header 'Content-Type: application/json' \
--data-binary '{
"invoice_number": "25322000000000123456",
"issue_date": "20250318",
"total_amount": "1130.00"
}'
Review the request your application built before letting the reviewer choose whether to submit it. A useful check is to compare the payload with the source document’s field labels rather than just comparing screen values with another generated export. If the vendor has issued a revised invoice, select the document intended for the order first. Changing the number to the latest one while keeping the original issue date and amount creates a hybrid request that matches neither invoice.
Older invoice examples
Special VAT invoice. For a worked comparison, suppose the invoice labels the amount before VAT as RMB 2,000, VAT as RMB 260 and its inclusive total as RMB 2,260. You could see the same three types of amount on a digital fapiao. Here the older special format also has a separate invoice code. Under the national portal’s rule for this type, the field to check is the RMB 2,000 issued amount before tax. Use net_amount and the appropriate separate invoice_code when submitting this supported input set to the API. The RMB 2,260 total still belongs in the payable reconciliation, where it explains what was charged.
Ordinary VAT invoice with a verification code. An older ordinary invoice can display both a separate invoice code and a much longer verification code. A buyer working from a photo may copy the row labelled 发票代码 into both fields, because the two labels sound similar in English. Use the required verification value from the applicable document field. The official national portal instructions specify the final six digits for several ordinary invoice types and describe a distinct password-area rule for certain paper forms issued by the electronic invoice service platform. If you have an older invoice whose formatting you cannot read, use the precise type instructions rather than guessing from the length of the visible numbers. A supplier can send the correct original or identify the invoice type.
Put these two examples alongside the digital one when reviewing extraction logic. They test different assumptions. The older special form checks that you preserve and use the pre-tax basis where required. The ordinary form checks that a code route can work without defaulting to the nearest visible amount. The digital route checks that the absence of a separate invoice code does not stop a valid input. In your own fixture set, maintain a label for every amount and code. A guessed value that matches an example due to coincidence will otherwise pass the test and carry the wrong assumption into production.
Read the result in two layers
Start with the transport and envelope. Did the API return a normal business result, or did the request fail before verification could complete? Then read data.verification_status. The sample below is a matched business result. Its invoice type code and result fields are those from the fixture. Do not treat one example type code as a comprehensive guide to the input patterns above. Keep the returned values and handle absent optional details explicitly.
{
"code": 0,
"msg": "ok",
"data": {
"verification_status": "matched",
"invoice_type": "10",
"invoice_number": "25322000000000123456",
"issue_date": "2025-03-18",
"seller_name": "苏州示例精密制造有限公司",
"seller_tax_id": "91320505MA00000005",
"buyer_name": "杭州示例工业设备有限公司",
"buyer_tax_id": "91330100MA0000000C",
"net_amount": "1000.00",
"tax_amount": "130.00",
"total_amount": "1130.00",
"line_items": [
{
"item_name": "精密加工零件",
"quantity": "10",
"unit": "件",
"net_amount": "1000.00",
"tax_amount": "130.00",
"tax_rate": "0.13"
}
]
}
}
| State | First diagnostic | Next action |
|---|---|---|
matched |
Is this the actual invoice from the intended seller to the correct buyer? | Compare legal names, tax IDs, currency and amount basis with the commercial record. |
mismatch |
Compare exact submitted values and their source labels against the same invoice. | Correct a demonstrated field error. If they agree, escalate the discrepancy with the issuer or relevant tax authority. |
not_found |
Check the invoice identity, issue date, source and relevant coverage before concluding anything from the absence. | Request the issued document or ask the issuer to confirm the record through the appropriate channel. |
| Request validation error | Check the selected route, required strings, field names and whether both amount fields were submitted. | Fix the request. An invalid payload does not establish an invoice outcome. |
| Timeout, permission or service error | Check whether the request reached a usable business result. Address server permissions, temporary failures or rate limits according to their documented state. | Keep the check pending and retry only under your operating policy. |
The official platform also separates a mismatch, where at least one checked value differs, from an invoice it cannot find. Its verification result explanation gives examples of both and describes marking a voided invoice when the matching record indicates it was voided. An API response showing a match answers the verification question presented by the response. Review any returned status affecting posting or payment and, where needed, use the relevant authoritative channel to confirm the current state. For an older invoice, consult the verification channel’s supported period before deciding what a no-result can establish. The Tianjin tax authority’s guidance on no-result checks identifies the official portal’s lookback as one example of a coverage constraint. That portal guidance does not promise the same coverage for every API request.
Diagnose the fields before retrying
The numbers seem right. Open the invoice and read each label alongside the submitted value. For a digital example using RMB 1,000 net and RMB 1,130 total, the result of a request carrying RMB 1,000 in the total field says very little about the correct 1,130 request. If the intake record already has both amounts, correct the mapping so a reviewer does not need to solve the same error on every invoice. When two values are numerically equal, review the amount label; equality does not make the mapping valid for the next document.
The identifier changed shape. Compare the original identifier to the serialized JSON. Watch for missing leading zeros or digits in the invoice number, a verification code with spaces copied from a viewer, or accidental reliance on a masked code. Keep the visible value and the source reference, and ask for a readable issued copy if you cannot reconstruct the exact string from the evidence you have. A month-end job should also compare the submitted date and the date stored in the purchasing record for off-by-one errors.
The document was replaced or adjusted. Select the intended invoice as a complete record. Preserve earlier checks on earlier versions, and reconcile a replacement or red-letter adjustment with the original transaction before approving the payable. If your only obstacle is retrieving readable fields from an original file, compare the documented PDF route and OFD route with the artifacts your suppliers actually deliver. Choose one justified route for each check instead of automatically trying every available route on the same evidence.
Errors before an invoice outcome
Read the actual HTTP status and returned reason when there is no usable verification state. A malformed JSON payload or a missing required field can produce a request error. A key without access to this operation calls for a permission check, and a credit issue belongs with the account owner. A rate-limit response calls for the wait described by that response. Put these into different queues if different people can resolve them. None answers whether the invoice matched its source record. Show a short label for the technical problem while leaving the payable awaiting verification.
For integration monitoring, keep the request time, route, HTTP status and error reason where available. Use your own source reference in logs so developers can trace a problem with access controls in place. Separate no-result outcomes from unavailable service in reports. If a week’s mismatch count rises after a form change, compare the saved amount basis and document types before concluding that suppliers supplied more inconsistent invoices. An increase in request errors after a credentials change points to a different investigation. With both signals, the person operating the queue can identify whether to fix the integration, review the document or contact the issuer.
Connect the check to approval
Match the legal Chinese seller name and tax ID to the supplier you onboarded. An English translation can make two companies in a group appear to be the same business. Match the buyer as well. A genuine invoice issued to another group company may still require correction before your team posts it. Then reconcile lines and amounts with the purchase order and delivery evidence. The fixture lists ten units and an amount before tax of RMB 1,000.00. Those details are useful for comparing records, but they do not establish that a warehouse received the items or that a particular beneficiary is entitled to payment.
Store the invoice reference, chosen amount basis, original strings or protected references to them, the time and outcome of the check, and the next action if any. Preserve any older result when a corrected request supersedes it. Do not keep credentials in client logs or distribute raw invoice data to debugging tools. The Ministry of Finance and National Archives notice on electronic accounting vouchers covers authenticity and storage controls for applicable electronic accounting workflows. Treat your verification record as evidence of the check while retaining the underlying voucher and transaction evidence according to your own requirements.
Before rollout, test a digital invoice on the total amount basis, an older supported invoice on its required basis, a fully preserved identifier with leading zeros, a business mismatch and an interrupted call. Confirm that the screen gives different explanations for each. That gives procurement the fields it needs to investigate a document and gives engineering a precise way to distinguish an API outage from a bad extraction.