Skip to main content

Zoho Books Integration

Connected as an accounting system

Zoho Books organisations are now connected from Integrations → Accounting as an AccountingSystem. The client id, secret and refresh token are verified once and stored encrypted; they are no longer sent with each request, and journals can be pushed nightly. See Accounting systems.

Overview​

PointNXT integrates directly with Zoho Books to provide automated, cloud-to-cloud journal synchronization. It translates PointNXT's settlement subledger entries into balanced manual journals and posts them directly to the Zoho Books REST API.

The integration provides:

  1. OAuth 2.0 Refresh Token Flow: Secure authorization across global Zoho domains (zoho.in, zoho.com, zoho.eu).
  2. Chart of Accounts Synchronization: Fetches real accounts from your Zoho Books organization to allow dropdown mapping.
  3. Automated Journal Posting: Posts balanced debit/credit manual journals directly via POST /api/v3/journals.
  4. Manual Journal CSV Export: Generates a pre-formatted CSV file formatted for Zoho Books bulk journal imports.

Architecture & Code Map​

Protocol logic is isolated inside src/integrations/zoho-books:

LayerFile PathResponsibility
Integration Modulesrc/integrations/zoho-books/zoho-books.module.tsNestJS module exporting ZohoBooksClientService
Barrel Exportsrc/integrations/zoho-books/index.tsClean public interface for domain services
Client Servicesrc/integrations/zoho-books/services/zoho-books-client.service.tsOAuth token exchange, Chart of Accounts fetch, journal POST, CSV build
Interfacessrc/integrations/zoho-books/interfaces/zoho-books.interface.tsZohoCredentials, ZohoAccount, ZohoJournalPayload, ZohoPushResult
Domain Orchestrationsrc/modules/finance/settlement/services/erp-integration.service.tsAccount ID resolution, payload validation, and sync audit logging
REST Controllersrc/modules/finance/settlement/controllers/erp-integration.controller.tsEndpoints for accounts sync, CSV export, and API push

Setting Up Zoho Books Credentials​

To connect PointNXT to Zoho Books:

  1. Go to Zoho Developer Console.
  2. Create a Self-Client (or Server-based Application).
  3. Generate a Code with the scope: ZohoBooks.fullaccess.all (or ZohoBooks.journals.CREATE, ZohoBooks.settings.READ).
  4. Exchange the code for a permanent refresh_token.
  5. Locate your organization_id inside Zoho Books under Settings > Organization Profile.
  6. Enter credentials in PointNXT:
    • Client ID & Client Secret
    • Refresh Token
    • Organization ID
    • Data Center Domain (in for India, com for US, eu for Europe)

Account Mapping Workflow​

  1. Click "Fetch Accounts from Zoho" in PointNXT.
  2. PointNXT fetches all active accounts from GET https://books.zoho.{domain}/api/v3/chartofaccounts.
  3. In the mapping table, associate each PointNXT accounting code with its corresponding Zoho Account:
    • 4000 Sales: E-Commerce Sales Income Account
    • 5000 Commission: Marketplace Commission Expense Account
    • 5010 Shipping: Marketplace Freight Expense Account
    • 2100 TCS: GST TCS Liability Account
    • 1300 TDS: Income Tax TDS Asset Account
    • 1120 Clearing: Bank or Undeposited Funds Clearing Account
  4. Save mappings.

API Endpoints​

1. Fetch Remote Chart of Accounts​

POST /v1/finance/settlement/erp/zoho/accounts
Authorization: Bearer <accessToken>
Content-Type: application/json

{
"clientId": "1000.XXXX",
"clientSecret": "YYYY",
"refreshToken": "1000.ZZZZ",
"organizationId": "60012345678",
"domain": "in"
}

2. Direct Push of Journal Voucher​

POST /v1/finance/settlement/erp/{systemId}/zoho/push
Authorization: Bearer <accessToken>
Content-Type: application/json

{
"payoutId": "0190a1b2-..."
}

Credentials are the ones stored on the connected accounting system; they are never sent in the request. Vouchers are chosen by payoutId, voucherId or a from/to range, and each unsent voucher in the selection becomes one Zoho manual journal. A voucher already sent to this organisation is skipped. Response:

{
"success": true,
"voucherNumber": "JN-00042",
"totalAmount": 10000,
"lineCount": 6,
"zohoResponse": {
"code": 0,
"message": "The journal has been created."
}
}

3. Export Zoho Books Manual Journal CSV​

GET /v1/finance/settlement/erp/{systemId}/zoho/export-csv?payoutId=0190a1b2-...
Authorization: Bearer <accessToken>

Returns a text/csv formatted with required headers: Journal Date,Reference Number,Notes,Account Name,Debit,Credit,Description.