> For the complete documentation index, see [llms.txt](https://docs.docbits.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.docbits.com/administration-and-setup/settings/global-settings/document-types/edi/supported-electronic-documents/china-fapiao.md).

# CHINA FAPIAO

China Fapiao (FAPIAO, E-FAPIAO, General VAT Invoice, Special VAT Invoice) electronic document support in DocBits

{% hint style="info" %}
Check the country guide for version limits, effective configuration and the country explainer. [China](/administration-and-setup/settings/global-settings/document-types/edi/supported-electronic-documents/china.md). The documented adapter uses the XML namespace urn:china:tax:fapiao:1.0. Do not assume that every native OFD, PDF or tax-platform export uses that contract.
{% endhint %}

| Property             | Value                                                            |
| -------------------- | ---------------------------------------------------------------- |
| **Country / Region** | China                                                            |
| **Document Types**   | General VAT Invoice (普通发票), Special VAT Invoice (专用发票), E-Fapiao |
| **Format**           | XML                                                              |
| **Standard**         | Fapiao (发票), State Taxation Administration                       |
| **Locale**           | `zh_CN`                                                          |

The catalogue includes Fapiao, E-Fapiao, General VAT Invoice and Special VAT Invoice. The documented adapter uses the XML namespace urn:china:tax:fapiao:1.0. Do not assume that every native OFD, PDF or tax-platform export uses that contract.

| fapiao\_type value | Document Type                                      |
| ------------------ | -------------------------------------------------- |
| 普通发票               | General VAT Invoice (FAPIAO / GENERAL VAT INVOICE) |
| 专用发票               | Special VAT Invoice (SPECIAL VAT INVOICE)          |
| 电子发票               | E-Fapiao (E-FAPIAO)                                |

## Support Status

| Component        | Status      |
| ---------------- | ----------- |
| Preview          | ✅ Supported |
| Field Extraction | ✅ Supported |
| Transformation   | ✅ Supported |

## Default Preview

<figure><img src="https://578966019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT2n2w4uDCJvv7CJ5zrdk%2Fuploads%2Fgit-blob-0bd66205ed3d05457ddaa83a7a58d5dd2238a508%2Fchina-fapiao-preview.png?alt=media" alt="China Fapiao General VAT Invoice preview in DocBits"><figcaption><p>Default DocBits preview for a China Fapiao General VAT Invoice (普通发票)</p></figcaption></figure>

## Field Mapping

### Header Fields

| DocBits Field      | Source XML Element          | Notes                                  |
| ------------------ | --------------------------- | -------------------------------------- |
| `invoice_id`       | `fapiao_head/fapiao_number` | Fapiao number — 8 digits (发票号码)        |
| `invoice_date`     | `fapiao_head/issue_date`    | Issue date (ISO 8601)                  |
| `currency`         | Fixed: `CNY`                | Always Chinese Yuan Renminbi           |
| `total_amount`     | `total/total_with_tax`      | Total amount incl. VAT (价税合计)          |
| `net_amount`       | `total/total_amount`        | Net taxable amount excl. VAT (金额)      |
| `tax_amount`       | `total/total_tax`           | Total VAT amount (税额)                  |
| `supplier_name`    | `seller/name`               | Seller company name (销售方名称)            |
| `supplier_id`      | `seller/taxpayer_id`        | Seller taxpayer ID — 18 chars (纳税人识别号) |
| `supplier_address` | `seller/address`            | Seller address                         |
| `supplier_country` | Fixed: `CN`                 | Always China                           |
| `iban`             | `seller/bank_account`       | Seller bank account number             |
| `buyer_name`       | `buyer/name`                | Buyer company name (购买方名称)             |
| `buyer_id`         | `buyer/taxpayer_id`         | Buyer taxpayer ID (纳税人识别号)             |
| `buyer_address`    | `buyer/address`             | Buyer address                          |
| `buyer_country`    | Fixed: `CN`                 | Always China                           |

### Line Item Table (`INVOICE_TABLE`)

Row path: `items/item`

| Column        | Source XML Element | Notes                                      |
| ------------- | ------------------ | ------------------------------------------ |
| `POSITION`    | `seq`              | Line sequence number                       |
| `DESCRIPTION` | `name` + `spec`    | Item name and specification (concatenated) |
| `QUANTITY`    | `quantity`         | Quantity                                   |
| `UNIT`        | `unit`             | Unit of measure (e.g. 箱, 台, 项)             |
| `UNIT_PRICE`  | `unit_price`       | Unit price excl. VAT                       |
| `VAT_RATE`    | `tax_rate`         | VAT rate in % (typically 6%, 9%, or 13%)   |
| `VAT`         | `tax_amount`       | VAT amount per line                        |
| `NET_AMOUNT`  | `amount`           | Line total excl. VAT                       |

## Classification Rules

DocBits detects China Fapiao documents by matching the XML namespace and `fapiao_type`:

| Electronic Document Type  | Pattern                                                        |
| ------------------------- | -------------------------------------------------------------- |
| CHINA GENERAL VAT INVOICE | `urn:china:tax:fapiao:1.0` + `<fapiao_type>普通发票</fapiao_type>` |
| CHINA SPECIAL VAT INVOICE | `urn:china:tax:fapiao:1.0` + `<fapiao_type>专用发票</fapiao_type>` |
| CHINA E-FAPIAO            | `urn:china:tax:fapiao:1.0` + `<fapiao_type>电子发票</fapiao_type>` |

The root element is `<fapiao>` with namespace `urn:china:tax:fapiao:1.0`. Classification uses the **first-match-wins** principle, sorted by pattern length (longest first).

## Related

* [Currently Supported E-Invoice Standards](https://github.com/Fellow-Consulting-AG/docbits/tree/main/readme/administration-and-setup/settings/global-settings/document-types/currently-supported-e-invoice-standards/README.md)
* [Supported Electronic Documents](/administration-and-setup/settings/global-settings/document-types/edi/supported-electronic-documents.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.docbits.com/administration-and-setup/settings/global-settings/document-types/edi/supported-electronic-documents/china-fapiao.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
