Issues a numbered, immutable document and returns it. Idempotent by apiIdentifier.
Two request shapes are accepted, detected by whether the JSON body has a top-level doc:
| Native (preferred) | Invoice4U-compatible | |
|---|---|---|
| Body | {"apiIdentifier": "…", "document": {…}} | {"doc": {…}, "token": "<key>"} |
| Auth | X-Api-Key / Authorization: Bearer | token in the body |
| Money | integer agorot | shekel floats |
| Quantity | quantityMilli (×1000) | Quantity (float) |
| VAT | basis points (vatBp) | percent (TaxPercentage) |
| Response | flat JSON | {"d": {…}} envelope |
| References to other documents | referenceDocIds | not expressible |
Use the compatible shape only to migrate a site that already calls Invoice4U's CreateDocument (change the URL and the token, nothing else). New code should use the native shape.
Native shape#
POST /api/billing/v1/create-document
X-Api-Key: bk_…
Content-Type: application/json{
"apiIdentifier": "order-12345",
"document": {
"docType": 3,
"customerName": "אורן כהן — סטודיו לעיצוב",
"customerUniqueId": "515131274",
"customerEmail": "[email protected]",
"subject": "תשלום על בניית אתר תדמית",
"taxIncluded": true,
"vatBp": 1800,
"issueDate": "2026-09-29",
"lines": [{ "name": "בניית אתר תדמית", "quantityMilli": 1000, "unitPriceAgorot": 450000 }],
"payments": [{ "paymentType": 3, "amountAgorot": 450000, "date": "2026-09-29" }]
}
}Response 200:
{
"id": "3f2b7c1e-9d4a-4c55-8a51-6d1e0f6b7a10",
"docNumber": 1042,
"status": 1,
"totalAgorot": 450000,
"alreadyExisted": false,
"viewUrl": "https://invoice.slk.co.il/billing/documents/3f2b7c1e-9d4a-4c55-8a51-6d1e0f6b7a10/view"
}alreadyExisted: true means this apiIdentifier was used before and you are seeing the stored document. In sandbox mode: docNumber is "SBX-000003", status is 0, sandbox: true is present and there is no viewUrl.
Document fields (document)#
Required: docType, customerName, subject, taxIncluded, vatBp, issueDate, lines.
| Field | Type | Notes |
|---|---|---|
docType | integer | See the table below. |
customerName | string | Buyer name as printed. Required and non-empty. |
customerId | string | null | Existing customer card id; optional. The name/ID fields are what is printed. |
customerUniqueId | string | null | Buyer ח.פ./ת.ז. Needed for allocation numbers; required for type 14 (the supplier's ID). |
customerEmail | string | null | Buyer email, stored on the document. |
customerAddress | string | null | |
subject | string | Subject line. Required, non-empty. |
language | 1 | 2 | 1 Hebrew (default), 2 English. |
currency | ILS | USD | EUR | GBP | Default ILS. |
fxRateMillionths | integer | null | ILS per 1 unit × 1,000,000. Required when currency ≠ ILS (3.71 → 3710000). |
taxIncluded | boolean | true: line prices already include VAT. |
vatBp | integer | Document default VAT: 0 or 1800. |
vatMode | regular | none | mixed | none = Eilat/abroad, every line forced to 0. Not allowed on types 14/15. |
issueDate | YYYY-MM-DD | Between 30 days ago and tomorrow (UTC). |
dueDate | date | null | |
discountValue, discountType | integer, 1 | 2 | Document discount, applied after line discounts, before VAT. 1 = agorot, 2 = percent × 100. |
roundTotal | boolean | Round the grand total to whole shekels. |
withholdingAgorot | integer ≥ 0 | ניכוי במקור withheld by the payer. Payment documents only. |
externalComments | string | null | Printed. |
internalComments | string | null | Never printed. |
fixedText | string | null | Free text above the footer. |
title | string | null | Project/scope title under the heading (quotes, proformas). |
branch | string | null | Branch name stamped on the document. |
unsigned | boolean | Issue without the digital signature (and without the dashboard's automatic customer email). The fiscal hash chain still applies. |
referenceDocIds | string[] | Ids of issued documents this one references. See below. |
lines | array (1–500) | See below. |
payments | array | See below. |
Lines#
| Field | Type | Notes |
|---|---|---|
name | string | |
quantityMilli | integer | ×1000. |
unitPriceAgorot | integer | Including VAT when taxIncluded is true. |
description | string | null | |
itemId | string | null | Catalog item reference. |
vatBp | 0 | 1800 | Per-line VAT; omitted = the document vatBp. 0 marks an exempt line. |
discountValue, discountType | integer, 1 | 2 | Per-line discount. |
isHeading | boolean | A titled separator row, no price, skipped by validation and totals. |
Mixed baskets work: give each line its own vatBp; VAT is computed and summed per line.
Payments#
| Field | Type | Notes |
|---|---|---|
paymentType | integer | 1 card · 2 check · 3 transfer · 4 cash · 5 credit · 7 other · 8 Bit · 9 PayBox · 10 PayPal · 11 in-kind · 12 Payoneer · 13 Google Pay · 14 Apple Pay · 15 bitcoin · 16 ethereum · 17 BUYME voucher · 18 gift voucher · 19 V-CHECK · 20 Colu. (6, 21, 22 are deductions — see below.) |
amountAgorot | integer > 0 | |
date | YYYY-MM-DD | Received date / check due date. |
bankName, branch, account, checkNumber, cardLast4, note | string | null | Optional detail. |
isDeposit | boolean | Receipts only. |
Payment documents (types 2, 3, 9, 11) must satisfy sum(payments.amountAgorot) + withholdingAgorot == total, or the call fails with 422. Deductions at source (payment types 6, 21, 22) are never sent as payment rows — use withholdingAgorot.
Document types#
docType | Document | Notes |
|---|---|---|
| 1 | חשבונית מס | Needs customerName. Payments are not used. |
| 2 | קבלה | Payments must equal the total. VAT is forced to 0. Set referenceDocIds to the invoice(s) it settles. |
| 3 | חשבונית מס קבלה | Payments must equal the total. |
| 4 | חשבונית זיכוי | referenceDocIds with exactly one issued invoice/receipt (not another credit note). |
| 5 | חשבון עסקה | |
| 6 | הזמנת עבודה | |
| 7 | הצעת מחיר | May not reference other documents. |
| 8 | תעודת משלוח | |
| 9 | הפקדה | Payment document. |
| 11 | קבלה על תרומה | Payment document, no VAT. See the caveat below. |
| 12 | תעודת החזרה | referenceDocIds with exactly one issued delivery note (8). |
| 13 | הזמנת רכש | To a supplier; may not reference documents. |
| 14 | חשבונית עצמית | Needs customerUniqueId (the supplier's ID); no references; vatMode may not be none. |
| 15 | חשבונית זיכוי עצמית | referenceDocIds with exactly one issued self-invoice (14). |
(There is no type 10.)
Examples per document type#
All examples use the native shape; add "apiIdentifier" at the top level as shown in the first example.
Receipt against an invoice#
Issued invoice 3f2b7c1e-… (₪1,180) is paid by Bit. The receipt's single line is the amount received; VAT is 0 on receipts.
{
"apiIdentifier": "receipt-for-inv-1042",
"document": {
"docType": 2,
"customerName": "נועה לוי",
"subject": "קבלה על חשבונית מס 1042",
"taxIncluded": true,
"vatBp": 0,
"issueDate": "2026-09-29",
"referenceDocIds": ["3f2b7c1e-9d4a-4c55-8a51-6d1e0f6b7a10"],
"lines": [{ "name": "תשלום עבור חשבונית מס 1042", "quantityMilli": 1000, "unitPriceAgorot": 118000 }],
"payments": [{ "paymentType": 8, "amountAgorot": 118000, "date": "2026-09-29" }]
}
}When the receipt brings the invoice's open balance to zero, a document.paid webhook fires for the invoice.
Credit note#
{
"apiIdentifier": "credit-inv-1042",
"document": {
"docType": 4,
"customerName": "נועה לוי",
"customerUniqueId": "301234567",
"subject": "זיכוי על חשבונית מס 1042",
"taxIncluded": true,
"vatBp": 1800,
"issueDate": "2026-09-29",
"referenceDocIds": ["3f2b7c1e-9d4a-4c55-8a51-6d1e0f6b7a10"],
"lines": [{ "name": "ייעוץ שעתי — זיכוי", "quantityMilli": 1000, "unitPriceAgorot": 35000 }]
}
}The credited total may not exceed the referenced document's total; a fully credited or cancelled document cannot be credited again.
חשבונית מס (no payment)#
{
"apiIdentifier": "inv-2026-0917",
"document": {
"docType": 1,
"customerName": "חנות הפרחים של דנה בע\"מ",
"customerUniqueId": "514987654",
"subject": "שירותי תחזוקה — ספטמבר",
"taxIncluded": false,
"vatBp": 1800,
"issueDate": "2026-09-29",
"dueDate": "2026-10-29",
"lines": [{ "name": "מנוי תחזוקה חודשי", "quantityMilli": 1000, "unitPriceAgorot": 29000 }]
}
}Here taxIncluded: false, so ₪290 is the price before VAT and the total is ₪342.20.
Donation receipt#
{
"apiIdentifier": "donation-2026-00871",
"document": {
"docType": 11,
"customerName": "משפחת אברהם",
"customerUniqueId": "300123456",
"subject": "תרומה לקרן מלגות",
"taxIncluded": false,
"vatBp": 0,
"issueDate": "2026-09-29",
"lines": [{ "name": "תרומה", "quantityMilli": 1000, "unitPriceAgorot": 36000, "vatBp": 0 }],
"payments": [{ "paymentType": 1, "amountAgorot": 36000, "date": "2026-09-29", "cardLast4": "4242" }]
}
}Caveat: a donation is never subject to VAT, so use vatBp: 0. A document issued through this endpoint goes through the generic engine only. The dashboard's donation flow additionally checks the organisation's §46 details, prints the §46 legal text and reports the donation to the Tax Authority; the API does not. Use the dashboard flow for donations that must be reported.
Foreign currency#
{ "currency": "USD", "fxRateMillionths": 3710000 }Add these two fields to any document; without an exchange rate a non-ILS document is refused, because the books need the shekel value.
Invoice4U-compatible shape#
{
"doc": {
"DocumentType": 3,
"Subject": "תשלום חודשי",
"ClientName": "לקוח בע\"מ",
"ClientEmail": "[email protected]",
"UniqueID": "515131274",
"TaxIncluded": true,
"TaxPercentage": 18,
"ApiIdentifier": "order-12345",
"Items": [{ "Name": "מנוי חודשי", "Quantity": 1, "Price": 1180, "TaxPercentage": 18 }],
"Payments": [{ "PaymentType": 3, "Amount": 1180, "Date": "/Date(1723372800000)/" }]
},
"token": "bk_…"
}Response:
{ "d": { "DocumentNumber": 5001, "ID": "…", "UniqueID": "…", "IsSuccess": true, "ErrorMessage": null,
"PrintOriginalPDFLink": "https://…/view", "PrintCertifiedCopyPDFLink": "https://…/view" } }Field mapping and rules:
Items[].Priceis shekels (float) and becomes agorot;QuantitybecomesquantityMilli;TaxPercentage(document or line) must be0or18.Payments[].Dateaccepts/Date(1723372800000)/or an ISO date/datetime.ApiIdentifieris required and non-blank (it is the idempotency key).Itemsis required and non-empty.ClientNameis required forDocumentType1 and 4; for 2 and 3 a blank name falls back to"לקוח/ה".Currency≠ ILS needsExchangeRate(ILS per unit, float).RoundAmountnon-zero rounds the total to whole shekels.UniqueIDmaps to the buyer's ID.TotalandItems[].Totalare accepted and ignored.- The issue date is always today (UTC). There is no way to back-date in this shape, and no
referenceDocIds, so credit notes (4), return notes (12), self-credits (15) and receipts that must reference an invoice cannot be issued this way — use the native shape. DocumentNumberis an integer; in sandbox it is the string"SBX-000123".- Errors come as
{"d":{"IsSuccess":false,"ErrorMessage":"…"}}with the HTTP status of the failure.
Validation (native shape)#
Checked in this order, first failure wins, each answers 422 with a specific message:
| Rule | Message shape |
|---|---|
document missing | document is required |
lines empty / missing | lines is required (non-empty array); more than 500 → too many lines (max 500) |
| Money not a whole number, or beyond ±10¹² agorot | lines[0].unitPriceAgorot must be an integer between -1000000000000 and 1000000000000 |
vatBp (document or line) not 0 or 1800 | vatBp: unsupported VAT rate 17% — only 0% (exempt) or 18% (statutory) are accepted |
issueDate malformed or outside the window | issueDate must be an ISO date YYYY-MM-DD / issueDate must be between 2026-08-30 and 2026-09-30 |
| Business rules (engine) | a credit note must reference exactly one document, payments (…) + withholding (…) must equal total (…), document total must be positive, withholding applies to payment documents only, payment amounts must be positive, currency/exchange-rate and reference rules, Hebrew messages for the newer document types |
Plan refusals are also 422: the free plan cannot issue through the API, and past the monthly allowance issuing is refused, both with a Hebrew message.
Send subject and customerName on every document; the engine requires them.
Webhooks and side effects#
A newly issued document fires document.issued; a settled reference additionally fires document.paid. A repeat call for an existing apiIdentifier fires nothing. Fiscal documents are hash-chained and digitally signed at issue (unless unsigned is set). Do not rely on the API to email the customer: store customerEmail on the document and deliver the document yourself.
Status codes#
200 issued or existing · 400 body is not JSON · 401 bad key · 403 dormant · 422 refused · 429 rate limited. See errors.