Skip to main content

Tally Prime Integration

Connected as an accounting system

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:

  1. 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).
  2. Standard XML Export: Downloads a compliant Tally <ENVELOPE> XML file for manual offline import via Import Data > Vouchers.

Architecture & Code Map​

The integration follows the hexagonal pattern where protocol-level communication is strictly isolated inside src/integrations/tally:

LayerFile PathResponsibility
Integration Modulesrc/integrations/tally/tally.module.tsNestJS module exporting TallyClientService
Barrel Exportsrc/integrations/tally/index.tsClean public interface for domain services
Client Servicesrc/integrations/tally/services/tally-client.service.tsXML generation, character escaping, and HTTP gateway requests
Interfacessrc/integrations/tally/interfaces/tally.interface.tsTallyVoucher, TallyVoucherLine, TallyExportResult, TallyPushResult
Domain Orchestrationsrc/modules/finance/settlement/services/erp-integration.service.tsChart of accounts resolution, database queries, and audit logging
REST Controllersrc/modules/finance/settlement/controllers/erp-integration.controller.tsHTTP 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: Journal with ACTION="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>).

Default Chart of Accounts Mapping​

Account CodeAccount DescriptionDefault Tally Ledger NameType
4000Sales: Gross Merchandise ValueE-Commerce Sales A/cCredit
5000Direct Expense: Marketplace CommissionMarketplace Commission ExpenseDebit
5010Direct Expense: Shipping & Freight FeesMarketplace Shipping & FreightDebit
5020Direct Expense: Fixed / Closing FeesMarketplace Closing FeesDebit
5030Direct Expense: Pick & Pack FeesFulfillment & Handling FeesDebit
5040Direct Expense: Reversal / RestockingReturn & Restocking FeesDebit
5100Operating Expense: Marketplace Ads (PPC)Marketplace Advertising ExpenseDebit
5200Operating Expense: Storage & WarehousingFBA Storage & WarehousingDebit
2100Other Current Liabilities: TCS (Sec 52)GST TCS u/s 52 PayableCredit
1300Other Current Assets: TDS (Sec 194-O)Income Tax TDS u/s 194-O ReceivableDebit
1120Cash & Bank: Marketplace Clearing AccountMarketplace Payout Clearing A/cDebit

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:

  1. Open Tally Prime on your workstation or server.
  2. Press F1: Help > Settings > Connectivity.
  3. In Client/Server Configuration:
    • Set TallyPrime is acting as: Both (or Server).
    • Set Enable ODBC: Yes.
    • Set Port: 9000 (or your chosen port).
  4. Restart Tally Prime and open your active Company.
  5. In PointNXT, configure the endpoint URL:
    • Local installation: http://localhost:9000
    • Network server: http://192.168.1.100:9000

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.