דלגו לתוכן הראשי
יומנאי

Entry webhook

Version 1 · Updated 2026-11-01 · Schema: entry-webhook.v1.schema.json · Contact: support@yomanai.ai

This document describes the webhook through which Yomanai delivers approved journal entries to an endpoint you host. It is the contract any push target implements: an ERP, a middleware, or an accounting system that has no connector of its own.

Yomanai calls you. You never call Yomanai. There is no API to poll. When a bookkeeper sends approved entries from Yomanai, Yomanai delivers them to your endpoint one entry at a time, shows the bookkeeper what your endpoint answered for each one, and retries on your behalf when the network fails. You map each entry into your own system.

1. What an entry is

A journal entry in Yomanai is one accounting record for one document. A document can produce two entries: an expense entry (the invoice against the supplier) and a payment entry (the supplier against the bank, card or cash account). Each entry is delivered on its own.

Every entry is balanced in the company's books currency. Its account keys, entry-type code (סוג תנועה) and reference fields are the ones the company configured for its accounting system, so the payload carries the same values Yomanai's file export would have written for that system. Your side decides how to book them.

Entries are insert-only. Yomanai never sends an update or a deletion for an entry it already delivered. A corrected entry is a new delivery (see §5).

2. What you provide

Item Requirement
Endpoint One https URL on a public host. Yomanai does not connect to private, link-local or loopback addresses, and does not follow redirects.
Certificate Issued by a public certificate authority. Self-signed certificates are refused.
Credential A bearer token you issue. Yomanai stores it encrypted, shows only its last four characters after saving, and never includes it in logs or in any response. The token can be replaced at any time without affecting deliveries in progress.
Source addresses Yomanai does not guarantee fixed outbound IP addresses. Authenticate by the token, not by address.

The company administrator enters the URL and the token in Yomanai (Company settings → Accounting → Ledger connection) and clicks Test. Yomanai then performs the handshake in §3.

3. Handshake

GET <endpoint>
Authorization: Bearer <token>
Accept: application/json
Yomanai-Webhook-Version: 1

Answer 200 with a JSON body. All fields are optional:

{
  "ok": true,
  "company_name": "Alpha Ltd",
  "registration_number": "515123456"
}

ok: false marks the connection as needing attention; include message to say why.

When registration_number is present, Yomanai compares it (digits only, leading zeros ignored) with the company's own registration number and warns the administrator if they differ. This catches a token that points at the wrong tenant before anything is sent.

Any other status marks the connection as needing attention, with your response body shown to the administrator.

4. Delivery

POST <endpoint>
Authorization: Bearer <token>
Content-Type: application/json; charset=utf-8
Accept: application/json
Idempotency-Key: <delivery_id>
Yomanai-Webhook-Version: 1
User-Agent: Yomanai-Webhook/1

One entry per request. Deliveries for one connection are strictly sequential: the next entry is sent only after the previous one is confirmed, rejected, or the job stopped. Yomanai waits up to 15 seconds to connect and up to 60 seconds for the response.

4.1 Your response

Status Meaning in Yomanai What happens next
200 or 201 with {"remote_ref": "…"} Confirmed. remote_ref is the entry's identifier in your system, 1–64 characters. It is shown to the bookkeeper. Next entry.
400, 409, 422 with {"message": "…"} Rejected. Nothing was booked. The message (up to 500 characters, Hebrew or English) is shown verbatim to the bookkeeper. Never retried automatically. The bookkeeper fixes the document and resends (§5). The next entry is sent.
429 Slow down. Yomanai waits for Retry-After seconds (60 when absent, at most 120) and sends the same request again. Not counted as a failure; a third 429 in a row stops the job, and an administrator retries it later.
401, 403, 404, any 3xx, any other 4xx Connection problem. The token is invalid, the endpoint moved, or it does not accept what Yomanai sends. The job stops, the connection is marked as needing attention, the bookkeeper responsible for the company is emailed. An administrator fixes the connection and retries the job.
5xx, connection refused, connect timeout Transient. Retried after 2, then 8 seconds (with jitter). The third failure stops the job; an administrator retries it later.
Timeout after the request was sent, or a 2xx without a usable remote_ref Unknown. The entry may have been booked. Yomanai sends the same request again later (currently after three minutes) with the same Idempotency-Key. Your endpoint must answer with the original outcome and must not book twice. After a third unknown outcome in a row Yomanai stops resending: the entry waits for a person to confirm it is in your system or to resend it (§5), and the next entry is sent.

Any other 2xx body is treated as unknown. A response body that is not JSON is shown to the bookkeeper as text.

4.2 Idempotency

