Tring for developers עברית

Tring API

Issue Israeli tax documents from your code: receipts, tax invoices, tax invoice / receipts, credit notes and transaction invoices. Tring computes the amounts and the VAT, numbers the document, signs it and keeps it. Your system sends what was sold or received.

js
import { Tring } from 'tring-sdk';

const tring = new Tring(); // TRING_API_KEY=kbl_test_...
const { draft } = await tring.prepareDraft(issuerId, receipt, { idempotencyKey: 'order-1001-receipt' });
const { document } = await tring.confirmDraft(draft.id);

Where to start

PageWhat it covers
QuickstartA sandbox key, install, your first receipt in curl, JavaScript or Python
Issuing documentsPrepare and confirm, the Idempotency-Key, what to do when the outcome is unknown, the five types, corrections
Webhooks and eventsSigned notices when a document is issued or downloaded, checking them, reading events after a gap
SDKsConfiguration, retries, errors, pagination, helpers, webhook signatures
AI agents and MCPConnect Claude Code or Cursor; how issuing stays behind a person's approval
API referenceEvery operation, its SDK method and its error codes

Five rules

  1. Issuing is two calls: prepare computes a draft and issues nothing; confirm issues it.
  2. One Idempotency-Key per document, made from your order number and stored before the first call.
  3. When a confirm gets no answer, send the same confirm again. Never prepare again under a new key.
  4. Amounts are text with two decimals ("118.00"), quantities with four ("1.0000").
  5. Build against the sandbox: its keys start with kbl_test_. Production is a new address and a kbl_live_ key.

Packages

PackageInstall
TypeScript / JavaScript SDK (Node 18+)npm install tring-sdk
Python SDK (3.9+)pip install tring-sdk
MCP server for AI agentsnpx -y tring-mcp
Local mock of the APInpx tring-mock-server

All four are generated from the same OpenAPI spec. For AI tools there is llms.txt and llms-full.txt.