Postal Savings Bank's Leqi Integration: Real-Time Invoicing Architecture
China Postal Savings Bank integrated with the Leqi platform's shared invoice service, enabling automatic invoice generation upon payment via a three-layer-one-core architecture using microservices, TCC distributed transactions, and domestic technology stack, achieving 99.9% success rate and seconds-level invoicing.
Background: Pain Points of Traditional Invoice Management and Leqi Lianyong Breakthrough
Traditional invoice issuance requires finance staff to log into tax portals, manually enter transaction data, verify amounts and tax rates, wait for approval, then download and print. During peak seasons, large enterprises may issue tens of thousands of invoices daily, forcing teams to work overnight. The Leqi (Natural System) platform, operated by the State Taxation Administration, provides a standardized, rule-open, fully digital e-invoice service platform that connects tax systems directly with enterprise IT systems. Leqi Lianyong (shared use) extends Leqi's capabilities to transaction counterparties without control relationships, making it a natural fit for banks and payment institutions that sit at the center of massive merchant-consumer networks. China Postal Savings Bank (PSBC) recently integrated with Leqi Lianyong, achieving end-to-end automation of "payment triggers invoicing" for specific transaction scenarios.
Overall Technical Architecture: Three Layers One Core
PSBC's Leqi Lianyong invoice docking platform adopts a "three layers one core" architecture, balancing technical advancement with business flexibility.
Touchpoint Layer
Provides multi-channel service entry points for end users. Internal customer-facing channels integrate invoice query, download, and status tracking capabilities via standardized APIs, ensuring consistent experience across channels. Handles unified access authentication, session management, and multi-terminal adaptation. Channels need only one integration to reuse all invoice services.
Business Layer
Encapsulates core business logic — payment, invoicing, reconciliation — into standardized service modules that can be assembled like building blocks. Implemented via microservice architecture with independent deployment and elastic scaling. PSBC is among the first large banks to adopt both enterprise-grade business modeling and distributed microservices simultaneously. The invoice management module assembles, sends, and receives invoicing requests to/from the Leqi platform. The platform links payment, original transaction data, merchant invoicing qualifications, Leqi interfaces, and invoice delivery, so compliant transactions automatically enter the invoicing flow after payment completion. Microservice governance includes service registration/discovery, unified configuration center, circuit breaking, rate limiting, and distributed tracing for end-to-end monitoring from payment request to invoicing result, greatly improving fault diagnosis and operational efficiency.
For distributed transactions, the platform combines TCC (Try-Confirm-Cancel) with a local message table to ensure eventual consistency between payment deduction and invoicing requests. After payment, the system records a pre-invoicing state; only after Leqi returns success is the transaction confirmed. If invoicing fails, an automatic compensation mechanism triggers, preventing "paid but no invoice" or "invoice issued but payment not settled" inconsistencies.
Connection Layer
Acts as the critical hub connecting PSBC's internal systems with the external Leqi platform, handling protocol conversion, data mapping, message assembly and parsing. It connects directly to tax systems via Leqi platform APIs, enabling automatic transaction data mapping and invoice issuance. Components include: Leqi interface adapter (encapsulating standard API calls for issuance, query, red-flush), internal system integration gateway (connecting core banking, payment, clearing, accounting, key management systems), and a data mapping engine that automatically extracts and maps transaction data to Leqi specifications without manual entry. The engine supports flexible mapping rule configuration, allowing rapid adaptation to Leqi interface version upgrades by adjusting configuration only, without modifying core business code. The connection layer also implements asynchronous message retry with dead-letter queues; when Leqi interfaces are temporarily unavailable, invoicing requests enter a retry queue with exponential backoff, maximizing success rates.
Security Core
Provides end-to-end security across all layers. Uses national cryptographic algorithms (SM2/SM3/SM4) for encrypted message transmission; keys are issued and rotated by the tax platform, with sandbox and production environments fully isolated. All invoice operations leave full audit trails meeting tax inspection and internal audit requirements. Strict role-based access control ensures sensitive tax information flows only within authorized scopes, enabling collaborative verification of business, fund, and invoice flows. Every invoicing request undergoes strict signature verification and data integrity checks, eliminating tampering and identity spoofing risks at the technical level.
On the infrastructure level, the platform runs on domestic Xinchuang (信创) servers, domestic operating systems, and domestic distributed databases. PSBC maintains 100% domestication of core business system hardware, OS, and database. Its self-developed distributed technology platform delivers order-of-magnitude improvements in load capacity, transaction response speed, and batch processing efficiency, providing a solid foundation for high-concurrency upper-layer applications.
Key Technical Implementation: Full-Chain Automation from Payment to Invoicing
End-to-End Business Process Closed Loop
Under the Leqi Lianyong model, PSBC achieves a fully online closed loop of "transaction-payment-invoicing-archiving" (see Figure 2). Flow: enterprise initiates payment via payment channel; payment system completes fund transfer and instantly pushes transaction details (seller identity, category, quantity, price) to the invoice service platform — fully automated, no human intervention; invoice service platform assembles tax-compliant invoicing requests via the Leqi adapter and sends them to the Leqi platform; Leqi platform instantly generates a fully digital e-invoice and returns the result; bank system automatically archives the invoice, creates voucher records, and both parties can query/download via their respective channels. The entire process compresses traditional multi-day manual operations to seconds, achieving synchronous "fund payment, invoice issuance". The system cross-validates fund flows, transaction orders, and invoice data in the background; anomalies such as payment-invoice amount mismatches automatically trigger risk alerts to operations staff.
Leqi Integration Technical Highlights
PSBC focused on three integration areas: sales-side (real-time invoicing, batch invoicing, anomaly alerting), purchase-side (invoice collection, verification, deduction selection), and system integration (deep integration with core, payment, and invoice management systems, tightly binding transaction flows with invoice data). Leveraging the bank's own payment system, transactions enter the direct-connection platform where rule-based data matching and digital invoicing services execute automatically. During integration, the technical team conducted exhaustive exception scenario testing for every Leqi interface, including network timeouts, message format errors, and signature verification failures, ensuring correct system responses under all adverse conditions.
Simulation Testing and Gray Release
Before production launch, PSBC fully utilized Leqi's independent simulation test environment (isolated from production) for end-to-end validation covering all business scenarios. After thorough sandbox testing of interface logic, message specifications, and exception handling, a gray release strategy gradually shifted traffic. The integration effort simultaneously completed local system upgrades, Leqi qualification applications, and sandbox tests. During gray release, the team continuously monitored system health, analyzing daily invoicing success rates and interface response latency, expanding traffic only after all metrics met expectations, minimizing launch risk.
Results and Future Outlook
Since integrating Leqi Lianyong invoice services, PSBC has achieved significant outcomes:
Efficiency: Invoicing reduced from hours to seconds, zero-delay payment-invoicing; cost savings on labor and time, standardized invoice format, smoother tax filing.
Risk: Three-flow (business, fund, invoice) closed-loop matching ensures authenticity and compliance at the source.
Experience: Participants no longer visit tax offices; funds arrive in real time, invoices generated automatically, delivered via QR code, email, download, and other methods.
Post-launch, the system runs stably with invoicing success rate consistently above 99.9%, earning positive feedback from enterprise clients and end users.
Looking ahead, the Leqi Lianyong model is expected to expand from finished oil and trade-in scenarios to more high-frequency transaction domains. Banks will continue leveraging their payment hub aggregation advantages, enhancing system intelligence on the domestic Xinchuang foundation, serving the real economy with fintech. As Leqi platform functions improve and coverage expands, the value of banks as transaction data hubs will further unlock, opening broad innovation space for bank-tax collaboration.
From a technical architecture perspective, PSBC's Leqi Lianyong invoice docking platform exemplifies successful bank-tax collaboration and epitomizes financial digital transformation. Built on domestic Xinchuang hardware and powered by a self-developed distributed microservice architecture, the bank's payment system and tax invoicing system achieve deep technical integration, using technology to bridge the "last mile" between financial and government services, injecting continuous digital momentum into high-quality industrial chain development.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