Idempotency-Key carries the delivery's delivery_id. Retries of the same delivery reuse it, with the same body. Your endpoint must keep the outcome of each key for at least 30 days and return it, unchanged, to a repeated key. This is the only protection against double booking after a lost response, and it is required.

4.3 Rules

  • A rejection means nothing was booked. Do not book part of an entry.
  • Write rejection messages for the bookkeeper who will read them, not for a log.
  • Respond only after the entry is durably stored (or durably refused). A 200 that is later lost on your side cannot be recovered: Yomanai will not send that delivery again.
  • Yomanai marks a document as exported only when every one of its entries is confirmed.

5. Resends and repeat deliveries

A rejected entry can be fixed by the bookkeeper in Yomanai and resent. The resend is a new delivery: a new delivery_id, a body rebuilt from the corrected entry, the same document.id and entry.leg. The pair (document.id, entry.leg) identifies an entry for its whole life and is the key to use if you keep your own record of what arrived.

A confirmed entry is not sent again unless a Yomanai user explicitly chooses to include already-exported entries in a send. It then arrives as a new delivery with the same (document.id, entry.leg). Whether your system books it again or treats it as a replacement is your decision; Yomanai does not know what you did with the first one.

An entry whose outcome Yomanai could not establish (§4.1) can also arrive again as a new delivery: when a person resends it after checking your system, or when a later send includes it and the user chooses to send it again. The earlier delivery may have been booked on your side, so the new delivery_id does not by itself mean a new entry; use (document.id, entry.leg) to recognise it.

6. The entry payload

The payload carries what Yomanai's file export for the company's accounting system would carry, plus the identifiers a webhook needs. It carries no reasoning: the values the bookkeeper approved, nothing about how Yomanai arrived at them.

All money amounts are decimal strings with two fraction digits ("1180.00"), never JSON numbers. Rates are decimal strings. Dates are YYYY-MM-DD. Timestamps are ISO 8601 with an offset. Absent values are null, never omitted. The body conforms to the JSON Schema at /developers/entry-webhook.v1.schema.json.

{
  "webhook_version": 1,
  "delivery_id": "6f1c2a9e-4b0d-4e3a-9c1e-2d7f0a8b5c41",
  "sent_at": "2026-10-14T11:02:17+03:00",
  "company": {
    "id": "0b4e7f52-1c3d-4a8e-9f61-7d2e5b9c0a13",
    "name": "אלפא טכנולוגיות",
    "registration_number": "515123456",
    "ledger": "hashavshevet"
  },
  "document": {
    "id": "9d2c4e71-8a5b-4f0c-b3e6-1a7d9c2f5e84",
    "url": "https://app.yomanai.ai/d/3kTz9Qa",
    "number": "INV-2026-0931",
    "allocation_number": "123456789"
  },
  "supplier": {
    "id": "c1a2b3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
    "name": "ספק לדוגמה",
    "account_key": "30045",
    "registration_number": "512345678",
    "withholding_rate": "0.05"
  },
  "supplier_cards": [
    {
      "id": "c1a2b3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
      "name": "ספק לדוגמה",
      "account_key": "30045",
      "registration_number": "512345678",
      "withholding_rate": "0.05"
    }
  ],
  "entry": {
    "leg": "expense",
    "entry_type_code": "חס",
    "date": "2026-09-30",
    "value_date": null,
    "reference_1": "20260931",
    "reference_2": "",
    "document_number": "0931",
    "description": "ספק לדוגמה",
    "currency": "ILS",
    "currency_code": null,
    "books_currency": "ILS",
    "exchange_rate": null,
    "amount_total": "1180.00",
    "cost_center": null,
    "registration_number": "512345678",
    "lines": [
      {
        "n": 1,
        "side": "debit",
        "role": "expense",
        "account_key": "6010",
        "amount": "1000.00",
        "amount_foreign": null,
        "description": null,
        "record": 0,
        "entry_type_code": null
      },
      {
        "n": 2,
        "side": "debit",
        "role": "vat",
        "account_key": "15010",
        "amount": "180.00",
        "amount_foreign": null,
        "description": null,
        "record": 0,
        "entry_type_code": null
      },
      {
        "n": 3,
        "side": "credit",
        "role": "supplier",
        "account_key": "30045",
        "amount": "1180.00",
        "amount_foreign": null,
        "description": null,
        "record": 0,
        "entry_type_code": null
      }
    ]
  }
}

6.1 Top level

Field Type Meaning
webhook_version integer 1. Also sent as the Yomanai-Webhook-Version header.
delivery_id UUID Unique per delivery. Equals the Idempotency-Key header.
sent_at timestamp When this request was built.

6.2 company

