Enterprise IT Deep Dive•13 min read

China's All-in-One Digital E-Invoicing (数电发票): Architecture & Global ERP Integration Guide

A comprehensive technical and operational blueprint for integrating China's Golden Tax Phase IV fully digitalized e-fapiao into global ERP systems like SAP S/4HANA, Oracle, and NetSuite.

CT
ChinaTechStack Research Team
Cross-Border Systems & Legal Research
Published: March 28, 2026Verified for 2026
Executive Resource Kit

Download the China Golden Tax IV & SAP/Oracle Middleware Integration Architecture Guide

Comprehensive compliance checklists, architecture blueprints, and regulator contact matrices.

Instant Access

For decades, the Chinese fapiao (official tax invoice) was synonymous with physical paper vouchers printed on specialized, government-controlled dot-matrix hardware (“Golden Tax Tax Control Disk” - 金税盘).

With the nationwide deployment of Golden Tax Phase IV (金税四期) and the Fully Digitalized Electronic Fapiao (全数字化电子发票 / 数电发票), China’s State Taxation Administration (STA) has modernized corporate taxation into a cloud-native, real-time digital infrastructure.

Paper fapiao and physical hardware disks are being phased out. Every invoice is now an XML/OFD structured digital artifact issued, validated, delivered, and reconciled directly against the National Tax Big Data Platform in real time.

For foreign multinationals operating subsidiaries in China, this transition fundamentally alters the finance and enterprise IT architecture. In this guide, we break down the technical integration patterns for global ERPs like SAP S/4HANA, Oracle Cloud ERP, and NetSuite.


1. Traditional Golden Tax III vs. Digital E-Fapiao (Golden Tax IV)

Understanding this paradigm shift is essential for CIOs and IT transformation leads:

Feature / Dimension Legacy Golden Tax III (金税三期) Fully Digitalized E-Fapiao (数电发票 - Golden Tax IV)
Medium & Carrier Paper fapiao or PDF issued via physical USB dongle / tax-control hardware disk Pure cloud-based digital artifact (XML / PDF / OFD); zero physical hardware
Issuance Quota Fixed monthly sheet quota (e.g., 50 paper invoices per batch) Dynamic, algorithm-based Credit Quota (总额度) adjusted in real time based on tax compliance, revenue, and payroll
Invoice Numbering 10- or 12-digit code printed in pre-allocated serial blocks 20-digit nationally unique digital identifier generated instantly by the cloud platform
Delivery Method Express courier mail or email attachment Automatic direct push to counterparty’s National Electronic Tax Bureau digital mailbox (Tax Digital Account - 税务数字账户)
System Architecture Isolated local client software; batch manual data export via CSV/Excel Cloud-to-cloud RESTful APIs and encrypted service bus integration

2. Core Technical Architecture: The Three Integration Models

Multinational corporations cannot connect their overseas ERP database directly to the Chinese Tax Bureau without an approved intermediary architecture. The three standard deployment patterns are:

[ Model A: Direct STA Cloud Direct Access (Large Enterprise) ]
Global ERP (SAP S/4HANA) ──► China Local SAP Gateway ──► STA Leqi API Gateway (乐企平台) ──► National Tax Core

[ Model B: Certified Tax Middleware / Value-Added Tax Aggregator (Most Popular) ]
Global ERP (Oracle/NetSuite) ──► Tax Middleware SaaS (e.g., Baiwang / Aisino / Wolters Kluwer) ──► STA Gateway

[ Model C: Hybrid RPA & Automated Web Bridge (Lightweight / Low Budget) ]
Global ERP ──► Scheduled CSV Export ──► Managed RPA Worker ──► Electronic Tax Bureau Web Portal

Detailed Evaluation of the Approaches:

Model A: “Leqi” Direct Cloud API (乐企直连)

  • How it works: The State Taxation Administration provides an enterprise-level open API platform named “Leqi” (乐企). Qualified large enterprises can build a direct TLS connection between their ERP/middleware and the provincial tax gateway.
  • Qualification Threshold: Typically requires annual sales exceeding 500 million RMB, high tax compliance ratings (Class A or B), and a rigorous security audit.
  • Best for: Fortune 500 multinationals with large Chinese operations processing thousands of customer billing events daily.

