Tally Prime Integration
Tally companies are now connected from Integrations → Accounting as an AccountingSystem (company name, push mode, chart-of-accounts mapping). Push modes include a connector agent for Tally on an office PC, and journals can be pushed nightly. The endpoint URL and company are no longer sent with each request. See Accounting systems.
Overview
PointNXT integrates directly with Tally Prime (Release 1.0 through 4.x+) to eliminate manual journal entry of marketplace settlement disbursements, commission deductions, logistics fees, TCS, and TDS.
The integration provides two synchronization modes:
- Direct HTTP Gateway Push: Automatically pushes journal vouchers over HTTP directly to Tally Prime's local or server XML Gateway (typically running on port
9000). - Standard XML Export: Downloads a compliant Tally
<ENVELOPE>XML file for manual offline import viaImport Data > Vouchers.
Architecture & Code Map
The integration follows the hexagonal pattern where protocol-level communication is strictly isolated inside src/integrations/tally:
| Layer | File Path | Responsibility |
|---|---|---|
| Integration Module | src/integrations/tally/tally.module.ts | NestJS module exporting TallyClientService |
| Barrel Export | src/integrations/tally/index.ts | Clean public interface for domain services |
| Client Service | src/integrations/tally/services/tally-client.service.ts | XML generation, character escaping, and HTTP gateway requests |
| Interfaces | src/integrations/tally/interfaces/tally.interface.ts | TallyVoucher, TallyVoucherLine, TallyExportResult, TallyPushResult |
| Domain Orchestration | src/modules/finance/settlement/services/erp-integration.service.ts | Chart of accounts resolution, database queries, and audit logging |
| REST Controller | src/modules/finance/settlement/controllers/erp-integration.controller.ts | HTTP API for export download and direct push triggers |
Accounting & Voucher Conventions
Tally Prime requires a specific format for Journal Vouchers:
- Root XML Structure:
<ENVELOPE><HEADER><TALLYREQUEST>Import Data</TALLYREQUEST></HEADER><BODY><IMPORTDATA>... - Current Company Target: Injected into
<STATICVARIABLES><SVCURRENTCOMPANY>Company Name</SVCURRENTCOMPANY></STATICVARIABLES>. - Voucher Type:
JournalwithACTION="Create". - Date Format:
YYYYMMDD(e.g.20260315). - Debits vs. Credits (Deemed Positive convention):
- Debits: Formatted with
<ISDEEMEDPOSITIVE>Yes</ISDEEMEDPOSITIVE>and a negative amount (e.g.<AMOUNT>-1500.00</AMOUNT>). - Credits: Formatted with
<ISDEEMEDPOSITIVE>No</ISDEEMEDPOSITIVE>and a positive amount (e.g.<AMOUNT>10000.00</AMOUNT>).
- Debits: Formatted with
Default Chart of Accounts Mapping
| Account Code | Account Description | Default Tally Ledger Name | Type |
|---|---|---|---|
4000 | Sales: Gross Merchandise Value | E-Commerce Sales A/c | Credit |
5000 | Direct Expense: Marketplace Commission | Marketplace Commission Expense | Debit |
5010 | Direct Expense: Shipping & Freight Fees | Marketplace Shipping & Freight | Debit |
5020 | Direct Expense: Fixed / Closing Fees | Marketplace Closing Fees | Debit |
5030 | Direct Expense: Pick & Pack Fees | Fulfillment & Handling Fees | Debit |
5040 | Direct Expense: Reversal / Restocking | Return & Restocking Fees | Debit |
5100 | Operating Expense: Marketplace Ads (PPC) | Marketplace Advertising Expense | Debit |
5200 | Operating Expense: Storage & Warehousing | FBA Storage & Warehousing | Debit |
2100 | Other Current Liabilities: TCS (Sec 52) | GST TCS u/s 52 Payable | Credit |
1300 | Other Current Assets: TDS (Sec 194-O) | Income Tax TDS u/s 194-O Receivable | Debit |
1120 | Cash & Bank: Marketplace Clearing Account | Marketplace Payout Clearing A/c | Debit |
Tenants can customize ledger names in Settlements > ERP Integration > Account Mappings.
Configuring Tally Prime for Direct Gateway Push
To allow PointNXT to push journal entries directly to Tally Prime without manual file imports:
- Open Tally Prime on your workstation or server.
- Press
F1: Help>Settings>Connectivity. - In Client/Server Configuration:
- Set TallyPrime is acting as:
Both(orServer). - Set Enable ODBC:
Yes. - Set Port:
9000(or your chosen port).
- Set TallyPrime is acting as:
- Restart Tally Prime and open your active Company.
- In PointNXT, configure the endpoint URL:
- Local installation:
http://localhost:9000 - Network server:
http://192.168.1.100:9000
- Local installation:
API Endpoints
Vouchers are chosen by one of: payoutId (every voucher of one payout, any source), voucherId, or a from/to voucher-date range. The Tally company, endpoint and push mode come from the connected accounting system (:systemId).
1. Download Tally Prime XML
GET /v1/finance/settlement/erp/{systemId}/tally/export?payoutId=0190a1b2-...
Authorization: Bearer <accessToken>
Returns an application/xml file ready for import into Tally Prime.
2. Push Directly to Tally Gateway
POST /v1/finance/settlement/erp/{systemId}/tally/push
Authorization: Bearer <accessToken>
Content-Type: application/json
{
"from": "2026-09-01",
"to": "2026-09-30"
}
A voucher already sent to this system is skipped (one ErpSyncLog per voucher per system). In agent mode the vouchers are queued for the connector agent and the response says queued: true.
Response:
{
"success": true,
"voucherCount": 1,
"totalDebit": "10000.00",
"totalCredit": "10000.00",
"tallyResponse": "<RESPONSE><CREATED>1</CREATED><ERRORS>0</ERRORS></RESPONSE>"
}
All push attempts are recorded in ErpSyncLog for auditing and retry tracking.