Field Type Meaning
id UUID The company in Yomanai. Stable. One endpoint may receive entries for several companies.
name string The company's name as entered in Yomanai.
registration_number string or null The company's VAT registration number (עוסק מורשה / ח.פ).
ledger string The accounting system the values are shaped for: hashavshevet, rivhit or priority. Decides the vocabulary of entry_type_code, currency_code and the account keys. More values may be added.

6.3 document

Field Type Meaning
id UUID The source document. Stable across resends; with entry.leg it identifies the entry.
url string Opens the document in Yomanai for a signed-in user. The same link the file export writes. The file itself is not part of the delivery.
number string or null The document number as printed, in full.
allocation_number string or null מספר הקצאה, when the document carries one.

6.4 supplier

The supplier's account card as Yomanai's export ships it, so you can create or update the card before booking the entry. null for an entry that carries no supplier card (a typed entry without one). When the company books small suppliers to one general card, the card is that general card, as the supplier line carries it.

Field Type Meaning
id UUID The supplier card in Yomanai. Stable.
name string The card's name.
account_key string The supplier's account key in the company's accounting system, exactly as the supplier line carries it.
registration_number string or null The card's own VAT registration number. The number printed on the document is entry.registration_number.
withholding_rate rate or null ניכוי מס במקור as a fraction ("0.05" = 5 %). null when the rate is not known to Yomanai.

supplier_cards is an array of every supplier card the entry's lines address, in the same shape, the supplier card first. An entry the bookkeeper typed may credit or debit a second supplier; create or update every card in the array before booking. Empty when the entry addresses none.

6.5 entry

Field Type Meaning
leg string expense or payment. With document.id, identifies the entry.
entry_type_code string The entry-type code (סוג תנועה) in the company's ledger vocabulary, frozen at approval.
date date The accounting date.
value_date date or null The value date when it differs from date.
reference_1, reference_2 string What the company configured for the ledger's two reference fields (אסמכתא 1 / אסמכתא 2): the document number, the allocation number, the cheque number, or empty. A document number here is already shortened to the length the company configured.
document_number string The document number as the ledger's note field receives it: shortened to the length the company configured, whole when none is configured. document.number stays the printed number.
description string The entry's description: the supplier name unless the bookkeeper wrote one.
currency string ISO 4217 code of the document.
currency_code string or null The same currency in the ledger's own code table, exactly as the file export writes it in the currency field; null when the file leaves it blank.
books_currency string The company's books currency. All amount values are in it.
exchange_rate rate or null The rate used to convert the document into the books currency, four fraction digits. null when no conversion happened.
amount_total money The document total in the document currency. Negative for a credit note.
cost_center string or null קוד תמחיר, present on expense entries only.
registration_number string or null The counterparty's registration number the entry reports (the file export's עוסק מורשה field): the number on the document, which may differ from the card's own.
lines array The debit and credit lines, in order. Debits equal credits.

6.6 entry.lines[]

Field Type Meaning
n integer Position, from 1.
side string debit or credit.
role string or null supplier, expense, vat, payment (the bank, card or cash account), tax_deduction (withholding tax), or null on a line the bookkeeper typed without a role. This is what the file export encodes by column position.
account_key string The account key in the company's accounting system.
amount money In the books currency.
amount_foreign money or null In the document currency, when it differs from the books currency. null where the file export leaves the foreign amount blank.
description string or null A per-line description the bookkeeper wrote. Fall back to entry.description.
record integer Lines that share a value are what Yomanai's file export writes as one ledger record. A calculated entry has one record (0). An entry the bookkeeper split or typed may have several. Book line by line if your system has no such grouping.
entry_type_code string or null The record's own entry-type code when it differs from the entry's; null otherwise.

Sign convention. A credit note keeps the same roles and sides as the invoice it reverses, with negative amounts. Debits and credits still balance.

7. Versioning

The webhook version is in the body and in the Yomanai-Webhook-Version header, and the JSON Schema's $id names it. Within version 1, Yomanai may add fields and may add values to company.ledger. Ignore fields you do not know. A removed field, a renamed field or a change in meaning is version 2, with a new header value and a new schema file, and a connection moves to it only when its administrator chooses.

8. Changelog

  • 1 (2026-10-14). First version.
  • 1 (2026-10-14). Added entry.document_number (additive).
  • 1 (2026-10-14). supplier is null for an entry with no supplier card; currency_code and amount_foreign are exactly what the file export writes.
  • 1 (2026-10-14). Added supplier_cards and entry.registration_number (additive); supplier is the card as the export ships it (its own name and number).
  • 1 (2026-11-01). Clarifications, no change to the payload: automatic resends after an unknown outcome stop after the third; an unconfirmed entry can arrive again under a new delivery_id; the connection settings location; who is emailed on a connection problem.