Skip to content

Tax Information Lookup

Query business registration details directly from Vietnam's Tax Authority (CQT) via T-VAN providers.

Overview

FeatureDescription
ServiceTVanService.getTaxInfo()
Data SourceCQT (Tax Authority)
Use CaseVerify customer/supplier tax codes

Use Cases

  • Verify customer tax code before issuing VAT invoice
  • Check supplier legitimacy
  • Validate business registration status
  • Pre-invoice verification

Single Lookup

typescript
import { inject } from '@venizia/ignis';
import { TVanService } from '@nx-3rd/t-van';

class TaxController {
  constructor(
    @inject({ key: 'services.TVanService' })
    private tvanService: TVanService,
  ) {}

  async lookupTaxInfo(taxCode: string) {
    const result = await this.tvanService.getTaxInfo({
      taxCode: taxCode,
    });

    return {
      taxCode: result.taxCode,
      companyName: result.companyName,
      address: result.address,
      representative: result.representative,
      status: result.status,
      registrationDate: result.registrationDate,
    };
  }
}

Response Structure

json
{
  "taxCode": "0123456789",
  "companyName": "CÔNG TY TNHH ABC",
  "address": "123 Nguyễn Huệ, Quận 1, TP.HCM",
  "representative": "Nguyễn Văn A",
  "status": "ACTIVE",
  "registrationDate": "2020-01-15",
  "businessType": "Retail",
  "phoneNumber": "028-1234-5678"
}

Business Status

StatusDescriptionCan Issue Invoice
ACTIVEOperating normallyYes
SUSPENDEDTemporarily suspendedNo
CLOSEDPermanently closedNo
PENDINGRegistration pendingNo

Batch Lookup

Query multiple businesses at once:

typescript
async batchLookup(taxCodes: string[]) {
  const results = await this.tvanService.batchGetTaxInfo({
    taxCodes: taxCodes,
  });

  return results.map(r => ({
    taxCode: r.taxCode,
    companyName: r.companyName,
    status: r.status,
    found: r.found,
  }));
}

Caching Strategy

Tax info doesn't change frequently - cache it:

typescript
const CACHE_TTL = 24 * 60 * 60 * 1000; // 24 hours

async getTaxInfoCached(taxCode: string) {
  const cached = await this.cache.get(`tax:${taxCode}`);
  if (cached) return cached;

  const info = await this.tvanService.getTaxInfo({ taxCode });
  await this.cache.set(`tax:${taxCode}`, info, CACHE_TTL);

  return info;
}

REST API

http
GET /api/t-van/tax-info/:taxCode

# Batch lookup
POST /api/t-van/tax-info/batch
Content-Type: application/json

{
  "taxCodes": ["0123456789", "9876543210"]
}

Error Handling

Error CodeDescriptionSolution
TVAN_001Invalid formatTax code must be 10 or 13 digits
TVAN_002Not foundTax code not registered
TVAN_003TimeoutRetry or check network

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