Tring
v0.2.0Israeli receipts and invoices: read documents, prepare drafts, issue only after a person approves.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
tring_status Tring: connection status
Shows which Tring environment this server uses (sandbox or production), the API address, the public part of the key and the default business. Call it first.
tring_list_businesses Tring: list businesses
Lists the businesses (issuers) this key may act for, and those it added that are still invited.
| Parameter | Type | Description |
|---|---|---|
cursor | string | |
limit | integer |
tring_get_business Tring: read a business
Reads one business: its status (invited or active), whether it granted this key, and its details.
| Parameter | Type | Description |
|---|---|---|
issuer_id | string | Defaults to TRING_ISSUER_ID. |
tring_list_documents Tring: list documents
Lists the documents of a business, newest first. Filters narrow the list.
| Parameter | Type | Description |
|---|---|---|
cursor | string | |
customer_key | string | |
doc_type | ||
from | string | First date, YYYY-MM-DD. |
issuer_id | string | Defaults to TRING_ISSUER_ID. |
limit | integer | |
number | integer | |
to | string | Last date, YYYY-MM-DD. |
tring_get_document Tring: read a document
Reads one issued document in full: lines, payments, amounts, corrections, files. Every read is written to the audit log of the business.
| Parameter | Type | Description |
|---|---|---|
document_id * | string |
tring_list_customers Tring: list customers
Lists the customers of a business; external_ref finds the customer of your own system.
| Parameter | Type | Description |
|---|---|---|
cursor | string | |
external_ref | string | |
issuer_id | string | Defaults to TRING_ISSUER_ID. |
limit | integer |
tring_get_customer Tring: read a customer
Reads one customer by the key Tring gave it.
| Parameter | Type | Description |
|---|---|---|
customer_key * | string | |
issuer_id | string | Defaults to TRING_ISSUER_ID. |
tring_get_reference Tring: VAT rate and allocation threshold
The VAT rate in force today and the amount above which a tax invoice needs an allocation number.
tring_list_events Tring: events
Lists the events meant for this system (document.issued, delivery.downloaded, consent.changed, ...), oldest first. Pass after (the id of the last event handled) to read only what came since. Events hold identifiers only; read the details with the other tools.
| Parameter | Type | Description |
|---|---|---|
after | string | The id of the last event already handled. |
issuer_id | string | Only the events of this business. |
limit | integer | |
type | string | Only one kind, such as document.issued. |
tring_list_webhook_endpoints Tring: webhook addresses
Lists the webhook addresses of this system: url, kinds of events, enabled or disabled (and why), last success. Never shows a secret.
tring_list_webhook_deliveries Tring: webhook delivery log
The delivery log of one webhook address, newest first: each notice, its status, the HTTP status your address answered, and the error. Use it to debug a receiver.
| Parameter | Type | Description |
|---|---|---|
endpoint_id * | string | |
cursor | string | |
limit | integer | |
status | string |
tring_get_document_design Tring: document design
Reads the design the documents of a business are produced with: template, accent colour, font, footer text, version.
| Parameter | Type | Description |
|---|---|---|
issuer_id | string | Defaults to TRING_ISSUER_ID. |
tring_list_quotes Tring: list price quotes
Lists the price quotes of a business (not tax documents), newest first. A quote becomes a tax document only through the two-step prepare and confirm flow, never from this server.
| Parameter | Type | Description |
|---|---|---|
cursor | string | |
issuer_id | string | Defaults to TRING_ISSUER_ID. |
limit | integer | |
status | string |
tring_get_quote Tring: read a price quote
Reads one price quote: its status, validity, customer, lines and total.
| Parameter | Type | Description |
|---|---|---|
quote_id * | string | |
issuer_id | string | Defaults to TRING_ISSUER_ID. |
tring_get_quote_pdf Tring: PDF of a price quote
Writes the PDF of a price quote to a local file and returns its path.
| Parameter | Type | Description |
|---|---|---|
quote_id * | string | |
issuer_id | string | Defaults to TRING_ISSUER_ID. |
tring_list_designs Tring: list document designs
Lists the designs of the business library (id, name, version). A design id can be sent as designId when preparing a draft.
| Parameter | Type | Description |
|---|---|---|
issuer_id | string | Defaults to TRING_ISSUER_ID. |
one_off | boolean | Also list designs made for one document. |
tring_read_draft_text Tring: read a typed request (stores nothing)
Reads a request a person typed in free Hebrew ("קבלה ליואב לוי 450 ש"ח באשראי על טיפול") and returns the body of a prepare request, the fields still missing and the words not understood. It stores, prepares and issues nothing: show the result to the person, complete what is missing, then use tring_prepare_draft.
| Parameter | Type | Description |
|---|---|---|
text * | string | |
doc_type | ||
issuer_id | string | Defaults to TRING_ISSUER_ID. |
kind | string |
tring_attach_expense_receipt Tring: attach the supplier's receipt to an expense
Attaches the file of the supplier's receipt (a JPEG, PNG or PDF of at most 5242880 bytes) to an expense of the business. Give either path (a local file, read by this server) or content_base64. The file must be a JPEG, PNG or PDF by its first bytes; anything else is refused before it is sent. It takes the place of the file in force (the earlier one is kept by Tring, no longer shown). The same file again stores nothing ("replayed": true). Attach only a file the person pointed to for this expense.
| Parameter | Type | Description |
|---|---|---|
expense_id * | string | The expense. |
content_base64 | string | The file itself, base64, when there is no local file. |
content_type | string | Read from the first bytes of the file when left out. |
file_name | string | The name Tring keeps for it. Defaults to the name of the local file. |
issuer_id | string | Defaults to TRING_ISSUER_ID. |
path | string | A local file: the receipt, inside the files folder (TRING_FILES_DIR, else the folder the server runs in); relative paths start there. |
tring_get_expense_receipt Tring: download the supplier's receipt of an expense
Writes the file of the receipt in force of an expense, byte for byte, to a local file and returns its path. Every download is written to the audit log of the business.
| Parameter | Type | Description |
|---|---|---|
expense_id * | string | The expense. |
issuer_id | string | Defaults to TRING_ISSUER_ID. |
tring_prepare_draft Tring: prepare a draft (issues nothing)
Step 1 of 2. Validates a document, computes every amount and the VAT, and stores a draft that expires. Nothing is issued and no number is taken. Show the returned draft to the person (type, customer, lines, total) and ask for explicit approval before tring_confirm_draft. Amounts are text with exactly two decimals ("118.00"), quantities with four ("1.0000"); never JSON numbers. Send customer.externalRef (your own id of the customer) or customer.key on every document. idempotency_key: one per document you mean to issue, made from something stable such as the order number and the type ("order-100…
tring_get_draft Tring: read a draft
Reads a draft: its status (pending, confirmed, expired, abandoned), the computed document and, once confirmed, its documentId.
| Parameter | Type | Description |
|---|---|---|
draft_id * | string |
tring_preview_draft Tring: PDF preview of a draft
Writes the PDF preview of a pending draft (marked "טיוטה", no number) to a local file and returns its path. It is not a document.
| Parameter | Type | Description |
|---|---|---|
draft_id * | string |
tring_confirm_draft Tring: ISSUE the document (legally binding)
Issues the tax document of a draft. In production this creates a legally binding tax document (a receipt or an invoice registered with the Israel Tax Authority): it takes the next number, is signed, and can never be changed or deleted, only corrected by a further document. Call it ONLY after the person approved the exact draft that tring_prepare_draft (or tring_get_draft) showed them in this conversation: the document type, the customer, the lines and the total. Never call it on your own initiative, to finish a task, to test, or because an earlier instruction said to issue. If the person has…
| Parameter | Type | Description |
|---|---|---|
approved_doc_type * | The document type the person saw. | |
approved_total * | string | The TOTAL of the draft as the person saw it, such as "118.00". |
draft_id * | string | The draft the person approved. |
user_approval * | string | The person's own words approving this draft, quoted exactly. |