Package Exports
- condo-billing-integration-client
- condo-billing-integration-client/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (condo-billing-integration-client) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
condo-billing-integration-client
A Node.js client for building billing integrations with CONDO.
It provides a reusable sync runtime:
- loads receipts from an external system
- saves them to CONDO
- uploads receipt PDFs (if available)
- sends a sync report to Telegram (optional)
Runtime flow
- Authenticate in CONDO.
- Load billing context and integration settings.
- Call your integration (
getAllReceipts). - Save receipts to CONDO in chunks.
- Upload PDF files for receipts that have them.
- Send a report (Telegram webhook or stdout fallback).
- If no receipts were found for the target period, optionally try previous months.
Requirements
- Node.js
v22.17.0
Installation
yarn installEnvironment variables
Required
CONDO_INTEGRATION='{"endpoint":"https://<condo>/admin/api","authRequisites":{"identity":"<email>","password":"<password>"}}'authRequisites supports:
identity/passwordphone/passwordtoken
Optional (Telegram notifications)
NOTIFY_TELEGRAM='{"url":"https://<bot-webhook>","chatId":"-100..."}'Optional (report language)
REPORT_LANG='en'Supported values:
ru(default)en
Running an integration
Typical command:
node index.js -c <BILLING_CONTEXT_ID> -p 2026-04-01Arguments:
-c,--context(required): billing context id-p,--period(optional): period inYYYY-MM-01format
If -p is omitted, current month start is used.
Report example
ООО "Название организации" (ИНН)
Контекст : ID-Контекста
Период : 2026-01-01
Загружено квитанций (70) : 28.72 s
Сохранение : 1.41 s
Новых : 0
Обновлено : 0
Ошибок : 0
Не изменилось : 70
PDF квитанции : 2.36 s
Не изменилось : 70Integration contract
Every integration must implement this interface:
class Integration {
async getAllReceipts ({ tin, period }) {
throw new Error('Not implemented')
}
hasPDFFile (receipt) {
throw new Error('Not implemented')
}
async getPDFBuffer (receipt) {
throw new Error('Not implemented')
}
}Minimal receipt shape
A receipt must contain:
accountNumber: string | number// Л/Сaddress: string// Адрес вместе с помещениемtin: string | number// ИННbankAccount: string | number// Р/СroutingNumber: string | number// БИКyear: numbermonth: numbertoPay: number | string
Recommended:
importIdfor idempotencyservices[]for itemized linestoPayDetailsfor detailed totals
Testing
This project uses native Node testing stack:
node:testnode:assert/strict
Run tests:
npm testWatch mode:
npm run test:watchLicense
MIT