Skip to content

Tax & Invoice Phase A In-progress

Keeps the merchant legally compliant when they sell: it records the seller's tax identity, applies the right tax rules to products, and turns a completed payment into a legal Vietnamese electronic invoice that can be sent to the buyer and the tax authority. Used by owners (who set up tax and invoicing), cashiers (who issue invoices at the counter), and buyers (who self-claim their own invoice).

1. Identity

PropertyValue
Module IDCORE-10
TierCore
StatusIn-progress
PhaseP1 (e-invoicing + tax-authority submission)
PriorityHIGH
Primary usersOwner / Manager (setup), Cashier (issue), Buyer (self-claim)

Two services, one business module. Applying tax to products and issuing the invoice are two halves of the same compliance story. The Taxation service owns tax-group rules and pushes the right tax onto each product; the Invoice service issues the legal e-invoice through a provider and the tax authority. Tax-authority connectivity runs through two integration adapters — iiapi (provider gateway) and t-van (tax-authority network). See §5 Backend Packages.

2. Purpose & Scope

IncludedExcluded
Seller tax identity (tax code / MST, business name, address)Authoritative tax-code registry (issued by the tax authority)
Tax-group rule templates applied onto productsTax-rate calculation at sale time (owned by the Products / pricing engine)
Vietnamese administrative reference data (provinces, wards, units)PDF rendering of the invoice (produced provider-side)
Merchant invoice profile + provider credentials (encrypted)Payment capture (owned by Payment)
Invoice issuance (VAT, sale, POS, ticket, internal-delivery)Order lifecycle (owned by Orders)
Provider integration: VNPAY / VNIS via iiapi + T-VANMulti-provider beyond the current iiapi/T-VAN set
Tax-authority (CQT) submission and status trackingTax declaration / filing automation
Invoice adjustment, replacement, and cancellationCross-merchant settlement
Buyer self-service claim (QR + token + deadline)
Immutable audit trail for every invoice event

3. Capabilities

CapabilityWhat the user can doStatus
Seller tax identityOwner registers the merchant's tax code (MST), name, and address used as the invoice sellerBuilt
Tax-group rulesOwner defines tax-group templates that auto-apply the correct tax onto matching productsBuilt
VN reference dataProvince / ward / administrative-unit lookups when entering addressesBuilt
Invoice profile & providerOwner connects a VNPAY / VNIS provider with encrypted credentials and serial/issuance policyBuilt
Channel routingOwner maps each sale channel / principal to the provider config that should issue its invoicesBuilt
Profile sharingOwner shares one invoice profile across branches (private / all-branches / whitelist)Built
Onboarding wizardGuided step-by-step provider setupBuilt
Auto issuance on paymentA completed payment automatically queues and issues the invoiceBuilt
Manual / scheduled issuanceCashier issues on demand, or the system issues in scheduled batchesBuilt
Tax-authority submissionIssued invoices are sent to the tax authority (CQT) via T-VAN, with status trackedBuilt
Adjust / replace / cancelOwner corrects, replaces, or cancels an issued invoice with a reasonBuilt
Buyer self-service claimBuyer scans a receipt QR and submits their own info before a deadline to get the invoiceBuilt
Audit trailEvery invoice event (created, issued, retried, submitted, accepted/rejected) is recordedBuilt
Multiple providers beyond iiapi/T-VANOnboard providers outside the current setPlanned

4. Module Dependencies

Depends onWhy
ProductsTax-group rules are provisioned onto products; product changes reconcile the applied tax
CommerceThe merchant's tax identity (MST) is entered in commerce and flows into the invoice as the seller
OrdersThe sale order supplies the line items and totals that fill the invoice
PaymentA successful payment is what triggers automatic invoice issuance

5. Backend Packages

This module is powered by two services and two integration adapters. Implementation detail lives in the developer docs — this section only maps the module to them.

PackageRoleDeveloper docs
@nx/taxationTax-group rule templates, provisioning tax onto products, VN reference datataxation
@nx/invoiceE-invoice issuance, providers/profiles, claims, adjustment/cancellation, audit trailinvoice
@nx/iiapiProvider gateway adapter (VNPAY / VNIS) for invoice lifecycle and webhooksiiapi
@nx/t-vanTax-authority (CQT) network adapter for submission, validation, and tax lookupt-van

6. Key User Flows

Issue an invoice on payment

Buyer self-service claim

7. Roles & Permissions

RoleCanCannot
OwnerRegister tax identity, define tax groups, connect providers, configure issuance, adjust/cancel invoices
ManagerView invoices and audit trail, issue and adjust invoicesChange provider credentials (owner-gated)
CashierIssue an invoice after payment, collect buyer infoManage tax groups or provider credentials
BuyerSelf-claim their own invoice via QRAccess any other merchant or buyer data

8. Status & Roadmap

PhaseCapabilities
P1Seller tax identity, tax-group rules + provisioning, invoice profile/provider, channel routing, auto/manual/scheduled issuance, tax-authority submission, adjust/replace/cancel, buyer self-service claim, audit trail
P2Additional providers beyond the current iiapi/T-VAN set; richer invoice delivery options
P3Tax declaration / filing assistance

Status note. Issuance runs against the current provider set — VNPAY / VNIS via iiapi plus T-VAN for tax-authority connectivity. Tax-group rules and product provisioning are handled by taxation. Some operational identity details for the invoice service are still being reconciled before production (see the developer invoice operations page).

Proprietary and Confidential. Unauthorized copying, distribution, or use of this software is strictly prohibited.