Model B: Certified Third-Party Tax Cloud Middleware

  • How it works: Leverage authorized Chinese tax-tech vendors (such as Baiwang, Aisino, Wolters Kluwer China, or Kingdee/Yonyou cloud connectors) who maintain pre-certified Leqi channels. Your ERP calls standard REST APIs or SFTP interfaces provided by the vendor.
  • Advantages: Shields global ERP teams from changing local tax bureau XML schemas; deployment timeline drops from 6 months to 4–6 weeks.
  • Best for: 85% of multinational subsidiaries in China.

3. End-to-End Invoice Lifecycle (Accounts Receivable / AR)

[ CRM / Billing Event ] (Salesforce / Internal SaaS)
         │
         ▼
[ Global ERP ] (SAP S/4HANA - Creates Billing Document)
         │
         ▼ (Triggers RFC / REST Webhook)
[ China Tax Middleware Integration Service ]
         │
         ├── Validates Tax Category Codes (税收分类编码)
         ├── Performs Pre-Issuance Credit Quota Check
         │
         ▼ (mTLS Encrypted Payload)
[ National Tax Bureau (STA) Digital Platform ]
         │
         ├── Generates 20-Digit Digital Fapiao ID
         ├── Signs Digital Timestamp & Cryptographic Hash
         ├── Generates XML + OFD + PDF Rendering
         │
         ▼
[ Immediate Delivery ]
         ├── Pushed automatically into Buyer's Tax Digital Account
         └── Webhook sent back to ERP: Updates SAP with Fapiao Number & Archive Link

Critical API Payload Attributes for Fully Digitalized Fapiao:

When constructing the invoice generation payload, your middleware must correctly map Chinese statutory parameters:

  • sellerTaxNo & buyerTaxNo: 18-digit Unified Social Credit Code.
  • taxClassificationCode (税收分类编码): Mandatory 19-digit commodity category code determining applicable VAT rates (e.g., 6%, 9%, 13%).
  • invoiceType: General VAT E-Invoice (数电普票) vs. Special VAT E-Invoice (数电专票 - enables tax deduction/credit for the buyer).
  • invoiceTotalAmount: Net revenue, VAT amount, and gross total, calculated to exact decimal precision.

4. Accounts Payable (AP): Inbound Fapiao Verification & Anti-Fraud

In China, obtaining a supplier’s invoice is insufficient to claim a corporate tax deduction. You must actively verify and deduct (勾选抵扣) the invoice through the Tax Bureau.

Digital Inbound Verification Flow:

  1. Automated Ingestion: The supplier issues a digital fapiao. The National Tax Platform automatically routes a copy directly to your company’s official Tax Digital Account (税务数字账户).
  2. Automated Matching: The AP middleware polls the Tax Digital Account via webhook/API, downloads the raw XML invoice artifact, and matches it against your ERP’s Purchase Order (PO) and Goods Receipt (GR) notes using a 3-way matching algorithm.
  3. One-Click Tax Credit Deduction: At month-end, the finance team approves the tax credit batch directly inside the ERP interface, triggering an API call to the tax bureau to finalize input VAT deduction.

Under Ministry of Finance Document No. [2020] 6, enterprises utilizing electronic invoices must retain the original structured data file (XML format). Merely archiving a scanned PDF or printout is an explicit compliance failure during state tax audits.


5. Architectural Checklist for IT Project Managers

  • Tax Classification Mapping: Map all global product catalog SKUs to the STA’s 19-digit Chinese Tax Classification Code directory.
  • XML Structured Archiving: Configure immutable cloud storage (e.g., AWS S3 Object Lock or Alibaba Cloud OSS WORM) to store original XML fapiao payloads for the statutory minimum of 30 years.
  • Dynamic Quota Monitoring: Implement real-time monitoring and alerting for remaining monthly billing credit quotas to avoid order disruptions during peak sales periods.
  • Exception Handling: Develop rollback and red-letter invoice (红字发票 / credit note) workflows to handle refunds, order cancellations, and partial adjustments automatically.
  • Dual-Language Interface: Provide dual-language (English/Simplified Chinese) error mapping between global ERP error consoles and local tax bureau status codes.
Regulatory & Professional Disclaimer

ChinaTechStack provides technical analysis, system blueprints, and comparative regulatory overviews based on publicly available statutes from the MIIT, CAC, SAFE, and STA. This publication is not formal legal counsel, tax advice, or a certified auditing opinion. Multinational corporations should consult qualified Chinese legal counsel and certified tax advisors prior to executing corporate restructurings or cross-border data transfer agreements.