{
  "openapi": "3.0.3",
  "info": {
    "title": "morning API Documentation",
    "description": "## Getting Started\n\nWelcome to the morning API.\n\n### About morning\n\nMorning is a business management platform that helps companies manage invoicing, accounting, payments, and their overall financial operations.\n\nThe Morning API provides programmatic access to the platform, enabling you to automate workflows and seamlessly integrate Morning's capabilities into your own applications.\n\nThe API is built around REST principles and uses standard HTTP methods and status codes. All API communication is conducted over HTTPS, and all request and response bodies are JSON-encoded.\n\nAuthentication is implemented using OAuth 2.0, providing secure, token-based authorization. Applications obtain access tokens that must be included in API requests to securely access Morning resources according to granted permissions.\n\n## Environments\n\nWe provide two environments for API development:\n\n**Production** - Live operations with real data.\n\n**Sandbox** - Testing and development. No real data is affected.\n\nEach environment requires its own set of API keys.\n\nWe recommend building and testing your integration in the sandbox environment before switching to production.\n\nBase URLs:",
    "version": "2.0.0"
  },
  "servers": [
    {
      "url": "https://api.greeninvoice.co.il/api/v1",
      "description": "Production"
    },
    {
      "url": "https://sandbox.d.greeninvoice.co.il/api/v1",
      "description": "Sandbox"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Authentication",
      "description": "Our APIs use the **OAuth 2.0 protocol** for authentication and authorization.\n\nTo get started:\n1. Obtain your API keys (OAuth 2.0 client credentials) for your relevant business as explained [here](https://support.greeninvoice.co.il/kb/he/article/%D7%90%D7%99%D7%9A-%D7%9C%D7%99%D7%A6%D7%95%D7%A8-%D7%9E%D7%A4%D7%AA%D7%97%D7%95%D7%AA-api) (Hebrew).\n2. Request an access token from our authentication server using the endpoint below.\n3. Include the returned `accessToken` as a `Bearer` token in the `Authorization` header of all subsequent API requests:\n```\nAuthorization: Bearer <accessToken>\n```"
    },
    {
      "name": "Documents",
      "description": "Create and manage business documents such as invoices, receipts, quotes, credit notes, and more.\n\nEach document is associated with a specific business and includes income rows, payment rows, and client information."
    },
    {
      "name": "Items",
      "description": "While generating documents you are usually requested to add items.\n\nItems are products that are bought from you, it can be either a real product (such as electronic device, restaurant dish) or a virtual service (such as a programmer hour).\n\nTo ease the process of entering the same item on multiple documents you are able to create an item once and use it various times later while creating a document."
    },
    {
      "name": "Clients",
      "description": "Create and manage clients — the customers you sell to and invoice."
    },
    {
      "name": "Suppliers",
      "description": "Create and manage suppliers — the businesses and individuals you buy from."
    },
    {
      "name": "Expenses",
      "description": "Track and manage your business expenses — the money your business spends on purchases and services.\n\nYou can create an expense in two ways:\n\n- **Without a file** — the expense is created immediately and is ready to use.\n- **With a file** (such as a receipt or invoice) — the upload first becomes an **expense draft**. Review the draft, then approve it to turn it into a regular expense.\n\nA draft is simply a pending expense waiting for your approval; until then, it isn't counted as an actual expense."
    },
    {
      "name": "Payments",
      "description": "Collect payments from your customers — generate a hosted payment form to share with a customer, and manage and charge saved credit-card tokens."
    },
    {
      "name": "Partners",
      "description": "> - Performing actions in user accounts is restricted to **existing users in morning with a `Best` subscription plan or higher**.\n> - Currently, partners are unable to create new user accounts.\n\nTo use the Partners endpoints you must be a Green Invoice partner. Contact Green Invoice to obtain your partner authorization code.\n\nA Green Invoice partner can connect third-party applications to Green Invoice and control connected users through their application.\n\n**How it works — 3 steps:**\n\n1. **Request authorization** from an existing morning by Green Invoice user. Call `POST /partners/users/connection` — the user receives an email with a connection approval link valid for 3 days. Once approved, Green Invoice sends a `POST` request to the `url` you specified. Its body contains the connected user's `id`, `email`, and a `key` object holding the business's newly created API key (its `id` and `secret`) — store the key securely, as you exchange it for an access token in step 2.\n2. **Obtain a JWT** for the user by calling [`POST /idp/v1/oauth/token`](#tag/Authentication/operation/obtainAccessToken) with the user's API key ID as `client_id` and the secret as `client_secret`.\n3. **Control the user** by using the returned `accessToken` as a `Bearer` token in the `Authorization` header of any subsequent API request.\n\n**Security note:** The approval callback includes an `X-Data-Signature` header — the SHA-256 HMAC of the request body, signed with your partner authorization code as the key. Compare it against your own HMAC computation to verify the callback's authenticity. This step is optional but recommended.\n\n> **Note:** An inactive partner account will result in a `403 Forbidden` response."
    },
    {
      "name": "Webhooks",
      "description": "Webhooks let your application receive real-time notifications when events happen in morning — for example, when a document is created.\n\nUnlike the rest of the API, webhooks are **configured in the morning interface**, not through an API call:\n\n1. In morning, open **[Developer Tools → Webhooks](https://app.greeninvoice.co.il/settings/developers/webhooks)**.\n2. Click **Add Webhook**, give it a name, and enter the **URL** on your server that should receive the notifications.\n3. Choose one or more **events** to subscribe to. Optionally, set a **secret** used to sign every delivery so you can verify it came from morning (see **Verifying deliveries** below). Then save.\n\nOnce saved, every subscribed event triggers an HTTP `POST` to your URL with a JSON body describing the event.\n\n**Delivery headers**\n\nEvery delivery includes the following headers:\n\n| Header | Description |\n|--------|-------------|\n| `x-webhook-topic` | The event type, e.g. `document/created`. |\n| `x-webhook-id` | Identifier of the webhook configuration that produced the delivery. |\n| `x-webhook-delivery-id` | Unique identifier of this specific delivery. |\n| `x-webhook-timestamp` | Time the event was emitted, in ISO 8601 format. |\n| `x-correlation-id` | Correlation identifier, useful for support and debugging. |\n| `user-agent` | Always `morning webhooks` followed by the version, e.g. `morning webhooks 2.1`. |\n| `x-webhook-signature` | Present only when the webhook is configured with a secret — an HMAC-SHA256 signature of the delivered body. See **Verifying deliveries** below. |\n\n**Verifying deliveries**\n\nWhen a webhook has a **secret**, every delivery carries an `x-webhook-signature` header — the HMAC-SHA256 of the raw request body, keyed with your secret, hex-encoded.\n\nTo verify, compute the same HMAC over the **raw** received bytes and compare with a constant-time comparison. Capture the raw body before any JSON parsing — re-serializing parsed JSON changes the bytes and breaks the signature.\n\nExample (Node.js / Express):\n\n```js\nconst crypto = require('crypto');\nconst express = require('express');\nconst app = express();\n\n// Capture the raw body exactly as received — do NOT let a JSON parser re-serialize it.\napp.use(express.raw({ type: 'application/json' }));\n\napp.post('/webhook', (req, res) => {\n    const rawBody = req.body; // Buffer of the exact bytes received\n    const signature = req.get('x-webhook-signature');\n    const expected = crypto.createHmac('sha256', secret).update(rawBody).digest('hex');\n\n    const isValid = signature &&\n        crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(signature));\n    if (!isValid) return res.status(401).send('invalid signature');\n\n    const event = JSON.parse(rawBody.toString('utf8'));\n    // ... handle the event\n    res.sendStatus(200);\n});\n```\n\n**Delivery failures**\n\nAcknowledge each delivery by responding with one of `200`, `201`, `202`, or `204`. Any other response — including `3xx` redirects and other status codes — is treated as a failed delivery, as are timeouts and connection errors.\n\nFailed deliveries are counted; after 15 failures the webhook becomes inactive and stops receiving events.\n\n**Available events**\n\n| Event | Triggered when |\n|-------|----------------|\n| `document/created` | A document is created. |\n| `client/created` | A client is created. |\n| `supplier/created` | A supplier is created. |\n| `payment/received` | A payment is received. |\n| `sale-pages/page-contacted` | A visitor submits their contact details on a sale page. |\n| `sale-pages/order-paid` | An order is paid on a sale page. |\n| `expense-draft/parsed` | An uploaded expense draft finishes parsing. |\n| `expense-draft/declined` | An uploaded expense draft is declined. |\n| `expense/file-updated` | An expense's file is updated. |\n| `file/infected` | An uploaded file is found to be infected and quarantined. |"
    },
    {
      "name": "Reference",
      "description": "Reference data endpoints — lookup values such as supported countries, currencies, and business categories.\n\n> **Note:** All endpoints under **Reference** are served from the shared cache host (`cache.greeninvoice.co.il`), which is the same across all environments — there is no separate sandbox host. Authentication is not required."
    },
    {
      "name": "Errors",
      "description": "Green Invoice system is in Hebrew language and therefore the errors you will receive are in Hebrew.\n\nWe have added a list for you to view of the error code numbers and their descriptions (the descriptions are in Hebrew).\n\n| Error Code | Description |\n|------------|-------------|\n| 401 | גישה נדחתה, נא להתחבר מחדש. |\n| 1002 | שדה שם ריק. |\n| 1003 | לא נמצא עסק פעיל בחשבון. |\n| 1004 | Empty request body or invalid JSON. |\n| 1005 | שגיאה במהלך שמירה. |\n| 1006 | נא לחדש את המינוי. |\n| 1007 | חסרה הרשאה מתאימה. |\n| 403 | גישה אסורה. |\n| 404 | פריט לא נמצא. |\n| 405 | Method Not Allowed. |\n| 1008 | פריט לא עודכן, כיוון שלא בוצעו שינויים. |\n| 1009 | יש לבחור כתובות מייל. |\n| 1010 | קיימת כבר בקשה עם נתונים זהים. |\n| 1011 | שפה לא נתמכת. |\n| 1012 | פעולה זו נתמכת במינוי גבוה יותר. |\n| 1013 | קובץ ריק או לא תקין. |\n| 1014 | סוג קובץ לא נתמך. |\n| 1015 | יש להסדיר את החוב בחשבון על מנת לבצע את הפעולה. |\n| 1016 | שגיאה בעדכון בסיס נתונים. |\n| 1017 | שגיאה כללית. |\n| 1018 | שגיאה בשליחת מייל. יתכן וכתובת המייל חסומה או לא תקינה. |\n| 1019 | כתובת המייל של הנמען חסומה לשליחה. |\n| 1020 | שגיאת הצפנה. |\n| 1100 | שדה {id} לא תקין |\n| 1101 | לא נשלחו שדות לעדכון. |\n| 1102 | כתובת מייל לא תקינה. |\n| 1103 | כתובת אתר לא תקינה. |\n| 1104 | קוד מדינה לא תקין. |\n| 1105 | ערך תנאי תשלום לא תקין. |\n| 1106 | ערך קוד מטבע לא תקין. |\n| 1107 | שער המרה לא תקין, ערך צריך להיות גדול מאפס. |\n| 1108 | שיעור מע\"מ לא תקין. צריך להיות בין 0-1. |\n| 1109 | קיימת שורה עם מע\"מ במסמך ללא מע\"מ. |\n| 1110 | מחיר לא תקין. |\n| 2000 | החשבון עדיין לא פעיל. |\n| 2001 | משתמש חסום. |\n| 2002 | מייל או סיסמה לא נכונים. |\n| 2003 | משתמש לא קיים. |\n| 2004 | נא למלא שם פרטי. |\n| 2005 | נא למלא שם משפחה. |\n| 2006 | סיסמה לא תקינה. צריכה להיות 8-16 ספרות או תווים. |\n| 2007 | מייל תפוס. |\n| 2008 | סיסמה נוכחית לא נכונה. |\n| 2009 | מספר ת.ז. לא תקין. |\n| 2010 | החשבון כבר הופעל. |\n| 2012 | ערך id לא תקין. |\n| 2013 | ערך type לא תקין. |\n| 2014 | נתוני מפתח לא נכונים. |\n| 1111 | מספר עוסק / ח.פ אינו תקין. |\n| 1112 | לא ניתן להוסיף מסמכים. בחודש זה הופקה כמות המסמכים המירבית לחשבון. |\n| 1113 | שדה תקבול לא נשלח. |\n| 1114 | תאריך התחלה לא תקין. |\n| 1115 | תאריך סיום לא תקין. |\n| 1116 | סכום מע״מ לא תקין. |\n| 1117 | תאריך לא תקין. |\n| 1118 | לא ניתן לרכוש שירותים נוספים ללא מסלול פעיל בתשלום. |\n| 1119 | גודל עמוד צריך להיות לכל היותר 100. |\n| 1120 | כתובת הדומיין של המייל לא תקינה. |\n| 2100 | סוג עוסק לא תקין. |\n| 2101 | שם העסק לא יכול להיות ריק. |\n| 2102 | לא ניתן להוסיף עוד עסקים במסגרת המינוי. |\n| 2103 | נא למלא כתובת עסק. |\n| 2104 | נא למלא עיר. |\n| 2105 | קובץ לא תקין או גדול מ 5M. |\n| 2106 | סוג קובץ לא נתמך. |\n| 2107 | מספר תבנית עיצוב לא תקין. |\n| 2125 | מספר סקין בתבנית עיצוב לא תקין. |\n| 2126 | אחוז מקדמות אינו תקין. ערך תקין הוא מספר בין 0-35. |\n| 2127 | ערך תחום עיסוק לא תקין. |\n| 2128 | ערך מקצוע לא תקין. |\n| 2129 | ערך סדר עיצוב שדות תקבולים במסמך לא תקין. |\n| 2108 | לא נמצא עסק. |\n| 2109 | מספר סניף בנק יכול להכיל עד 5 תווים. |\n| 2110 | עסק עם שם זהה כבר רשום בחשבון. |\n| 2111 | מספר עוסק / ח.פ כבר קיים בחשבון. |\n| 2112 | מספר עוסק / ח.פ כבר קיים במערכת תחת חשבון אחר. |\n| 2113 | מספר עוסק / ח.פ כבר רשום בחשבון פעמיים. ניתן עד להקים עד 2 עסקים עם אותו מספר עוסק. |\n| 2114 | מספר תיק ניכויים אינו תקין. |\n| 2115 | אחוז ניכוי במקור אינו תקין. ערך תקין הוא מספר בין 0-35. |\n| 2116 | ערך שיטת דיווח לא תקין. |\n| 2117 | ניתן להוסיף עד 3 כתובות מייל להנהלת חשבונות. |\n| 2118 | חלק מההשדות לא עודכנו. קיים עסק נוסף עם מספר עוסק זהה ולכן חייב להישמר ביניהם טווח הפרש של לפחות 8,000. |\n| 2119 | מספור מסמך לא תקין. ערכים תקינים בין 1-999999999. |\n| 2120 | שדה {types} לא נשלח. |\n| 2121 | לא ניתן לעדכן מספור זה מאחר וכבר הופקו מסמכים בשנה זו. |\n| 2122 | לא ניתן לבצע פעולה זו בעסק מוקפא. |\n| 2123 | ערך {id} לא תקין של העסק |\n| 2124 | תוכן בתחתית המסמך מוגבל ל-2000 תווים. |\n| 2200 | ניתן להוסיף עד 3 כתובות מייל ללקוח. |\n| 2201 | נא למלא שם לקוח. |\n| 2202 | לא ניתן לאחד לקוח פעיל. |\n| 2203 | לא ניתן למחוק לקוח שהופקו עבורו מסמכים. |\n| 2204 | שדה {id} של לקוח מטרה לא נשלח. |\n| 2205 | לא נמצאו לקוחות חדשים או שהקובץ המיובא אינו תקין. |\n| 2206 | ניתן להוסיף עד 3 תגיות ללקוח. |\n| 2207 | קובץ לא תקין או גדול מ 5M. |\n| 2208 | יתרה לא תקינה. |\n| 2209 | הכנסות לא תקינות. |\n| 2210 | לא ניתן למחוק לקוח בעל כרטיסי אשראי שמורים. |\n| 2250 | ניתן להוסיף עד 3 כתובות מייל לספק. |\n| 2251 | נא למלא שם ספק. |\n| 2252 | לא ניתן לאחד ספק פעיל. |\n| 2253 | לא ניתן למחוק ספק ששויכו אליו הוצאות. |\n| 2254 | שדה {id} של ספק מטרה לא נשלח. |\n| 2255 | לא נמצאו ספקים חדשים ותקינים בקובץ היבוא. |\n| 2256 | ניתן להוסיף עד 3 תגיות ללקוח. |\n| 2257 | קובץ לא תקין או גדול מ 5M. |\n| 2258 | יתרה לא תקינה. |\n| 2259 | הכנסות לא תקינות. |\n| 2300 | נא למלא שם פריט. |\n| 2301 | נא למלא תיאור פריט. |\n| 2302 | לא נמצאו פריטים חדשים ותקינים בקובץ היבוא. |\n| 2305 | קובץ לא תקין או גדול מ 5M. |\n| 2400 | לא ניתן לסגור מסמך שאינו פתוח. |\n| 2401 | לא ניתן לפתוח מסמך שאינו סגור ידנית. |\n| 2402 | שדה {ids} לא נשלח או לא תקין. |\n| 2403 | סוג מסמך לא נשלח או אינו נתמך עבור סוג עסק זה. |\n| 2404 | Invalid or missing {linkType} field. Can be only (copy\\|cancel\\|link). |\n| 2405 | התאריך שנבחר עתידי או מוקדם מדי לסוג מסמך זה. |\n| 2406 | ערך שפה לא תקין. |\n| 2407 | ערך קוד מטבע לא תקין. |\n| 2408 | תאריך לתשלום עד לא תקין. |\n| 2409 | סוג מע\"מ לא תקין. |\n| 2410 | שדה לקוח {client} חסר. |\n| 2411 | לקוח לא קיים. |\n| 2412 | חשבונית עצמית יכולה להיות מופקת רק עם סוג חשבונית מס. |\n| 2413 | נא למלא לפחות שירות או פריט אחד. |\n| 2414 | סכום תשלום לא תקין. צריך להיות מספר עשרוני. |\n| 2415 | תיאור שורה לא יכול להיות ריק. |\n| 2416 | סכום מסמך לא תקין. צריך להיות שונה מאפס. |\n| 2417 | סכום מסמך לא תקין. צריך להיות גדול מאפס. |\n| 2418 | סכום מסמך לא תקין. צריך להיות גדול או שווה לאפס. |\n| 2419 | נא למלא לפחות שורת תקבולים אחת. |\n| 2420 | Invalid discount type. Can be 'sum' or 'percentage'. |\n| 2421 | קוד סוג תשלום לא תקין. |\n| 2422 | קיים חוסר התאמה בין סכום התקבולים לסכום התשלומים. |\n| 2423 | סוג כרטיס אשראי לא תקין. |\n| 2424 | קוד סוג עסקה לא תקין. |\n| 2425 | מספר תשלומים יכול להיות רק 1-36. |\n| 2426 | תאריך תקבול ריק, עתידי או לא תקין. |\n| 2427 | לא ניתן לשלוח במייל מסמך שלא נחתם דיגיטלית. |\n| 2428 | נא למלא שורת תקבולים אחת לפחות בנוסף לניכוי במקור. |\n| 2429 | מסמך מקושר לא נמצא. |\n| 2430 | ערך כמות צריך להיות גדול מ 1. |\n| 2431 | כמות מירבית מותרת של שורות הכנסה / תשלום היא 200 למסמך. |\n| 2432 | סוג עותק מסמך לא נתמך. |\n| 2433 | סוג סטטוס הפצת מייל לא נתמך. |\n| 2434 | ערך סכום תקבול צריך להיות שונה מ 0. |\n| 2435 | ערך טקסט הערות לא תקין. |\n| 2436 | ערך טקסט תחתון לא תקין. |\n| 2437 | ערך שליחת מסמך במייל לא תקין. |\n| 2500 | כתובת לא תקינה. |\n| 2501 | קטגוריה חסרה. |\n| 2502 | כותרת חסרה. |\n| 2503 | כתובת חסרה. |\n| 2504 | רשימת מיון ריקה. |\n| 2600 | לא נמצא מסוף סליקה פעיל. |\n| 2601 | קיימת בעיה בחיוב אשראי, נא ליצור קשר עם התמיכה. |\n| 2602 | שגיאה בחיבור תוסף. |\n| 2603 | שגיאה בחיוב כרטיס אשראי. |\n| 2604 | ערך flow לא תקין. |\n| 2605 | לא נשלח תוכן מסמך. |\n| 2606 | שגיאה בשינוי סטטוס מסוף. |\n| 2607 | סוג טוקן לא תקין. |\n| 2608 | 4 ספרות של כרטיס אשראי אינם תקינים. |\n| 2609 | סוג מזהה עסקה לא תקין. |\n| 2610 | סכום תשלום לא תקין. צריך להיות גדול מאפס. |\n| 2611 | שגיאת אשראי. |\n| 2612 | מזהה עסקה לא תקין. |\n| 2613 | סוג סטטוס עסקה לא תקין. |\n| 2614 | שדה מותאם אישית לא תקין. |\n| 2615 | לא ניתן לבטל עסקה שבוטלה. |\n| 2616 | לא ניתן לבטל עסקה, נא לבצע זיכוי. |\n| 2617 | לא ניתן לזכות עסקה. |\n| 2618 | לא ניתן לבטל עסקה שבוטלה. |\n| 2619 | שדה סוג חיוב לא תקין |\n| 2620 | בקשה הושלמה בעבר. |\n| 2621 | לא ניתן לבטל או לזכות עסקה. |\n| 2622 | שם בעל כרטיס לא תקין. |\n| 2623 | תוקף כרטיס לא תקין. |\n| 2624 | לא ניתן לזכות עסקה בסכום גדול מהסכום המקורי. |\n| 2625 | לתוסף שנבחר אין הרשאה לשמירת כרטיסי אשראי. |\n| 2626 | שם משלם לא תקין. |\n| 2627 | כרטיס אשראי שמור לא קיים או לא פעיל. |\n| 2700 | מפתח API לא תקין. |\n| 2701 | מצב מפתח API לא תקין. |\n| 2702 | סוג מפתח דורש הזדהות נוספת. |\n| 2800 | קוד חשבון ריק. |\n| 2801 | סוג ממשק לא ניתן לסנכרון. |\n| 2802 | סוג ממשק חיצוני לא תקין. |\n| 2803 | שגיאת התחברות לממשק חיצוני. |\n| 2804 | שגיאת תוסף. |\n| 2805 | תוסף לא פעיל. |\n| 2900 | תאריך התחלה לא תקין. |\n| 2901 | תאריך סיום לא תקין או שאינו מאפשר לפחות הפקת מסמך אחד. |\n| 2902 | תקופת חזרה לא תקינה. |\n| 2903 | סטטוס ריטיינר לא תקין. |\n| 2904 | תאריך ריטיינר לא תקין. |\n| 3000 | שגיאה כללית. |\n| 3001 | לא קיים כרטיס אשראי בחשבון. |\n| 3002 | סוג המינוי שנשלח לא קיים. |\n| 4000 | סוג נתונים לא תקין. |\n| 3003 | סוג פעולה לא נתמך. |\n| 3004 | שדה אחד או יותר חסרים. |\n| 3005 | מינוי זהה קיים בחשבון. |\n| 3006 | מכסת ההרשמות היומית הסתיימה. נסו שוב מחר או פנו למנהל תיק הלקוח שלכם להגדלת המכסה היומית. |\n| 3007 | מכסת החיבורים היומית הסתיימה. נסו שוב מחר או פנו למנהל תיק הלקוח שלכם להגדלת המכסה היומית. |\n| 3008 | לא ניתן להפעיל את החיבור. |\n| 3009 | סוג טרנזאקציה לא נתמכת. |\n| 3010 | קיים חוב בחשבון. נא להסדיר את החוב לפני רכישת מינוי חדש. |\n| 3100 | שם תגית ריק. |\n| 3101 | אורך מקסימלי של תגית אפשרי עד 30 תווים. |\n| 3200 | סוג משימה לא נתמך. |\n| 3300 | סוג סטטוס הוצאה לא נתמך. |\n| 3301 | סכום הוצאה לא תקין. |\n| 3302 | סכום מע״מ בהוצאה לא תקין. |\n| 3303 | נא לצרף קובץ עבור ההוצאה. |\n| 3304 | סוג טיוטת הוצאה לא נתמך. |\n| 3305 | טיוטת הוצאה מקושרת לא נמצאה. |\n| 3306 | מספר מסמך הוצאה לא תקין. |\n| 3307 | תאריך מסמך הוצאה לא תקין. |\n| 3308 | סוג מסמך הוצאה לא תקין. |\n| 3309 | לא ניתן לסווג מסמכי הכנסה של העסק כהוצאה. |\n| 3310 | חודש דיווח לא תקין. |\n| 3311 | נא למלא פרטי ספק. |\n| 3312 | נא למלא פרטי סוג הוצאה. |\n| 3313 | שדה expenseIds לא תקין. |\n| 3314 | לא ניתן לעדכן הוצאה לאחר שדווחה. |\n| 3315 | לא ניתן לפתוח הוצאה שלא דווחה. |\n| 3316 | לא ניתן לסגור הוצאה שאינה פתוחה. |\n| 3317 | סוג אמצעי התשלום של ההוצאה לא תקין. |\n| 3318 | מיקום משרד לא תקין. |\n| 3319 | מספר חדרים לא תקין. |\n| 3320 | מספר רכב לא תקין. |\n| 3400 | נא למלא כותרת לחשבון. |\n| 3401 | שיעור הוצאה מוכרת לא תקין. |\n| 3402 | שיעור מע״מ מוכר לא תקין. |\n| 3403 | סוג ההוצאה לא תקין. |\n| 3404 | קוד 6111 לא תקין. |\n| 3405 | לא ניתן למחוק סוג הוצאה ששויכו אליו הוצאות. |"
    }
  ],
  "paths": {
    "/idp/v1/oauth/token": {
      "servers": [
        {
          "url": "https://api.morning.co",
          "description": "Production"
        },
        {
          "url": "https://api.sandbox.morning.dev",
          "description": "Sandbox"
        }
      ],
      "post": {
        "tags": [
          "Authentication"
        ],
        "operationId": "obtainAccessToken",
        "summary": "Obtain an Access Token",
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST https://api.morning.co/idp/v1/oauth/token \\\n  -H \"Content-Type: application/json\" \\\n  --data @- <<EOF\n{\n  \"grant_type\": \"client_credentials\",\n  \"client_id\": \"$MORNING_CLIENT_ID\",\n  \"client_secret\": \"$MORNING_CLIENT_SECRET\"\n}\nEOF"
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://api.morning.co/idp/v1/oauth/token', {\n  method: 'POST',\n  headers: { 'Content-Type': 'application/json' },\n  body: JSON.stringify({\n    grant_type: 'client_credentials',\n    client_id: process.env.MORNING_CLIENT_ID,\n    client_secret: process.env.MORNING_CLIENT_SECRET,\n  }),\n});\n\nconst { accessToken, expiresAt } = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nres = requests.post(\n    \"https://api.morning.co/idp/v1/oauth/token\",\n    json={\n        \"grant_type\": \"client_credentials\",\n        \"client_id\": os.environ[\"MORNING_CLIENT_ID\"],\n        \"client_secret\": os.environ[\"MORNING_CLIENT_SECRET\"],\n    },\n)\n\naccess_token = res.json()[\"accessToken\"]"
          }
        ],
        "security": [],
        "description": "This endpoint returns an access token (issued as a signed JWT) in the response body as `accessToken`.\n\n**NOTES:**\n- Please be advised that **the `accessToken` is valid for 1 hour.** Once a token becomes invalid, requests to protected endpoints will return a `401 Unauthorized` error, and you will need to request a new token.\n- The access token is scoped to the business associated with your API keys.\n\n* Error Handling - All error responses follow the OAuth 2.0 error format (RFC 6749):\n\n| Status | Error&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | Description |\n|:---|:---|:---|\n| 400 | `invalid_request` | Missing `grant_type` parameter |\n| 400 | `unsupported_grant_type` | `grant_type` is not `client_credentials` |\n| 400 | `invalid_grant` | API key privilege is expired, revoked, or pending |\n| 400 | `unauthorized_client` | No active subscription, or subscription does not include API access |\n| 401 | `invalid_client` | Missing or incorrect `client_id`/`client_secret`, or application/account is blocked |\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TokenRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Access token successfully generated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenResponse"
                },
                "example": {
                  "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJtb3JuaW5nIiwiaWF0IjoxNzcxMzEzNzI3LCJleHAiOjE3NzEzMTczMjcsImVudiI6InByb2QiLCJzdWIiOiJhMWIyYzNkNC1lNWY2LTRhN2ItOGM5ZC0wZTFmMmEzYjRjNWQiLCJ0eXAiOiJhY2Nlc3NfdG9rZW4iLCJhY2NvdW50SWQiOiIwMDAwMDAwMC0wMDAwLTQwMDAtODAwMC0wMDAwMDAwMDAwMDEiLCJyZXNvdXJjZUlkIjoiMDAwMDAwMDAtMDAwMC00MDAwLTgwMDAtMDAwMDAwMDAwMDAyIiwiYXBwSWQiOiJidXNpbmVzcyIsImF1ZCI6ImJ1c2luZXNzOjAwMDAwMDAwLTAwMDAtNDAwMC04MDAwLTAwMDAwMDAwMDAwMiIsInJvbGUiOjUwLCJzY29wZXMiOiIifQ.dGhpcy1pcy1hLXNhbXBsZS1zaWduYXR1cmU",
                  "tokenType": "Bearer",
                  "expiresAt": 1771317327
                }
              }
            }
          },
          "400": {
            "description": "Bad request — invalid or missing parameters, expired/revoked privileges, or insufficient subscription",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuth2Error"
                },
                "examples": {
                  "invalid_request": {
                    "summary": "Missing grant_type parameter",
                    "value": {
                      "error": "invalid_request",
                      "error_description": "The request is missing a required parameter or is otherwise malformed"
                    }
                  },
                  "unsupported_grant_type": {
                    "summary": "Unsupported grant type",
                    "value": {
                      "error": "unsupported_grant_type",
                      "error_description": "The authorization grant type is not supported"
                    }
                  },
                  "invalid_grant": {
                    "summary": "Privilege expired, revoked, or pending",
                    "value": {
                      "error": "invalid_grant",
                      "error_description": "The provided authorization grant is invalid or expired"
                    }
                  },
                  "unauthorized_client": {
                    "summary": "No active subscription or missing API access",
                    "value": {
                      "error": "unauthorized_client",
                      "error_description": "The client is not authorized to use this grant type"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized — client authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuth2Error"
                },
                "examples": {
                  "invalid_client": {
                    "summary": "Client authentication failed",
                    "description": "Missing or incorrect `client_id` / `client_secret`, or the application or account is blocked.",
                    "value": {
                      "error": "invalid_client",
                      "error_description": "Invalid client credentials"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/documents": {
      "post": {
        "tags": [
          "Documents"
        ],
        "operationId": "addDocument",
        "summary": "Add Document",
        "description": "Add a document to the current business.\n\nThe document will be generated based on the default business and document settings, and by any overriding request attributes received in this endpoint.\n\n**Notes:**\n- **VAT Configuration** — When declaring your `vatType`, you can define the general VAT type of the entire document, as well as the `vatType` for each individual income row.\n- **Document Linking** — Use `linkedDocumentIds` to state the related documents. For example, when creating a receipt, include the original invoice document ID in this array. This linkage enables the system to automatically mark the original invoice as closed.\n- **Payment Association** — The `linkedPaymentId` field allows you to define the payment ID that the document is relevant to. This can be attached only to invoice documents (type `305`).\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |\n| `Authorization` | `Bearer <accessToken>` | Yes |",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDocumentRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Document created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateDocumentResponse"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST 'https://api.greeninvoice.co.il/api/v1/documents' \\\n  -H \"Authorization: Bearer $MORNING_ACCESS_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"description\": \"Just an order\",\n  \"remarks\": \"Some remarks\",\n  \"footer\": \"Texts in footer\",\n  \"emailContent\": \"Email content\",\n  \"type\": 305,\n  \"date\": \"2026-05-12\",\n  \"dueDate\": \"2026-05-31\",\n  \"lang\": \"he\",\n  \"currency\": \"ILS\",\n  \"vatType\": 0,\n  \"discount\": {\n    \"amount\": 1,\n    \"type\": \"sum\"\n  },\n  \"rounding\": false,\n  \"signed\": true,\n  \"attachment\": false,\n  \"paymentRequestData\": {\n    \"plugins\": [\n      {\n        \"id\": \"031e827a-c664-c1e4-d231-a80027271123\",\n        \"group\": 100,\n        \"type\": 12100\n      }\n    ],\n    \"maxPayments\": 1\n  },\n  \"client\": {\n    \"id\": \"7944827a-c664-11e4-8231-080027271114\",\n    \"name\": \"John Doe\",\n    \"emails\": [\n      \"email1@example.com\",\n      \"email2@example.com\"\n    ],\n    \"taxId\": \"0123456789\",\n    \"address\": \"1 Luria St\",\n    \"city\": \"Tel Aviv\",\n    \"zip\": \"1234567\",\n    \"country\": \"IL\",\n    \"phone\": \"+972-54-1234567\",\n    \"fax\": \"+972-54-1234567\",\n    \"mobile\": \"+972-54-1234567\",\n    \"add\": false,\n    \"self\": false\n  },\n  \"income\": [\n    {\n      \"catalogNum\": \"MXDFSDD\",\n      \"description\": \"Item description\",\n      \"quantity\": 1,\n      \"price\": 300,\n      \"currency\": \"ILS\",\n      \"currencyRate\": 1,\n      \"vatRate\": 0.18,\n      \"itemId\": \"8b338c95-095e-46d4-b2c6-331747508759\",\n      \"vatType\": 1\n    }\n  ],\n  \"payment\": [\n    {\n      \"date\": \"2026-05-21\",\n      \"type\": 3,\n      \"price\": 300,\n      \"currency\": \"ILS\",\n      \"currencyRate\": 1,\n      \"bankName\": \"My Bank\",\n      \"bankBranch\": \"198\",\n      \"bankAccount\": \"212435\",\n      \"chequeNum\": \"10002\",\n      \"accountId\": \"TFGFFGSYYE\",\n      \"transactionId\": \"TGBBBXNLKS75SKJS\",\n      \"appType\": 1,\n      \"subType\": 1,\n      \"cardType\": 2,\n      \"cardNum\": \"8765\",\n      \"dealType\": 1,\n      \"numPayments\": 1,\n      \"firstPayment\": 10\n    }\n  ],\n  \"linkedDocumentIds\": [\n    \"031e827a-c664-c1e4-d231-a80027271123\"\n  ],\n  \"linkedPaymentId\": \"031e827a-c664-c1e4-d231-a80027271123\",\n  \"linkType\": \"link\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://api.greeninvoice.co.il/api/v1/documents', {\n  method: 'POST',\n  headers: {\n    Authorization: `Bearer ${process.env.MORNING_ACCESS_TOKEN}`,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    \"description\": \"Just an order\",\n    \"remarks\": \"Some remarks\",\n    \"footer\": \"Texts in footer\",\n    \"emailContent\": \"Email content\",\n    \"type\": 305,\n    \"date\": \"2026-05-12\",\n    \"dueDate\": \"2026-05-31\",\n    \"lang\": \"he\",\n    \"currency\": \"ILS\",\n    \"vatType\": 0,\n    \"discount\": {\n      \"amount\": 1,\n      \"type\": \"sum\"\n    },\n    \"rounding\": false,\n    \"signed\": true,\n    \"attachment\": false,\n    \"paymentRequestData\": {\n      \"plugins\": [\n        {\n          \"id\": \"031e827a-c664-c1e4-d231-a80027271123\",\n          \"group\": 100,\n          \"type\": 12100\n        }\n      ],\n      \"maxPayments\": 1\n    },\n    \"client\": {\n      \"id\": \"7944827a-c664-11e4-8231-080027271114\",\n      \"name\": \"John Doe\",\n      \"emails\": [\n        \"email1@example.com\",\n        \"email2@example.com\"\n      ],\n      \"taxId\": \"0123456789\",\n      \"address\": \"1 Luria St\",\n      \"city\": \"Tel Aviv\",\n      \"zip\": \"1234567\",\n      \"country\": \"IL\",\n      \"phone\": \"+972-54-1234567\",\n      \"fax\": \"+972-54-1234567\",\n      \"mobile\": \"+972-54-1234567\",\n      \"add\": false,\n      \"self\": false\n    },\n    \"income\": [\n      {\n        \"catalogNum\": \"MXDFSDD\",\n        \"description\": \"Item description\",\n        \"quantity\": 1,\n        \"price\": 300,\n        \"currency\": \"ILS\",\n        \"currencyRate\": 1,\n        \"vatRate\": 0.18,\n        \"itemId\": \"8b338c95-095e-46d4-b2c6-331747508759\",\n        \"vatType\": 1\n      }\n    ],\n    \"payment\": [\n      {\n        \"date\": \"2026-05-21\",\n        \"type\": 3,\n        \"price\": 300,\n        \"currency\": \"ILS\",\n        \"currencyRate\": 1,\n        \"bankName\": \"My Bank\",\n        \"bankBranch\": \"198\",\n        \"bankAccount\": \"212435\",\n        \"chequeNum\": \"10002\",\n        \"accountId\": \"TFGFFGSYYE\",\n        \"transactionId\": \"TGBBBXNLKS75SKJS\",\n        \"appType\": 1,\n        \"subType\": 1,\n        \"cardType\": 2,\n        \"cardNum\": \"8765\",\n        \"dealType\": 1,\n        \"numPayments\": 1,\n        \"firstPayment\": 10\n      }\n    ],\n    \"linkedDocumentIds\": [\n      \"031e827a-c664-c1e4-d231-a80027271123\"\n    ],\n    \"linkedPaymentId\": \"031e827a-c664-c1e4-d231-a80027271123\",\n    \"linkType\": \"link\"\n  }),\n});\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nres = requests.post(\n    \"https://api.greeninvoice.co.il/api/v1/documents\",\n    headers={\"Authorization\": f\"Bearer {os.environ['MORNING_ACCESS_TOKEN']}\"},\n    json={\n        \"description\": \"Just an order\",\n        \"remarks\": \"Some remarks\",\n        \"footer\": \"Texts in footer\",\n        \"emailContent\": \"Email content\",\n        \"type\": 305,\n        \"date\": \"2026-05-12\",\n        \"dueDate\": \"2026-05-31\",\n        \"lang\": \"he\",\n        \"currency\": \"ILS\",\n        \"vatType\": 0,\n        \"discount\": {\n            \"amount\": 1,\n            \"type\": \"sum\",\n        },\n        \"rounding\": False,\n        \"signed\": True,\n        \"attachment\": False,\n        \"paymentRequestData\": {\n            \"plugins\": [\n                {\n                    \"id\": \"031e827a-c664-c1e4-d231-a80027271123\",\n                    \"group\": 100,\n                    \"type\": 12100,\n                },\n            ],\n            \"maxPayments\": 1,\n        },\n        \"client\": {\n            \"id\": \"7944827a-c664-11e4-8231-080027271114\",\n            \"name\": \"John Doe\",\n            \"emails\": [\n                \"email1@example.com\",\n                \"email2@example.com\",\n            ],\n            \"taxId\": \"0123456789\",\n            \"address\": \"1 Luria St\",\n            \"city\": \"Tel Aviv\",\n            \"zip\": \"1234567\",\n            \"country\": \"IL\",\n            \"phone\": \"+972-54-1234567\",\n            \"fax\": \"+972-54-1234567\",\n            \"mobile\": \"+972-54-1234567\",\n            \"add\": False,\n            \"self\": False,\n        },\n        \"income\": [\n            {\n                \"catalogNum\": \"MXDFSDD\",\n                \"description\": \"Item description\",\n                \"quantity\": 1,\n                \"price\": 300,\n                \"currency\": \"ILS\",\n                \"currencyRate\": 1,\n                \"vatRate\": 0.18,\n                \"itemId\": \"8b338c95-095e-46d4-b2c6-331747508759\",\n                \"vatType\": 1,\n            },\n        ],\n        \"payment\": [\n            {\n                \"date\": \"2026-05-21\",\n                \"type\": 3,\n                \"price\": 300,\n                \"currency\": \"ILS\",\n                \"currencyRate\": 1,\n                \"bankName\": \"My Bank\",\n                \"bankBranch\": \"198\",\n                \"bankAccount\": \"212435\",\n                \"chequeNum\": \"10002\",\n                \"accountId\": \"TFGFFGSYYE\",\n                \"transactionId\": \"TGBBBXNLKS75SKJS\",\n                \"appType\": 1,\n                \"subType\": 1,\n                \"cardType\": 2,\n                \"cardNum\": \"8765\",\n                \"dealType\": 1,\n                \"numPayments\": 1,\n                \"firstPayment\": 10,\n            },\n        ],\n        \"linkedDocumentIds\": [\n            \"031e827a-c664-c1e4-d231-a80027271123\",\n        ],\n        \"linkedPaymentId\": \"031e827a-c664-c1e4-d231-a80027271123\",\n        \"linkType\": \"link\",\n    },\n)\n\ndata = res.json()"
          }
        ]
      }
    },
    "/documents/search": {
      "post": {
        "tags": [
          "Documents"
        ],
        "operationId": "searchDocuments",
        "summary": "Search Documents",
        "description": "Search the documents of the current business using any combination of the filters in the request body. All filters are optional; omitting the body returns the most recent documents. Results are paginated.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |\n| `Authorization` | `Bearer <accessToken>` | Yes |",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchDocumentsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Paginated list of documents matching the search",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchDocumentsResponse"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST 'https://api.greeninvoice.co.il/api/v1/documents/search' \\\n  -H \"Authorization: Bearer $MORNING_ACCESS_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"page\": 1,\n  \"pageSize\": 25,\n  \"number\": 12001,\n  \"type\": [\n    305\n  ],\n  \"status\": [\n    0\n  ],\n  \"paymentTypes\": [\n    3\n  ],\n  \"fromDate\": \"2016-01-01\",\n  \"toDate\": \"2016-01-31\",\n  \"clientId\": \"28fa4c1d-a29b-11e4-963c-18002725111e\",\n  \"clientName\": \"John\",\n  \"description\": \"Any text\",\n  \"download\": true,\n  \"sort\": \"documentDate\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://api.greeninvoice.co.il/api/v1/documents/search', {\n  method: 'POST',\n  headers: {\n    Authorization: `Bearer ${process.env.MORNING_ACCESS_TOKEN}`,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    \"page\": 1,\n    \"pageSize\": 25,\n    \"number\": 12001,\n    \"type\": [\n      305\n    ],\n    \"status\": [\n      0\n    ],\n    \"paymentTypes\": [\n      3\n    ],\n    \"fromDate\": \"2016-01-01\",\n    \"toDate\": \"2016-01-31\",\n    \"clientId\": \"28fa4c1d-a29b-11e4-963c-18002725111e\",\n    \"clientName\": \"John\",\n    \"description\": \"Any text\",\n    \"download\": true,\n    \"sort\": \"documentDate\"\n  }),\n});\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nres = requests.post(\n    \"https://api.greeninvoice.co.il/api/v1/documents/search\",\n    headers={\"Authorization\": f\"Bearer {os.environ['MORNING_ACCESS_TOKEN']}\"},\n    json={\n        \"page\": 1,\n        \"pageSize\": 25,\n        \"number\": 12001,\n        \"type\": [\n            305,\n        ],\n        \"status\": [\n            0,\n        ],\n        \"paymentTypes\": [\n            3,\n        ],\n        \"fromDate\": \"2016-01-01\",\n        \"toDate\": \"2016-01-31\",\n        \"clientId\": \"28fa4c1d-a29b-11e4-963c-18002725111e\",\n        \"clientName\": \"John\",\n        \"description\": \"Any text\",\n        \"download\": True,\n        \"sort\": \"documentDate\",\n    },\n)\n\ndata = res.json()"
          }
        ]
      }
    },
    "/documents/payments/search": {
      "post": {
        "tags": [
          "Documents"
        ],
        "operationId": "searchDocumentPayments",
        "summary": "Search Payments in Documents",
        "description": "Search the payments recorded across the current business's documents, using any combination of the filters in the request body. Each result is the document that contains the matching payment(s), with the payments in its `payment` array. All filters are optional. Results are paginated.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |\n| `Authorization` | `Bearer <accessToken>` | Yes |",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchDocumentPaymentsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Paginated list of documents whose payments matched the search",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchDocumentPaymentsResponse"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST 'https://api.greeninvoice.co.il/api/v1/documents/payments/search' \\\n  -H \"Authorization: Bearer $MORNING_ACCESS_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"page\": 1,\n  \"pageSize\": 25,\n  \"type\": [\n    320\n  ],\n  \"paymentTypes\": [\n    3\n  ],\n  \"fromDate\": \"2016-01-01\",\n  \"toDate\": \"2016-01-31\",\n  \"paymentId\": \"427547\",\n  \"sort\": \"date:desc\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://api.greeninvoice.co.il/api/v1/documents/payments/search', {\n  method: 'POST',\n  headers: {\n    Authorization: `Bearer ${process.env.MORNING_ACCESS_TOKEN}`,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    \"page\": 1,\n    \"pageSize\": 25,\n    \"type\": [\n      320\n    ],\n    \"paymentTypes\": [\n      3\n    ],\n    \"fromDate\": \"2016-01-01\",\n    \"toDate\": \"2016-01-31\",\n    \"paymentId\": \"427547\",\n    \"sort\": \"date:desc\"\n  }),\n});\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nres = requests.post(\n    \"https://api.greeninvoice.co.il/api/v1/documents/payments/search\",\n    headers={\"Authorization\": f\"Bearer {os.environ['MORNING_ACCESS_TOKEN']}\"},\n    json={\n        \"page\": 1,\n        \"pageSize\": 25,\n        \"type\": [\n            320,\n        ],\n        \"paymentTypes\": [\n            3,\n        ],\n        \"fromDate\": \"2016-01-01\",\n        \"toDate\": \"2016-01-31\",\n        \"paymentId\": \"427547\",\n        \"sort\": \"date:desc\",\n    },\n)\n\ndata = res.json()"
          }
        ]
      }
    },
    "/documents/preview": {
      "post": {
        "tags": [
          "Documents"
        ],
        "operationId": "addPreviewDocument",
        "summary": "Get a Preview Document",
        "description": "Previews a document before the actual generation.\n\nThis endpoint returns a file in Base64 format (you can read more about Base64 [here](https://en.wikipedia.org/wiki/Base64)).\n\nIf you would like to view the file on your website there are built-in plugins to display PDF, other than that - if you would like to have a consistent user experience through all browsers (including mobile browsers) we would suggest using [PDF.js](https://mozilla.github.io/pdf.js/) (an amazing Mozilla library), which can view PDF from Base64 format.\n\nIf you would like to add a download button for the preview in your website, here is a simple script to do that (do not forget to switch the {base64string} with the Base64 file that you received from the result):\n\n```\n<a download=\"preview-document.pdf\" href=\"data:application/pdf;base64,{base64string}\">Download Preview</a>\n```\n\n**NOTE:** If you would like just to check how a preview file looks, use the string that was given in the `file` property from our server response, put it in the following website: <https://www.freeformatter.com/base64-encoder.html> and click `DECODE AND DOWNLOAD`. This will download the base64 string as a PDF file into your computer so that you can view it.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |\n| `Authorization` | `Bearer <accessToken>` | Yes |",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDocumentRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Preview document generated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreviewDocumentResponse"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST 'https://api.greeninvoice.co.il/api/v1/documents/preview' \\\n  -H \"Authorization: Bearer $MORNING_ACCESS_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"description\": \"Just an order\",\n  \"remarks\": \"Some remarks\",\n  \"footer\": \"Texts in footer\",\n  \"emailContent\": \"Email content\",\n  \"type\": 305,\n  \"date\": \"2026-05-12\",\n  \"dueDate\": \"2026-05-31\",\n  \"lang\": \"he\",\n  \"currency\": \"ILS\",\n  \"vatType\": 0,\n  \"discount\": {\n    \"amount\": 1,\n    \"type\": \"sum\"\n  },\n  \"rounding\": false,\n  \"signed\": true,\n  \"attachment\": false,\n  \"paymentRequestData\": {\n    \"plugins\": [\n      {\n        \"id\": \"031e827a-c664-c1e4-d231-a80027271123\",\n        \"group\": 100,\n        \"type\": 12100\n      }\n    ],\n    \"maxPayments\": 1\n  },\n  \"client\": {\n    \"id\": \"7944827a-c664-11e4-8231-080027271114\",\n    \"name\": \"John Doe\",\n    \"emails\": [\n      \"email1@example.com\",\n      \"email2@example.com\"\n    ],\n    \"taxId\": \"0123456789\",\n    \"address\": \"1 Luria St\",\n    \"city\": \"Tel Aviv\",\n    \"zip\": \"1234567\",\n    \"country\": \"IL\",\n    \"phone\": \"+972-54-1234567\",\n    \"fax\": \"+972-54-1234567\",\n    \"mobile\": \"+972-54-1234567\",\n    \"add\": false,\n    \"self\": false\n  },\n  \"income\": [\n    {\n      \"catalogNum\": \"MXDFSDD\",\n      \"description\": \"Item description\",\n      \"quantity\": 1,\n      \"price\": 300,\n      \"currency\": \"ILS\",\n      \"currencyRate\": 1,\n      \"vatRate\": 0.18,\n      \"itemId\": \"8b338c95-095e-46d4-b2c6-331747508759\",\n      \"vatType\": 1\n    }\n  ],\n  \"payment\": [\n    {\n      \"date\": \"2026-05-21\",\n      \"type\": 3,\n      \"price\": 300,\n      \"currency\": \"ILS\",\n      \"currencyRate\": 1,\n      \"bankName\": \"My Bank\",\n      \"bankBranch\": \"198\",\n      \"bankAccount\": \"212435\",\n      \"chequeNum\": \"10002\",\n      \"accountId\": \"TFGFFGSYYE\",\n      \"transactionId\": \"TGBBBXNLKS75SKJS\",\n      \"appType\": 1,\n      \"subType\": 1,\n      \"cardType\": 2,\n      \"cardNum\": \"8765\",\n      \"dealType\": 1,\n      \"numPayments\": 1,\n      \"firstPayment\": 10\n    }\n  ],\n  \"linkedDocumentIds\": [\n    \"031e827a-c664-c1e4-d231-a80027271123\"\n  ],\n  \"linkedPaymentId\": \"031e827a-c664-c1e4-d231-a80027271123\",\n  \"linkType\": \"link\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://api.greeninvoice.co.il/api/v1/documents/preview', {\n  method: 'POST',\n  headers: {\n    Authorization: `Bearer ${process.env.MORNING_ACCESS_TOKEN}`,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    \"description\": \"Just an order\",\n    \"remarks\": \"Some remarks\",\n    \"footer\": \"Texts in footer\",\n    \"emailContent\": \"Email content\",\n    \"type\": 305,\n    \"date\": \"2026-05-12\",\n    \"dueDate\": \"2026-05-31\",\n    \"lang\": \"he\",\n    \"currency\": \"ILS\",\n    \"vatType\": 0,\n    \"discount\": {\n      \"amount\": 1,\n      \"type\": \"sum\"\n    },\n    \"rounding\": false,\n    \"signed\": true,\n    \"attachment\": false,\n    \"paymentRequestData\": {\n      \"plugins\": [\n        {\n          \"id\": \"031e827a-c664-c1e4-d231-a80027271123\",\n          \"group\": 100,\n          \"type\": 12100\n        }\n      ],\n      \"maxPayments\": 1\n    },\n    \"client\": {\n      \"id\": \"7944827a-c664-11e4-8231-080027271114\",\n      \"name\": \"John Doe\",\n      \"emails\": [\n        \"email1@example.com\",\n        \"email2@example.com\"\n      ],\n      \"taxId\": \"0123456789\",\n      \"address\": \"1 Luria St\",\n      \"city\": \"Tel Aviv\",\n      \"zip\": \"1234567\",\n      \"country\": \"IL\",\n      \"phone\": \"+972-54-1234567\",\n      \"fax\": \"+972-54-1234567\",\n      \"mobile\": \"+972-54-1234567\",\n      \"add\": false,\n      \"self\": false\n    },\n    \"income\": [\n      {\n        \"catalogNum\": \"MXDFSDD\",\n        \"description\": \"Item description\",\n        \"quantity\": 1,\n        \"price\": 300,\n        \"currency\": \"ILS\",\n        \"currencyRate\": 1,\n        \"vatRate\": 0.18,\n        \"itemId\": \"8b338c95-095e-46d4-b2c6-331747508759\",\n        \"vatType\": 1\n      }\n    ],\n    \"payment\": [\n      {\n        \"date\": \"2026-05-21\",\n        \"type\": 3,\n        \"price\": 300,\n        \"currency\": \"ILS\",\n        \"currencyRate\": 1,\n        \"bankName\": \"My Bank\",\n        \"bankBranch\": \"198\",\n        \"bankAccount\": \"212435\",\n        \"chequeNum\": \"10002\",\n        \"accountId\": \"TFGFFGSYYE\",\n        \"transactionId\": \"TGBBBXNLKS75SKJS\",\n        \"appType\": 1,\n        \"subType\": 1,\n        \"cardType\": 2,\n        \"cardNum\": \"8765\",\n        \"dealType\": 1,\n        \"numPayments\": 1,\n        \"firstPayment\": 10\n      }\n    ],\n    \"linkedDocumentIds\": [\n      \"031e827a-c664-c1e4-d231-a80027271123\"\n    ],\n    \"linkedPaymentId\": \"031e827a-c664-c1e4-d231-a80027271123\",\n    \"linkType\": \"link\"\n  }),\n});\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nres = requests.post(\n    \"https://api.greeninvoice.co.il/api/v1/documents/preview\",\n    headers={\"Authorization\": f\"Bearer {os.environ['MORNING_ACCESS_TOKEN']}\"},\n    json={\n        \"description\": \"Just an order\",\n        \"remarks\": \"Some remarks\",\n        \"footer\": \"Texts in footer\",\n        \"emailContent\": \"Email content\",\n        \"type\": 305,\n        \"date\": \"2026-05-12\",\n        \"dueDate\": \"2026-05-31\",\n        \"lang\": \"he\",\n        \"currency\": \"ILS\",\n        \"vatType\": 0,\n        \"discount\": {\n            \"amount\": 1,\n            \"type\": \"sum\",\n        },\n        \"rounding\": False,\n        \"signed\": True,\n        \"attachment\": False,\n        \"paymentRequestData\": {\n            \"plugins\": [\n                {\n                    \"id\": \"031e827a-c664-c1e4-d231-a80027271123\",\n                    \"group\": 100,\n                    \"type\": 12100,\n                },\n            ],\n            \"maxPayments\": 1,\n        },\n        \"client\": {\n            \"id\": \"7944827a-c664-11e4-8231-080027271114\",\n            \"name\": \"John Doe\",\n            \"emails\": [\n                \"email1@example.com\",\n                \"email2@example.com\",\n            ],\n            \"taxId\": \"0123456789\",\n            \"address\": \"1 Luria St\",\n            \"city\": \"Tel Aviv\",\n            \"zip\": \"1234567\",\n            \"country\": \"IL\",\n            \"phone\": \"+972-54-1234567\",\n            \"fax\": \"+972-54-1234567\",\n            \"mobile\": \"+972-54-1234567\",\n            \"add\": False,\n            \"self\": False,\n        },\n        \"income\": [\n            {\n                \"catalogNum\": \"MXDFSDD\",\n                \"description\": \"Item description\",\n                \"quantity\": 1,\n                \"price\": 300,\n                \"currency\": \"ILS\",\n                \"currencyRate\": 1,\n                \"vatRate\": 0.18,\n                \"itemId\": \"8b338c95-095e-46d4-b2c6-331747508759\",\n                \"vatType\": 1,\n            },\n        ],\n        \"payment\": [\n            {\n                \"date\": \"2026-05-21\",\n                \"type\": 3,\n                \"price\": 300,\n                \"currency\": \"ILS\",\n                \"currencyRate\": 1,\n                \"bankName\": \"My Bank\",\n                \"bankBranch\": \"198\",\n                \"bankAccount\": \"212435\",\n                \"chequeNum\": \"10002\",\n                \"accountId\": \"TFGFFGSYYE\",\n                \"transactionId\": \"TGBBBXNLKS75SKJS\",\n                \"appType\": 1,\n                \"subType\": 1,\n                \"cardType\": 2,\n                \"cardNum\": \"8765\",\n                \"dealType\": 1,\n                \"numPayments\": 1,\n                \"firstPayment\": 10,\n            },\n        ],\n        \"linkedDocumentIds\": [\n            \"031e827a-c664-c1e4-d231-a80027271123\",\n        ],\n        \"linkedPaymentId\": \"031e827a-c664-c1e4-d231-a80027271123\",\n        \"linkType\": \"link\",\n    },\n)\n\ndata = res.json()"
          }
        ]
      }
    },
    "/documents/info": {
      "get": {
        "tags": [
          "Documents"
        ],
        "operationId": "getDocumentInformation",
        "summary": "Get Document Information",
        "description": "Retrieve metadata about a specific document type — the next document number to assign, supported features (income rows, payment rows, self-invoicing, linked-document flows), default business settings that apply when creating documents of this type, and the payment plugins active on this business.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |\n| `Authorization` | `Bearer <accessToken>` | Yes |",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "required": true,
            "description": "Document type to retrieve information for",
            "schema": {
              "$ref": "#/components/schemas/DocumentType"
            },
            "example": 305
          }
        ],
        "responses": {
          "200": {
            "description": "Document type information retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentInfo"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl 'https://api.greeninvoice.co.il/api/v1/documents/info?type=305' \\\n  -H \"Authorization: Bearer $MORNING_ACCESS_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://api.greeninvoice.co.il/api/v1/documents/info?type=305', {\n  headers: {\n    Authorization: `Bearer ${process.env.MORNING_ACCESS_TOKEN}`,\n  },\n});\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nres = requests.get(\n    \"https://api.greeninvoice.co.il/api/v1/documents/info?type=305\",\n    headers={\"Authorization\": f\"Bearer {os.environ['MORNING_ACCESS_TOKEN']}\"},\n)\n\ndata = res.json()"
          }
        ]
      }
    },
    "/documents/templates": {
      "get": {
        "tags": [
          "Documents"
        ],
        "operationId": "getDocumentTemplates",
        "summary": "Get Document Templates",
        "description": "Retrieve information about the available document templates and their corresponding colour skins. Templates are global to the system; every business sees the same list.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |\n| `Authorization` | `Bearer <accessToken>` | Yes |",
        "responses": {
          "200": {
            "description": "List of available document templates",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Template"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl 'https://api.greeninvoice.co.il/api/v1/documents/templates' \\\n  -H \"Authorization: Bearer $MORNING_ACCESS_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://api.greeninvoice.co.il/api/v1/documents/templates', {\n  headers: {\n    Authorization: `Bearer ${process.env.MORNING_ACCESS_TOKEN}`,\n  },\n});\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nres = requests.get(\n    \"https://api.greeninvoice.co.il/api/v1/documents/templates\",\n    headers={\"Authorization\": f\"Bearer {os.environ['MORNING_ACCESS_TOKEN']}\"},\n)\n\ndata = res.json()"
          }
        ]
      }
    },
    "/documents/types": {
      "get": {
        "tags": [
          "Documents"
        ],
        "operationId": "getDocumentTypes",
        "summary": "Get Document Types",
        "description": "Retrieve the available document types as a list of `{ id, name }` pairs. Names are localised by the `lang` query parameter.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |\n| `Authorization` | `Bearer <accessToken>` | Yes |",
        "parameters": [
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "description": "Content language for the localised `name` field. Defaults to `he` (Hebrew) if omitted or unsupported.",
            "schema": {
              "$ref": "#/components/schemas/Lang"
            },
            "example": "he"
          }
        ],
        "responses": {
          "200": {
            "description": "List of available document types with localised names",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DocumentTypeMapItem"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl 'https://api.greeninvoice.co.il/api/v1/documents/types' \\\n  -H \"Authorization: Bearer $MORNING_ACCESS_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://api.greeninvoice.co.il/api/v1/documents/types', {\n  headers: {\n    Authorization: `Bearer ${process.env.MORNING_ACCESS_TOKEN}`,\n  },\n});\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nres = requests.get(\n    \"https://api.greeninvoice.co.il/api/v1/documents/types\",\n    headers={\"Authorization\": f\"Bearer {os.environ['MORNING_ACCESS_TOKEN']}\"},\n)\n\ndata = res.json()"
          }
        ]
      }
    },
    "/documents/statuses": {
      "get": {
        "tags": [
          "Documents"
        ],
        "operationId": "getDocumentStatuses",
        "summary": "Get Document Statuses",
        "description": "Retrieve the available document statuses as a list of `{ id, name }` pairs. Names are localised by the `lang` query parameter.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |\n| `Authorization` | `Bearer <accessToken>` | Yes |",
        "parameters": [
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "description": "Content language for the localised `name` field. Defaults to `he` (Hebrew) if omitted or unsupported.",
            "schema": {
              "$ref": "#/components/schemas/Lang"
            },
            "example": "he"
          }
        ],
        "responses": {
          "200": {
            "description": "List of available document statuses with localised names",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DocumentStatusMapItem"
                  }
                },
                "example": [
                  {
                    "id": 0,
                    "name": "מסמך פתוח"
                  },
                  {
                    "id": 1,
                    "name": "מסמך סגור"
                  },
                  {
                    "id": 2,
                    "name": "מסמך סומן ידנית כסגור"
                  },
                  {
                    "id": 3,
                    "name": "מסמך מבטל"
                  },
                  {
                    "id": 4,
                    "name": "מסמך שבוטל"
                  }
                ]
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl 'https://api.greeninvoice.co.il/api/v1/documents/statuses' \\\n  -H \"Authorization: Bearer $MORNING_ACCESS_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://api.greeninvoice.co.il/api/v1/documents/statuses', {\n  headers: {\n    Authorization: `Bearer ${process.env.MORNING_ACCESS_TOKEN}`,\n  },\n});\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nres = requests.get(\n    \"https://api.greeninvoice.co.il/api/v1/documents/statuses\",\n    headers={\"Authorization\": f\"Bearer {os.environ['MORNING_ACCESS_TOKEN']}\"},\n)\n\ndata = res.json()"
          }
        ]
      }
    },
    "/documents/{id}": {
      "get": {
        "tags": [
          "Documents"
        ],
        "operationId": "getDocument",
        "summary": "Get Document",
        "description": "Retrieve a single document by its ID.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |\n| `Authorization` | `Bearer <accessToken>` | Yes |",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Document ID",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "57ae2ff9-0c24-43e8-b39c-a5bdcc05573d"
          }
        ],
        "responses": {
          "200": {
            "description": "Document retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Document"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl 'https://api.greeninvoice.co.il/api/v1/documents/57ae2ff9-0c24-43e8-b39c-a5bdcc05573d' \\\n  -H \"Authorization: Bearer $MORNING_ACCESS_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://api.greeninvoice.co.il/api/v1/documents/57ae2ff9-0c24-43e8-b39c-a5bdcc05573d', {\n  headers: {\n    Authorization: `Bearer ${process.env.MORNING_ACCESS_TOKEN}`,\n  },\n});\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nres = requests.get(\n    \"https://api.greeninvoice.co.il/api/v1/documents/57ae2ff9-0c24-43e8-b39c-a5bdcc05573d\",\n    headers={\"Authorization\": f\"Bearer {os.environ['MORNING_ACCESS_TOKEN']}\"},\n)\n\ndata = res.json()"
          }
        ]
      }
    },
    "/documents/{id}/linked": {
      "get": {
        "tags": [
          "Documents"
        ],
        "operationId": "getLinkedDocuments",
        "summary": "Get Linked Documents",
        "description": "Get information about linked / related documents to a specific document.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |\n| `Authorization` | `Bearer <accessToken>` | Yes |",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Document ID",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "57ae2ff9-0c24-43e8-b39c-a5bdcc05573d"
          }
        ],
        "responses": {
          "200": {
            "description": "Linked documents retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LinkedDocument"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl 'https://api.greeninvoice.co.il/api/v1/documents/57ae2ff9-0c24-43e8-b39c-a5bdcc05573d/linked' \\\n  -H \"Authorization: Bearer $MORNING_ACCESS_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://api.greeninvoice.co.il/api/v1/documents/57ae2ff9-0c24-43e8-b39c-a5bdcc05573d/linked', {\n  headers: {\n    Authorization: `Bearer ${process.env.MORNING_ACCESS_TOKEN}`,\n  },\n});\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nres = requests.get(\n    \"https://api.greeninvoice.co.il/api/v1/documents/57ae2ff9-0c24-43e8-b39c-a5bdcc05573d/linked\",\n    headers={\"Authorization\": f\"Bearer {os.environ['MORNING_ACCESS_TOKEN']}\"},\n)\n\ndata = res.json()"
          }
        ]
      }
    },
    "/documents/{id}/download/links": {
      "get": {
        "tags": [
          "Documents"
        ],
        "operationId": "getDocumentDownloadLinks",
        "summary": "Get Document Download Links",
        "description": "Retrieve download links for a given document. The response includes the original copy plus any localised copies; the `en` link is returned only when an English copy exists.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |\n| `Authorization` | `Bearer <accessToken>` | Yes |",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Document ID",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "57ae2ff9-0c24-43e8-b39c-a5bdcc05573d"
          }
        ],
        "responses": {
          "200": {
            "description": "Download links retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDownloadLinks"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl 'https://api.greeninvoice.co.il/api/v1/documents/57ae2ff9-0c24-43e8-b39c-a5bdcc05573d/download/links' \\\n  -H \"Authorization: Bearer $MORNING_ACCESS_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://api.greeninvoice.co.il/api/v1/documents/57ae2ff9-0c24-43e8-b39c-a5bdcc05573d/download/links', {\n  headers: {\n    Authorization: `Bearer ${process.env.MORNING_ACCESS_TOKEN}`,\n  },\n});\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nres = requests.get(\n    \"https://api.greeninvoice.co.il/api/v1/documents/57ae2ff9-0c24-43e8-b39c-a5bdcc05573d/download/links\",\n    headers={\"Authorization\": f\"Bearer {os.environ['MORNING_ACCESS_TOKEN']}\"},\n)\n\ndata = res.json()"
          }
        ]
      }
    },
    "/documents/{id}/close": {
      "post": {
        "tags": [
          "Documents"
        ],
        "operationId": "closeDocument",
        "summary": "Close Document",
        "description": "Manually close a document. The status will be set to `Manually closed`.\n\n**Note:** Only documents currently in `Open` status can be closed via this endpoint. Attempting to close a document in any other status will return a validation error.\n\nThe response is the updated document.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |\n| `Authorization` | `Bearer <accessToken>` | Yes |",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Document ID",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "57ae2ff9-0c24-43e8-b39c-a5bdcc05573d"
          }
        ],
        "responses": {
          "200": {
            "description": "Document closed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdatedDocument"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST 'https://api.greeninvoice.co.il/api/v1/documents/57ae2ff9-0c24-43e8-b39c-a5bdcc05573d/close' \\\n  -H \"Authorization: Bearer $MORNING_ACCESS_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://api.greeninvoice.co.il/api/v1/documents/57ae2ff9-0c24-43e8-b39c-a5bdcc05573d/close', {\n  method: 'POST',\n  headers: {\n    Authorization: `Bearer ${process.env.MORNING_ACCESS_TOKEN}`,\n  },\n});\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nres = requests.post(\n    \"https://api.greeninvoice.co.il/api/v1/documents/57ae2ff9-0c24-43e8-b39c-a5bdcc05573d/close\",\n    headers={\"Authorization\": f\"Bearer {os.environ['MORNING_ACCESS_TOKEN']}\"},\n)\n\ndata = res.json()"
          }
        ]
      }
    },
    "/documents/{id}/open": {
      "post": {
        "tags": [
          "Documents"
        ],
        "operationId": "openDocument",
        "summary": "Open Document",
        "description": "Re-open a document that was previously manually closed. The status will be set to `Open`.\n\n**Note:** Only documents currently in `Manually closed` status can be re-opened via this endpoint. Documents in `Closed` status (closed automatically by the system) or any other status cannot be re-opened and will return a validation error.\n\nThe response is the updated document.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |\n| `Authorization` | `Bearer <accessToken>` | Yes |",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Document ID",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "57ae2ff9-0c24-43e8-b39c-a5bdcc05573d"
          }
        ],
        "responses": {
          "200": {
            "description": "Document re-opened successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdatedDocument"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST 'https://api.greeninvoice.co.il/api/v1/documents/57ae2ff9-0c24-43e8-b39c-a5bdcc05573d/open' \\\n  -H \"Authorization: Bearer $MORNING_ACCESS_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://api.greeninvoice.co.il/api/v1/documents/57ae2ff9-0c24-43e8-b39c-a5bdcc05573d/open', {\n  method: 'POST',\n  headers: {\n    Authorization: `Bearer ${process.env.MORNING_ACCESS_TOKEN}`,\n  },\n});\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nres = requests.post(\n    \"https://api.greeninvoice.co.il/api/v1/documents/57ae2ff9-0c24-43e8-b39c-a5bdcc05573d/open\",\n    headers={\"Authorization\": f\"Bearer {os.environ['MORNING_ACCESS_TOKEN']}\"},\n)\n\ndata = res.json()"
          }
        ]
      }
    },
    "/items": {
      "post": {
        "tags": [
          "Items"
        ],
        "operationId": "addItem",
        "summary": "Add Item",
        "description": "Create a new catalog item for the current business.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |\n| `Authorization` | `Bearer <accessToken>` | Yes |",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ItemRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Item created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Item"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST 'https://api.greeninvoice.co.il/api/v1/items' \\\n  -H \"Authorization: Bearer $MORNING_ACCESS_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"name\": \"גבינייה מפוארת\",\n  \"description\": \"מאפה גבינייה אישי ומפואר\",\n  \"price\": 5,\n  \"currency\": \"ILS\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://api.greeninvoice.co.il/api/v1/items', {\n  method: 'POST',\n  headers: {\n    Authorization: `Bearer ${process.env.MORNING_ACCESS_TOKEN}`,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    \"name\": \"גבינייה מפוארת\",\n    \"description\": \"מאפה גבינייה אישי ומפואר\",\n    \"price\": 5,\n    \"currency\": \"ILS\"\n  }),\n});\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nres = requests.post(\n    \"https://api.greeninvoice.co.il/api/v1/items\",\n    headers={\"Authorization\": f\"Bearer {os.environ['MORNING_ACCESS_TOKEN']}\"},\n    json={\n        \"name\": \"גבינייה מפוארת\",\n        \"description\": \"מאפה גבינייה אישי ומפואר\",\n        \"price\": 5,\n        \"currency\": \"ILS\",\n    },\n)\n\ndata = res.json()"
          }
        ]
      }
    },
    "/items/{id}": {
      "get": {
        "tags": [
          "Items"
        ],
        "operationId": "getItem",
        "summary": "Get Item",
        "description": "Retrieve a single item by its ID.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |\n| `Authorization` | `Bearer <accessToken>` | Yes |",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Item ID",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "ff27e4fe-29d9-4f6f-b6a0-f43cdf635702"
          }
        ],
        "responses": {
          "200": {
            "description": "Item retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Item"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl 'https://api.greeninvoice.co.il/api/v1/items/ff27e4fe-29d9-4f6f-b6a0-f43cdf635702' \\\n  -H \"Authorization: Bearer $MORNING_ACCESS_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://api.greeninvoice.co.il/api/v1/items/ff27e4fe-29d9-4f6f-b6a0-f43cdf635702', {\n  headers: {\n    Authorization: `Bearer ${process.env.MORNING_ACCESS_TOKEN}`,\n  },\n});\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nres = requests.get(\n    \"https://api.greeninvoice.co.il/api/v1/items/ff27e4fe-29d9-4f6f-b6a0-f43cdf635702\",\n    headers={\"Authorization\": f\"Bearer {os.environ['MORNING_ACCESS_TOKEN']}\"},\n)\n\ndata = res.json()"
          }
        ]
      },
      "put": {
        "tags": [
          "Items"
        ],
        "operationId": "updateItem",
        "summary": "Update Item",
        "description": "Update an existing item by its ID. This is a partial update: include only the fields you want to change — any field you omit keeps its current value.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |\n| `Authorization` | `Bearer <accessToken>` | Yes |",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Item ID",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "ff27e4fe-29d9-4f6f-b6a0-f43cdf635702"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateItemRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Item updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Item"
                },
                "example": {
                  "id": "ff27e4fe-29d9-4f6f-b6a0-f43cdf635702",
                  "name": "גבינייה מפוארת",
                  "description": "מאפה גבינה ודובדני אמרנה אישי ומפואר",
                  "price": 4,
                  "currency": "ILS",
                  "creationDate": 1780836793,
                  "lastUpdateDate": 1780839374
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X PUT 'https://api.greeninvoice.co.il/api/v1/items/ff27e4fe-29d9-4f6f-b6a0-f43cdf635702' \\\n  -H \"Authorization: Bearer $MORNING_ACCESS_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"name\": \"גבינייה מפוארת\",\n  \"description\": \"מאפה גבינה ודובדני אמרנה אישי ומפואר\",\n  \"price\": 4,\n  \"currency\": \"ILS\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://api.greeninvoice.co.il/api/v1/items/ff27e4fe-29d9-4f6f-b6a0-f43cdf635702', {\n  method: 'PUT',\n  headers: {\n    Authorization: `Bearer ${process.env.MORNING_ACCESS_TOKEN}`,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    \"name\": \"גבינייה מפוארת\",\n    \"description\": \"מאפה גבינה ודובדני אמרנה אישי ומפואר\",\n    \"price\": 4,\n    \"currency\": \"ILS\"\n  }),\n});\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nres = requests.put(\n    \"https://api.greeninvoice.co.il/api/v1/items/ff27e4fe-29d9-4f6f-b6a0-f43cdf635702\",\n    headers={\"Authorization\": f\"Bearer {os.environ['MORNING_ACCESS_TOKEN']}\"},\n    json={\n        \"name\": \"גבינייה מפוארת\",\n        \"description\": \"מאפה גבינה ודובדני אמרנה אישי ומפואר\",\n        \"price\": 4,\n        \"currency\": \"ILS\",\n    },\n)\n\ndata = res.json()"
          }
        ]
      },
      "delete": {
        "tags": [
          "Items"
        ],
        "operationId": "deleteItem",
        "summary": "Delete Item",
        "description": "Delete an item by its ID. The response body is an empty object.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |\n| `Authorization` | `Bearer <accessToken>` | Yes |",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Item ID",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "ff27e4fe-29d9-4f6f-b6a0-f43cdf635702"
          }
        ],
        "responses": {
          "200": {
            "description": "Item deleted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {}
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X DELETE 'https://api.greeninvoice.co.il/api/v1/items/ff27e4fe-29d9-4f6f-b6a0-f43cdf635702' \\\n  -H \"Authorization: Bearer $MORNING_ACCESS_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://api.greeninvoice.co.il/api/v1/items/ff27e4fe-29d9-4f6f-b6a0-f43cdf635702', {\n  method: 'DELETE',\n  headers: {\n    Authorization: `Bearer ${process.env.MORNING_ACCESS_TOKEN}`,\n  },\n});\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nres = requests.delete(\n    \"https://api.greeninvoice.co.il/api/v1/items/ff27e4fe-29d9-4f6f-b6a0-f43cdf635702\",\n    headers={\"Authorization\": f\"Bearer {os.environ['MORNING_ACCESS_TOKEN']}\"},\n)\n\ndata = res.json()"
          }
        ]
      }
    },
    "/items/search": {
      "post": {
        "tags": [
          "Items"
        ],
        "operationId": "searchItems",
        "summary": "Search Items",
        "description": "Search the catalog items of the current business using any combination of the filters in the request body. All filters are optional; omitting the body returns the most recent items. Results are paginated.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |\n| `Authorization` | `Bearer <accessToken>` | Yes |",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchItemsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Paginated list of items matching the search",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchItemsResponse"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST 'https://api.greeninvoice.co.il/api/v1/items/search' \\\n  -H \"Authorization: Bearer $MORNING_ACCESS_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"page\": 1,\n  \"pageSize\": 25,\n  \"name\": \"גבינייה מפוארת\",\n  \"description\": \"מאפה גבינה\",\n  \"currency\": \"ILS\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://api.greeninvoice.co.il/api/v1/items/search', {\n  method: 'POST',\n  headers: {\n    Authorization: `Bearer ${process.env.MORNING_ACCESS_TOKEN}`,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    \"page\": 1,\n    \"pageSize\": 25,\n    \"name\": \"גבינייה מפוארת\",\n    \"description\": \"מאפה גבינה\",\n    \"currency\": \"ILS\"\n  }),\n});\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nres = requests.post(\n    \"https://api.greeninvoice.co.il/api/v1/items/search\",\n    headers={\"Authorization\": f\"Bearer {os.environ['MORNING_ACCESS_TOKEN']}\"},\n    json={\n        \"page\": 1,\n        \"pageSize\": 25,\n        \"name\": \"גבינייה מפוארת\",\n        \"description\": \"מאפה גבינה\",\n        \"currency\": \"ILS\",\n    },\n)\n\ndata = res.json()"
          }
        ]
      }
    },
    "/clients": {
      "post": {
        "tags": [
          "Clients"
        ],
        "operationId": "addClient",
        "summary": "Add Client",
        "description": "Create a new client for the current business.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |\n| `Authorization` | `Bearer <accessToken>` | Yes |",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Client created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Client"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST 'https://api.greeninvoice.co.il/api/v1/clients' \\\n  -H \"Authorization: Bearer $MORNING_ACCESS_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"name\": \"יעקב יעקבי\",\n  \"active\": true,\n  \"send\": true,\n  \"department\": \"מחלקת כספים\",\n  \"taxId\": \"999152580\",\n  \"accountingKey\": \"b6230777\",\n  \"paymentTerms\": 0,\n  \"bankName\": \"12\",\n  \"bankBranch\": \"450\",\n  \"bankAccount\": \"1111\",\n  \"address\": \"הרצל 5\",\n  \"city\": \"תל אביב\",\n  \"zip\": \"5555\",\n  \"country\": \"IL\",\n  \"category\": 4,\n  \"subCategory\": 406,\n  \"phone\": \"0505555555\",\n  \"fax\": \"033333333\",\n  \"mobile\": \"033333333\",\n  \"remarks\": \"לקוח קבוע\",\n  \"contactPerson\": \"יעקב\",\n  \"emails\": [\n    \"test@test-yakov.com\"\n  ],\n  \"labels\": [\n    \"3777a6ef-fac3-4b2e-a296-238d5dcd6450\"\n  ],\n  \"balance\": 0\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://api.greeninvoice.co.il/api/v1/clients', {\n  method: 'POST',\n  headers: {\n    Authorization: `Bearer ${process.env.MORNING_ACCESS_TOKEN}`,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    \"name\": \"יעקב יעקבי\",\n    \"active\": true,\n    \"send\": true,\n    \"department\": \"מחלקת כספים\",\n    \"taxId\": \"999152580\",\n    \"accountingKey\": \"b6230777\",\n    \"paymentTerms\": 0,\n    \"bankName\": \"12\",\n    \"bankBranch\": \"450\",\n    \"bankAccount\": \"1111\",\n    \"address\": \"הרצל 5\",\n    \"city\": \"תל אביב\",\n    \"zip\": \"5555\",\n    \"country\": \"IL\",\n    \"category\": 4,\n    \"subCategory\": 406,\n    \"phone\": \"0505555555\",\n    \"fax\": \"033333333\",\n    \"mobile\": \"033333333\",\n    \"remarks\": \"לקוח קבוע\",\n    \"contactPerson\": \"יעקב\",\n    \"emails\": [\n      \"test@test-yakov.com\"\n    ],\n    \"labels\": [\n      \"3777a6ef-fac3-4b2e-a296-238d5dcd6450\"\n    ],\n    \"balance\": 0\n  }),\n});\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nres = requests.post(\n    \"https://api.greeninvoice.co.il/api/v1/clients\",\n    headers={\"Authorization\": f\"Bearer {os.environ['MORNING_ACCESS_TOKEN']}\"},\n    json={\n        \"name\": \"יעקב יעקבי\",\n        \"active\": True,\n        \"send\": True,\n        \"department\": \"מחלקת כספים\",\n        \"taxId\": \"999152580\",\n        \"accountingKey\": \"b6230777\",\n        \"paymentTerms\": 0,\n        \"bankName\": \"12\",\n        \"bankBranch\": \"450\",\n        \"bankAccount\": \"1111\",\n        \"address\": \"הרצל 5\",\n        \"city\": \"תל אביב\",\n        \"zip\": \"5555\",\n        \"country\": \"IL\",\n        \"category\": 4,\n        \"subCategory\": 406,\n        \"phone\": \"0505555555\",\n        \"fax\": \"033333333\",\n        \"mobile\": \"033333333\",\n        \"remarks\": \"לקוח קבוע\",\n        \"contactPerson\": \"יעקב\",\n        \"emails\": [\n            \"test@test-yakov.com\",\n        ],\n        \"labels\": [\n            \"3777a6ef-fac3-4b2e-a296-238d5dcd6450\",\n        ],\n        \"balance\": 0,\n    },\n)\n\ndata = res.json()"
          }
        ]
      }
    },
    "/clients/{id}": {
      "get": {
        "tags": [
          "Clients"
        ],
        "operationId": "getClient",
        "summary": "Get Client",
        "description": "Retrieve a single client by its ID.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |\n| `Authorization` | `Bearer <accessToken>` | Yes |",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Client ID",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "42aa171f-d031-4f3f-bec4-ff60c04eeafc"
          }
        ],
        "responses": {
          "200": {
            "description": "Client retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Client"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl 'https://api.greeninvoice.co.il/api/v1/clients/42aa171f-d031-4f3f-bec4-ff60c04eeafc' \\\n  -H \"Authorization: Bearer $MORNING_ACCESS_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://api.greeninvoice.co.il/api/v1/clients/42aa171f-d031-4f3f-bec4-ff60c04eeafc', {\n  headers: {\n    Authorization: `Bearer ${process.env.MORNING_ACCESS_TOKEN}`,\n  },\n});\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nres = requests.get(\n    \"https://api.greeninvoice.co.il/api/v1/clients/42aa171f-d031-4f3f-bec4-ff60c04eeafc\",\n    headers={\"Authorization\": f\"Bearer {os.environ['MORNING_ACCESS_TOKEN']}\"},\n)\n\ndata = res.json()"
          }
        ]
      },
      "put": {
        "tags": [
          "Clients"
        ],
        "operationId": "updateClient",
        "summary": "Update Client",
        "description": "Update an existing client by its ID. Only the fields you send are applied.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |\n| `Authorization` | `Bearer <accessToken>` | Yes |",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Client ID",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "42aa171f-d031-4f3f-bec4-ff60c04eeafc"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateClientRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Client updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Client"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X PUT 'https://api.greeninvoice.co.il/api/v1/clients/42aa171f-d031-4f3f-bec4-ff60c04eeafc' \\\n  -H \"Authorization: Bearer $MORNING_ACCESS_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"name\": \"יעקב יעקבי\",\n  \"active\": true,\n  \"send\": true,\n  \"department\": \"מחלקת כספים\",\n  \"taxId\": \"999152580\",\n  \"accountingKey\": \"b6230777\",\n  \"paymentTerms\": 0,\n  \"bankName\": \"12\",\n  \"bankBranch\": \"450\",\n  \"bankAccount\": \"1111\",\n  \"address\": \"הרצל 5\",\n  \"city\": \"ראשון לציון\",\n  \"zip\": \"4444\",\n  \"country\": \"IL\",\n  \"category\": 4,\n  \"subCategory\": 406,\n  \"phone\": \"0505555555\",\n  \"fax\": \"033333333\",\n  \"mobile\": \"033333333\",\n  \"remarks\": \"לקוח קבוע\",\n  \"contactPerson\": \"יעקב\",\n  \"emails\": [\n    \"test@test-yakov.com\"\n  ],\n  \"labels\": [\n    \"3777a6ef-fac3-4b2e-a296-238d5dcd6450\"\n  ]\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://api.greeninvoice.co.il/api/v1/clients/42aa171f-d031-4f3f-bec4-ff60c04eeafc', {\n  method: 'PUT',\n  headers: {\n    Authorization: `Bearer ${process.env.MORNING_ACCESS_TOKEN}`,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    \"name\": \"יעקב יעקבי\",\n    \"active\": true,\n    \"send\": true,\n    \"department\": \"מחלקת כספים\",\n    \"taxId\": \"999152580\",\n    \"accountingKey\": \"b6230777\",\n    \"paymentTerms\": 0,\n    \"bankName\": \"12\",\n    \"bankBranch\": \"450\",\n    \"bankAccount\": \"1111\",\n    \"address\": \"הרצל 5\",\n    \"city\": \"ראשון לציון\",\n    \"zip\": \"4444\",\n    \"country\": \"IL\",\n    \"category\": 4,\n    \"subCategory\": 406,\n    \"phone\": \"0505555555\",\n    \"fax\": \"033333333\",\n    \"mobile\": \"033333333\",\n    \"remarks\": \"לקוח קבוע\",\n    \"contactPerson\": \"יעקב\",\n    \"emails\": [\n      \"test@test-yakov.com\"\n    ],\n    \"labels\": [\n      \"3777a6ef-fac3-4b2e-a296-238d5dcd6450\"\n    ]\n  }),\n});\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nres = requests.put(\n    \"https://api.greeninvoice.co.il/api/v1/clients/42aa171f-d031-4f3f-bec4-ff60c04eeafc\",\n    headers={\"Authorization\": f\"Bearer {os.environ['MORNING_ACCESS_TOKEN']}\"},\n    json={\n        \"name\": \"יעקב יעקבי\",\n        \"active\": True,\n        \"send\": True,\n        \"department\": \"מחלקת כספים\",\n        \"taxId\": \"999152580\",\n        \"accountingKey\": \"b6230777\",\n        \"paymentTerms\": 0,\n        \"bankName\": \"12\",\n        \"bankBranch\": \"450\",\n        \"bankAccount\": \"1111\",\n        \"address\": \"הרצל 5\",\n        \"city\": \"ראשון לציון\",\n        \"zip\": \"4444\",\n        \"country\": \"IL\",\n        \"category\": 4,\n        \"subCategory\": 406,\n        \"phone\": \"0505555555\",\n        \"fax\": \"033333333\",\n        \"mobile\": \"033333333\",\n        \"remarks\": \"לקוח קבוע\",\n        \"contactPerson\": \"יעקב\",\n        \"emails\": [\n            \"test@test-yakov.com\",\n        ],\n        \"labels\": [\n            \"3777a6ef-fac3-4b2e-a296-238d5dcd6450\",\n        ],\n    },\n)\n\ndata = res.json()"
          }
        ]
      },
      "delete": {
        "tags": [
          "Clients"
        ],
        "operationId": "deleteClient",
        "summary": "Delete Client",
        "description": "Delete a client by its ID. A client can be deleted only when it is inactive and has no associated documents, no active payment tokens, and no recurring charges. The response body is empty.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |\n| `Authorization` | `Bearer <accessToken>` | Yes |",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Client ID",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "42aa171f-d031-4f3f-bec4-ff60c04eeafc"
          }
        ],
        "responses": {
          "200": {
            "description": "Client deleted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {}
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X DELETE 'https://api.greeninvoice.co.il/api/v1/clients/42aa171f-d031-4f3f-bec4-ff60c04eeafc' \\\n  -H \"Authorization: Bearer $MORNING_ACCESS_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://api.greeninvoice.co.il/api/v1/clients/42aa171f-d031-4f3f-bec4-ff60c04eeafc', {\n  method: 'DELETE',\n  headers: {\n    Authorization: `Bearer ${process.env.MORNING_ACCESS_TOKEN}`,\n  },\n});\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nres = requests.delete(\n    \"https://api.greeninvoice.co.il/api/v1/clients/42aa171f-d031-4f3f-bec4-ff60c04eeafc\",\n    headers={\"Authorization\": f\"Bearer {os.environ['MORNING_ACCESS_TOKEN']}\"},\n)\n\ndata = res.json()"
          }
        ]
      }
    },
    "/clients/search": {
      "post": {
        "tags": [
          "Clients"
        ],
        "operationId": "searchClients",
        "summary": "Search Clients",
        "description": "Search the current business's clients with optional filters. Results are paginated.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |\n| `Authorization` | `Bearer <accessToken>` | Yes |",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchClientsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Paginated list of clients matching the search",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchClientsResponse"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST 'https://api.greeninvoice.co.il/api/v1/clients/search' \\\n  -H \"Authorization: Bearer $MORNING_ACCESS_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"name\": \"יעקב\",\n  \"active\": true,\n  \"email\": \"test@test-yakov.com\",\n  \"contactPerson\": \"יעקב\",\n  \"labels\": [\n    \"3777a6ef-fac3-4b2e-a296-238d5dcd6450\"\n  ],\n  \"page\": 1,\n  \"pageSize\": 25\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://api.greeninvoice.co.il/api/v1/clients/search', {\n  method: 'POST',\n  headers: {\n    Authorization: `Bearer ${process.env.MORNING_ACCESS_TOKEN}`,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    \"name\": \"יעקב\",\n    \"active\": true,\n    \"email\": \"test@test-yakov.com\",\n    \"contactPerson\": \"יעקב\",\n    \"labels\": [\n      \"3777a6ef-fac3-4b2e-a296-238d5dcd6450\"\n    ],\n    \"page\": 1,\n    \"pageSize\": 25\n  }),\n});\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nres = requests.post(\n    \"https://api.greeninvoice.co.il/api/v1/clients/search\",\n    headers={\"Authorization\": f\"Bearer {os.environ['MORNING_ACCESS_TOKEN']}\"},\n    json={\n        \"name\": \"יעקב\",\n        \"active\": True,\n        \"email\": \"test@test-yakov.com\",\n        \"contactPerson\": \"יעקב\",\n        \"labels\": [\n            \"3777a6ef-fac3-4b2e-a296-238d5dcd6450\",\n        ],\n        \"page\": 1,\n        \"pageSize\": 25,\n    },\n)\n\ndata = res.json()"
          }
        ]
      }
    },
    "/clients/{id}/assoc": {
      "post": {
        "tags": [
          "Clients"
        ],
        "operationId": "associateClientDocuments",
        "summary": "Associate Documents to a Client",
        "description": "Associate one or more existing documents with a client. Used when a document was issued to a one-time client and needs to be associated with an existing client record.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |\n| `Authorization` | `Bearer <accessToken>` | Yes |",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Client ID",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "b0077e19-977b-4389-a2e1-f84fa0527d23"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssociateDocumentsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Documents associated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {}
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST 'https://api.greeninvoice.co.il/api/v1/clients/b0077e19-977b-4389-a2e1-f84fa0527d23/assoc' \\\n  -H \"Authorization: Bearer $MORNING_ACCESS_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"id\": \"b0077e19-977b-4389-a2e1-f84fa0527d23\",\n  \"ids\": [\n    \"85d1f759-88bb-4617-b4ae-d138582370b8\"\n  ]\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://api.greeninvoice.co.il/api/v1/clients/b0077e19-977b-4389-a2e1-f84fa0527d23/assoc', {\n  method: 'POST',\n  headers: {\n    Authorization: `Bearer ${process.env.MORNING_ACCESS_TOKEN}`,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    \"id\": \"b0077e19-977b-4389-a2e1-f84fa0527d23\",\n    \"ids\": [\n      \"85d1f759-88bb-4617-b4ae-d138582370b8\"\n    ]\n  }),\n});\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nres = requests.post(\n    \"https://api.greeninvoice.co.il/api/v1/clients/b0077e19-977b-4389-a2e1-f84fa0527d23/assoc\",\n    headers={\"Authorization\": f\"Bearer {os.environ['MORNING_ACCESS_TOKEN']}\"},\n    json={\n        \"id\": \"b0077e19-977b-4389-a2e1-f84fa0527d23\",\n        \"ids\": [\n            \"85d1f759-88bb-4617-b4ae-d138582370b8\",\n        ],\n    },\n)\n\ndata = res.json()"
          }
        ]
      }
    },
    "/clients/{id}/balance": {
      "post": {
        "tags": [
          "Clients"
        ],
        "operationId": "updateClientBalance",
        "summary": "Update Client Balance",
        "description": "Update a client's balance. Recalculates the client's payment amount so that the balance equals the requested value; send `0` to reset it to zero. The response body is empty.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |\n| `Authorization` | `Bearer <accessToken>` | Yes |",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Client ID",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "42aa171f-d031-4f3f-bec4-ff60c04eeafc"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateClientBalanceRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Client balance updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {}
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST 'https://api.greeninvoice.co.il/api/v1/clients/42aa171f-d031-4f3f-bec4-ff60c04eeafc/balance' \\\n  -H \"Authorization: Bearer $MORNING_ACCESS_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"balance\": 30\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://api.greeninvoice.co.il/api/v1/clients/42aa171f-d031-4f3f-bec4-ff60c04eeafc/balance', {\n  method: 'POST',\n  headers: {\n    Authorization: `Bearer ${process.env.MORNING_ACCESS_TOKEN}`,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    \"balance\": 30\n  }),\n});\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nres = requests.post(\n    \"https://api.greeninvoice.co.il/api/v1/clients/42aa171f-d031-4f3f-bec4-ff60c04eeafc/balance\",\n    headers={\"Authorization\": f\"Bearer {os.environ['MORNING_ACCESS_TOKEN']}\"},\n    json={\n        \"balance\": 30,\n    },\n)\n\ndata = res.json()"
          }
        ]
      }
    },
    "/clients/{id}/merge": {
      "post": {
        "tags": [
          "Clients"
        ],
        "operationId": "mergeClients",
        "summary": "Merge Clients",
        "description": "Merge one client into another. The inactive client identified by `mergeId` (in the body) is merged into the active client identified by `id` (in the path): the inactive client's documents and balance are transferred to the active client, and the inactive client is then deleted. One of the two clients must be inactive. The response body is empty.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |\n| `Authorization` | `Bearer <accessToken>` | Yes |",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the active client to merge into (the surviving client).",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "42aa171f-d031-4f3f-bec4-ff60c04eeafc"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MergeClientRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Clients merged successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {}
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST 'https://api.greeninvoice.co.il/api/v1/clients/42aa171f-d031-4f3f-bec4-ff60c04eeafc/merge' \\\n  -H \"Authorization: Bearer $MORNING_ACCESS_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"mergeId\": \"ba76e441-9266-40e5-9857-f0ca646f6bc1\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://api.greeninvoice.co.il/api/v1/clients/42aa171f-d031-4f3f-bec4-ff60c04eeafc/merge', {\n  method: 'POST',\n  headers: {\n    Authorization: `Bearer ${process.env.MORNING_ACCESS_TOKEN}`,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    \"mergeId\": \"ba76e441-9266-40e5-9857-f0ca646f6bc1\"\n  }),\n});\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nres = requests.post(\n    \"https://api.greeninvoice.co.il/api/v1/clients/42aa171f-d031-4f3f-bec4-ff60c04eeafc/merge\",\n    headers={\"Authorization\": f\"Bearer {os.environ['MORNING_ACCESS_TOKEN']}\"},\n    json={\n        \"mergeId\": \"ba76e441-9266-40e5-9857-f0ca646f6bc1\",\n    },\n)\n\ndata = res.json()"
          }
        ]
      }
    },
    "/payments/form": {
      "post": {
        "tags": [
          "Payments"
        ],
        "operationId": "getPaymentForm",
        "summary": "Get Payment Form",
        "description": "Create a payment request and return a payment form URL you can present to the customer — as an iframe or a redirect — to collect a payment. Once the customer pays, the configured document is created automatically.\n\nThe `group` field is required only when using the Digital Payments (Grow) plugin. If no `pluginId` is provided, the business's default payment plugin is used.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |\n| `Authorization` | `Bearer <accessToken>` | Yes |",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentFormRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Payment form URL created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentFormResponse"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST 'https://api.greeninvoice.co.il/api/v1/payments/form' \\\n  -H \"Authorization: Bearer $MORNING_ACCESS_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"description\": \"Payment for order #1024\",\n  \"type\": 320,\n  \"amount\": 20,\n  \"currency\": \"ILS\",\n  \"vatType\": 0,\n  \"lang\": \"he\",\n  \"maxPayments\": 1,\n  \"pluginId\": \"7944827a-c664-11e4-8231-080027271115\",\n  \"group\": 100,\n  \"client\": {\n    \"id\": \"7944827a-c664-11e4-8231-080027271114\",\n    \"name\": \"John Doe\",\n    \"emails\": [\n      \"email1@example.com\",\n      \"email2@example.com\"\n    ],\n    \"taxId\": \"0123456789\",\n    \"address\": \"1 Luria St\",\n    \"city\": \"Tel Aviv\",\n    \"zip\": \"1234567\",\n    \"country\": \"IL\",\n    \"phone\": \"+972-54-1234567\",\n    \"fax\": \"+972-54-1234567\",\n    \"mobile\": \"+972-54-1234567\",\n    \"add\": false\n  },\n  \"income\": [\n    {\n      \"catalogNum\": \"MXDFSDD\",\n      \"description\": \"Item description\",\n      \"quantity\": 1,\n      \"price\": 20,\n      \"currency\": \"ILS\",\n      \"vatType\": 1\n    }\n  ],\n  \"remarks\": \"Some remarks\",\n  \"successUrl\": \"https://example.com/success\",\n  \"failureUrl\": \"https://example.com/failure\",\n  \"notifyUrl\": \"https://example.com/notify\",\n  \"custom\": \"order-1024\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://api.greeninvoice.co.il/api/v1/payments/form', {\n  method: 'POST',\n  headers: {\n    Authorization: `Bearer ${process.env.MORNING_ACCESS_TOKEN}`,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    \"description\": \"Payment for order #1024\",\n    \"type\": 320,\n    \"amount\": 20,\n    \"currency\": \"ILS\",\n    \"vatType\": 0,\n    \"lang\": \"he\",\n    \"maxPayments\": 1,\n    \"pluginId\": \"7944827a-c664-11e4-8231-080027271115\",\n    \"group\": 100,\n    \"client\": {\n      \"id\": \"7944827a-c664-11e4-8231-080027271114\",\n      \"name\": \"John Doe\",\n      \"emails\": [\n        \"email1@example.com\",\n        \"email2@example.com\"\n      ],\n      \"taxId\": \"0123456789\",\n      \"address\": \"1 Luria St\",\n      \"city\": \"Tel Aviv\",\n      \"zip\": \"1234567\",\n      \"country\": \"IL\",\n      \"phone\": \"+972-54-1234567\",\n      \"fax\": \"+972-54-1234567\",\n      \"mobile\": \"+972-54-1234567\",\n      \"add\": false\n    },\n    \"income\": [\n      {\n        \"catalogNum\": \"MXDFSDD\",\n        \"description\": \"Item description\",\n        \"quantity\": 1,\n        \"price\": 20,\n        \"currency\": \"ILS\",\n        \"vatType\": 1\n      }\n    ],\n    \"remarks\": \"Some remarks\",\n    \"successUrl\": \"https://example.com/success\",\n    \"failureUrl\": \"https://example.com/failure\",\n    \"notifyUrl\": \"https://example.com/notify\",\n    \"custom\": \"order-1024\"\n  }),\n});\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nres = requests.post(\n    \"https://api.greeninvoice.co.il/api/v1/payments/form\",\n    headers={\"Authorization\": f\"Bearer {os.environ['MORNING_ACCESS_TOKEN']}\"},\n    json={\n        \"description\": \"Payment for order #1024\",\n        \"type\": 320,\n        \"amount\": 20,\n        \"currency\": \"ILS\",\n        \"vatType\": 0,\n        \"lang\": \"he\",\n        \"maxPayments\": 1,\n        \"pluginId\": \"7944827a-c664-11e4-8231-080027271115\",\n        \"group\": 100,\n        \"client\": {\n            \"id\": \"7944827a-c664-11e4-8231-080027271114\",\n            \"name\": \"John Doe\",\n            \"emails\": [\n                \"email1@example.com\",\n                \"email2@example.com\",\n            ],\n            \"taxId\": \"0123456789\",\n            \"address\": \"1 Luria St\",\n            \"city\": \"Tel Aviv\",\n            \"zip\": \"1234567\",\n            \"country\": \"IL\",\n            \"phone\": \"+972-54-1234567\",\n            \"fax\": \"+972-54-1234567\",\n            \"mobile\": \"+972-54-1234567\",\n            \"add\": False,\n        },\n        \"income\": [\n            {\n                \"catalogNum\": \"MXDFSDD\",\n                \"description\": \"Item description\",\n                \"quantity\": 1,\n                \"price\": 20,\n                \"currency\": \"ILS\",\n                \"vatType\": 1,\n            },\n        ],\n        \"remarks\": \"Some remarks\",\n        \"successUrl\": \"https://example.com/success\",\n        \"failureUrl\": \"https://example.com/failure\",\n        \"notifyUrl\": \"https://example.com/notify\",\n        \"custom\": \"order-1024\",\n    },\n)\n\ndata = res.json()"
          }
        ]
      }
    },
    "/payments/tokens/search": {
      "post": {
        "tags": [
          "Payments"
        ],
        "operationId": "searchCreditCardTokens",
        "summary": "Search Credit Card Tokens",
        "description": "Search the saved credit-card tokens of the current business using any combination of the filters in the request body. All filters are optional; omitting the body returns the most recent tokens. Results are paginated.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |\n| `Authorization` | `Bearer <accessToken>` | Yes |",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchCreditCardTokensRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Paginated list of credit-card tokens matching the search",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchCreditCardTokensResponse"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST 'https://api.greeninvoice.co.il/api/v1/payments/tokens/search' \\\n  -H \"Authorization: Bearer $MORNING_ACCESS_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"page\": 1,\n  \"pageSize\": 25,\n  \"paymentNumber\": \"0000\",\n  \"cardHolder\": \"John Doe\",\n  \"externalKey\": \"b0077e19-977b-4389-a2e1-f84fa0527d23\",\n  \"cardType\": [\n    2\n  ]\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://api.greeninvoice.co.il/api/v1/payments/tokens/search', {\n  method: 'POST',\n  headers: {\n    Authorization: `Bearer ${process.env.MORNING_ACCESS_TOKEN}`,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    \"page\": 1,\n    \"pageSize\": 25,\n    \"paymentNumber\": \"0000\",\n    \"cardHolder\": \"John Doe\",\n    \"externalKey\": \"b0077e19-977b-4389-a2e1-f84fa0527d23\",\n    \"cardType\": [\n      2\n    ]\n  }),\n});\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nres = requests.post(\n    \"https://api.greeninvoice.co.il/api/v1/payments/tokens/search\",\n    headers={\"Authorization\": f\"Bearer {os.environ['MORNING_ACCESS_TOKEN']}\"},\n    json={\n        \"page\": 1,\n        \"pageSize\": 25,\n        \"paymentNumber\": \"0000\",\n        \"cardHolder\": \"John Doe\",\n        \"externalKey\": \"b0077e19-977b-4389-a2e1-f84fa0527d23\",\n        \"cardType\": [\n            2,\n        ],\n    },\n)\n\ndata = res.json()"
          }
        ]
      }
    },
    "/payments/tokens/{id}/charge": {
      "post": {
        "tags": [
          "Payments"
        ],
        "operationId": "chargeCreditCardToken",
        "summary": "Charge Credit Card Token",
        "description": "Charge a saved credit-card token. A document of the requested type is created and returned once the charge succeeds.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |\n| `Authorization` | `Bearer <accessToken>` | Yes |",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The credit-card token ID to charge.",
            "schema": {
              "type": "string"
            },
            "example": "8b338c95-095e-46d4-b2c6-331747508759"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChargeTokenPaymentRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The document created by the charge",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChargeTokenResponse"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST 'https://api.greeninvoice.co.il/api/v1/payments/tokens/8b338c95-095e-46d4-b2c6-331747508759/charge' \\\n  -H \"Authorization: Bearer $MORNING_ACCESS_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"description\": \"Transaction description\",\n  \"type\": 320,\n  \"amount\": 20,\n  \"currency\": \"ILS\",\n  \"vatType\": 0,\n  \"lang\": \"he\",\n  \"maxPayments\": 1,\n  \"income\": [\n    {\n      \"catalogNum\": \"MXDFSDD\",\n      \"description\": \"Item description\",\n      \"quantity\": 1,\n      \"price\": 20,\n      \"currency\": \"ILS\",\n      \"vatType\": 1\n    }\n  ],\n  \"remarks\": \"Some remarks\",\n  \"notifyUrl\": \"https://example.com/notify\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://api.greeninvoice.co.il/api/v1/payments/tokens/8b338c95-095e-46d4-b2c6-331747508759/charge', {\n  method: 'POST',\n  headers: {\n    Authorization: `Bearer ${process.env.MORNING_ACCESS_TOKEN}`,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    \"description\": \"Transaction description\",\n    \"type\": 320,\n    \"amount\": 20,\n    \"currency\": \"ILS\",\n    \"vatType\": 0,\n    \"lang\": \"he\",\n    \"maxPayments\": 1,\n    \"income\": [\n      {\n        \"catalogNum\": \"MXDFSDD\",\n        \"description\": \"Item description\",\n        \"quantity\": 1,\n        \"price\": 20,\n        \"currency\": \"ILS\",\n        \"vatType\": 1\n      }\n    ],\n    \"remarks\": \"Some remarks\",\n    \"notifyUrl\": \"https://example.com/notify\"\n  }),\n});\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nres = requests.post(\n    \"https://api.greeninvoice.co.il/api/v1/payments/tokens/8b338c95-095e-46d4-b2c6-331747508759/charge\",\n    headers={\"Authorization\": f\"Bearer {os.environ['MORNING_ACCESS_TOKEN']}\"},\n    json={\n        \"description\": \"Transaction description\",\n        \"type\": 320,\n        \"amount\": 20,\n        \"currency\": \"ILS\",\n        \"vatType\": 0,\n        \"lang\": \"he\",\n        \"maxPayments\": 1,\n        \"income\": [\n            {\n                \"catalogNum\": \"MXDFSDD\",\n                \"description\": \"Item description\",\n                \"quantity\": 1,\n                \"price\": 20,\n                \"currency\": \"ILS\",\n                \"vatType\": 1,\n            },\n        ],\n        \"remarks\": \"Some remarks\",\n        \"notifyUrl\": \"https://example.com/notify\",\n    },\n)\n\ndata = res.json()"
          }
        ]
      }
    },
    "/suppliers": {
      "post": {
        "tags": [
          "Suppliers"
        ],
        "operationId": "addSupplier",
        "summary": "Add Supplier",
        "description": "Create a new supplier for the current business.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |\n| `Authorization` | `Bearer <accessToken>` | Yes |",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SupplierRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Supplier created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Supplier"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST 'https://api.greeninvoice.co.il/api/v1/suppliers' \\\n  -H \"Authorization: Bearer $MORNING_ACCESS_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"name\": \"ישראל ישראלי\",\n  \"active\": true,\n  \"department\": \"Sales\",\n  \"taxId\": \"999317746\",\n  \"accountingKey\": \"31653639\",\n  \"paymentTerms\": 0,\n  \"bankName\": \"פועלים\",\n  \"bankBranch\": \"123\",\n  \"bankAccount\": \"123456\",\n  \"address\": \"הרצל 12\",\n  \"city\": \"תל אביב\",\n  \"zip\": \"6688320\",\n  \"country\": \"IL\",\n  \"phone\": \"0505555555\",\n  \"fax\": \"0504444444\",\n  \"mobile\": \"0504444444\",\n  \"remarks\": \"ספק קבוע\",\n  \"contactPerson\": \"ישראל ישראלי\",\n  \"emails\": [\n    \"test_test@test.com\"\n  ],\n  \"labels\": [\n    \"אינסטלטורים\"\n  ],\n  \"balanceAmount\": 0\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://api.greeninvoice.co.il/api/v1/suppliers', {\n  method: 'POST',\n  headers: {\n    Authorization: `Bearer ${process.env.MORNING_ACCESS_TOKEN}`,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    \"name\": \"ישראל ישראלי\",\n    \"active\": true,\n    \"department\": \"Sales\",\n    \"taxId\": \"999317746\",\n    \"accountingKey\": \"31653639\",\n    \"paymentTerms\": 0,\n    \"bankName\": \"פועלים\",\n    \"bankBranch\": \"123\",\n    \"bankAccount\": \"123456\",\n    \"address\": \"הרצל 12\",\n    \"city\": \"תל אביב\",\n    \"zip\": \"6688320\",\n    \"country\": \"IL\",\n    \"phone\": \"0505555555\",\n    \"fax\": \"0504444444\",\n    \"mobile\": \"0504444444\",\n    \"remarks\": \"ספק קבוע\",\n    \"contactPerson\": \"ישראל ישראלי\",\n    \"emails\": [\n      \"test_test@test.com\"\n    ],\n    \"labels\": [\n      \"אינסטלטורים\"\n    ],\n    \"balanceAmount\": 0\n  }),\n});\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nres = requests.post(\n    \"https://api.greeninvoice.co.il/api/v1/suppliers\",\n    headers={\"Authorization\": f\"Bearer {os.environ['MORNING_ACCESS_TOKEN']}\"},\n    json={\n        \"name\": \"ישראל ישראלי\",\n        \"active\": True,\n        \"department\": \"Sales\",\n        \"taxId\": \"999317746\",\n        \"accountingKey\": \"31653639\",\n        \"paymentTerms\": 0,\n        \"bankName\": \"פועלים\",\n        \"bankBranch\": \"123\",\n        \"bankAccount\": \"123456\",\n        \"address\": \"הרצל 12\",\n        \"city\": \"תל אביב\",\n        \"zip\": \"6688320\",\n        \"country\": \"IL\",\n        \"phone\": \"0505555555\",\n        \"fax\": \"0504444444\",\n        \"mobile\": \"0504444444\",\n        \"remarks\": \"ספק קבוע\",\n        \"contactPerson\": \"ישראל ישראלי\",\n        \"emails\": [\n            \"test_test@test.com\",\n        ],\n        \"labels\": [\n            \"אינסטלטורים\",\n        ],\n        \"balanceAmount\": 0,\n    },\n)\n\ndata = res.json()"
          }
        ]
      }
    },
    "/suppliers/{id}": {
      "get": {
        "tags": [
          "Suppliers"
        ],
        "operationId": "getSupplier",
        "summary": "Get Supplier",
        "description": "Retrieve a single supplier by its ID.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |\n| `Authorization` | `Bearer <accessToken>` | Yes |",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Supplier ID",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "32770ce2-ca0f-469f-87cf-8d92c7826e9b"
          }
        ],
        "responses": {
          "200": {
            "description": "Supplier retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Supplier"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl 'https://api.greeninvoice.co.il/api/v1/suppliers/32770ce2-ca0f-469f-87cf-8d92c7826e9b' \\\n  -H \"Authorization: Bearer $MORNING_ACCESS_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://api.greeninvoice.co.il/api/v1/suppliers/32770ce2-ca0f-469f-87cf-8d92c7826e9b', {\n  headers: {\n    Authorization: `Bearer ${process.env.MORNING_ACCESS_TOKEN}`,\n  },\n});\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nres = requests.get(\n    \"https://api.greeninvoice.co.il/api/v1/suppliers/32770ce2-ca0f-469f-87cf-8d92c7826e9b\",\n    headers={\"Authorization\": f\"Bearer {os.environ['MORNING_ACCESS_TOKEN']}\"},\n)\n\ndata = res.json()"
          }
        ]
      },
      "put": {
        "tags": [
          "Suppliers"
        ],
        "operationId": "updateSupplier",
        "summary": "Update Supplier",
        "description": "Update an existing supplier by its ID. This is a partial update: include only the fields you want to change — any field you omit keeps its current value.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |\n| `Authorization` | `Bearer <accessToken>` | Yes |",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Supplier ID",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "32770ce2-ca0f-469f-87cf-8d92c7826e9b"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSupplierRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Supplier updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Supplier"
                },
                "example": {
                  "id": "32770ce2-ca0f-469f-87cf-8d92c7826e9b",
                  "name": "ישראל ישראלי",
                  "active": true,
                  "department": "",
                  "taxId": "999317746",
                  "accountingKey": "31653639",
                  "paymentTerms": -1,
                  "bankName": "פועלים",
                  "bankBranch": "123",
                  "bankAccount": "123456",
                  "address": "הרצל 13",
                  "city": "ראשון לציון",
                  "zip": "6688320",
                  "country": "IL",
                  "phone": "0505555555",
                  "fax": "0504444444",
                  "mobile": "0502222222",
                  "emails": [
                    "test_test@test.com"
                  ],
                  "labels": [
                    "775c188f-33a1-4d39-a5f2-cf7b82dd5bd5"
                  ],
                  "remarks": "",
                  "contactPerson": "ישראל ישראלי",
                  "incomeAmount": 0,
                  "paymentAmount": 0,
                  "creationDate": 1780919300,
                  "lastUpdateDate": 1780923638,
                  "balanceAmount": 0
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X PUT 'https://api.greeninvoice.co.il/api/v1/suppliers/32770ce2-ca0f-469f-87cf-8d92c7826e9b' \\\n  -H \"Authorization: Bearer $MORNING_ACCESS_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"name\": \"ישראל ישראלי\",\n  \"active\": true,\n  \"department\": \"Sales\",\n  \"taxId\": \"999317746\",\n  \"accountingKey\": \"31653639\",\n  \"paymentTerms\": 0,\n  \"bankName\": \"פועלים\",\n  \"bankBranch\": \"123\",\n  \"bankAccount\": \"123456\",\n  \"address\": \"הרצל 12\",\n  \"city\": \"תל אביב\",\n  \"zip\": \"6688320\",\n  \"country\": \"IL\",\n  \"phone\": \"0505555555\",\n  \"fax\": \"0504444444\",\n  \"mobile\": \"0504444444\",\n  \"remarks\": \"ספק קבוע\",\n  \"contactPerson\": \"ישראל ישראלי\",\n  \"emails\": [\n    \"test_test@test.com\"\n  ],\n  \"labels\": [\n    \"אינסטלטורים\"\n  ]\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://api.greeninvoice.co.il/api/v1/suppliers/32770ce2-ca0f-469f-87cf-8d92c7826e9b', {\n  method: 'PUT',\n  headers: {\n    Authorization: `Bearer ${process.env.MORNING_ACCESS_TOKEN}`,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    \"name\": \"ישראל ישראלי\",\n    \"active\": true,\n    \"department\": \"Sales\",\n    \"taxId\": \"999317746\",\n    \"accountingKey\": \"31653639\",\n    \"paymentTerms\": 0,\n    \"bankName\": \"פועלים\",\n    \"bankBranch\": \"123\",\n    \"bankAccount\": \"123456\",\n    \"address\": \"הרצל 12\",\n    \"city\": \"תל אביב\",\n    \"zip\": \"6688320\",\n    \"country\": \"IL\",\n    \"phone\": \"0505555555\",\n    \"fax\": \"0504444444\",\n    \"mobile\": \"0504444444\",\n    \"remarks\": \"ספק קבוע\",\n    \"contactPerson\": \"ישראל ישראלי\",\n    \"emails\": [\n      \"test_test@test.com\"\n    ],\n    \"labels\": [\n      \"אינסטלטורים\"\n    ]\n  }),\n});\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nres = requests.put(\n    \"https://api.greeninvoice.co.il/api/v1/suppliers/32770ce2-ca0f-469f-87cf-8d92c7826e9b\",\n    headers={\"Authorization\": f\"Bearer {os.environ['MORNING_ACCESS_TOKEN']}\"},\n    json={\n        \"name\": \"ישראל ישראלי\",\n        \"active\": True,\n        \"department\": \"Sales\",\n        \"taxId\": \"999317746\",\n        \"accountingKey\": \"31653639\",\n        \"paymentTerms\": 0,\n        \"bankName\": \"פועלים\",\n        \"bankBranch\": \"123\",\n        \"bankAccount\": \"123456\",\n        \"address\": \"הרצל 12\",\n        \"city\": \"תל אביב\",\n        \"zip\": \"6688320\",\n        \"country\": \"IL\",\n        \"phone\": \"0505555555\",\n        \"fax\": \"0504444444\",\n        \"mobile\": \"0504444444\",\n        \"remarks\": \"ספק קבוע\",\n        \"contactPerson\": \"ישראל ישראלי\",\n        \"emails\": [\n            \"test_test@test.com\",\n        ],\n        \"labels\": [\n            \"אינסטלטורים\",\n        ],\n    },\n)\n\ndata = res.json()"
          }
        ]
      },
      "delete": {
        "tags": [
          "Suppliers"
        ],
        "operationId": "deleteSupplier",
        "summary": "Delete Supplier",
        "description": "Delete a supplier by its ID. The response is the deleted supplier.\n\n**Note:** The supplier must be **inactive** (`active: false`) before it can be deleted — deactivate it first via [Update Supplier](#operation/updateSupplier). A supplier that has linked expenses cannot be deleted.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |\n| `Authorization` | `Bearer <accessToken>` | Yes |",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Supplier ID",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "32770ce2-ca0f-469f-87cf-8d92c7826e9b"
          }
        ],
        "responses": {
          "200": {
            "description": "Supplier deleted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Supplier"
                },
                "example": {
                  "id": "32770ce2-ca0f-469f-87cf-8d92c7826e9b",
                  "name": "ישראל ישראלי",
                  "active": false,
                  "department": "",
                  "taxId": "999317746",
                  "accountingKey": "31653639",
                  "paymentTerms": -1,
                  "bankName": "פועלים",
                  "bankBranch": "123",
                  "bankAccount": "123456",
                  "address": "הרצל 13",
                  "city": "ראשון לציון",
                  "zip": "6688320",
                  "country": "IL",
                  "phone": "0505555555",
                  "fax": "0504444444",
                  "mobile": "0502222222",
                  "emails": [
                    "test_test@test.com"
                  ],
                  "labels": [
                    "775c188f-33a1-4d39-a5f2-cf7b82dd5bd5"
                  ],
                  "remarks": "",
                  "contactPerson": "ישראל ישראלי",
                  "incomeAmount": 0,
                  "paymentAmount": 0,
                  "creationDate": 1780919300,
                  "lastUpdateDate": 1780928006,
                  "balanceAmount": 0
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X DELETE 'https://api.greeninvoice.co.il/api/v1/suppliers/32770ce2-ca0f-469f-87cf-8d92c7826e9b' \\\n  -H \"Authorization: Bearer $MORNING_ACCESS_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://api.greeninvoice.co.il/api/v1/suppliers/32770ce2-ca0f-469f-87cf-8d92c7826e9b', {\n  method: 'DELETE',\n  headers: {\n    Authorization: `Bearer ${process.env.MORNING_ACCESS_TOKEN}`,\n  },\n});\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nres = requests.delete(\n    \"https://api.greeninvoice.co.il/api/v1/suppliers/32770ce2-ca0f-469f-87cf-8d92c7826e9b\",\n    headers={\"Authorization\": f\"Bearer {os.environ['MORNING_ACCESS_TOKEN']}\"},\n)\n\ndata = res.json()"
          }
        ]
      }
    },
    "/suppliers/search": {
      "post": {
        "tags": [
          "Suppliers"
        ],
        "operationId": "searchSuppliers",
        "summary": "Search Suppliers",
        "description": "Search the suppliers of the current business using any combination of the filters in the request body. All filters are optional; omitting the body returns the most recent suppliers. Results are paginated.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |\n| `Authorization` | `Bearer <accessToken>` | Yes |",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchSuppliersRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Paginated list of suppliers matching the search",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchSuppliersResponse"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST 'https://api.greeninvoice.co.il/api/v1/suppliers/search' \\\n  -H \"Authorization: Bearer $MORNING_ACCESS_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"page\": 1,\n  \"pageSize\": 25,\n  \"name\": \"ישראל ישראלי\",\n  \"active\": true,\n  \"email\": \"test_test@test.com\",\n  \"contactPerson\": \"ישראל ישראלי\",\n  \"taxId\": \"999317746\",\n  \"labels\": [\n    \"775c188f-33a1-4d39-a5f2-cf7b82dd5bd5\"\n  ]\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://api.greeninvoice.co.il/api/v1/suppliers/search', {\n  method: 'POST',\n  headers: {\n    Authorization: `Bearer ${process.env.MORNING_ACCESS_TOKEN}`,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    \"page\": 1,\n    \"pageSize\": 25,\n    \"name\": \"ישראל ישראלי\",\n    \"active\": true,\n    \"email\": \"test_test@test.com\",\n    \"contactPerson\": \"ישראל ישראלי\",\n    \"taxId\": \"999317746\",\n    \"labels\": [\n      \"775c188f-33a1-4d39-a5f2-cf7b82dd5bd5\"\n    ]\n  }),\n});\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nres = requests.post(\n    \"https://api.greeninvoice.co.il/api/v1/suppliers/search\",\n    headers={\"Authorization\": f\"Bearer {os.environ['MORNING_ACCESS_TOKEN']}\"},\n    json={\n        \"page\": 1,\n        \"pageSize\": 25,\n        \"name\": \"ישראל ישראלי\",\n        \"active\": True,\n        \"email\": \"test_test@test.com\",\n        \"contactPerson\": \"ישראל ישראלי\",\n        \"taxId\": \"999317746\",\n        \"labels\": [\n            \"775c188f-33a1-4d39-a5f2-cf7b82dd5bd5\",\n        ],\n    },\n)\n\ndata = res.json()"
          }
        ]
      }
    },
    "/suppliers/{id}/merge": {
      "post": {
        "tags": [
          "Suppliers"
        ],
        "operationId": "mergeSuppliers",
        "summary": "Merge Suppliers",
        "description": "Merge one supplier into another. The supplier identified by the path `id` is the **target** that data is merged into; the `mergeId` in the request body is the **source** supplier that data is merged from.\n\n**Note:** One of the two suppliers must be inactive — specifically the source (`mergeId`). After the merge the source supplier is deleted and all of its documents are reassigned to the target supplier. The response body is an empty object.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |\n| `Authorization` | `Bearer <accessToken>` | Yes |",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The target supplier ID (the supplier that data is merged into)",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "fa12ede8-6b22-4566-abfd-5a801e6b0fb4"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MergeSupplierRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Suppliers merged successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {}
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST 'https://api.greeninvoice.co.il/api/v1/suppliers/fa12ede8-6b22-4566-abfd-5a801e6b0fb4/merge' \\\n  -H \"Authorization: Bearer $MORNING_ACCESS_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"mergeId\": \"6e8f79d3-ed3e-4940-ad95-94c5416e9b19\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://api.greeninvoice.co.il/api/v1/suppliers/fa12ede8-6b22-4566-abfd-5a801e6b0fb4/merge', {\n  method: 'POST',\n  headers: {\n    Authorization: `Bearer ${process.env.MORNING_ACCESS_TOKEN}`,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    \"mergeId\": \"6e8f79d3-ed3e-4940-ad95-94c5416e9b19\"\n  }),\n});\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nres = requests.post(\n    \"https://api.greeninvoice.co.il/api/v1/suppliers/fa12ede8-6b22-4566-abfd-5a801e6b0fb4/merge\",\n    headers={\"Authorization\": f\"Bearer {os.environ['MORNING_ACCESS_TOKEN']}\"},\n    json={\n        \"mergeId\": \"6e8f79d3-ed3e-4940-ad95-94c5416e9b19\",\n    },\n)\n\ndata = res.json()"
          }
        ]
      }
    },
    "/expenses": {
      "post": {
        "tags": [
          "Expenses"
        ],
        "operationId": "addExpense",
        "summary": "Add Expense",
        "description": "Add an expense to the current business.\n\nThe expense is generated from the business and document default settings, overridden by any attributes provided in the request.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |\n| `Authorization` | `Bearer <accessToken>` | Yes |",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExpenseRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Expense created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Expense"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST 'https://api.greeninvoice.co.il/api/v1/expenses' \\\n  -H \"Authorization: Bearer $MORNING_ACCESS_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"documentType\": 320,\n  \"number\": \"100\",\n  \"date\": \"2026-05-06\",\n  \"reportingDate\": \"2026-05-01\",\n  \"paymentType\": 3,\n  \"currency\": \"ILS\",\n  \"currencyRate\": 1,\n  \"amount\": 472,\n  \"vat\": 72,\n  \"description\": \"אינסטלטור\",\n  \"remarks\": \"אינסטלטור-שולם\",\n  \"labels\": [\n    \"דחוף\"\n  ],\n  \"allocationNumber\": \"166056573\",\n  \"pcnClassification\": \"T\",\n  \"supplier\": {\n    \"name\": \"ישראל ישראלי\",\n    \"active\": true,\n    \"department\": \"Sales\",\n    \"taxId\": \"999317746\",\n    \"accountingKey\": \"31653639\",\n    \"paymentTerms\": 0,\n    \"bankName\": \"פועלים\",\n    \"bankBranch\": \"123\",\n    \"bankAccount\": \"123456\",\n    \"address\": \"הרצל 12\",\n    \"city\": \"תל אביב\",\n    \"zip\": \"6688320\",\n    \"country\": \"IL\",\n    \"phone\": \"0505555555\",\n    \"fax\": \"0504444444\",\n    \"mobile\": \"0504444444\",\n    \"remarks\": \"ספק קבוע\",\n    \"contactPerson\": \"ישראל ישראלי\",\n    \"emails\": [\n      \"test_test@test.com\"\n    ],\n    \"labels\": [\n      \"אינסטלטורים\"\n    ],\n    \"balanceAmount\": 0,\n    \"add\": true\n  },\n  \"accountingClassification\": {\n    \"id\": \"451b3028-68b7-4d1a-bf63-9bb8be24ca9d\",\n    \"key\": \"1310\",\n    \"code\": \"1300\",\n    \"title\": \"עבודות חוץ וקבלני משנה\",\n    \"irsCode\": 1310,\n    \"type\": 20,\n    \"income\": 100,\n    \"vat\": 100,\n    \"mixed\": 100,\n    \"creationDate\": 1771231523,\n    \"lastUpdateDate\": 1779287537\n  },\n  \"active\": true\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://api.greeninvoice.co.il/api/v1/expenses', {\n  method: 'POST',\n  headers: {\n    Authorization: `Bearer ${process.env.MORNING_ACCESS_TOKEN}`,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    \"documentType\": 320,\n    \"number\": \"100\",\n    \"date\": \"2026-05-06\",\n    \"reportingDate\": \"2026-05-01\",\n    \"paymentType\": 3,\n    \"currency\": \"ILS\",\n    \"currencyRate\": 1,\n    \"amount\": 472,\n    \"vat\": 72,\n    \"description\": \"אינסטלטור\",\n    \"remarks\": \"אינסטלטור-שולם\",\n    \"labels\": [\n      \"דחוף\"\n    ],\n    \"allocationNumber\": \"166056573\",\n    \"pcnClassification\": \"T\",\n    \"supplier\": {\n      \"name\": \"ישראל ישראלי\",\n      \"active\": true,\n      \"department\": \"Sales\",\n      \"taxId\": \"999317746\",\n      \"accountingKey\": \"31653639\",\n      \"paymentTerms\": 0,\n      \"bankName\": \"פועלים\",\n      \"bankBranch\": \"123\",\n      \"bankAccount\": \"123456\",\n      \"address\": \"הרצל 12\",\n      \"city\": \"תל אביב\",\n      \"zip\": \"6688320\",\n      \"country\": \"IL\",\n      \"phone\": \"0505555555\",\n      \"fax\": \"0504444444\",\n      \"mobile\": \"0504444444\",\n      \"remarks\": \"ספק קבוע\",\n      \"contactPerson\": \"ישראל ישראלי\",\n      \"emails\": [\n        \"test_test@test.com\"\n      ],\n      \"labels\": [\n        \"אינסטלטורים\"\n      ],\n      \"balanceAmount\": 0,\n      \"add\": true\n    },\n    \"accountingClassification\": {\n      \"id\": \"451b3028-68b7-4d1a-bf63-9bb8be24ca9d\",\n      \"key\": \"1310\",\n      \"code\": \"1300\",\n      \"title\": \"עבודות חוץ וקבלני משנה\",\n      \"irsCode\": 1310,\n      \"type\": 20,\n      \"income\": 100,\n      \"vat\": 100,\n      \"mixed\": 100,\n      \"creationDate\": 1771231523,\n      \"lastUpdateDate\": 1779287537\n    },\n    \"active\": true\n  }),\n});\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nres = requests.post(\n    \"https://api.greeninvoice.co.il/api/v1/expenses\",\n    headers={\"Authorization\": f\"Bearer {os.environ['MORNING_ACCESS_TOKEN']}\"},\n    json={\n        \"documentType\": 320,\n        \"number\": \"100\",\n        \"date\": \"2026-05-06\",\n        \"reportingDate\": \"2026-05-01\",\n        \"paymentType\": 3,\n        \"currency\": \"ILS\",\n        \"currencyRate\": 1,\n        \"amount\": 472,\n        \"vat\": 72,\n        \"description\": \"אינסטלטור\",\n        \"remarks\": \"אינסטלטור-שולם\",\n        \"labels\": [\n            \"דחוף\",\n        ],\n        \"allocationNumber\": \"166056573\",\n        \"pcnClassification\": \"T\",\n        \"supplier\": {\n            \"name\": \"ישראל ישראלי\",\n            \"active\": True,\n            \"department\": \"Sales\",\n            \"taxId\": \"999317746\",\n            \"accountingKey\": \"31653639\",\n            \"paymentTerms\": 0,\n            \"bankName\": \"פועלים\",\n            \"bankBranch\": \"123\",\n            \"bankAccount\": \"123456\",\n            \"address\": \"הרצל 12\",\n            \"city\": \"תל אביב\",\n            \"zip\": \"6688320\",\n            \"country\": \"IL\",\n            \"phone\": \"0505555555\",\n            \"fax\": \"0504444444\",\n            \"mobile\": \"0504444444\",\n            \"remarks\": \"ספק קבוע\",\n            \"contactPerson\": \"ישראל ישראלי\",\n            \"emails\": [\n                \"test_test@test.com\",\n            ],\n            \"labels\": [\n                \"אינסטלטורים\",\n            ],\n            \"balanceAmount\": 0,\n            \"add\": True,\n        },\n        \"accountingClassification\": {\n            \"id\": \"451b3028-68b7-4d1a-bf63-9bb8be24ca9d\",\n            \"key\": \"1310\",\n            \"code\": \"1300\",\n            \"title\": \"עבודות חוץ וקבלני משנה\",\n            \"irsCode\": 1310,\n            \"type\": 20,\n            \"income\": 100,\n            \"vat\": 100,\n            \"mixed\": 100,\n            \"creationDate\": 1771231523,\n            \"lastUpdateDate\": 1779287537,\n        },\n        \"active\": True,\n    },\n)\n\ndata = res.json()"
          }
        ]
      }
    },
    "/expenses/search": {
      "post": {
        "tags": [
          "Expenses"
        ],
        "operationId": "searchExpenses",
        "summary": "Search Expenses",
        "description": "Search the current business's expenses with optional filters. Results are paginated.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |\n| `Authorization` | `Bearer <accessToken>` | Yes |",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchExpensesRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Paginated list of expenses matching the search",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchExpensesResponse"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST 'https://api.greeninvoice.co.il/api/v1/expenses/search' \\\n  -H \"Authorization: Bearer $MORNING_ACCESS_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"fromDate\": \"2025-06-01\",\n  \"toDate\": \"2026-06-01\",\n  \"description\": \"אינסטלטור\",\n  \"supplierId\": \"28fa4c1d-a29b-11e4-963c-18002725111e\",\n  \"supplierName\": \"אינסטלטור\",\n  \"number\": \"100\",\n  \"paid\": true,\n  \"minAmount\": 100,\n  \"maxAmount\": 5000,\n  \"documentType\": [\n    320\n  ],\n  \"paymentType\": [\n    3\n  ],\n  \"status\": [\n    10\n  ],\n  \"page\": 1,\n  \"pageSize\": 25\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://api.greeninvoice.co.il/api/v1/expenses/search', {\n  method: 'POST',\n  headers: {\n    Authorization: `Bearer ${process.env.MORNING_ACCESS_TOKEN}`,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    \"fromDate\": \"2025-06-01\",\n    \"toDate\": \"2026-06-01\",\n    \"description\": \"אינסטלטור\",\n    \"supplierId\": \"28fa4c1d-a29b-11e4-963c-18002725111e\",\n    \"supplierName\": \"אינסטלטור\",\n    \"number\": \"100\",\n    \"paid\": true,\n    \"minAmount\": 100,\n    \"maxAmount\": 5000,\n    \"documentType\": [\n      320\n    ],\n    \"paymentType\": [\n      3\n    ],\n    \"status\": [\n      10\n    ],\n    \"page\": 1,\n    \"pageSize\": 25\n  }),\n});\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nres = requests.post(\n    \"https://api.greeninvoice.co.il/api/v1/expenses/search\",\n    headers={\"Authorization\": f\"Bearer {os.environ['MORNING_ACCESS_TOKEN']}\"},\n    json={\n        \"fromDate\": \"2025-06-01\",\n        \"toDate\": \"2026-06-01\",\n        \"description\": \"אינסטלטור\",\n        \"supplierId\": \"28fa4c1d-a29b-11e4-963c-18002725111e\",\n        \"supplierName\": \"אינסטלטור\",\n        \"number\": \"100\",\n        \"paid\": True,\n        \"minAmount\": 100,\n        \"maxAmount\": 5000,\n        \"documentType\": [\n            320,\n        ],\n        \"paymentType\": [\n            3,\n        ],\n        \"status\": [\n            10,\n        ],\n        \"page\": 1,\n        \"pageSize\": 25,\n    },\n)\n\ndata = res.json()"
          }
        ]
      }
    },
    "/expenses/{id}": {
      "get": {
        "tags": [
          "Expenses"
        ],
        "operationId": "getExpense",
        "summary": "Get Expense",
        "description": "Retrieve a single expense by its ID.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |\n| `Authorization` | `Bearer <accessToken>` | Yes |",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Expense ID",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "b22f10a6-85f3-4374-b563-e1e039d5528c"
          }
        ],
        "responses": {
          "200": {
            "description": "Expense retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Expense"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl 'https://api.greeninvoice.co.il/api/v1/expenses/b22f10a6-85f3-4374-b563-e1e039d5528c' \\\n  -H \"Authorization: Bearer $MORNING_ACCESS_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://api.greeninvoice.co.il/api/v1/expenses/b22f10a6-85f3-4374-b563-e1e039d5528c', {\n  headers: {\n    Authorization: `Bearer ${process.env.MORNING_ACCESS_TOKEN}`,\n  },\n});\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nres = requests.get(\n    \"https://api.greeninvoice.co.il/api/v1/expenses/b22f10a6-85f3-4374-b563-e1e039d5528c\",\n    headers={\"Authorization\": f\"Bearer {os.environ['MORNING_ACCESS_TOKEN']}\"},\n)\n\ndata = res.json()"
          }
        ]
      },
      "put": {
        "tags": [
          "Expenses"
        ],
        "operationId": "updateExpense",
        "summary": "Update Expense",
        "description": "Update an existing expense by its ID. Only the fields you send are applied.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |\n| `Authorization` | `Bearer <accessToken>` | Yes |",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Expense ID",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "206e85f0-1606-4310-86d8-3a6736a41158"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateExpenseRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Expense updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Expense"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X PUT 'https://api.greeninvoice.co.il/api/v1/expenses/206e85f0-1606-4310-86d8-3a6736a41158' \\\n  -H \"Authorization: Bearer $MORNING_ACCESS_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"documentType\": 320,\n  \"number\": \"111\",\n  \"date\": \"2026-06-09\",\n  \"reportingDate\": \"2026-06-01\",\n  \"paymentType\": 3,\n  \"currency\": \"ILS\",\n  \"currencyRate\": 1,\n  \"amount\": 2360,\n  \"vat\": 360,\n  \"description\": \"מאתר נזילות\",\n  \"remarks\": \"מאתר נזילות - שולם\",\n  \"labels\": [\n    \"דחוף\"\n  ],\n  \"allocationNumber\": \"166056573\",\n  \"pcnClassification\": \"T\",\n  \"supplier\": {\n    \"name\": \"ישראל ישראלי\",\n    \"active\": true,\n    \"department\": \"Sales\",\n    \"taxId\": \"999317746\",\n    \"accountingKey\": \"31653639\",\n    \"paymentTerms\": 0,\n    \"bankName\": \"פועלים\",\n    \"bankBranch\": \"123\",\n    \"bankAccount\": \"123456\",\n    \"address\": \"הרצל 12\",\n    \"city\": \"תל אביב\",\n    \"zip\": \"6688320\",\n    \"country\": \"IL\",\n    \"phone\": \"0505555555\",\n    \"fax\": \"0504444444\",\n    \"mobile\": \"0504444444\",\n    \"remarks\": \"ספק קבוע\",\n    \"contactPerson\": \"ישראל ישראלי\",\n    \"emails\": [\n      \"test_test@test.com\"\n    ],\n    \"labels\": [\n      \"אינסטלטורים\"\n    ],\n    \"balanceAmount\": 0,\n    \"add\": true\n  },\n  \"accountingClassification\": {\n    \"id\": \"451b3028-68b7-4d1a-bf63-9bb8be24ca9d\",\n    \"key\": \"1310\",\n    \"code\": \"1300\",\n    \"title\": \"עבודות חוץ וקבלני משנה\",\n    \"irsCode\": 1310,\n    \"type\": 20,\n    \"income\": 100,\n    \"vat\": 100,\n    \"mixed\": 100,\n    \"creationDate\": 1771231523,\n    \"lastUpdateDate\": 1779287537\n  },\n  \"active\": true\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://api.greeninvoice.co.il/api/v1/expenses/206e85f0-1606-4310-86d8-3a6736a41158', {\n  method: 'PUT',\n  headers: {\n    Authorization: `Bearer ${process.env.MORNING_ACCESS_TOKEN}`,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    \"documentType\": 320,\n    \"number\": \"111\",\n    \"date\": \"2026-06-09\",\n    \"reportingDate\": \"2026-06-01\",\n    \"paymentType\": 3,\n    \"currency\": \"ILS\",\n    \"currencyRate\": 1,\n    \"amount\": 2360,\n    \"vat\": 360,\n    \"description\": \"מאתר נזילות\",\n    \"remarks\": \"מאתר נזילות - שולם\",\n    \"labels\": [\n      \"דחוף\"\n    ],\n    \"allocationNumber\": \"166056573\",\n    \"pcnClassification\": \"T\",\n    \"supplier\": {\n      \"name\": \"ישראל ישראלי\",\n      \"active\": true,\n      \"department\": \"Sales\",\n      \"taxId\": \"999317746\",\n      \"accountingKey\": \"31653639\",\n      \"paymentTerms\": 0,\n      \"bankName\": \"פועלים\",\n      \"bankBranch\": \"123\",\n      \"bankAccount\": \"123456\",\n      \"address\": \"הרצל 12\",\n      \"city\": \"תל אביב\",\n      \"zip\": \"6688320\",\n      \"country\": \"IL\",\n      \"phone\": \"0505555555\",\n      \"fax\": \"0504444444\",\n      \"mobile\": \"0504444444\",\n      \"remarks\": \"ספק קבוע\",\n      \"contactPerson\": \"ישראל ישראלי\",\n      \"emails\": [\n        \"test_test@test.com\"\n      ],\n      \"labels\": [\n        \"אינסטלטורים\"\n      ],\n      \"balanceAmount\": 0,\n      \"add\": true\n    },\n    \"accountingClassification\": {\n      \"id\": \"451b3028-68b7-4d1a-bf63-9bb8be24ca9d\",\n      \"key\": \"1310\",\n      \"code\": \"1300\",\n      \"title\": \"עבודות חוץ וקבלני משנה\",\n      \"irsCode\": 1310,\n      \"type\": 20,\n      \"income\": 100,\n      \"vat\": 100,\n      \"mixed\": 100,\n      \"creationDate\": 1771231523,\n      \"lastUpdateDate\": 1779287537\n    },\n    \"active\": true\n  }),\n});\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nres = requests.put(\n    \"https://api.greeninvoice.co.il/api/v1/expenses/206e85f0-1606-4310-86d8-3a6736a41158\",\n    headers={\"Authorization\": f\"Bearer {os.environ['MORNING_ACCESS_TOKEN']}\"},\n    json={\n        \"documentType\": 320,\n        \"number\": \"111\",\n        \"date\": \"2026-06-09\",\n        \"reportingDate\": \"2026-06-01\",\n        \"paymentType\": 3,\n        \"currency\": \"ILS\",\n        \"currencyRate\": 1,\n        \"amount\": 2360,\n        \"vat\": 360,\n        \"description\": \"מאתר נזילות\",\n        \"remarks\": \"מאתר נזילות - שולם\",\n        \"labels\": [\n            \"דחוף\",\n        ],\n        \"allocationNumber\": \"166056573\",\n        \"pcnClassification\": \"T\",\n        \"supplier\": {\n            \"name\": \"ישראל ישראלי\",\n            \"active\": True,\n            \"department\": \"Sales\",\n            \"taxId\": \"999317746\",\n            \"accountingKey\": \"31653639\",\n            \"paymentTerms\": 0,\n            \"bankName\": \"פועלים\",\n            \"bankBranch\": \"123\",\n            \"bankAccount\": \"123456\",\n            \"address\": \"הרצל 12\",\n            \"city\": \"תל אביב\",\n            \"zip\": \"6688320\",\n            \"country\": \"IL\",\n            \"phone\": \"0505555555\",\n            \"fax\": \"0504444444\",\n            \"mobile\": \"0504444444\",\n            \"remarks\": \"ספק קבוע\",\n            \"contactPerson\": \"ישראל ישראלי\",\n            \"emails\": [\n                \"test_test@test.com\",\n            ],\n            \"labels\": [\n                \"אינסטלטורים\",\n            ],\n            \"balanceAmount\": 0,\n            \"add\": True,\n        },\n        \"accountingClassification\": {\n            \"id\": \"451b3028-68b7-4d1a-bf63-9bb8be24ca9d\",\n            \"key\": \"1310\",\n            \"code\": \"1300\",\n            \"title\": \"עבודות חוץ וקבלני משנה\",\n            \"irsCode\": 1310,\n            \"type\": 20,\n            \"income\": 100,\n            \"vat\": 100,\n            \"mixed\": 100,\n            \"creationDate\": 1771231523,\n            \"lastUpdateDate\": 1779287537,\n        },\n        \"active\": True,\n    },\n)\n\ndata = res.json()"
          }
        ]
      },
      "delete": {
        "tags": [
          "Expenses"
        ],
        "operationId": "deleteExpense",
        "summary": "Delete Expense",
        "description": "Delete an expense by its ID. Returns the deleted expense.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |\n| `Authorization` | `Bearer <accessToken>` | Yes |",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Expense ID",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "b22f10a6-85f3-4374-b563-e1e039d5528c"
          }
        ],
        "responses": {
          "200": {
            "description": "Expense deleted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Expense"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X DELETE 'https://api.greeninvoice.co.il/api/v1/expenses/b22f10a6-85f3-4374-b563-e1e039d5528c' \\\n  -H \"Authorization: Bearer $MORNING_ACCESS_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://api.greeninvoice.co.il/api/v1/expenses/b22f10a6-85f3-4374-b563-e1e039d5528c', {\n  method: 'DELETE',\n  headers: {\n    Authorization: `Bearer ${process.env.MORNING_ACCESS_TOKEN}`,\n  },\n});\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nres = requests.delete(\n    \"https://api.greeninvoice.co.il/api/v1/expenses/b22f10a6-85f3-4374-b563-e1e039d5528c\",\n    headers={\"Authorization\": f\"Bearer {os.environ['MORNING_ACCESS_TOKEN']}\"},\n)\n\ndata = res.json()"
          }
        ]
      }
    },
    "/expenses/statuses": {
      "get": {
        "tags": [
          "Expenses"
        ],
        "operationId": "getExpenseStatuses",
        "summary": "Get Allowed Expenses Statuses",
        "description": "Retrieve the available expense statuses as a list of `{ id, name }` pairs. Names are localised by the `lang` query parameter.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |\n| `Authorization` | `Bearer <accessToken>` | Yes |",
        "parameters": [
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "description": "Content language for the localised `name` field. Defaults to `he` (Hebrew) if omitted or unsupported.",
            "schema": {
              "$ref": "#/components/schemas/Lang"
            },
            "example": "he"
          }
        ],
        "responses": {
          "200": {
            "description": "List of available expense statuses with localised names",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ExpenseStatusMapItem"
                  }
                },
                "example": [
                  {
                    "id": 10,
                    "name": "הוצאה אושרה לדו״ח"
                  },
                  {
                    "id": 20,
                    "name": "הוצאה נכללת בדו״ח"
                  },
                  {
                    "id": 30,
                    "name": "הוצאה שנערכה מחדש"
                  },
                  {
                    "id": 100,
                    "name": "הוצאה מחוקה"
                  },
                  {
                    "id": 40,
                    "name": "הוצאה אושרה ע״י מייצג"
                  }
                ]
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl 'https://api.greeninvoice.co.il/api/v1/expenses/statuses' \\\n  -H \"Authorization: Bearer $MORNING_ACCESS_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://api.greeninvoice.co.il/api/v1/expenses/statuses', {\n  headers: {\n    Authorization: `Bearer ${process.env.MORNING_ACCESS_TOKEN}`,\n  },\n});\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nres = requests.get(\n    \"https://api.greeninvoice.co.il/api/v1/expenses/statuses\",\n    headers={\"Authorization\": f\"Bearer {os.environ['MORNING_ACCESS_TOKEN']}\"},\n)\n\ndata = res.json()"
          }
        ]
      }
    },
    "/expenses/{id}/close": {
      "post": {
        "tags": [
          "Expenses"
        ],
        "operationId": "closeExpense",
        "summary": "Close Expense",
        "description": "Close an expense by its ID. No request body is required, and the response returns an empty body.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |\n| `Authorization` | `Bearer <accessToken>` | Yes |",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Expense ID",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "b22f10a6-85f3-4374-b563-e1e039d5528c"
          }
        ],
        "responses": {
          "200": {
            "description": "Expense closed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {}
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST 'https://api.greeninvoice.co.il/api/v1/expenses/b22f10a6-85f3-4374-b563-e1e039d5528c/close' \\\n  -H \"Authorization: Bearer $MORNING_ACCESS_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://api.greeninvoice.co.il/api/v1/expenses/b22f10a6-85f3-4374-b563-e1e039d5528c/close', {\n  method: 'POST',\n  headers: {\n    Authorization: `Bearer ${process.env.MORNING_ACCESS_TOKEN}`,\n  },\n});\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nres = requests.post(\n    \"https://api.greeninvoice.co.il/api/v1/expenses/b22f10a6-85f3-4374-b563-e1e039d5528c/close\",\n    headers={\"Authorization\": f\"Bearer {os.environ['MORNING_ACCESS_TOKEN']}\"},\n)\n\ndata = res.json()"
          }
        ]
      }
    },
    "/expenses/{id}/open": {
      "post": {
        "tags": [
          "Expenses"
        ],
        "operationId": "openExpense",
        "summary": "Open Expense",
        "description": "Open an expense by its ID. No request body is required, and the response returns an empty body.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |\n| `Authorization` | `Bearer <accessToken>` | Yes |",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Expense ID",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "b22f10a6-85f3-4374-b563-e1e039d5528c"
          }
        ],
        "responses": {
          "200": {
            "description": "Expense opened successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {}
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST 'https://api.greeninvoice.co.il/api/v1/expenses/b22f10a6-85f3-4374-b563-e1e039d5528c/open' \\\n  -H \"Authorization: Bearer $MORNING_ACCESS_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://api.greeninvoice.co.il/api/v1/expenses/b22f10a6-85f3-4374-b563-e1e039d5528c/open', {\n  method: 'POST',\n  headers: {\n    Authorization: `Bearer ${process.env.MORNING_ACCESS_TOKEN}`,\n  },\n});\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nres = requests.post(\n    \"https://api.greeninvoice.co.il/api/v1/expenses/b22f10a6-85f3-4374-b563-e1e039d5528c/open\",\n    headers={\"Authorization\": f\"Bearer {os.environ['MORNING_ACCESS_TOKEN']}\"},\n)\n\ndata = res.json()"
          }
        ]
      }
    },
    "/file-upload/v1/url": {
      "servers": [
        {
          "url": "https://api.morning.co",
          "description": "Production"
        },
        {
          "url": "https://api.sandbox.d.greeninvoice.co.il",
          "description": "Sandbox"
        }
      ],
      "get": {
        "tags": [
          "Expenses"
        ],
        "operationId": "getExpenseFileUploadUrl",
        "summary": "Upload Expense File · Step 1: Get Upload URL",
        "description": "**Step 1 of the expense file-upload flow.** Returns a pre-signed S3 POST (`url` + `fields`) that you use in Step 2 to upload the file. Uploading a file always creates an **expense draft** (which becomes a real expense only after approval).\n\n> **Note:** The pre-signed POST is valid for **60 seconds**. Complete Step 2 within 60 seconds of this request — after that the URL expires and you must request a new one.\n\n- To create a new draft, send `data={\"source\":5}`.\n- To attach a file to an existing expense, send `data={\"id\":\"<expenseId>\",\"source\":5,\"state\":\"expense\"}`.\n\nThe upload is processed **asynchronously**; track the outcome via webhooks (`expense-draft/parsed`, `expense-file/updated`, `expense-draft/declined`, `file/infected`).\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |\n| `Authorization` | `Bearer <accessToken>` | Yes |",
        "parameters": [
          {
            "name": "context",
            "in": "query",
            "required": true,
            "description": "Upload context. Must be `expense` for the expense file-upload flow.",
            "schema": {
              "type": "string"
            },
            "example": "expense"
          },
          {
            "name": "data",
            "in": "query",
            "required": true,
            "description": "JSON string describing the upload. `source` must be 5. New draft: `{\"source\":5}`. Attach to an existing expense: `{\"id\":\"<expenseId>\",\"source\":5,\"state\":\"expense\"}`.",
            "schema": {
              "type": "string"
            },
            "example": "{\"source\":5}"
          }
        ],
        "responses": {
          "201": {
            "description": "Pre-signed S3 upload details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileUploadUrlResponse"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl 'https://api.morning.co/file-upload/v1/url?context=expense&data=%7B%22source%22%3A5%7D' \\\n  -H \"Authorization: Bearer $MORNING_ACCESS_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://api.morning.co/file-upload/v1/url?context=expense&data=%7B%22source%22%3A5%7D', {\n  headers: {\n    Authorization: `Bearer ${process.env.MORNING_ACCESS_TOKEN}`,\n  },\n});\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nres = requests.get(\n    \"https://api.morning.co/file-upload/v1/url?context=expense&data=%7B%22source%22%3A5%7D\",\n    headers={\"Authorization\": f\"Bearer {os.environ['MORNING_ACCESS_TOKEN']}\"},\n)\n\ndata = res.json()"
          }
        ]
      }
    },
    "/": {
      "servers": [
        {
          "url": "https://s3.eu-west-1.amazonaws.com/file-upload-service-uploaded",
          "description": "Production"
        },
        {
          "url": "https://s3.eu-west-1.amazonaws.com/sandbox-file-upload-service-uploaded",
          "description": "Sandbox"
        }
      ],
      "post": {
        "tags": [
          "Expenses"
        ],
        "operationId": "uploadExpenseFile",
        "summary": "Upload Expense File · Step 2: Send the File",
        "x-codeSamples": [
          {
            "lang": "TypeScript",
            "label": "Helper Script",
            "source": "interface File extends Blob {\n  readonly name: string;\n}\n\nasync uploadFile(file: File, headers: object): Promise<any> {\n  // Step 1 — get the pre-signed POST (url + fields)\n  const presignedPost = await this.getSignedUrl();\n\n  const data = new FormData();\n  // Append every field returned by Step 1 ...\n  Object.entries(presignedPost.fields).forEach(([field, value]) => {\n    data.append(field, value);\n  });\n  // ... then append the file LAST.\n  data.append('file', file, file?.name);\n\n  // Headers must include 'Content-Type': 'multipart/form-data'\n  return this.http.post(presignedPost.url, data, headers);\n}"
          }
        ],
        "security": [],
        "description": "**Step 2 of the expense file-upload flow.** Upload the file directly to the `url` returned by [Step 1: Get Upload URL](#operation/getExpenseFileUploadUrl), sending every field from that response's `fields` object as `multipart/form-data` alongside the `file`.\n\n> **Important:** Add the `file` field **last** in the `multipart/form-data` body — after all the other fields. The upload fails if `file` is not the final field.\n\n> **Note:** The pre-signed POST returned in Step 1 is valid for only **60 seconds**. Upload the file within that window, or it expires and you'll need to request a new URL.\n\nWhether this **creates a new expense draft** or **updates an existing expense's file** is determined by the `data` you sent in Step 1. Processing is **asynchronous** — the response is `204 No Content`; track the outcome via webhooks. An expense cannot be updated once it has been reported.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `multipart/form-data` | Yes |",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/ExpenseFileUploadRequest"
              },
              "example": {
                "key": "2026/06/09/c1e4a7b2-8d3f-4a9c-b5e6-3f4a5b6c7d8e/${filename}",
                "Policy": "string",
                "X-Amz-Algorithm": "AWS4-HMAC-SHA256",
                "X-Amz-Credential": "string",
                "X-Amz-Date": "20260609T130133Z",
                "X-Amz-Security-Token": "string",
                "X-Amz-Signature": "string",
                "bucket": "string",
                "file": "<the file to upload>"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "File accepted for processing"
          }
        }
      }
    },
    "/expenses/drafts/search": {
      "post": {
        "tags": [
          "Expenses"
        ],
        "operationId": "searchExpenseDrafts",
        "summary": "Search Expense Drafts",
        "description": "Search the current business's expense drafts with optional filters. Results are paginated.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |\n| `Authorization` | `Bearer <accessToken>` | Yes |",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchExpenseDraftsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Paginated list of expense drafts matching the search",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchExpenseDraftsResponse"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST 'https://api.greeninvoice.co.il/api/v1/expenses/drafts/search' \\\n  -H \"Authorization: Bearer $MORNING_ACCESS_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"fromDate\": \"2026-03-01\",\n  \"toDate\": \"2026-06-30\",\n  \"description\": \"string\",\n  \"supplierId\": \"string\",\n  \"supplierName\": \"שפע\",\n  \"page\": 1,\n  \"pageSize\": 20\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://api.greeninvoice.co.il/api/v1/expenses/drafts/search', {\n  method: 'POST',\n  headers: {\n    Authorization: `Bearer ${process.env.MORNING_ACCESS_TOKEN}`,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    \"fromDate\": \"2026-03-01\",\n    \"toDate\": \"2026-06-30\",\n    \"description\": \"string\",\n    \"supplierId\": \"string\",\n    \"supplierName\": \"שפע\",\n    \"page\": 1,\n    \"pageSize\": 20\n  }),\n});\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nres = requests.post(\n    \"https://api.greeninvoice.co.il/api/v1/expenses/drafts/search\",\n    headers={\"Authorization\": f\"Bearer {os.environ['MORNING_ACCESS_TOKEN']}\"},\n    json={\n        \"fromDate\": \"2026-03-01\",\n        \"toDate\": \"2026-06-30\",\n        \"description\": \"string\",\n        \"supplierId\": \"string\",\n        \"supplierName\": \"שפע\",\n        \"page\": 1,\n        \"pageSize\": 20,\n    },\n)\n\ndata = res.json()"
          }
        ]
      }
    },
    "/businesses/v1/occupations": {
      "servers": [
        {
          "url": "https://cache.greeninvoice.co.il",
          "description": "Cache API"
        }
      ],
      "get": {
        "tags": [
          "Reference"
        ],
        "operationId": "getSupportedBusinessCategories",
        "summary": "Get Supported Business Categories",
        "description": "Get all supported business categories and their sub-categories, ordered alphabetically by the localized name.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |",
        "security": [],
        "parameters": [
          {
            "name": "locale",
            "in": "query",
            "required": true,
            "description": "Content language for the localized `name` and `keywords` fields",
            "schema": {
              "type": "string",
              "enum": [
                "en_US",
                "he_IL"
              ]
            },
            "example": "he_IL"
          }
        ],
        "responses": {
          "200": {
            "description": "List of supported business categories",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/BusinessCategory"
                  }
                },
                "example": [
                  {
                    "id": 22,
                    "updatedAt": 1718054936930,
                    "name": "אבטחה וחקירות",
                    "keywords": [
                      "חוקר"
                    ],
                    "children": [
                      {
                        "id": 2201,
                        "updatedAt": 1718054936931,
                        "name": "שירותי אבטחה",
                        "keywords": [
                          "מאבטח"
                        ]
                      },
                      {
                        "id": 2202,
                        "updatedAt": 1718054936931,
                        "name": "שירותי חקירה",
                        "keywords": [
                          "חוקר"
                        ]
                      }
                    ]
                  }
                ]
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl 'https://cache.greeninvoice.co.il/businesses/v1/occupations?locale=he_IL'"
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://cache.greeninvoice.co.il/businesses/v1/occupations?locale=he_IL');\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import requests\n\nres = requests.get(\n    \"https://cache.greeninvoice.co.il/businesses/v1/occupations?locale=he_IL\",\n)\n\ndata = res.json()"
          }
        ]
      }
    },
    "/geo-location/v1/countries": {
      "servers": [
        {
          "url": "https://cache.greeninvoice.co.il",
          "description": "Cache API"
        }
      ],
      "get": {
        "tags": [
          "Reference"
        ],
        "operationId": "getSupportedCountries",
        "summary": "Get Supported Countries",
        "description": "Get all supported countries, ordered alphabetically by the localized country name.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |",
        "security": [],
        "parameters": [
          {
            "name": "locale",
            "in": "query",
            "required": true,
            "description": "Content language for the localized `name` field",
            "schema": {
              "type": "string",
              "enum": [
                "en_US",
                "he_IL"
              ]
            },
            "example": "he_IL"
          }
        ],
        "responses": {
          "200": {
            "description": "List of supported countries",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CountryObject"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl 'https://cache.greeninvoice.co.il/geo-location/v1/countries?locale=he_IL'"
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://cache.greeninvoice.co.il/geo-location/v1/countries?locale=he_IL');\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import requests\n\nres = requests.get(\n    \"https://cache.greeninvoice.co.il/geo-location/v1/countries?locale=he_IL\",\n)\n\ndata = res.json()"
          }
        ]
      }
    },
    "/geo-location/v1/cities": {
      "servers": [
        {
          "url": "https://cache.greeninvoice.co.il",
          "description": "Cache API"
        }
      ],
      "get": {
        "tags": [
          "Reference"
        ],
        "operationId": "getSupportedCities",
        "summary": "Get Supported Cities",
        "description": "Get all supported cities for a given country, ordered alphabetically by the localized city name.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |",
        "security": [],
        "parameters": [
          {
            "name": "locale",
            "in": "query",
            "required": true,
            "description": "Content language for the localized `name` field",
            "schema": {
              "type": "string",
              "enum": [
                "en_US",
                "he_IL"
              ]
            },
            "example": "he_IL"
          },
          {
            "name": "country",
            "in": "query",
            "required": true,
            "description": "2-letter ISO 3166-1 alpha-2 country code. Currently only `IL` (Israel) is supported.",
            "schema": {
              "type": "string",
              "enum": [
                "IL"
              ]
            },
            "example": "IL"
          }
        ],
        "responses": {
          "200": {
            "description": "List of supported cities",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CityObject"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl 'https://cache.greeninvoice.co.il/geo-location/v1/cities?locale=he_IL&country=IL'"
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://cache.greeninvoice.co.il/geo-location/v1/cities?locale=he_IL&country=IL');\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import requests\n\nres = requests.get(\n    \"https://cache.greeninvoice.co.il/geo-location/v1/cities?locale=he_IL&country=IL\",\n)\n\ndata = res.json()"
          }
        ]
      }
    },
    "/currency-exchange/v1/latest": {
      "servers": [
        {
          "url": "https://cache.greeninvoice.co.il",
          "description": "Cache API"
        }
      ],
      "get": {
        "tags": [
          "Reference"
        ],
        "operationId": "getSupportedCurrencies",
        "summary": "Get Supported Currencies",
        "description": "Get the latest and previous-day exchange rates for supported currencies, relative to a specified base currency.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |",
        "security": [],
        "parameters": [
          {
            "name": "base",
            "in": "query",
            "required": true,
            "description": "3-letter currency code of the base currency",
            "schema": {
              "type": "string"
            },
            "example": "ILS"
          }
        ],
        "responses": {
          "200": {
            "description": "Latest exchange rates for the supported currencies",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CurrencyExchange"
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl 'https://cache.greeninvoice.co.il/currency-exchange/v1/latest?base=ILS'"
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://cache.greeninvoice.co.il/currency-exchange/v1/latest?base=ILS');\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import requests\n\nres = requests.get(\n    \"https://cache.greeninvoice.co.il/currency-exchange/v1/latest?base=ILS\",\n)\n\ndata = res.json()"
          }
        ]
      }
    },
    "/partners/users": {
      "get": {
        "tags": [
          "Partners"
        ],
        "operationId": "getPartnerUsers",
        "summary": "Get Connected Users",
        "security": [
          {
            "basicAuth": []
          }
        ],
        "description": "Returns all connected and approved users for your partner account.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |\n| `Authorization` | `Basic <credentials>` | Yes |",
        "responses": {
          "200": {
            "description": "Connected users retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ConnectedPartnerUser"
                  }
                },
                "example": [
                  {
                    "id": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4",
                    "email": "user@example.com"
                  }
                ]
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl 'https://api.greeninvoice.co.il/api/v1/partners/users' \\\n  -H \"Authorization: Bearer $MORNING_ACCESS_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://api.greeninvoice.co.il/api/v1/partners/users', {\n  headers: {\n    Authorization: `Bearer ${process.env.MORNING_ACCESS_TOKEN}`,\n  },\n});\n\nconst data = await res.json();"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nres = requests.get(\n    \"https://api.greeninvoice.co.il/api/v1/partners/users\",\n    headers={\"Authorization\": f\"Bearer {os.environ['MORNING_ACCESS_TOKEN']}\"},\n)\n\ndata = res.json()"
          }
        ]
      }
    },
    "/partners/users/connection": {
      "post": {
        "tags": [
          "Partners"
        ],
        "operationId": "requestUserApproval",
        "summary": "Request User Approval",
        "security": [
          {
            "basicAuth": []
          }
        ],
        "description": "Sends a connection request to an existing morning by Green Invoice user.\n\nThe user receives an email with a link to approve the connection. The link expires after 3 days — if it is not approved in time, a new request must be initiated.\n\nOnce the user approves, Green Invoice sends a `POST` request to the `url` you specified. The body contains the connected user's `id`, `email`, and a `key` object holding the business's newly created API key — including its `id` and `secret`. An `X-Data-Signature` header is also included — the SHA-256 HMAC of the body using your partner authorization code as the key — which you can use to verify the callback's authenticity.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |\n| `Authorization` | `Basic <credentials>` | Yes |",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email",
                  "url"
                ],
                "properties": {
                  "email": {
                    "type": "string",
                    "description": "The email address of the morning user to invite. For example: `user@example.com`.",
                    "example": "user@example.com"
                  },
                  "url": {
                    "type": "string",
                    "description": "The callback URL where Green Invoice will send the connection approval notification. For example: `https://example.com/callback`.",
                    "example": "https://example.com/callback"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Connection request sent successfully"
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST 'https://api.greeninvoice.co.il/api/v1/partners/users/connection' \\\n  -H \"Authorization: Bearer $MORNING_ACCESS_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"email\": \"user@example.com\",\n  \"url\": \"https://example.com/callback\"\n}'"
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://api.greeninvoice.co.il/api/v1/partners/users/connection', {\n  method: 'POST',\n  headers: {\n    Authorization: `Bearer ${process.env.MORNING_ACCESS_TOKEN}`,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n    \"email\": \"user@example.com\",\n    \"url\": \"https://example.com/callback\"\n  }),\n});"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nres = requests.post(\n    \"https://api.greeninvoice.co.il/api/v1/partners/users/connection\",\n    headers={\"Authorization\": f\"Bearer {os.environ['MORNING_ACCESS_TOKEN']}\"},\n    json={\n        \"email\": \"user@example.com\",\n        \"url\": \"https://example.com/callback\",\n    },\n)"
          }
        ]
      },
      "delete": {
        "tags": [
          "Partners"
        ],
        "operationId": "disconnectPartnerUser",
        "summary": "Disconnect Partner User",
        "security": [
          {
            "basicAuth": []
          }
        ],
        "description": "Removes a connected user from your partner account.\n\nAll partner-related API keys for the user's businesses are revoked and you will no longer be able to access their resources. If the user is billed through your partner account, billing stops immediately for future documents.\n\nThe user receives a notification email upon disconnection. A disconnected user may reconnect at any time.\n\n> **Note:** All businesses of the specified user that are associated with your partner will be disconnected.\n\n**Request headers**\n\n| Header | Value | Required |\n|--------|-------|----------|\n| `Content-Type` | `application/json` | Yes |\n| `Authorization` | `Basic <credentials>` | Yes |",
        "parameters": [
          {
            "name": "email",
            "in": "query",
            "required": true,
            "description": "The email address of the connected user to disconnect. For example: `user@example.com`.",
            "schema": {
              "type": "string"
            },
            "example": "user@example.com"
          }
        ],
        "responses": {
          "200": {
            "description": "User disconnected successfully"
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X DELETE 'https://api.greeninvoice.co.il/api/v1/partners/users/connection?email=user%40example.com' \\\n  -H \"Authorization: Bearer $MORNING_ACCESS_TOKEN\""
          },
          {
            "lang": "JavaScript",
            "label": "Node.js",
            "source": "const res = await fetch('https://api.greeninvoice.co.il/api/v1/partners/users/connection?email=user%40example.com', {\n  method: 'DELETE',\n  headers: {\n    Authorization: `Bearer ${process.env.MORNING_ACCESS_TOKEN}`,\n  },\n});"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import os\nimport requests\n\nres = requests.delete(\n    \"https://api.greeninvoice.co.il/api/v1/partners/users/connection?email=user%40example.com\",\n    headers={\"Authorization\": f\"Bearer {os.environ['MORNING_ACCESS_TOKEN']}\"},\n)"
          }
        ]
      }
    }
  },
  "x-webhooks": {
    "document/created": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "webhookDocumentCreated",
        "summary": "Document Created",
        "security": [],
        "description": "Sent to your configured webhook URL whenever a document is created in a subscribed business.\n\nThe `x-webhook-topic` header on this delivery is `document/created`.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookDocumentCreated"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Return any `2xx` status code to acknowledge that your endpoint received the event."
          }
        }
      }
    },
    "client/created": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "webhookClientCreated",
        "summary": "Client Created",
        "security": [],
        "description": "Sent to your configured webhook URL whenever a client is created in a subscribed business.\n\nThe `x-webhook-topic` header on this delivery is `client/created`.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookClientCreated"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Return any `2xx` status code to acknowledge that your endpoint received the event."
          }
        }
      }
    },
    "supplier/created": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "webhookSupplierCreated",
        "summary": "Supplier Created",
        "security": [],
        "description": "Sent to your configured webhook URL whenever a supplier is created in a subscribed business.\n\nThe `x-webhook-topic` header on this delivery is `supplier/created`.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookSupplierCreated"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Return any `2xx` status code to acknowledge that your endpoint received the event."
          }
        }
      }
    },
    "payment/received": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "webhookPaymentReceived",
        "summary": "Payment Received",
        "security": [],
        "description": "Sent to your configured webhook URL whenever a payment is received in a subscribed business.\n\nThe `x-webhook-topic` header on this delivery is `payment/received`.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPaymentReceived"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Return any `2xx` status code to acknowledge that your endpoint received the event."
          }
        }
      }
    },
    "sale-pages/page-contacted": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "webhookSalePagesPageContacted",
        "summary": "Sale Page Contacted",
        "security": [],
        "description": "Sent to your configured webhook URL whenever a visitor submits their details on a sale page in a subscribed business. This covers both sale-page blocks that collect visitor details — the **contact** block and the **newsletter-signup** block — which share the same payload. Which fields are populated depends on the block and its configuration; `newsletter` indicates whether the visitor opted into the mailing list.\n\nThe `x-webhook-topic` header on this delivery is `sale-pages/page-contacted`.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookSalePagesPageContacted"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Return any `2xx` status code to acknowledge that your endpoint received the event."
          }
        }
      }
    },
    "sale-pages/order-paid": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "webhookSalePagesOrderPaid",
        "summary": "Sale Page Order Paid",
        "security": [],
        "description": "Sent to your configured webhook URL whenever an order is paid on a sale page in a subscribed business.\n\nThe `x-webhook-topic` header on this delivery is `sale-pages/order-paid`.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookSalePagesOrderPaid"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Return any `2xx` status code to acknowledge that your endpoint received the event."
          }
        }
      }
    },
    "expense-draft/parsed": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "webhookExpenseDraftParsed",
        "summary": "Expense Draft Parsed",
        "security": [],
        "description": "Sent to your configured webhook URL whenever an uploaded expense draft finishes parsing in a subscribed business.\n\nThe `x-webhook-topic` header on this delivery is `expense-draft/parsed`.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookExpenseDraftParsed"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Return any `2xx` status code to acknowledge that your endpoint received the event."
          }
        }
      }
    },
    "expense-draft/declined": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "webhookExpenseDraftDeclined",
        "summary": "Expense Draft Declined",
        "security": [],
        "description": "Sent to your configured webhook URL whenever an accountant declines an uploaded expense draft — i.e. does not approve it for intake — in a subscribed business.\n\nThe `x-webhook-topic` header on this delivery is `expense-draft/declined`.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookExpenseDraftDeclined"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Return any `2xx` status code to acknowledge that your endpoint received the event."
          }
        }
      }
    },
    "expense/file-updated": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "webhookExpenseFileUpdated",
        "summary": "Expense File Updated",
        "security": [],
        "description": "Sent to your configured webhook URL whenever the file of an **already-approved expense** is updated in a subscribed business. This fires only for an approved expense — updating the file of an expense **draft** does not trigger it.\n\nThe `x-webhook-topic` header on this delivery is `expense/file-updated`.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookExpenseFileUpdated"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Return any `2xx` status code to acknowledge that your endpoint received the event."
          }
        }
      }
    },
    "file/infected": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "webhookFileInfected",
        "summary": "File Infected",
        "security": [],
        "description": "Sent to your configured webhook URL whenever an uploaded file is found to be infected and quarantined in a subscribed business.\n\nThe `x-webhook-topic` header on this delivery is `file/infected`.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookFileInfected"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Return any `2xx` status code to acknowledge that your endpoint received the event."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      },
      "basicAuth": {
        "type": "http",
        "scheme": "basic",
        "description": "Partner credentials encoded as Base64(`id:secret`)."
      }
    },
    "schemas": {
      "TokenRequest": {
        "type": "object",
        "required": [
          "grant_type",
          "client_id",
          "client_secret"
        ],
        "properties": {
          "grant_type": {
            "type": "string",
            "enum": [
              "client_credentials"
            ],
            "description": "OAuth 2.0 grant type. Must be `client_credentials`.",
            "example": "client_credentials"
          },
          "client_id": {
            "type": "string",
            "description": "API Key Client ID. For example: `a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d`.",
            "example": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"
          },
          "client_secret": {
            "type": "string",
            "description": "API Key Client Secret. Keep it server-side — never embed it in client-side code or commit it to source control. For example: `Ex4mpleS3cret-DoNotUse`.",
            "example": "Ex4mpleS3cret-DoNotUse"
          }
        }
      },
      "TokenResponse": {
        "type": "object",
        "required": [
          "accessToken",
          "tokenType",
          "expiresAt"
        ],
        "properties": {
          "accessToken": {
            "type": "string",
            "description": "The access token to use as `Authorization: Bearer <token>` header"
          },
          "tokenType": {
            "type": "string",
            "enum": [
              "Bearer"
            ],
            "description": "The token type"
          },
          "expiresAt": {
            "type": "integer",
            "format": "int64",
            "description": "Unix timestamp in seconds when this token expires and becomes invalid"
          }
        }
      },
      "OAuth2Error": {
        "type": "object",
        "required": [
          "error",
          "error_description"
        ],
        "properties": {
          "error": {
            "type": "string",
            "description": "OAuth 2.0 error code",
            "enum": [
              "invalid_request",
              "unsupported_grant_type",
              "invalid_grant",
              "unauthorized_client",
              "invalid_client"
            ]
          },
          "error_description": {
            "type": "string",
            "description": "Human-readable error description"
          }
        }
      },
      "DocumentType": {
        "type": "integer",
        "description": "Document type code.\n\n| Code | Type |\n|------|------|\n| 10 | הצעת מחיר |\n| 20 | חשבון / אישור תשלום |\n| 100 | הזמנה |\n| 200 | תעודת משלוח |\n| 210 | תעודת החזרה |\n| 300 | חשבון עסקה |\n| 305 | חשבונית מס |\n| 320 | חשבונית מס / קבלה |\n| 330 | חשבונית זיכוי |\n| 400 | קבלה |\n| 405 | קבלה על תרומה |\n| 410 | ביטול תרומה |\n| 500 | הזמנת רכש |\n| 600 | קבלת פיקדון |\n| 610 | משיכת פיקדון |",
        "example": 305
      },
      "Lang": {
        "type": "string",
        "enum": [
          "he",
          "en"
        ],
        "description": "Content language",
        "example": "he"
      },
      "Currency": {
        "type": "string",
        "description": "3-letter ISO currency code.\n\n| Code | Name |\n|------|------|\n| ILS | שקל |\n| USD | דולר |\n| EUR | אירו |\n| GBP | ליש״ט |\n| JPY | יין יפני |\n| CHF | פרנק שוויצרי |\n| CNY | יואן סיני |\n| AUD | דולר אוסטרלי |\n| CAD | דולר קנדי |\n| RUB | רובל |\n| BRL | ריאל ברזילאי |\n| HKD | דולר הונג קונגי |\n| SGD | דולר סינגפורי |\n| THB | באט תאילנדי |\n| MXN | פזו מקסיקני |\n| TRY | לירה טורקית |\n| NZD | דולר ניו זילנדי |\n| SEK | כתר שבדי |\n| NOK | כתר נורבגי |\n| DKK | כתר דני |\n| KRW | וון דרום קוריאני |\n| INR | רופי הודי |\n| IDR | רופי אינדונזי |\n| PLN | זלוטי |\n| RON | לאו רומני |\n| ZAR | ראנד דרא״פ |\n| HRK | קונה |",
        "example": "ILS"
      },
      "DocumentVatType": {
        "type": "integer",
        "description": "Document-level VAT type.\n\n| Value | Meaning |\n|-------|---------|\n| 0 | Default (based on business type) |\n| 1 | Exempt (VAT-free) |\n| 2 | Mixed (contains both exempt and taxable rows) |",
        "example": 0
      },
      "DiscountRequest": {
        "type": "object",
        "required": [
          "amount",
          "type"
        ],
        "properties": {
          "amount": {
            "type": "number",
            "description": "Discount amount (excluded from VAT). For example: 1.",
            "example": 1
          },
          "type": {
            "type": "string",
            "description": "Discount amount type.\n\n| Value | Meaning |\n|-------|---------|\n| `sum` | Amount in currency units |\n| `percentage` | Amount in percentage units |",
            "example": "sum"
          }
        }
      },
      "PaymentPluginGroup": {
        "type": "integer",
        "description": "Payment plugin group.\n\n| Code | Group |\n|------|-------|\n| 100 | Credit Card |\n| 110 | PayPal |\n| 120 | bit |\n| 150 | Google Pay |\n| 160 | Apple Pay |\n| 170 | Payment Initiation Service (PIS) |",
        "example": 100
      },
      "PluginType": {
        "type": "integer",
        "description": "Payment plugin type.\n\n| Code | Plugin |\n|------|--------|\n| 12010 | PayPal (פייפאל) |\n| 12100 | קארדקום |\n| 12120 | מקס |\n| 12130 | Digital Payments (Grow) תשלומים דיגיטליים (גרו) |\n| 12200 | Digital Payments (Morning) תשלומים דיגיטליים |",
        "example": 12100
      },
      "ItemVatType": {
        "type": "integer",
        "description": "Item VAT type calculation.\n\n| Value | Meaning |\n|-------|---------|\n| 0 | Default (VAT added based on business type) |\n| 1 | Included (VAT included in price) |\n| 2 | Exempt (VAT-free) |",
        "example": 1
      },
      "IncomeRowRequest": {
        "type": "object",
        "required": [
          "description",
          "quantity",
          "price",
          "currency",
          "vatType"
        ],
        "properties": {
          "catalogNum": {
            "type": "string",
            "description": "Catalog number. For example: `MXDFSDD`.",
            "example": "MXDFSDD"
          },
          "description": {
            "type": "string",
            "description": "Item description. For example: `Item description`.",
            "example": "Item description"
          },
          "quantity": {
            "type": "number",
            "description": "Quantity. For example: 1.",
            "example": 1
          },
          "price": {
            "type": "number",
            "description": "Item price. For example: 300.",
            "example": 300
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          },
          "currencyRate": {
            "type": "number",
            "description": "Currency rate relative to ILS. Defaults to 1. For example: 1.",
            "default": 1,
            "example": 1
          },
          "vatRate": {
            "type": "number",
            "description": "VAT rate of the item. For example: 0.18.",
            "example": 0.18
          },
          "itemId": {
            "type": "string",
            "description": "The ID of an existing item to attach as income. For example: `8b338c95-095e-46d4-b2c6-331747508759`.",
            "example": "8b338c95-095e-46d4-b2c6-331747508759"
          },
          "vatType": {
            "$ref": "#/components/schemas/ItemVatType"
          }
        }
      },
      "PaymentGroup": {
        "type": "integer",
        "description": "Payment method type.\n\n| Code | Method |\n|------|--------|\n| 0 | ניכוי במקור |\n| 1 | מזומן |\n| 2 | צ׳ק |\n| 3 | כרטיס אשראי |\n| 4 | העברה בנקאית |\n| 5 | פייפאל |\n| 10 | אפליקציית תשלום |\n| 11 | אחר |",
        "example": 3
      },
      "PaymentAppType": {
        "type": "integer",
        "description": "Payment application type.\n\n| Code | App |\n|------|-----|\n| 1 | Bit |\n| 2 | Pay |\n| 3 | PayBox |\n| 5 | Google Pay |\n| 6 | Apple Pay |",
        "example": 1
      },
      "OtherSubType": {
        "type": "integer",
        "description": "Other payment sub type (required when using 'other' as a Payment type)\n\n| Code | Type |\n|------|------|\n| 1 | ביטקוין |\n| 2 | שווה כסף |\n| 3 | V-Check |\n| 4 | שובר מתנה |\n| 5 | ניכוי חלק עובד ביטוח לאומי |\n| 6 | אתריום |\n| 7 | BUYME שובר |\n| 9 | ניכוי אחר |",
        "example": 1
      },
      "CreditCardType": {
        "type": "integer",
        "description": "Credit card brand.\n\n| Code | Brand |\n|------|-------|\n| 0 | Unknown |\n| 1 | Isracard |\n| 2 | Visa |\n| 3 | Mastercard |\n| 4 | American Express |\n| 5 | Diners |",
        "example": 2
      },
      "CreditCardDealType": {
        "type": "integer",
        "description": "Credit card deal type.\n\n| Code | Type |\n|------|------|\n| 1 | Standard |\n| 2 | Payments |\n| 3 | Credit |\n| 4 | Deferred |\n| 5 | Other |\n| 6 | Recurring |",
        "example": 1
      },
      "PaymentRowRequest": {
        "type": "object",
        "required": [
          "date",
          "type",
          "price",
          "currency"
        ],
        "properties": {
          "date": {
            "type": "string",
            "description": "Payment date in the format `YYYY-MM-DD`. For example: `2026-05-21`.",
            "example": "2026-05-21"
          },
          "type": {
            "$ref": "#/components/schemas/PaymentGroup"
          },
          "price": {
            "type": "number",
            "description": "Payment amount. For example: 300.",
            "example": 300
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          },
          "currencyRate": {
            "type": "number",
            "description": "Currency rate relative to ILS. Defaults to 1. For example: 1.",
            "default": 1,
            "example": 1
          },
          "bankName": {
            "type": "string",
            "description": "Bank name (required when using cheques). For example: `My Bank`.",
            "example": "My Bank"
          },
          "bankBranch": {
            "type": "string",
            "description": "Bank branch (required when using cheques). For example: `198`.",
            "example": "198"
          },
          "bankAccount": {
            "type": "string",
            "description": "Bank account (required when using cheques). For example: `212435`.",
            "example": "212435"
          },
          "chequeNum": {
            "type": "string",
            "description": "Cheque number (required when using cheques). For example: `10002`.",
            "example": "10002"
          },
          "accountId": {
            "type": "string",
            "description": "Payer account (PayPal / Payment App / Other). For example: `TFGFFGSYYE`.",
            "example": "TFGFFGSYYE"
          },
          "transactionId": {
            "type": "string",
            "description": "Transaction ID (PayPal / Payment App / Other). For example: `TGBBBXNLKS75SKJS`.",
            "example": "TGBBBXNLKS75SKJS"
          },
          "appType": {
            "$ref": "#/components/schemas/PaymentAppType"
          },
          "subType": {
            "$ref": "#/components/schemas/OtherSubType"
          },
          "cardType": {
            "$ref": "#/components/schemas/CreditCardType"
          },
          "cardNum": {
            "type": "string",
            "description": "Credit card's last 4 digits. For example: `8765`.",
            "example": "8765"
          },
          "dealType": {
            "$ref": "#/components/schemas/CreditCardDealType"
          },
          "numPayments": {
            "type": "integer",
            "description": "Credit card payments count (1–36). For example: 1.",
            "minimum": 1,
            "maximum": 36,
            "example": 1
          },
          "firstPayment": {
            "type": "number",
            "description": "Credit card first payment amount. For example: 10.",
            "example": 10
          }
        }
      },
      "CreateDocumentRequest": {
        "type": "object",
        "required": [
          "type",
          "lang",
          "currency",
          "vatType",
          "income"
        ],
        "properties": {
          "description": {
            "type": "string",
            "description": "Document description. For example: `Just an order`.",
            "example": "Just an order"
          },
          "remarks": {
            "type": "string",
            "description": "Document remarks. For example: `Some remarks`.",
            "example": "Some remarks"
          },
          "footer": {
            "type": "string",
            "description": "Document footer text. For example: `Texts in footer`.",
            "example": "Texts in footer"
          },
          "emailContent": {
            "type": "string",
            "description": "Custom extra text appearing in the email sent to the customer. For example: `Email content`.",
            "example": "Email content"
          },
          "type": {
            "$ref": "#/components/schemas/DocumentType"
          },
          "date": {
            "type": "string",
            "description": "Document date in the format `YYYY-MM-DD`. Defaults to today. For example: `2026-05-12`.",
            "example": "2026-05-12"
          },
          "dueDate": {
            "type": "string",
            "description": "Document payment due date in the format `YYYY-MM-DD`. For example: `2026-05-31`.",
            "example": "2026-05-31"
          },
          "lang": {
            "$ref": "#/components/schemas/Lang"
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          },
          "vatType": {
            "$ref": "#/components/schemas/DocumentVatType"
          },
          "discount": {
            "$ref": "#/components/schemas/DiscountRequest"
          },
          "rounding": {
            "type": "boolean",
            "description": "Round the amounts. Defaults to `false`.",
            "default": false
          },
          "signed": {
            "type": "boolean",
            "description": "Digitally sign the document. Defaults to `true`.",
            "default": true
          },
          "attachment": {
            "type": "boolean",
            "description": "Attach the document in the email sent to the recipient. Defaults to `false`.",
            "default": false
          },
          "paymentRequestData": {
            "type": "object",
            "description": "Payment request configuration",
            "properties": {
              "plugins": {
                "type": "array",
                "description": "Payment plugins to use (can be up to one in each channel [e.g.: Credit card (Leumicard / Cardcom), PayPal]).",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Plugin ID. For example: `031e827a-c664-c1e4-d231-a80027271123`.",
                      "example": "031e827a-c664-c1e4-d231-a80027271123"
                    },
                    "group": {
                      "$ref": "#/components/schemas/PaymentPluginGroup"
                    },
                    "type": {
                      "$ref": "#/components/schemas/PluginType"
                    }
                  }
                }
              },
              "maxPayments": {
                "type": "integer",
                "description": "Maximum payments allowed (credit card channel only). For example: 1.",
                "example": 1
              }
            }
          },
          "client": {
            "type": "object",
            "description": "Client information",
            "properties": {
              "id": {
                "type": "string",
                "description": "Existing client ID. For example: `7944827a-c664-11e4-8231-080027271114`.",
                "example": "7944827a-c664-11e4-8231-080027271114"
              },
              "name": {
                "type": "string",
                "description": "Client name. For example: `John Doe`.",
                "example": "John Doe"
              },
              "emails": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Client emails — the document download link will be sent to these addresses. For example: `[\"email1@example.com\", \"email2@example.com\"]`.",
                "example": [
                  "email1@example.com",
                  "email2@example.com"
                ]
              },
              "taxId": {
                "type": "string",
                "description": "Client tax ID. For example: `0123456789`.",
                "example": "0123456789"
              },
              "address": {
                "type": "string",
                "description": "Client address. For example: `1 Luria St`.",
                "example": "1 Luria St"
              },
              "city": {
                "type": "string",
                "description": "Client city. For example: `Tel Aviv`.",
                "example": "Tel Aviv"
              },
              "zip": {
                "type": "string",
                "description": "Client zip code. For example: `1234567`.",
                "example": "1234567"
              },
              "country": {
                "type": "string",
                "description": "Client 2-letter ISO country code. Defaults to `IL`. For example: `IL`.",
                "default": "IL",
                "example": "IL"
              },
              "phone": {
                "type": "string",
                "description": "Client phone. For example: `+972-54-1234567`.",
                "example": "+972-54-1234567"
              },
              "fax": {
                "type": "string",
                "description": "Client fax. For example: `+972-54-1234567`.",
                "example": "+972-54-1234567"
              },
              "mobile": {
                "type": "string",
                "description": "Client mobile. For example: `+972-54-1234567`.",
                "example": "+972-54-1234567"
              },
              "add": {
                "type": "boolean",
                "description": "Add a temporary client to the clients list. Defaults to `false`.",
                "default": false
              },
              "self": {
                "type": "boolean",
                "description": "Is this a self-invoice? Defaults to `false`.",
                "default": false
              }
            }
          },
          "income": {
            "type": "array",
            "description": "Income rows",
            "items": {
              "$ref": "#/components/schemas/IncomeRowRequest"
            }
          },
          "payment": {
            "type": "array",
            "description": "Payment rows",
            "items": {
              "$ref": "#/components/schemas/PaymentRowRequest"
            }
          },
          "linkedDocumentIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Linked document IDs. When creating a receipt, include the original invoice document ID — this will automatically close the original invoice if needed. For example: `[\"031e827a-c664-c1e4-d231-a80027271123\"]`.",
            "example": [
              "031e827a-c664-c1e4-d231-a80027271123"
            ]
          },
          "linkedPaymentId": {
            "type": "string",
            "description": "Linked payment ID. Can only be attached to invoice documents (type `305`). For example: `031e827a-c664-c1e4-d231-a80027271123`.",
            "example": "031e827a-c664-c1e4-d231-a80027271123"
          },
          "linkType": {
            "type": "string",
            "description": "Reference type (applicable only when using `linkedDocumentIds`).\n\n| Value | Meaning |\n|-------|---------|\n| `link` | Document is related to another |\n| `cancel` | Document cancels another |",
            "example": "link"
          }
        }
      },
      "CreateDocumentResponse": {
        "type": "object",
        "required": [
          "id",
          "number",
          "type",
          "signed",
          "lang",
          "client",
          "url"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Document unique ID",
            "example": "57ae2ff9-0c24-43e8-b39c-a5bdcc05573d"
          },
          "number": {
            "type": "integer",
            "description": "Document serial number",
            "example": 40034
          },
          "dueDate": {
            "type": "string",
            "description": "Document payment due date in the format `YYYY-MM-DD`",
            "example": "2026-05-31"
          },
          "type": {
            "$ref": "#/components/schemas/DocumentType"
          },
          "signed": {
            "type": "boolean",
            "description": "Whether the document was digitally signed",
            "example": true
          },
          "lang": {
            "$ref": "#/components/schemas/Lang"
          },
          "client": {
            "type": "object",
            "description": "Client linked to the document",
            "properties": {
              "id": {
                "type": "string",
                "description": "Linked client ID",
                "example": "7944827a-c664-11e4-8231-080027271114"
              }
            }
          },
          "taxAuthorityConfirmationInitiated": {
            "type": "boolean",
            "description": "Whether tax authority confirmation was initiated for the document",
            "example": false
          },
          "url": {
            "type": "object",
            "description": "Document download URLs",
            "properties": {
              "origin": {
                "type": "string",
                "description": "Original document URL"
              },
              "he": {
                "type": "string",
                "description": "Copy in Hebrew"
              },
              "en": {
                "type": "string",
                "description": "Copy in English (if lang was `en`)"
              }
            }
          },
          "taxAuthorityConfirmationLastError": {
            "type": "integer",
            "description": "Error code from the most recent tax authority confirmation attempt. `0` indicates no error; a non-zero value (for example `400` or `406`) indicates a failure.",
            "example": 0
          },
          "vatRate": {
            "type": "number",
            "description": "VAT rate applied to the document",
            "example": 0.18
          }
        }
      },
      "DocumentStatus": {
        "type": "integer",
        "description": "Document status.\n\n| Code | Status |\n|------|--------|\n| 0 | מסמך פתוח |\n| 1 | מסמך סגור |\n| 2 | מסמך סומן ידנית כסגור |\n| 3 | מסמך מבטל |\n| 4 | מסמך שבוטל |",
        "example": 0
      },
      "SearchDocumentsRequest": {
        "type": "object",
        "description": "Filters for the document search. All fields are optional.",
        "properties": {
          "page": {
            "type": "integer",
            "description": "Page number to retrieve. Defaults to 1.",
            "default": 1,
            "example": 1
          },
          "pageSize": {
            "type": "integer",
            "description": "Number of results per page. Defaults to 25.",
            "default": 25,
            "example": 25
          },
          "number": {
            "type": "integer",
            "description": "Filter by document serial number. For example: 12001.",
            "example": 12001
          },
          "type": {
            "type": "array",
            "description": "Filter by document type(s).\n\n| Code | Type |\n|------|------|\n| 10 | הצעת מחיר |\n| 20 | חשבון / אישור תשלום |\n| 100 | הזמנה |\n| 200 | תעודת משלוח |\n| 210 | תעודת החזרה |\n| 300 | חשבון עסקה |\n| 305 | חשבונית מס |\n| 320 | חשבונית מס / קבלה |\n| 330 | חשבונית זיכוי |\n| 400 | קבלה |\n| 405 | קבלה על תרומה |\n| 410 | ביטול תרומה |\n| 500 | הזמנת רכש |\n| 600 | קבלת פיקדון |\n| 610 | משיכת פיקדון |",
            "items": {
              "$ref": "#/components/schemas/DocumentType"
            }
          },
          "status": {
            "type": "array",
            "description": "Filter by document status(es).\n\n| Code | Status |\n|------|--------|\n| 0 | מסמך פתוח |\n| 1 | מסמך סגור |\n| 2 | מסמך סומן ידנית כסגור |\n| 3 | מסמך מבטל |\n| 4 | מסמך שבוטל |",
            "items": {
              "$ref": "#/components/schemas/DocumentStatus"
            }
          },
          "paymentTypes": {
            "type": "array",
            "description": "Filter by payment type(s) used in the document.\n\n| Code | Method |\n|------|--------|\n| 0 | ניכוי במקור |\n| 1 | מזומן |\n| 2 | צ׳ק |\n| 3 | כרטיס אשראי |\n| 4 | העברה בנקאית |\n| 5 | פייפאל |\n| 10 | אפליקציית תשלום |\n| 11 | אחר |",
            "items": {
              "$ref": "#/components/schemas/PaymentGroup"
            }
          },
          "fromDate": {
            "type": "string",
            "description": "Return documents whose document date from this date, in the format `YYYY-MM-DD`. For example: `2016-01-01`.",
            "example": "2016-01-01"
          },
          "toDate": {
            "type": "string",
            "description": "Return documents whose document date to this date, in the format `YYYY-MM-DD`. For example: `2016-01-31`.",
            "example": "2016-01-31"
          },
          "clientId": {
            "type": "string",
            "description": "Filter by client ID. For example: `28fa4c1d-a29b-11e4-963c-18002725111e`.",
            "example": "28fa4c1d-a29b-11e4-963c-18002725111e"
          },
          "clientName": {
            "type": "string",
            "description": "Filter by client name. For example: `John`.",
            "example": "John"
          },
          "description": {
            "type": "string",
            "description": "Filter by document description. For example: `Any text`.",
            "example": "Any text"
          },
          "download": {
            "type": "boolean",
            "description": "Filter by whether the document was downloaded by the client. For example: `true`.",
            "example": true
          },
          "sort": {
            "type": "string",
            "description": "Field to sort the result set by.\n\n| Value | Sorts by |\n|-------|----------|\n| `documentDate` | Document (issue) date |\n| `dueDate` | Due date |\n| `client` | Client name |",
            "example": "documentDate"
          }
        }
      },
      "BusinessType": {
        "type": "integer",
        "description": "Business type.\n\n| Code | Type |\n|------|------|\n| 1 | עוסק מורשה |\n| 2 | חברה בע״מ |\n| 3 | עוסק פטור |\n| 4 | עמותה |\n| 5 | חברה לתועלת הציבור |\n| 6 | שותפות |",
        "example": 1
      },
      "IncomeRow": {
        "type": "object",
        "required": [
          "description",
          "quantity",
          "price",
          "currency",
          "vatType"
        ],
        "properties": {
          "catalogNum": {
            "type": "string",
            "description": "Catalog number",
            "example": "MXDFSDD"
          },
          "description": {
            "type": "string",
            "description": "Item description",
            "example": "Item description"
          },
          "quantity": {
            "type": "number",
            "description": "Quantity",
            "example": 1
          },
          "price": {
            "type": "number",
            "description": "Item price",
            "example": 300
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          },
          "currencyRate": {
            "type": "number",
            "description": "Currency rate relative to ILS",
            "example": 1
          },
          "vatType": {
            "$ref": "#/components/schemas/ItemVatType"
          },
          "vatRate": {
            "type": "number",
            "description": "VAT rate of the item",
            "example": 0.18
          },
          "amount": {
            "type": "number",
            "description": "Per-unit row amount",
            "example": 300
          },
          "vat": {
            "type": "number",
            "description": "VAT amount for this row",
            "example": 54
          },
          "amountTotal": {
            "type": "number",
            "description": "Total row amount (`amount` × `quantity`)",
            "example": 354
          },
          "itemId": {
            "type": "string",
            "description": "The ID of the item attached as income. For example: `8b338c95-095e-46d4-b2c6-331747508759`.",
            "example": "8b338c95-095e-46d4-b2c6-331747508759"
          }
        }
      },
      "DocumentPaymentRow": {
        "type": "object",
        "required": [
          "type",
          "price"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Payment method display name (always returned in Hebrew, regardless of the document's `lang`)",
            "example": "כרטיס אשראי"
          },
          "type": {
            "$ref": "#/components/schemas/PaymentGroup"
          },
          "subType": {
            "$ref": "#/components/schemas/OtherSubType"
          },
          "appType": {
            "$ref": "#/components/schemas/PaymentAppType",
            "description": "Returned only when the payment was made through a payment app."
          },
          "price": {
            "type": "number",
            "description": "Payment amount",
            "example": 300
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          },
          "ref": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DocumentType"
            },
            "description": "Referenced document types"
          },
          "cancellable": {
            "type": "boolean",
            "description": "Whether this payment is cancellable",
            "example": false
          }
        }
      },
      "SearchDocument": {
        "type": "object",
        "required": [
          "id",
          "type",
          "number",
          "documentDate",
          "status",
          "lang",
          "currency",
          "amount"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The document unique ID",
            "example": "73aedf13-0263-4399-95b8-2261e1c89e68"
          },
          "type": {
            "$ref": "#/components/schemas/DocumentType"
          },
          "number": {
            "type": "string",
            "description": "Document number",
            "example": "80010"
          },
          "status": {
            "$ref": "#/components/schemas/DocumentStatus"
          },
          "documentDate": {
            "type": "string",
            "description": "Document reference date in the format `YYYY-MM-DD`",
            "example": "2026-01-19"
          },
          "creationDate": {
            "type": "integer",
            "format": "int64",
            "description": "Creation date Unix timestamp (in seconds)",
            "example": 1768829547
          },
          "lang": {
            "$ref": "#/components/schemas/Lang"
          },
          "description": {
            "type": "string",
            "description": "Document description",
            "example": "Just an order"
          },
          "remarks": {
            "type": "string",
            "description": "Document remarks",
            "example": "Some remarks"
          },
          "amount": {
            "type": "number",
            "description": "Total amount, in requested currency (including the VAT, Discount & Rounding)",
            "example": 354
          },
          "amountLocal": {
            "type": "number",
            "description": "Total amount in local currency, including VAT, discount, and rounding",
            "example": 354
          },
          "amountDueVat": {
            "type": "number",
            "description": "Amount due VAT - Amount before VAT, and before rounding & discount (if requested)",
            "example": 300
          },
          "amountExemptVat": {
            "type": "number",
            "description": "Amount exempt VAT - 0 unless there's one or more items that are excluded of VAT such as mixed documents (that have both VAT excluded & included items)",
            "example": 0
          },
          "amountExcludeVat": {
            "type": "number",
            "description": "Amount excluded from VAT",
            "example": 0
          },
          "amountOpened": {
            "type": "number",
            "description": "The amount that is still left to be paid, exists only in payment request documents",
            "example": 0
          },
          "vat": {
            "type": "number",
            "description": "VAT amount",
            "example": 54
          },
          "vatType": {
            "$ref": "#/components/schemas/DocumentVatType"
          },
          "vatRate": {
            "type": "number",
            "description": "VAT rate applied to the document",
            "example": 0.18
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          },
          "currencyRate": {
            "type": "number",
            "description": "Currency rate relative to ILS",
            "example": 1
          },
          "client": {
            "type": "object",
            "description": "Client linked to the document",
            "properties": {
              "id": {
                "type": "string",
                "description": "The client ID",
                "example": "b0077e19-977b-4389-a2e1-f84fa0527d23"
              },
              "name": {
                "type": "string",
                "description": "The client name",
                "example": "John Doe"
              },
              "emails": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "The client email addresses",
                "example": [
                  "email1@example.com"
                ]
              },
              "taxId": {
                "type": "string",
                "description": "The client tax ID",
                "example": "0123456789"
              },
              "self": {
                "type": "boolean",
                "description": "Is this a self-invoice?",
                "example": false
              },
              "country": {
                "type": "string",
                "description": "2-letter ISO 3166-1 alpha-2 country code. Defaults to `IL` (Israel).",
                "example": "IL"
              },
              "phone": {
                "type": "string",
                "description": "The client phone number",
                "example": "+972-54-1234567"
              }
            }
          },
          "business": {
            "type": "object",
            "description": "Business that issued the document",
            "properties": {
              "type": {
                "$ref": "#/components/schemas/BusinessType"
              },
              "exemption": {
                "type": "boolean",
                "description": "Whether the business is VAT-exempt",
                "example": false
              }
            }
          },
          "data": {
            "type": "object",
            "description": "Tax Authority confirmation data and document tags",
            "properties": {
              "tags": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Document tags",
                "example": []
              },
              "taxAuthorityConfirmationNumber": {
                "type": "string",
                "description": "Tax Authority confirmation number initiated for the document",
                "example": "20241104100000000000001"
              },
              "taxAuthorityConfirmationLastError": {
                "type": "integer",
                "description": "Inner errorCode from the most recent Tax Authority confirmation attempt. 0 indicates success; a non-zero value indicates a failure.",
                "example": 0
              }
            }
          },
          "income": {
            "type": "array",
            "description": "Income rows",
            "items": {
              "$ref": "#/components/schemas/IncomeRow"
            }
          },
          "payment": {
            "type": "array",
            "description": "Payment rows",
            "items": {
              "$ref": "#/components/schemas/DocumentPaymentRow"
            }
          },
          "signed": {
            "type": "boolean",
            "description": "Is this document digitally signed",
            "example": true
          },
          "cancellable": {
            "type": "boolean",
            "description": "Is this document cancellable",
            "example": true
          },
          "downloaded": {
            "type": "boolean",
            "description": "Whether the document was downloaded by the client",
            "example": false
          },
          "reverseCharge": {
            "type": "boolean",
            "description": "Whether reverse-charge VAT applies to the document",
            "example": false
          },
          "rounding": {
            "type": "boolean",
            "description": "Whether the sum was rounded or not",
            "example": false
          },
          "taxConfirmationEligible": {
            "type": "boolean",
            "description": "Whether the document is eligible for Tax Authority confirmation",
            "example": false
          },
          "url": {
            "type": "object",
            "description": "Document download URLs",
            "properties": {
              "he": {
                "type": "string",
                "description": "Copy in Hebrew"
              },
              "origin": {
                "type": "string",
                "description": "Origin document URL"
              },
              "en": {
                "type": "string",
                "description": "Copy in English (if lang was `en`)"
              }
            }
          }
        }
      },
      "SearchDocumentsResponse": {
        "type": "object",
        "required": [
          "total",
          "page",
          "pageSize",
          "from",
          "to",
          "pages",
          "items"
        ],
        "properties": {
          "total": {
            "type": "integer",
            "description": "Total number of documents matching the search",
            "example": 25
          },
          "page": {
            "type": "integer",
            "description": "The requested page number",
            "example": 1
          },
          "pageSize": {
            "type": "integer",
            "description": "The requested page size",
            "example": 25
          },
          "from": {
            "type": "integer",
            "description": "Index of the first item in the current page",
            "example": 1
          },
          "to": {
            "type": "integer",
            "description": "Index of the last item in the current page",
            "example": 25
          },
          "pages": {
            "type": "integer",
            "description": "Total number of pages available",
            "example": 2
          },
          "items": {
            "type": "array",
            "description": "The documents matching the search",
            "items": {
              "$ref": "#/components/schemas/SearchDocument"
            }
          }
        }
      },
      "PaymentSearchDocumentType": {
        "type": "integer",
        "description": "Document type accepted by the payments search filter.\n\n| Code | Type |\n|------|------|\n| 320 | חשבונית מס / קבלה |\n| 400 | קבלה |\n| 405 | קבלה על תרומה |\n| 600 | קבלת פיקדון |\n| 610 | משיכת פיקדון |",
        "example": 320
      },
      "SearchDocumentPaymentsRequest": {
        "type": "object",
        "description": "Filters for the payments-in-documents search. All fields are optional.",
        "properties": {
          "page": {
            "type": "integer",
            "description": "Page number to retrieve. Defaults to 1.",
            "default": 1,
            "example": 1
          },
          "pageSize": {
            "type": "integer",
            "description": "Number of results per page. Defaults to 25.",
            "default": 25,
            "example": 25
          },
          "type": {
            "type": "array",
            "description": "Filter by document type(s).\n\n| Code | Type |\n|------|------|\n| 320 | חשבונית מס / קבלה |\n| 400 | קבלה |\n| 405 | קבלה על תרומה |\n| 600 | קבלת פיקדון |\n| 610 | משיכת פיקדון |",
            "items": {
              "$ref": "#/components/schemas/PaymentSearchDocumentType"
            }
          },
          "paymentTypes": {
            "type": "array",
            "description": "Filter by payment type(s) used in the document.\n\n| Code | Method |\n|------|--------|\n| 0 | ניכוי במקור |\n| 1 | מזומן |\n| 2 | צ׳ק |\n| 3 | כרטיס אשראי |\n| 4 | העברה בנקאית |\n| 5 | פייפאל |\n| 10 | אפליקציית תשלום |\n| 11 | אחר |",
            "items": {
              "$ref": "#/components/schemas/PaymentGroup"
            }
          },
          "fromDate": {
            "type": "string",
            "description": "Return payments dated on or after this date, in the format `YYYY-MM-DD`. For example: `2016-01-01`.",
            "example": "2016-01-01"
          },
          "toDate": {
            "type": "string",
            "description": "Return payments dated on or before this date, in the format `YYYY-MM-DD`. For example: `2016-01-31`.",
            "example": "2016-01-31"
          },
          "paymentId": {
            "type": "string",
            "description": "Payment identifier, such as a cheque number or PayPal transaction ID. For example: `427547`.",
            "example": "427547"
          },
          "sort": {
            "type": "string",
            "description": "Field and direction to sort the result set by.\n\n| Value | Sorts by |\n|-------|----------|\n| `date:desc` | Payment date, descending |\n| `date:asc` | Payment date, ascending |",
            "example": "date:desc"
          }
        }
      },
      "PaymentStatus": {
        "type": "integer",
        "description": "Payment status.\n\n| Code | Status |\n|------|--------|\n| 0 | Open |\n| 1 | Closed |\n| 2 | Cancelling |\n| 3 | Cancelled |",
        "example": 0
      },
      "DocumentPaymentSearchRow": {
        "type": "object",
        "required": [
          "type",
          "price"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The payment ID",
            "example": "63dad8e3-44d2-40b4-8708-39e6c37d0448"
          },
          "date": {
            "type": "string",
            "description": "Payment date and time in the format `YYYY-MM-DDTHH:MM:SS`",
            "example": "2025-12-14T00:00:00"
          },
          "type": {
            "$ref": "#/components/schemas/PaymentGroup"
          },
          "paymentStatus": {
            "$ref": "#/components/schemas/PaymentStatus"
          },
          "price": {
            "type": "number",
            "description": "Payment amount",
            "example": 251
          },
          "amount": {
            "type": "number",
            "description": "Payment amount in the document currency",
            "example": 251
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          },
          "currencyRate": {
            "type": "number",
            "description": "Currency rate relative to ILS",
            "example": 1
          },
          "name": {
            "type": "string",
            "description": "Payment method display name (always returned in Hebrew, regardless of the document's `lang`)",
            "example": "כרטיס אשראי"
          },
          "description": {
            "type": "string",
            "description": "Payment description",
            "example": "ויזה 0000 / רגיל"
          },
          "cardType": {
            "$ref": "#/components/schemas/CreditCardType"
          },
          "cardNum": {
            "type": "string",
            "description": "Credit card's last 4 digits",
            "example": "0000"
          },
          "dealType": {
            "$ref": "#/components/schemas/CreditCardDealType"
          },
          "numPayments": {
            "type": "integer",
            "description": "Credit card payments count",
            "example": 1
          }
        }
      },
      "DocumentPayment": {
        "type": "object",
        "required": [
          "id",
          "type",
          "number",
          "documentDate",
          "status",
          "lang",
          "currency",
          "amount"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The document unique ID",
            "example": "7af2e6e7-6551-4691-9e80-a5e6172e81cc"
          },
          "type": {
            "$ref": "#/components/schemas/DocumentType"
          },
          "number": {
            "type": "integer",
            "description": "Document serial number",
            "example": 60005
          },
          "status": {
            "$ref": "#/components/schemas/DocumentStatus"
          },
          "documentDate": {
            "type": "string",
            "description": "Document reference date and time in the format `YYYY-MM-DDTHH:MM:SS`",
            "example": "2025-12-14T00:00:00"
          },
          "creationDate": {
            "type": "string",
            "description": "Creation date and time in the format `YYYY-MM-DDTHH:MM:SS`",
            "example": "2025-12-14T09:39:03"
          },
          "lang": {
            "$ref": "#/components/schemas/Lang"
          },
          "amount": {
            "type": "number",
            "description": "Total amount, in requested currency (including the VAT, Discount & Rounding)",
            "example": 354
          },
          "amountLocal": {
            "type": "number",
            "description": "Total amount in local currency, including VAT, discount, and rounding",
            "example": 354
          },
          "amountDueVat": {
            "type": "number",
            "description": "Amount due VAT - Amount before VAT, and before rounding & discount (if requested)",
            "example": 300
          },
          "amountExemptVat": {
            "type": "number",
            "description": "Amount exempt VAT - 0 unless there's one or more items that are excluded of VAT such as mixed documents (that have both VAT excluded & included items)",
            "example": 0
          },
          "amountExcludeVat": {
            "type": "number",
            "description": "Amount excluded from VAT",
            "example": 0
          },
          "vat": {
            "type": "number",
            "description": "VAT amount",
            "example": 54
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          },
          "currencyRate": {
            "type": "number",
            "description": "Currency rate relative to ILS",
            "example": 1
          },
          "client": {
            "type": "object",
            "description": "Client linked to the document",
            "properties": {
              "id": {
                "type": "string",
                "description": "The client ID",
                "example": "b0077e19-977b-4389-a2e1-f84fa0527d23"
              },
              "name": {
                "type": "string",
                "description": "The client name",
                "example": "John Doe"
              },
              "emails": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "The client email addresses",
                "example": [
                  "email1@example.com"
                ]
              },
              "taxId": {
                "type": "string",
                "description": "The client tax ID",
                "example": "0123456789"
              },
              "self": {
                "type": "boolean",
                "description": "Is this a self-invoice?",
                "example": false
              },
              "country": {
                "type": "string",
                "description": "2-letter ISO 3166-1 alpha-2 country code. Defaults to `IL` (Israel).",
                "example": "IL"
              },
              "phone": {
                "type": "string",
                "description": "The client phone number",
                "example": "+972-54-1234567"
              }
            }
          },
          "business": {
            "type": "object",
            "description": "Business that issued the document",
            "properties": {
              "type": {
                "$ref": "#/components/schemas/BusinessType"
              },
              "exemption": {
                "type": "boolean",
                "description": "Whether the business is VAT-exempt",
                "example": false
              }
            }
          },
          "income": {
            "type": "array",
            "description": "Income rows",
            "items": {
              "$ref": "#/components/schemas/IncomeRow"
            }
          },
          "payment": {
            "type": "array",
            "description": "Payment rows matching the search",
            "items": {
              "$ref": "#/components/schemas/DocumentPaymentSearchRow"
            }
          },
          "signed": {
            "type": "boolean",
            "description": "Is this document digitally signed",
            "example": true
          },
          "cancellable": {
            "type": "boolean",
            "description": "Is this document cancellable",
            "example": true
          },
          "downloaded": {
            "type": "boolean",
            "description": "Whether the document was downloaded by the client",
            "example": false
          },
          "reverseCharge": {
            "type": "boolean",
            "description": "Whether reverse-charge VAT applies to the document",
            "example": false
          },
          "rounding": {
            "type": "boolean",
            "description": "Whether the sum was rounded or not",
            "example": false
          },
          "taxConfirmationEligible": {
            "type": "boolean",
            "description": "Whether the document is eligible for Tax Authority confirmation",
            "example": false
          },
          "url": {
            "type": "object",
            "description": "Document download URLs",
            "properties": {
              "he": {
                "type": "string",
                "description": "Copy in Hebrew"
              },
              "origin": {
                "type": "string",
                "description": "Origin document URL"
              }
            }
          }
        }
      },
      "SearchDocumentPaymentsResponse": {
        "type": "object",
        "required": [
          "total",
          "page",
          "pageSize",
          "from",
          "to",
          "pages",
          "items"
        ],
        "properties": {
          "total": {
            "type": "integer",
            "description": "Total number of documents matching the search",
            "example": 25
          },
          "page": {
            "type": "integer",
            "description": "The requested page number",
            "example": 1
          },
          "pageSize": {
            "type": "integer",
            "description": "The requested page size",
            "example": 25
          },
          "from": {
            "type": "integer",
            "description": "Index of the first item in the current page",
            "example": 1
          },
          "to": {
            "type": "integer",
            "description": "Index of the last item in the current page",
            "example": 25
          },
          "pages": {
            "type": "integer",
            "description": "Total number of pages available",
            "example": 2
          },
          "items": {
            "type": "array",
            "description": "The documents whose payments matched the search",
            "items": {
              "$ref": "#/components/schemas/DocumentPayment"
            }
          }
        }
      },
      "PreviewDocumentResponse": {
        "type": "object",
        "required": [
          "file"
        ],
        "properties": {
          "file": {
            "type": "string",
            "format": "byte",
            "description": "The generated preview document as a Base64-encoded PDF string. See the endpoint description for guidance on decoding and rendering.",
            "example": "JVBERi0xLjcKJeLjz9MKMyAwIG9iago8PC9UeXBlIC9QYWdlCi9QYXJlbnQgMSAwIFIK..."
          }
        }
      },
      "Plugin": {
        "type": "object",
        "required": [
          "id",
          "description",
          "friendlyName",
          "active",
          "type",
          "maxPayments",
          "creationDate",
          "lastUpdateDate"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The plugin ID",
            "example": "9aa1a2ef-3efb-4566-b59a-54c233e81557"
          },
          "description": {
            "type": "string",
            "description": "Description for the plugin",
            "example": "קארדקום"
          },
          "friendlyName": {
            "type": "string",
            "description": "A usable name that describes the plugin",
            "example": "מסוף בדיקות (סליקה במערכת)"
          },
          "active": {
            "type": "boolean",
            "description": "Is the plugin currently active or not",
            "example": true
          },
          "type": {
            "$ref": "#/components/schemas/PluginType"
          },
          "maxPayments": {
            "type": "integer",
            "description": "The default amount of payments the plugin uses (relevant for Cardcom, Max)",
            "example": 36
          },
          "creationDate": {
            "type": "integer",
            "description": "Unix timestamp in seconds of the plugin's creation date",
            "example": 1766492513
          },
          "lastUpdateDate": {
            "type": "integer",
            "description": "Unix timestamp in seconds of the plugin's last update date",
            "example": 1766492514
          }
        }
      },
      "DocumentLinkType": {
        "type": "string",
        "enum": [
          "copy",
          "link",
          "cancel"
        ],
        "description": "Relationship type between a document and its linked documents.\n\n| Value | Meaning |\n|-------|---------|\n| copy | A new document duplicating an existing document's contents |\n| link | A reference to a related document (e.g. an invoice → receipt link) |\n| cancel | A document that cancels or credits an existing document |",
        "example": "copy"
      },
      "DocumentInfo": {
        "type": "object",
        "required": [
          "type",
          "number",
          "footer",
          "remark",
          "used",
          "first",
          "lastDocumentDate",
          "today",
          "settings",
          "selfInvoiceEnabled",
          "incomeRowsEnabled",
          "incomeRowsRequired",
          "paymentRowsEnabled",
          "reverseCharge",
          "payable",
          "exemption",
          "vatRate",
          "vatTypes",
          "paymentPlugins",
          "hasTaxAuthorityConfirmation"
        ],
        "properties": {
          "type": {
            "$ref": "#/components/schemas/DocumentType"
          },
          "number": {
            "type": "integer",
            "description": "Next document number that will be assigned to a new document of this `type` in the business's series",
            "example": 50041
          },
          "footer": {
            "type": "object",
            "description": "Document footer text, keyed by language. Either or both keys may be present depending on the business's configuration.",
            "properties": {
              "he": {
                "type": "string",
                "description": "Footer text in Hebrew"
              },
              "en": {
                "type": "string",
                "description": "Footer text in English"
              }
            }
          },
          "remark": {
            "type": "object",
            "description": "Document remark text, keyed by language. Either or both keys may be present depending on the business's configuration.",
            "properties": {
              "he": {
                "type": "string",
                "description": "Remark text in Hebrew"
              },
              "en": {
                "type": "string",
                "description": "Remark text in English"
              }
            }
          },
          "used": {
            "type": "boolean",
            "description": "Whether the business has previously issued at least one document of this `type`",
            "example": true
          },
          "first": {
            "type": "boolean",
            "description": "Whether this would be the first document of this `type` for the business",
            "example": false
          },
          "lastDocumentDate": {
            "type": "string",
            "description": "Date of the most recent document of this `type` issued by the business, in the format `YYYY-MM-DD`",
            "example": "2026-05-18"
          },
          "today": {
            "type": "string",
            "description": "Today's date in the business's timezone, in the format `YYYY-MM-DD`",
            "example": "2026-06-04"
          },
          "settings": {
            "type": "object",
            "description": "Business-level defaults that apply when creating a new document of this `type`",
            "required": [
              "documentCurrency",
              "documentLang",
              "documentRounding",
              "documentVatType",
              "rowVatType",
              "mixedVatEnabled",
              "receiptIncomeEnabled",
              "unsignedEnabled",
              "attachmentEnabled",
              "selectedPaymentChannels",
              "taxAuthorityProformaInvoiceEnabled",
              "taxAuthorityConnected"
            ],
            "properties": {
              "documentCurrency": {
                "$ref": "#/components/schemas/Currency"
              },
              "documentLang": {
                "$ref": "#/components/schemas/Lang"
              },
              "documentRounding": {
                "type": "boolean",
                "description": "Whether to round document totals by default",
                "example": false
              },
              "documentVatType": {
                "$ref": "#/components/schemas/DocumentVatType"
              },
              "rowVatType": {
                "$ref": "#/components/schemas/ItemVatType"
              },
              "mixedVatEnabled": {
                "type": "boolean",
                "description": "Whether the business allows documents containing both exempt and taxable rows",
                "example": true
              },
              "receiptIncomeEnabled": {
                "type": "boolean",
                "description": "Whether receipts may include income rows for this business",
                "example": false
              },
              "unsignedEnabled": {
                "type": "boolean",
                "description": "Whether unsigned documents are permitted for this business",
                "example": false
              },
              "attachmentEnabled": {
                "type": "boolean",
                "description": "Whether attachments may be included in documents for this business",
                "example": true
              },
              "selectedPaymentChannels": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/PaymentPluginGroup"
                },
                "description": "Payment plugin groups enabled for documents in this business",
                "example": [
                  100,
                  120,
                  150,
                  160
                ]
              },
              "taxAuthorityProformaInvoiceEnabled": {
                "type": "boolean",
                "description": "Whether proforma invoices are reported to the Tax Authority for this business",
                "example": true
              },
              "taxAuthorityConnected": {
                "type": "boolean",
                "description": "Whether the business is connected to the Israeli Tax Authority's confirmation system",
                "example": false
              }
            }
          },
          "selfInvoiceEnabled": {
            "type": "boolean",
            "description": "Whether the business may issue self-invoices for this document type",
            "example": true
          },
          "incomeRowsEnabled": {
            "type": "boolean",
            "description": "Whether income rows are supported on this document type",
            "example": true
          },
          "incomeRowsRequired": {
            "type": "boolean",
            "description": "Whether income rows are required on this document type",
            "example": true
          },
          "paymentRowsEnabled": {
            "type": "boolean",
            "description": "Whether payment rows are supported on this document type",
            "example": false
          },
          "reverseCharge": {
            "type": "boolean",
            "description": "Whether reverse-charge VAT applies to this document",
            "example": false
          },
          "payable": {
            "type": "boolean",
            "description": "Whether this document type accepts payments",
            "example": true
          },
          "exemption": {
            "type": "boolean",
            "description": "Whether the business is exempt from VAT",
            "example": false
          },
          "vatRate": {
            "type": "number",
            "description": "VAT rate that will apply to a new document, expressed as a decimal fraction (e.g. 0.18 for 18%)",
            "example": 0.18
          },
          "vatTypes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DocumentVatType"
            },
            "description": "VAT types available for use on this document",
            "example": [
              0,
              1,
              2
            ]
          },
          "paymentPlugins": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Plugin"
            },
            "description": "Active payment plugins available to this business for documents of this type"
          },
          "linkedDocumentIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Returned only when the request is part of a linked-document flow (e.g. creating a receipt from an invoice). The IDs of the documents being linked."
          },
          "linkedPaymentId": {
            "type": "string",
            "format": "uuid",
            "description": "Returned only when the request is part of a linked-document flow. The ID of the payment being linked."
          },
          "linkType": {
            "$ref": "#/components/schemas/DocumentLinkType",
            "description": "Returned only when the request is part of a linked-document flow. Describes the relationship between the new document and the documents identified by `linkedDocumentIds`."
          },
          "hasTaxAuthorityConfirmation": {
            "type": "boolean",
            "description": "Whether this document type requires Tax Authority confirmation in this business's type",
            "example": false
          }
        }
      },
      "TemplateSkin": {
        "type": "object",
        "required": [
          "id",
          "attributes"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "description": "Skin ID within the template",
            "example": 1
          },
          "attributes": {
            "type": "object",
            "description": "The skin's visual attributes",
            "required": [
              "color1"
            ],
            "properties": {
              "color1": {
                "type": "string",
                "description": "The first colour HEX code",
                "example": "#FF1919"
              },
              "color2": {
                "type": "string",
                "description": "The second colour HEX code. Omitted for single-colour templates.",
                "example": "#FFFFFF"
              }
            },
            "additionalProperties": true
          }
        }
      },
      "Template": {
        "type": "object",
        "required": [
          "id",
          "name",
          "description",
          "defaultSkinId",
          "skins"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "description": "The template ID",
            "example": 6
          },
          "name": {
            "type": "string",
            "description": "The name of the template",
            "example": "דריי מרטיני"
          },
          "description": {
            "type": "string",
            "description": "A description of the template — typically usage notes or recommended logo size",
            "example": "כדי שהלוגו לא ייראה מפוקסל, מומלץ להעלות קובץ בגודל מינימלי של 450x300 פיקסלים."
          },
          "defaultSkinId": {
            "type": "integer",
            "description": "The default skin ID for this template",
            "example": 8
          },
          "skins": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TemplateSkin"
            },
            "description": "Available skins (colour variants) for this template"
          }
        }
      },
      "DocumentTypeMapItem": {
        "type": "object",
        "required": [
          "id",
          "name"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/DocumentType"
          },
          "name": {
            "type": "string",
            "description": "Localised name of the document type, in the language indicated by the `lang` query parameter",
            "example": "הצעת מחיר"
          }
        }
      },
      "DocumentStatusMapItem": {
        "type": "object",
        "required": [
          "id",
          "name"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/DocumentStatus"
          },
          "name": {
            "type": "string",
            "description": "Localised name of the document status, in the language indicated by the `lang` query parameter",
            "example": "מסמך פתוח"
          }
        }
      },
      "LinkedDocument": {
        "type": "object",
        "required": [
          "id",
          "currency"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Linked document ID",
            "example": "a8804e5b-1031-4868-8332-76efb328961f"
          },
          "type": {
            "$ref": "#/components/schemas/DocumentType"
          },
          "number": {
            "type": "integer",
            "description": "Document serial number",
            "example": 12323
          },
          "documentDate": {
            "type": "string",
            "description": "Document date in the format `YYYY-MM-DD`",
            "example": "2026-05-12"
          },
          "amount": {
            "type": "number",
            "description": "Document amount",
            "example": 354
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          },
          "currencyRate": {
            "type": "number",
            "description": "Currency rate relative to ILS",
            "example": 1
          },
          "status": {
            "$ref": "#/components/schemas/DocumentStatus"
          }
        }
      },
      "DiscountResponse": {
        "type": "object",
        "required": [
          "amount",
          "type",
          "total"
        ],
        "properties": {
          "amount": {
            "type": "number",
            "description": "Discount amount (excluded from VAT)",
            "example": 10
          },
          "type": {
            "type": "string",
            "description": "Discount amount type.\n\n| Value | Meaning |\n|-------|---------|\n| `sum` | Amount in currency units |\n| `percentage` | Amount in percentage units |",
            "example": "sum"
          },
          "total": {
            "type": "number",
            "description": "Total discount applied to the document (server-computed, typically negative)",
            "example": -22
          }
        }
      },
      "Document": {
        "type": "object",
        "required": [
          "id",
          "type",
          "number",
          "documentDate",
          "status",
          "lang",
          "currency",
          "amount"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The document unique ID",
            "example": "57ae2ff9-0c24-43e8-b39c-a5bdcc05573d"
          },
          "description": {
            "type": "string",
            "description": "Document description",
            "example": "Just an order"
          },
          "type": {
            "$ref": "#/components/schemas/DocumentType"
          },
          "number": {
            "type": "integer",
            "description": "Document serial number",
            "example": 40034
          },
          "documentDate": {
            "type": "string",
            "description": "Document reference date in the format `YYYY-MM-DD`",
            "example": "2026-05-12"
          },
          "creationDate": {
            "type": "integer",
            "format": "int64",
            "description": "Creation date Unix timestamp (in seconds)",
            "example": 1718049888
          },
          "status": {
            "$ref": "#/components/schemas/DocumentStatus"
          },
          "lang": {
            "$ref": "#/components/schemas/Lang"
          },
          "footer": {
            "type": "string",
            "description": "Document footer text",
            "example": "Texts in footer"
          },
          "remarks": {
            "type": "string",
            "description": "Document remarks",
            "example": "Some remarks"
          },
          "amount": {
            "type": "number",
            "description": "Total amount, in requested currency (including the VAT, Discount & Rounding)",
            "example": 354
          },
          "amountLocal": {
            "type": "number",
            "description": "Total amount in local currency, including VAT, discount, and rounding",
            "example": 354
          },
          "amountOpened": {
            "type": "number",
            "description": "The amount that is still left to be paid, exists only in payment request documents",
            "example": 0
          },
          "amountDueVat": {
            "type": "number",
            "description": "Amount due VAT - Amount before VAT, and before rounding & discount (if requested)",
            "example": 300
          },
          "amountExemptVat": {
            "type": "number",
            "description": "Amount exempt VAT - 0 unless there's one or more items that are excluded of VAT such as mixed documents (that have both VAT excluded & included items)",
            "example": 0
          },
          "amountExcludeVat": {
            "type": "number",
            "description": "Amount excluded from VAT",
            "example": 0
          },
          "vat": {
            "type": "number",
            "description": "VAT amount",
            "example": 54
          },
          "vatRate": {
            "type": "number",
            "description": "VAT rate applied to the document",
            "example": 0.18
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          },
          "currencyRate": {
            "type": "number",
            "description": "Currency rate relative to ILS",
            "example": 1
          },
          "vatType": {
            "$ref": "#/components/schemas/DocumentVatType"
          },
          "client": {
            "type": "object",
            "description": "Client linked to the document",
            "properties": {
              "id": {
                "type": "string",
                "description": "The client ID",
                "example": "7944827a-c664-11e4-8231-080027271114"
              },
              "name": {
                "type": "string",
                "description": "The client name",
                "example": "John Doe"
              },
              "taxId": {
                "type": "string",
                "description": "The client tax ID",
                "example": "0123456789"
              },
              "department": {
                "type": "string",
                "description": "The client department",
                "example": "Sales"
              },
              "address": {
                "type": "string",
                "description": "The client address",
                "example": "1 Luria St"
              },
              "city": {
                "type": "string",
                "description": "The client city",
                "example": "Tel Aviv"
              },
              "zip": {
                "type": "string",
                "description": "The client zip code",
                "example": "1234567"
              },
              "country": {
                "type": "string",
                "description": "2-letter ISO 3166-1 alpha-2 country code. Defaults to `IL` (Israel). Use the [Get Supported Countries](#operation/getSupportedCountries) endpoint to retrieve the full list.",
                "example": "IL"
              },
              "phone": {
                "type": "string",
                "description": "The client phone number",
                "example": "+972-54-1234567"
              },
              "fax": {
                "type": "string",
                "description": "The client fax number",
                "example": "+972-54-1234567"
              },
              "mobile": {
                "type": "string",
                "description": "The client mobile number",
                "example": "+972-54-1234567"
              },
              "emails": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "The client email addresses",
                "example": [
                  "email1@example.com"
                ]
              },
              "self": {
                "type": "boolean",
                "description": "Is this a self-invoice?",
                "example": false
              }
            }
          },
          "business": {
            "type": "object",
            "description": "Business that issued the document",
            "properties": {
              "type": {
                "$ref": "#/components/schemas/BusinessType"
              },
              "taxId": {
                "type": "string",
                "description": "Business tax ID",
                "example": "123456789"
              },
              "name": {
                "type": "string",
                "description": "Business name",
                "example": "עסק לדוגמה"
              },
              "title": {
                "type": "string",
                "description": "Business title",
                "example": "כותרת לעסק"
              },
              "address": {
                "type": "string",
                "description": "Business address",
                "example": "רחוב סוקולוב 15"
              },
              "city": {
                "type": "string",
                "description": "Business city",
                "example": "תל אביב-יפו"
              },
              "zip": {
                "type": "string",
                "description": "Business ZIP code",
                "example": "6291790"
              },
              "phone": {
                "type": "string",
                "description": "Business phone number",
                "example": "054-1234567"
              },
              "fax": {
                "type": "string",
                "description": "Business fax number",
                "example": "054-1234567"
              },
              "mobile": {
                "type": "string",
                "description": "Business mobile number",
                "example": "054-1234567"
              },
              "website": {
                "type": "string",
                "description": "Business website",
                "example": "https://www.greeninvoice.co.il"
              },
              "email": {
                "type": "string",
                "description": "Business email",
                "example": "john@gmail.com"
              },
              "bankName": {
                "type": "string",
                "description": "Business bank name",
                "example": "לאומי"
              },
              "bankBranch": {
                "type": "string",
                "description": "Business bank branch number",
                "example": "44"
              },
              "bankAccount": {
                "type": "string",
                "description": "Business bank account number",
                "example": "565656565656"
              },
              "bankSwift": {
                "type": "string",
                "description": "Business SWIFT clearing code",
                "example": "FIRBILIT"
              },
              "bankAba": {
                "type": "string",
                "description": "Business ABA clearing code",
                "example": "04064927"
              },
              "bankIban": {
                "type": "string",
                "description": "Business IBAN code",
                "example": "IL170108000000012612345"
              },
              "bankBeneficiary": {
                "type": "string",
                "description": "Business beneficiary name",
                "example": "יעקב כהן"
              },
              "exemption": {
                "type": "boolean",
                "description": "Whether the business is VAT-exempt",
                "example": false
              }
            }
          },
          "data": {
            "type": "object",
            "description": "Tax Authority confirmation data",
            "properties": {
              "taxAuthorityConfirmationNumber": {
                "type": "string",
                "description": "Tax Authority confirmation number initiated for the document",
                "example": "20241104100000000000001"
              },
              "taxAuthorityConfirmationInitiated": {
                "type": "boolean",
                "description": "Whether an attempt was made to obtain a confirmation number from the Tax Authority for the document",
                "example": true
              },
              "taxAuthorityConfirmationLastError": {
                "type": "integer",
                "description": "Inner errorCode from the most recent Tax Authority confirmation attempt. 0 indicates success; a non-zero value indicates a failure.",
                "example": 0
              }
            }
          },
          "income": {
            "type": "array",
            "description": "Income rows",
            "items": {
              "$ref": "#/components/schemas/IncomeRow"
            }
          },
          "payment": {
            "type": "array",
            "description": "Payment rows",
            "items": {
              "$ref": "#/components/schemas/DocumentPaymentRow"
            }
          },
          "linkedDocuments": {
            "type": "array",
            "description": "Documents linked to this one",
            "items": {
              "$ref": "#/components/schemas/LinkedDocument"
            }
          },
          "ref": {
            "type": "array",
            "description": "The referred document types.\n\n| Code | Type |\n|------|------|\n| 10 | הצעת מחיר |\n| 100 | הזמנה |\n| 200 | תעודת משלוח |\n| 210 | תעודת החזרה |\n| 300 | חשבון עסקה |\n| 305 | חשבונית מס |\n| 320 | חשבונית מס / קבלה |\n| 330 | חשבונית זיכוי |\n| 400 | קבלה |\n| 405 | קבלה על תרומה |\n| 410 | ביטול תרומה |\n| 500 | הזמנת רכש |\n| 600 | קבלת פיקדון |\n| 610 | משיכת פיקדון |",
            "items": {
              "$ref": "#/components/schemas/DocumentType"
            }
          },
          "signed": {
            "type": "boolean",
            "description": "Is this document digitally signed",
            "example": true
          },
          "cancellable": {
            "type": "boolean",
            "description": "Is this document cancellable",
            "example": false
          },
          "rounding": {
            "type": "boolean",
            "description": "Whether the sum was rounded or not",
            "example": false
          },
          "discount": {
            "$ref": "#/components/schemas/DiscountResponse"
          },
          "url": {
            "type": "object",
            "description": "Document download URLs",
            "properties": {
              "he": {
                "type": "string",
                "description": "Copy in Hebrew"
              },
              "origin": {
                "type": "string",
                "description": "Origin document URL"
              },
              "en": {
                "type": "string",
                "description": "Copy in English (if lang was `en`)"
              }
            }
          },
          "paymentUrl": {
            "type": "string",
            "description": "URL of the hosted payment (bill) page for this document, where the client can pay it online. Returned only when the document was issued with a payment button (i.e. it has an associated payment request).",
            "example": "https://pages.greeninvoice.co.il/payments/bills/3fa85f64-5717-4562-b3fc-2c963f66afa6"
          },
          "allocationNumber": {
            "type": "string",
            "description": "Allocation Number issued by the Israeli Tax Authority",
            "example": "20220101163314614014050888"
          }
        }
      },
      "DocumentDownloadLinks": {
        "type": "object",
        "description": "Document download URLs.",
        "properties": {
          "he": {
            "type": "string",
            "description": "Copy link in Hebrew"
          },
          "en": {
            "type": "string",
            "description": "Copy link in English (if applicable)"
          },
          "origin": {
            "type": "string",
            "description": "Original document"
          }
        }
      },
      "UpdatedDocument": {
        "type": "object",
        "required": [
          "id",
          "type",
          "number",
          "documentDate",
          "status",
          "lang",
          "currency",
          "amount"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The document unique ID",
            "example": "57ae2ff9-0c24-43e8-b39c-a5bdcc05573d"
          },
          "description": {
            "type": "string",
            "description": "Document description",
            "example": "Just an order"
          },
          "type": {
            "$ref": "#/components/schemas/DocumentType"
          },
          "number": {
            "type": "integer",
            "description": "Document serial number",
            "example": 40034
          },
          "documentDate": {
            "type": "string",
            "description": "Document reference date in the format `YYYY-MM-DD`",
            "example": "2026-05-12"
          },
          "creationDate": {
            "type": "integer",
            "format": "int64",
            "description": "Creation date Unix timestamp (in seconds)",
            "example": 1718049888
          },
          "status": {
            "$ref": "#/components/schemas/DocumentStatus"
          },
          "lang": {
            "$ref": "#/components/schemas/Lang"
          },
          "footer": {
            "type": "string",
            "description": "Document footer text",
            "example": "Texts in footer"
          },
          "remarks": {
            "type": "string",
            "description": "Document remarks",
            "example": "Some remarks"
          },
          "amount": {
            "type": "number",
            "description": "Total amount, in requested currency (including the VAT, Discount & Rounding)",
            "example": 354
          },
          "amountLocal": {
            "type": "number",
            "description": "Total amount in local currency, including VAT, discount, and rounding",
            "example": 354
          },
          "amountOpened": {
            "type": "number",
            "description": "The amount that is still left to be paid, exists only in payment request documents",
            "example": 0
          },
          "amountDueVat": {
            "type": "number",
            "description": "Amount due VAT - Amount before VAT, and before rounding & discount (if requested)",
            "example": 300
          },
          "amountExemptVat": {
            "type": "number",
            "description": "Amount exempt VAT - 0 unless there's one or more items that are excluded of VAT such as mixed documents (that have both VAT excluded & included items)",
            "example": 0
          },
          "amountExcludeVat": {
            "type": "number",
            "description": "Amount excluded from VAT",
            "example": 0
          },
          "vat": {
            "type": "number",
            "description": "VAT amount",
            "example": 54
          },
          "vatRate": {
            "type": "number",
            "description": "VAT rate applied to the document",
            "example": 0.18
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          },
          "currencyRate": {
            "type": "number",
            "description": "Currency rate relative to ILS",
            "example": 1
          },
          "vatType": {
            "$ref": "#/components/schemas/DocumentVatType"
          },
          "client": {
            "type": "object",
            "description": "Client linked to the document",
            "properties": {
              "id": {
                "type": "string",
                "description": "The client ID",
                "example": "7944827a-c664-11e4-8231-080027271114"
              },
              "name": {
                "type": "string",
                "description": "The client name",
                "example": "John Doe"
              },
              "taxId": {
                "type": "string",
                "description": "The client tax ID",
                "example": "0123456789"
              },
              "department": {
                "type": "string",
                "description": "The client department",
                "example": "Sales"
              },
              "address": {
                "type": "string",
                "description": "The client address",
                "example": "1 Luria St"
              },
              "city": {
                "type": "string",
                "description": "The client city",
                "example": "Tel Aviv"
              },
              "zip": {
                "type": "string",
                "description": "The client zip code",
                "example": "1234567"
              },
              "country": {
                "type": "string",
                "description": "2-letter ISO 3166-1 alpha-2 country code. Defaults to `IL` (Israel). Use the [Get Supported Countries](#operation/getSupportedCountries) endpoint to retrieve the full list.",
                "example": "IL"
              },
              "phone": {
                "type": "string",
                "description": "The client phone number",
                "example": "+972-54-1234567"
              },
              "fax": {
                "type": "string",
                "description": "The client fax number",
                "example": "+972-54-1234567"
              },
              "mobile": {
                "type": "string",
                "description": "The client mobile number",
                "example": "+972-54-1234567"
              },
              "emails": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "The client email addresses",
                "example": [
                  "email1@example.com"
                ]
              },
              "self": {
                "type": "boolean",
                "description": "Is this a self-invoice?",
                "example": false
              }
            }
          },
          "data": {
            "type": "object",
            "description": "Tax Authority confirmation data",
            "properties": {
              "taxAuthorityConfirmationNumber": {
                "type": "string",
                "description": "Tax Authority confirmation number initiated for the document",
                "example": "20241104100000000000001"
              },
              "taxAuthorityConfirmationInitiated": {
                "type": "boolean",
                "description": "Whether an attempt was made to obtain a confirmation number from the Tax Authority for the document",
                "example": true
              },
              "taxAuthorityConfirmationLastError": {
                "type": "integer",
                "description": "Inner errorCode from the most recent Tax Authority confirmation attempt. 0 indicates success; a non-zero value indicates a failure.",
                "example": 0
              }
            }
          },
          "income": {
            "type": "array",
            "description": "Income rows",
            "items": {
              "$ref": "#/components/schemas/IncomeRow"
            }
          },
          "payment": {
            "type": "array",
            "description": "Payment rows",
            "items": {
              "$ref": "#/components/schemas/DocumentPaymentRow"
            }
          },
          "linkedDocuments": {
            "type": "array",
            "description": "Documents linked to this one",
            "items": {
              "$ref": "#/components/schemas/LinkedDocument"
            }
          },
          "ref": {
            "type": "array",
            "description": "The referred document types.\n\n| Code | Type |\n|------|------|\n| 10 | הצעת מחיר |\n| 100 | הזמנה |\n| 200 | תעודת משלוח |\n| 210 | תעודת החזרה |\n| 300 | חשבון עסקה |\n| 305 | חשבונית מס |\n| 320 | חשבונית מס / קבלה |\n| 330 | חשבונית זיכוי |\n| 400 | קבלה |\n| 405 | קבלה על תרומה |\n| 410 | ביטול תרומה |\n| 500 | הזמנת רכש |\n| 600 | קבלת פיקדון |\n| 610 | משיכת פיקדון |",
            "items": {
              "$ref": "#/components/schemas/DocumentType"
            }
          },
          "signed": {
            "type": "boolean",
            "description": "Is this document digitally signed",
            "example": true
          },
          "cancellable": {
            "type": "boolean",
            "description": "Is this document cancellable",
            "example": false
          },
          "rounding": {
            "type": "boolean",
            "description": "Whether the sum was rounded or not",
            "example": false
          },
          "discount": {
            "$ref": "#/components/schemas/DiscountResponse"
          },
          "url": {
            "type": "object",
            "description": "Document download URLs",
            "properties": {
              "he": {
                "type": "string",
                "description": "Copy in Hebrew"
              },
              "origin": {
                "type": "string",
                "description": "Origin document URL"
              },
              "en": {
                "type": "string",
                "description": "Copy in English (if lang was `en`)"
              }
            }
          },
          "allocationNumber": {
            "type": "string",
            "description": "Allocation Number issued by the Israeli Tax Authority",
            "example": "20220101163314614014050888"
          }
        }
      },
      "ItemRequest": {
        "type": "object",
        "required": [
          "name",
          "description",
          "price",
          "currency"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 32,
            "description": "The item name. For example: `גבינייה מפוארת`.",
            "example": "גבינייה מפוארת"
          },
          "description": {
            "type": "string",
            "description": "The item description. For example: `מאפה גבינייה אישי ומפואר`.",
            "example": "מאפה גבינייה אישי ומפואר"
          },
          "price": {
            "type": "number",
            "description": "The item price. For example: 5.",
            "example": 5
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          }
        }
      },
      "Item": {
        "type": "object",
        "required": [
          "id",
          "name",
          "price",
          "currency",
          "creationDate",
          "lastUpdateDate"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The item ID",
            "example": "ff27e4fe-29d9-4f6f-b6a0-f43cdf635702"
          },
          "name": {
            "type": "string",
            "description": "The item name",
            "example": "גבינייה מפוארת"
          },
          "description": {
            "type": "string",
            "description": "The item description",
            "example": "מאפה גבינייה אישי ומפואר"
          },
          "price": {
            "type": "number",
            "description": "The item price",
            "example": 5
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          },
          "creationDate": {
            "type": "integer",
            "format": "int64",
            "description": "Creation date Unix timestamp (in seconds)",
            "example": 1780836793
          },
          "lastUpdateDate": {
            "type": "integer",
            "format": "int64",
            "description": "Last update date Unix timestamp (in seconds)",
            "example": 1780836793
          }
        }
      },
      "UpdateItemRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 32,
            "description": "The item name. For example: `גבינייה מפוארת`.",
            "example": "גבינייה מפוארת"
          },
          "description": {
            "type": "string",
            "maxLength": 500,
            "description": "The item description. For example: `מאפה גבינה ודובדני אמרנה אישי ומפואר`.",
            "example": "מאפה גבינה ודובדני אמרנה אישי ומפואר"
          },
          "price": {
            "type": "number",
            "description": "The item price. For example: 4.",
            "example": 4
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          }
        }
      },
      "SearchItemsRequest": {
        "type": "object",
        "description": "Filters for the item search. All fields are optional.",
        "properties": {
          "page": {
            "type": "integer",
            "description": "Page number to retrieve. Defaults to 1.",
            "default": 1,
            "example": 1
          },
          "pageSize": {
            "type": "integer",
            "description": "Number of results per page. Defaults to 25.",
            "default": 25,
            "example": 25
          },
          "name": {
            "type": "string",
            "description": "Filter by item name. For example: `גבינייה מפוארת`.",
            "example": "גבינייה מפוארת"
          },
          "description": {
            "type": "string",
            "description": "Filter by item description. For example: `מאפה גבינה`.",
            "example": "מאפה גבינה"
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          }
        }
      },
      "SearchItem": {
        "type": "object",
        "required": [
          "id",
          "name",
          "price",
          "currency",
          "creationDate"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The item ID",
            "example": "df700df9-27d2-4b03-aa8d-d65a63e37542"
          },
          "name": {
            "type": "string",
            "description": "The item name",
            "example": "גבינייה מפוארת"
          },
          "description": {
            "type": "string",
            "description": "The item description",
            "example": "מאפה גבינה ודובדני אמרנה אישי ומפואר"
          },
          "price": {
            "type": "number",
            "description": "The item price",
            "example": 5
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          },
          "creationDate": {
            "type": "integer",
            "format": "int64",
            "description": "Creation date Unix timestamp (in seconds)",
            "example": 1780910969
          }
        }
      },
      "SearchItemsResponse": {
        "type": "object",
        "required": [
          "total",
          "page",
          "pageSize",
          "from",
          "to",
          "pages",
          "items"
        ],
        "properties": {
          "total": {
            "type": "integer",
            "description": "Total number of items matching the search",
            "example": 1
          },
          "page": {
            "type": "integer",
            "description": "The requested page number",
            "example": 1
          },
          "pageSize": {
            "type": "integer",
            "description": "The requested page size",
            "example": 25
          },
          "from": {
            "type": "integer",
            "description": "Index of the first item in the current page",
            "example": 1
          },
          "to": {
            "type": "integer",
            "description": "Index of the last item in the current page",
            "example": 1
          },
          "pages": {
            "type": "integer",
            "description": "Total number of pages available",
            "example": 1
          },
          "items": {
            "type": "array",
            "description": "The items matching the search",
            "items": {
              "$ref": "#/components/schemas/SearchItem"
            }
          }
        }
      },
      "PaymentTerm": {
        "type": "integer",
        "description": "Payment term.\n\n| Code | Term |\n|------|------|\n| -1 | מיידי |\n| 0 | שוטף |\n| 10 | שוטף +10 |\n| 15 | שוטף +15 |\n| 30 | שוטף +30 |\n| 45 | שוטף +45 |\n| 60 | שוטף +60 |\n| 75 | שוטף +75 |\n| 90 | שוטף +90 |\n| 120 | שוטף +120 |",
        "example": 0
      },
      "ClientRequest": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "The client name. For example: `יעקב יעקבי`.",
            "example": "יעקב יעקבי"
          },
          "active": {
            "type": "boolean",
            "description": "Is the client currently active or not. Defaults to `true`.",
            "example": true
          },
          "send": {
            "type": "boolean",
            "description": "Whether to automatically send emails to the client when assigning them to a document. Defaults to `true` when the client has at least one email address.",
            "example": true
          },
          "department": {
            "type": "string",
            "description": "The client department. For example: `מחלקת כספים`.",
            "example": "מחלקת כספים"
          },
          "taxId": {
            "type": "string",
            "description": "The client tax ID. For example: `999152580`.",
            "example": "999152580"
          },
          "accountingKey": {
            "type": "string",
            "description": "The client accounting key. Generated automatically if omitted. For example: `b6230777`.",
            "example": "b6230777"
          },
          "paymentTerms": {
            "$ref": "#/components/schemas/PaymentTerm"
          },
          "bankName": {
            "type": "string",
            "description": "The client bank name. For example: `12`.",
            "example": "12"
          },
          "bankBranch": {
            "type": "string",
            "description": "The client bank branch number. For example: `450`.",
            "example": "450"
          },
          "bankAccount": {
            "type": "string",
            "description": "The client bank account number. For example: `1111`.",
            "example": "1111"
          },
          "address": {
            "type": "string",
            "description": "The client address. For example: `הרצל 5`.",
            "example": "הרצל 5"
          },
          "city": {
            "type": "string",
            "description": "The client city. For example: `תל אביב`.",
            "example": "תל אביב"
          },
          "zip": {
            "type": "string",
            "description": "The client ZIP code. For example: `5555`.",
            "example": "5555"
          },
          "country": {
            "type": "string",
            "description": "2-letter ISO 3166-1 alpha-2 country code. Defaults to `IL` (Israel). Use the [Get Supported Countries](#operation/getSupportedCountries) endpoint to retrieve the full list. For example: `IL`.",
            "example": "IL"
          },
          "category": {
            "type": "integer",
            "description": "The business category code this client is related to. Use the [Get Supported Business Categories](#operation/getSupportedBusinessCategories) endpoint to retrieve the full list. For example: 4.",
            "example": 4
          },
          "subCategory": {
            "type": "integer",
            "description": "The business sub-category code this client is related to. Use the [Get Supported Business Categories](#operation/getSupportedBusinessCategories) endpoint to retrieve the full list. For example: 406.",
            "example": 406
          },
          "phone": {
            "type": "string",
            "description": "The client phone number. For example: `0505555555`.",
            "example": "0505555555"
          },
          "fax": {
            "type": "string",
            "description": "The client fax number. For example: `033333333`.",
            "example": "033333333"
          },
          "mobile": {
            "type": "string",
            "description": "The client mobile number. For example: `033333333`.",
            "example": "033333333"
          },
          "remarks": {
            "type": "string",
            "description": "Client remarks for internal use. For example: `לקוח קבוע`.",
            "example": "לקוח קבוע"
          },
          "contactPerson": {
            "type": "string",
            "description": "The client contact person name. For example: `יעקב`.",
            "example": "יעקב"
          },
          "emails": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 5,
            "description": "The client email addresses (up to 5). For example: `[\"test@test-yakov.com\"]`.",
            "example": [
              "test@test-yakov.com"
            ]
          },
          "labels": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 3,
            "description": "Label IDs to assign to the client (up to 3). For example: `[\"3777a6ef-fac3-4b2e-a296-238d5dcd6450\"]`.",
            "example": [
              "3777a6ef-fac3-4b2e-a296-238d5dcd6450"
            ]
          },
          "balance": {
            "type": "number",
            "description": "Opening balance for the client. This value is primarily computed by the system from the client's documents and payments; provide it only to set an initial balance. For example: 0.",
            "example": 0
          }
        }
      },
      "Client": {
        "type": "object",
        "required": [
          "id",
          "name",
          "active",
          "send",
          "paymentTerms",
          "incomeAmount",
          "paymentAmount",
          "balanceAmount",
          "creationDate",
          "lastUpdateDate"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The client ID",
            "example": "42aa171f-d031-4f3f-bec4-ff60c04eeafc"
          },
          "name": {
            "type": "string",
            "description": "The client name",
            "example": "יעקב יעקבי"
          },
          "active": {
            "type": "boolean",
            "description": "Is the client currently active or not",
            "example": true
          },
          "send": {
            "type": "boolean",
            "description": "Whether emails are automatically sent to the client when assigning them to a document. Set automatically on creation based on whether the client has any email addresses.",
            "example": true
          },
          "department": {
            "type": "string",
            "description": "The client department",
            "example": "מחלקת כספים"
          },
          "taxId": {
            "type": "string",
            "description": "The client tax ID",
            "example": "999152580"
          },
          "accountingKey": {
            "type": "string",
            "description": "The client accounting key",
            "example": "b6230777"
          },
          "paymentTerms": {
            "$ref": "#/components/schemas/PaymentTerm"
          },
          "bankName": {
            "type": "string",
            "description": "The client bank name",
            "example": "12"
          },
          "bankBranch": {
            "type": "string",
            "description": "The client bank branch number",
            "example": "450"
          },
          "bankAccount": {
            "type": "string",
            "description": "The client bank account number",
            "example": "1111"
          },
          "address": {
            "type": "string",
            "description": "The client address",
            "example": "הרצל 5"
          },
          "city": {
            "type": "string",
            "description": "The client city",
            "example": "תל אביב"
          },
          "zip": {
            "type": "string",
            "description": "The client ZIP code",
            "example": "5555"
          },
          "country": {
            "type": "string",
            "description": "2-letter ISO 3166-1 alpha-2 country code",
            "example": "IL"
          },
          "category": {
            "type": "integer",
            "description": "The business category code this client is related to. Use the [Get Supported Business Categories](#operation/getSupportedBusinessCategories) endpoint to retrieve the full list.",
            "example": 4
          },
          "subCategory": {
            "type": "integer",
            "description": "The business sub-category code this client is related to. Use the [Get Supported Business Categories](#operation/getSupportedBusinessCategories) endpoint to retrieve the full list.",
            "example": 406
          },
          "phone": {
            "type": "string",
            "description": "The client phone number",
            "example": "0505555555"
          },
          "fax": {
            "type": "string",
            "description": "The client fax number",
            "example": "033333333"
          },
          "mobile": {
            "type": "string",
            "description": "The client mobile number",
            "example": "033333333"
          },
          "emails": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The client email addresses",
            "example": [
              "test@test-yakov.com"
            ]
          },
          "labels": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "IDs of the labels assigned to the client",
            "example": [
              "7bd2d410-74fe-47e1-b5a3-3e544cbe2a71"
            ]
          },
          "remarks": {
            "type": "string",
            "description": "Client remarks for internal use",
            "example": ""
          },
          "contactPerson": {
            "type": "string",
            "description": "The client contact person name",
            "example": "יעקב"
          },
          "incomeAmount": {
            "type": "number",
            "description": "Total income recorded from the client. Computed by the system.",
            "example": 0
          },
          "paymentAmount": {
            "type": "number",
            "description": "Total payments received from the client. Computed by the system.",
            "example": 0
          },
          "creationDate": {
            "type": "integer",
            "format": "int64",
            "description": "Creation date Unix timestamp (in seconds)",
            "example": 1781422213
          },
          "lastUpdateDate": {
            "type": "integer",
            "format": "int64",
            "description": "Last update date Unix timestamp (in seconds)",
            "example": 1781422213
          },
          "balanceAmount": {
            "type": "number",
            "description": "The client balance amount. Computed as paymentAmount minus incomeAmount.",
            "example": 0
          }
        }
      },
      "UpdateClientRequest": {
        "type": "object",
        "description": "Fields to update on the client. All fields are optional — only the fields you send are applied.",
        "properties": {
          "name": {
            "type": "string",
            "description": "The client name. For example: `יעקב יעקבי`.",
            "example": "יעקב יעקבי"
          },
          "active": {
            "type": "boolean",
            "description": "Whether the client is currently active. For example: `true`.",
            "example": true
          },
          "send": {
            "type": "boolean",
            "description": "Whether emails are automatically sent to the client when assigning them to a document. For example: `true`.",
            "example": true
          },
          "department": {
            "type": "string",
            "description": "The client department. For example: `מחלקת כספים`.",
            "example": "מחלקת כספים"
          },
          "taxId": {
            "type": "string",
            "description": "The client tax ID. For example: `999152580`.",
            "example": "999152580"
          },
          "accountingKey": {
            "type": "string",
            "description": "The client accounting key. For example: `b6230777`.",
            "example": "b6230777"
          },
          "paymentTerms": {
            "$ref": "#/components/schemas/PaymentTerm"
          },
          "bankName": {
            "type": "string",
            "description": "The client bank name. For example: `12`.",
            "example": "12"
          },
          "bankBranch": {
            "type": "string",
            "description": "The client bank branch number. For example: `450`.",
            "example": "450"
          },
          "bankAccount": {
            "type": "string",
            "description": "The client bank account number. For example: `1111`.",
            "example": "1111"
          },
          "address": {
            "type": "string",
            "description": "The client address. For example: `הרצל 5`.",
            "example": "הרצל 5"
          },
          "city": {
            "type": "string",
            "description": "The client city. For example: `ראשון לציון`.",
            "example": "ראשון לציון"
          },
          "zip": {
            "type": "string",
            "description": "The client ZIP code. For example: `4444`.",
            "example": "4444"
          },
          "country": {
            "type": "string",
            "description": "2-letter ISO 3166-1 alpha-2 country code. Use the [Get Supported Countries](#operation/getSupportedCountries) endpoint to retrieve the full list. For example: `IL`.",
            "example": "IL"
          },
          "category": {
            "type": "integer",
            "description": "The business category code this client is related to. Use the [Get Supported Business Categories](#operation/getSupportedBusinessCategories) endpoint to retrieve the full list. For example: 4.",
            "example": 4
          },
          "subCategory": {
            "type": "integer",
            "description": "The business sub-category code this client is related to. Use the [Get Supported Business Categories](#operation/getSupportedBusinessCategories) endpoint to retrieve the full list. For example: 406.",
            "example": 406
          },
          "phone": {
            "type": "string",
            "description": "The client phone number. For example: `0505555555`.",
            "example": "0505555555"
          },
          "fax": {
            "type": "string",
            "description": "The client fax number. For example: `033333333`.",
            "example": "033333333"
          },
          "mobile": {
            "type": "string",
            "description": "The client mobile number. For example: `033333333`.",
            "example": "033333333"
          },
          "remarks": {
            "type": "string",
            "description": "Client remarks for internal use. For example: `לקוח קבוע`.",
            "example": "לקוח קבוע"
          },
          "contactPerson": {
            "type": "string",
            "description": "The client contact person name. For example: `יעקב`.",
            "example": "יעקב"
          },
          "emails": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 5,
            "description": "The client email addresses (up to 5). For example: `[\"test@test-yakov.com\"]`.",
            "example": [
              "test@test-yakov.com"
            ]
          },
          "labels": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 3,
            "description": "Label IDs to assign to the client (up to 3). For example: `[\"3777a6ef-fac3-4b2e-a296-238d5dcd6450\"]`.",
            "example": [
              "3777a6ef-fac3-4b2e-a296-238d5dcd6450"
            ]
          }
        }
      },
      "SearchClientsRequest": {
        "type": "object",
        "description": "Filters for searching clients. All fields are optional; an empty body returns all clients.",
        "properties": {
          "name": {
            "type": "string",
            "description": "Filter by client name. For example: `יעקב`.",
            "example": "יעקב"
          },
          "active": {
            "type": "boolean",
            "description": "Filter by active state. When omitted, both active and inactive clients are returned. For example: `true`.",
            "example": true
          },
          "email": {
            "type": "string",
            "description": "Filter by client email address. For example: `test@test-yakov.com`.",
            "example": "test@test-yakov.com"
          },
          "contactPerson": {
            "type": "string",
            "description": "Filter by contact person name. For example: `יעקב`.",
            "example": "יעקב"
          },
          "labels": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Filter by label IDs. For example: `[\"3777a6ef-fac3-4b2e-a296-238d5dcd6450\"]`.",
            "example": [
              "3777a6ef-fac3-4b2e-a296-238d5dcd6450"
            ]
          },
          "page": {
            "type": "integer",
            "description": "Page number to retrieve (1-based). Defaults to 1.",
            "example": 1
          },
          "pageSize": {
            "type": "integer",
            "description": "Number of results per page. Defaults to 25.",
            "example": 25
          }
        }
      },
      "SearchClient": {
        "type": "object",
        "required": [
          "id",
          "name",
          "active",
          "send",
          "paymentTerms",
          "incomeAmount",
          "paymentAmount",
          "balanceAmount",
          "creationDate",
          "lastUpdateDate"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The client ID",
            "example": "42aa171f-d031-4f3f-bec4-ff60c04eeafc"
          },
          "name": {
            "type": "string",
            "description": "The client name",
            "example": "יעקב יעקבי"
          },
          "active": {
            "type": "boolean",
            "description": "Is the client currently active or not",
            "example": true
          },
          "send": {
            "type": "boolean",
            "description": "Whether emails are automatically sent to the client when assigning them to a document. Set automatically on creation based on whether the client has any email addresses.",
            "example": true
          },
          "department": {
            "type": "string",
            "description": "The client department",
            "example": "מחלקת כספים"
          },
          "taxId": {
            "type": "string",
            "description": "The client tax ID",
            "example": "999152580"
          },
          "accountingKey": {
            "type": "string",
            "description": "The client accounting key",
            "example": "b6230777"
          },
          "paymentTerms": {
            "$ref": "#/components/schemas/PaymentTerm"
          },
          "bankName": {
            "type": "string",
            "description": "The client bank name",
            "example": "12"
          },
          "bankBranch": {
            "type": "string",
            "description": "The client bank branch number",
            "example": "450"
          },
          "bankAccount": {
            "type": "string",
            "description": "The client bank account number",
            "example": "1111"
          },
          "address": {
            "type": "string",
            "description": "The client address",
            "example": "הרצל 5"
          },
          "city": {
            "type": "string",
            "description": "The client city",
            "example": "ראשון לציון"
          },
          "zip": {
            "type": "string",
            "description": "The client ZIP code",
            "example": "4444"
          },
          "country": {
            "type": "string",
            "description": "2-letter ISO 3166-1 alpha-2 country code",
            "example": "IL"
          },
          "phone": {
            "type": "string",
            "description": "The client phone number",
            "example": "0505555555"
          },
          "fax": {
            "type": "string",
            "description": "The client fax number",
            "example": "033333333"
          },
          "mobile": {
            "type": "string",
            "description": "The client mobile number",
            "example": "033333333"
          },
          "emails": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The client email addresses",
            "example": [
              "test@test-yakov.com"
            ]
          },
          "labels": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "IDs of the labels assigned to the client",
            "example": [
              "7bd2d410-74fe-47e1-b5a3-3e544cbe2a71"
            ]
          },
          "remarks": {
            "type": "string",
            "description": "Client remarks for internal use",
            "example": ""
          },
          "contactPerson": {
            "type": "string",
            "description": "The client contact person name",
            "example": "יעקב"
          },
          "incomeAmount": {
            "type": "number",
            "description": "Total income recorded from the client. Computed by the system.",
            "example": 0
          },
          "paymentAmount": {
            "type": "number",
            "description": "Total payments received from the client. Computed by the system.",
            "example": 0
          },
          "creationDate": {
            "type": "integer",
            "format": "int64",
            "description": "Creation date Unix timestamp (in seconds)",
            "example": 1781422213
          },
          "lastUpdateDate": {
            "type": "integer",
            "format": "int64",
            "description": "Last update date Unix timestamp (in seconds)",
            "example": 1781525122
          },
          "balanceAmount": {
            "type": "number",
            "description": "The client balance amount. Computed as paymentAmount minus incomeAmount.",
            "example": 0
          }
        }
      },
      "SearchClientsResponse": {
        "type": "object",
        "properties": {
          "total": {
            "type": "integer",
            "description": "Total number of clients matching the search.",
            "example": 1
          },
          "page": {
            "type": "integer",
            "description": "The page number returned.",
            "example": 1
          },
          "pageSize": {
            "type": "integer",
            "description": "The number of results per page.",
            "example": 25
          },
          "pages": {
            "type": "integer",
            "description": "The total number of pages available.",
            "example": 1
          },
          "from": {
            "type": "integer",
            "description": "1-based index of the first item on this page.",
            "example": 1
          },
          "to": {
            "type": "integer",
            "description": "1-based index of the last item on this page.",
            "example": 1
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SearchClient"
            },
            "description": "The clients matching the search."
          }
        }
      },
      "AssociateDocumentsRequest": {
        "type": "object",
        "required": [
          "id",
          "ids"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The ID of the client to associate the documents with. For example: `b0077e19-977b-4389-a2e1-f84fa0527d23`.",
            "example": "b0077e19-977b-4389-a2e1-f84fa0527d23"
          },
          "ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "IDs of the existing documents to associate with the client. For example: `[\"85d1f759-88bb-4617-b4ae-d138582370b8\"]`.",
            "example": [
              "85d1f759-88bb-4617-b4ae-d138582370b8"
            ]
          }
        }
      },
      "UpdateClientBalanceRequest": {
        "type": "object",
        "required": [
          "balance"
        ],
        "properties": {
          "balance": {
            "type": "number",
            "description": "The client's new balance. The endpoint recalculates the client's payment amount so the balance equals this value. Send `0` to reset the balance. For example: 30.",
            "example": 30
          }
        }
      },
      "MergeClientRequest": {
        "type": "object",
        "required": [
          "mergeId"
        ],
        "properties": {
          "mergeId": {
            "type": "string",
            "format": "uuid",
            "description": "The ID of the inactive client to merge from. Its documents and balance are transferred to the active client (the path `id`), and the inactive client is then deleted. For example: `ba76e441-9266-40e5-9857-f0ca646f6bc1`.",
            "example": "ba76e441-9266-40e5-9857-f0ca646f6bc1"
          }
        }
      },
      "PaidDocumentType": {
        "type": "integer",
        "description": "Document type that can be created through a payment.\n\n| Code | Type |\n|------|------|\n| 320 | חשבונית מס / קבלה |\n| 400 | קבלה |\n| 405 | קבלה על תרומה |\n| 600 | קבלת פיקדון |",
        "example": 320
      },
      "PaidCurrency": {
        "type": "string",
        "description": "3-letter ISO currency code supported for payments.\n\n| Code | Name |\n|------|------|\n| ILS | שקל |\n| USD | דולר |\n| EUR | אירו |\n| GBP | ליש״ט |",
        "example": "ILS"
      },
      "PaymentFormGroup": {
        "type": "integer",
        "description": "Payment method offered on the payment form.\n\n| Code | Group |\n|------|-------|\n| 100 | Credit Card |\n| 110 | PayPal |\n| 120 | Bit |\n| 150 | Google Pay |\n| 160 | Apple Pay |",
        "example": 100
      },
      "MinimalIncomeRowRequest": {
        "type": "object",
        "required": [
          "description",
          "quantity",
          "price",
          "currency",
          "vatType"
        ],
        "properties": {
          "catalogNum": {
            "type": "string",
            "description": "Item catalog number. For example: `MXDFSDD`.",
            "example": "MXDFSDD"
          },
          "description": {
            "type": "string",
            "description": "Item description. For example: `Item description`.",
            "example": "Item description"
          },
          "quantity": {
            "type": "number",
            "description": "Item quantity. For example: 1.",
            "example": 1
          },
          "price": {
            "type": "number",
            "description": "Item price. For example: 20.",
            "example": 20
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          },
          "vatType": {
            "$ref": "#/components/schemas/ItemVatType"
          }
        }
      },
      "PaymentFormRequest": {
        "type": "object",
        "required": [
          "description",
          "type",
          "amount",
          "currency",
          "vatType",
          "lang",
          "client"
        ],
        "properties": {
          "description": {
            "type": "string",
            "description": "Description of the document created for this payment. For example: `Payment for order #1024`.",
            "example": "Payment for order #1024"
          },
          "type": {
            "$ref": "#/components/schemas/PaidDocumentType"
          },
          "amount": {
            "type": "number",
            "description": "The amount the customer needs to pay. Must be greater than 0. For example: 20.",
            "example": 20
          },
          "currency": {
            "$ref": "#/components/schemas/PaidCurrency"
          },
          "vatType": {
            "$ref": "#/components/schemas/DocumentVatType"
          },
          "lang": {
            "$ref": "#/components/schemas/Lang"
          },
          "maxPayments": {
            "type": "integer",
            "description": "Number of credit-card installments, between 1 and 36. Defaults to 1.",
            "example": 1
          },
          "pluginId": {
            "type": "string",
            "description": "The clearing plugin ID to use. If omitted, the business's default payment plugin is used. For example: `7944827a-c664-11e4-8231-080027271115`.",
            "example": "7944827a-c664-11e4-8231-080027271115"
          },
          "group": {
            "$ref": "#/components/schemas/PaymentFormGroup"
          },
          "client": {
            "type": "object",
            "description": "Client information",
            "properties": {
              "id": {
                "type": "string",
                "description": "Existing client ID. For example: `7944827a-c664-11e4-8231-080027271114`.",
                "example": "7944827a-c664-11e4-8231-080027271114"
              },
              "name": {
                "type": "string",
                "description": "Client name. For example: `John Doe`.",
                "example": "John Doe"
              },
              "emails": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Client emails — payment and document links are sent to these addresses. For example: `[\"email1@example.com\", \"email2@example.com\"]`.",
                "example": [
                  "email1@example.com",
                  "email2@example.com"
                ]
              },
              "taxId": {
                "type": "string",
                "description": "Client tax ID. For example: `0123456789`.",
                "example": "0123456789"
              },
              "address": {
                "type": "string",
                "description": "Client address. For example: `1 Luria St`.",
                "example": "1 Luria St"
              },
              "city": {
                "type": "string",
                "description": "Client city. For example: `Tel Aviv`.",
                "example": "Tel Aviv"
              },
              "zip": {
                "type": "string",
                "description": "Client zip code. For example: `1234567`.",
                "example": "1234567"
              },
              "country": {
                "type": "string",
                "description": "Client 2-letter ISO country code. Defaults to `IL`. For example: `IL`.",
                "default": "IL",
                "example": "IL"
              },
              "phone": {
                "type": "string",
                "description": "Client phone. For example: `+972-54-1234567`.",
                "example": "+972-54-1234567"
              },
              "fax": {
                "type": "string",
                "description": "Client fax. For example: `+972-54-1234567`.",
                "example": "+972-54-1234567"
              },
              "mobile": {
                "type": "string",
                "description": "Client mobile. For example: `+972-54-1234567`.",
                "example": "+972-54-1234567"
              },
              "add": {
                "type": "boolean",
                "description": "Add a temporary client to the clients list. Defaults to `false`.",
                "default": false
              }
            }
          },
          "income": {
            "type": "array",
            "description": "Income (line-item) rows. If no rows are provided, a single row is created from the request's `description` and `amount`.",
            "items": {
              "$ref": "#/components/schemas/MinimalIncomeRowRequest"
            }
          },
          "remarks": {
            "type": "string",
            "description": "Remarks shown on the created document. For example: `Some remarks`.",
            "example": "Some remarks"
          },
          "successUrl": {
            "type": "string",
            "description": "HTTPS URL the customer is redirected to after a successful payment. For example: `https://example.com/success`.",
            "example": "https://example.com/success"
          },
          "failureUrl": {
            "type": "string",
            "description": "HTTPS URL the customer is redirected to after a failed payment. For example: `https://example.com/failure`.",
            "example": "https://example.com/failure"
          },
          "notifyUrl": {
            "type": "string",
            "description": "HTTPS URL notified (POST) once the payment succeeds and the document is created. For example: `https://example.com/notify`.",
            "example": "https://example.com/notify"
          },
          "custom": {
            "type": "string",
            "description": "Custom data echoed back to your success / failure / notify URLs, such as an internal order ID. For example: `order-1024`.",
            "example": "order-1024"
          }
        }
      },
      "PaymentFormResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "Whether the request succeeded.",
            "example": true
          },
          "errorCode": {
            "type": "integer",
            "description": "Result code. 0 means success; a non-zero value indicates the error.",
            "example": 0
          },
          "errorDescription": {
            "type": "string",
            "description": "Human-readable error message. Returned only when the request failed."
          },
          "url": {
            "type": "string",
            "description": "The payment form URL. Embed it as an iframe, or redirect the customer to it, to collect the payment.",
            "example": "https://payments.example.com/checkout/1a2b3c4d"
          }
        }
      },
      "SearchCreditCardTokensRequest": {
        "type": "object",
        "description": "Filters for the credit-card token search. All fields are optional.",
        "properties": {
          "page": {
            "type": "integer",
            "description": "Page number to retrieve. Defaults to 1.",
            "default": 1,
            "example": 1
          },
          "pageSize": {
            "type": "integer",
            "description": "Number of results per page. Defaults to 25.",
            "default": 25,
            "example": 25
          },
          "paymentNumber": {
            "type": "string",
            "description": "Filter by the card's last 4 digits. For example: `0000`.",
            "example": "0000"
          },
          "cardHolder": {
            "type": "string",
            "description": "Filter by card holder name. For example: `John Doe`.",
            "example": "John Doe"
          },
          "externalKey": {
            "type": "string",
            "description": "Filter by the client ID the token is associated with. For example: `b0077e19-977b-4389-a2e1-f84fa0527d23`.",
            "example": "b0077e19-977b-4389-a2e1-f84fa0527d23"
          },
          "cardType": {
            "type": "array",
            "description": "Filter by credit card brand(s).\n\n| Code | Brand |\n|------|-------|\n| 0 | Unknown |\n| 1 | Isracard |\n| 2 | Visa |\n| 3 | Mastercard |\n| 4 | American Express |\n| 5 | Diners |",
            "items": {
              "$ref": "#/components/schemas/CreditCardType"
            }
          }
        }
      },
      "CreditCardTokenStatus": {
        "type": "integer",
        "description": "Saved credit-card token status.\n\n| Code | Status |\n|------|--------|\n| 0 | Deleted |\n| 1 | Valid (active) |\n| 2 | Valid |\n| 3 | Revoked |\n| 4 | Expired |",
        "example": 1
      },
      "CreditCardToken": {
        "type": "object",
        "required": [
          "id",
          "number",
          "expires"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The saved credit-card token ID",
            "example": "46e78fc4-9d8c-4429-9748-454947be39cb"
          },
          "externalKey": {
            "type": "string",
            "description": "The client ID the token is associated with",
            "example": "b0077e19-977b-4389-a2e1-f84fa0527d23"
          },
          "clientName": {
            "type": "string",
            "description": "The associated client's name",
            "example": "John Doe"
          },
          "status": {
            "$ref": "#/components/schemas/CreditCardTokenStatus"
          },
          "cardType": {
            "$ref": "#/components/schemas/CreditCardType"
          },
          "number": {
            "type": "string",
            "description": "The card's last 4 digits",
            "example": "0000"
          },
          "expires": {
            "type": "string",
            "description": "Card expiry date in `MMYY` format",
            "example": "0129"
          },
          "holderName": {
            "type": "string",
            "description": "Card holder name",
            "example": "John Doe"
          },
          "pluginType": {
            "$ref": "#/components/schemas/PluginType"
          },
          "currencies": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Currency"
            },
            "description": "Currencies the card can be charged in (the payment plugin's supported currencies)",
            "example": [
              "ILS"
            ]
          },
          "creationDate": {
            "type": "integer",
            "description": "Unix timestamp in seconds of the token's creation date",
            "example": 1765186595
          },
          "lastUpdateDate": {
            "type": "integer",
            "description": "Unix timestamp in seconds of the token's last update date",
            "example": 1765186595
          }
        }
      },
      "SearchCreditCardTokensResponse": {
        "type": "object",
        "required": [
          "total",
          "page",
          "pageSize",
          "from",
          "to",
          "pages",
          "items"
        ],
        "properties": {
          "total": {
            "type": "integer",
            "description": "Total number of tokens matching the search",
            "example": 1
          },
          "page": {
            "type": "integer",
            "description": "The requested page number",
            "example": 1
          },
          "pageSize": {
            "type": "integer",
            "description": "The requested page size",
            "example": 25
          },
          "from": {
            "type": "integer",
            "description": "Index of the first token in the current page",
            "example": 1
          },
          "to": {
            "type": "integer",
            "description": "Index of the last token in the current page",
            "example": 1
          },
          "pages": {
            "type": "integer",
            "description": "Total number of pages available",
            "example": 1
          },
          "items": {
            "type": "array",
            "description": "The credit-card tokens matching the search",
            "items": {
              "$ref": "#/components/schemas/CreditCardToken"
            }
          }
        }
      },
      "ChargeTokenPaymentRequest": {
        "type": "object",
        "required": [
          "type",
          "amount",
          "currency",
          "vatType",
          "lang"
        ],
        "properties": {
          "description": {
            "type": "string",
            "description": "Description of the document created for this charge. For example: `Transaction description`.",
            "example": "Transaction description"
          },
          "type": {
            "$ref": "#/components/schemas/PaidDocumentType"
          },
          "amount": {
            "type": "number",
            "description": "The amount to charge. Must be greater than 0. For example: 20.",
            "example": 20
          },
          "currency": {
            "$ref": "#/components/schemas/PaidCurrency"
          },
          "vatType": {
            "$ref": "#/components/schemas/DocumentVatType"
          },
          "lang": {
            "$ref": "#/components/schemas/Lang"
          },
          "maxPayments": {
            "type": "integer",
            "description": "Number of credit-card installments, between 1 and 36. Defaults to 1.",
            "example": 1
          },
          "income": {
            "type": "array",
            "description": "Income (line-item) rows. If no rows are provided, a single row is created from the request's `description` and `amount`.",
            "items": {
              "$ref": "#/components/schemas/MinimalIncomeRowRequest"
            }
          },
          "remarks": {
            "type": "string",
            "description": "Remarks shown on the created document. For example: `Some remarks`.",
            "example": "Some remarks"
          },
          "notifyUrl": {
            "type": "string",
            "description": "HTTPS URL notified (POST) once the payment succeeds and the document is created. For example: `https://example.com/notify`.",
            "example": "https://example.com/notify"
          }
        }
      },
      "ChargeTokenResponse": {
        "type": "object",
        "required": [
          "id",
          "number",
          "type",
          "signed",
          "lang",
          "client",
          "url"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Document unique ID",
            "example": "57ae2ff9-0c24-43e8-b39c-a5bdcc05573d"
          },
          "number": {
            "type": "integer",
            "description": "Document serial number",
            "example": 40034
          },
          "type": {
            "$ref": "#/components/schemas/DocumentType"
          },
          "signed": {
            "type": "boolean",
            "description": "Whether the document was digitally signed",
            "example": true
          },
          "lang": {
            "$ref": "#/components/schemas/Lang"
          },
          "client": {
            "type": "object",
            "description": "Client linked to the document",
            "properties": {
              "id": {
                "type": "string",
                "description": "Linked client ID",
                "example": "7944827a-c664-11e4-8231-080027271114"
              }
            }
          },
          "taxAuthorityConfirmationInitiated": {
            "type": "boolean",
            "description": "Whether tax authority confirmation was initiated for the document",
            "example": false
          },
          "url": {
            "type": "object",
            "description": "Document download URLs",
            "properties": {
              "origin": {
                "type": "string",
                "description": "Original document URL"
              },
              "he": {
                "type": "string",
                "description": "Copy in Hebrew"
              },
              "en": {
                "type": "string",
                "description": "Copy in English (if lang was `en`)"
              }
            }
          },
          "taxAuthorityConfirmationLastError": {
            "type": "integer",
            "description": "Error code from the most recent tax authority confirmation attempt. `0` indicates no error; a non-zero value (for example `400` or `406`) indicates a failure.",
            "example": 0
          },
          "vatRate": {
            "type": "number",
            "description": "VAT rate applied to the document",
            "example": 0.18
          },
          "transactionId": {
            "type": "string",
            "description": "The payment transaction ID.",
            "example": "feac32ae-cfda-422c-8502-3adc2cd2e261"
          }
        }
      },
      "SupplierRequest": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "The supplier name. For example: `ישראל ישראלי`.",
            "example": "ישראל ישראלי"
          },
          "active": {
            "type": "boolean",
            "description": "Is the supplier currently active or not. Defaults to `true`.",
            "example": true
          },
          "department": {
            "type": "string",
            "description": "The supplier department. For example: `Sales`.",
            "example": "Sales"
          },
          "taxId": {
            "type": "string",
            "description": "The supplier tax ID. For example: `999317746`.",
            "example": "999317746"
          },
          "accountingKey": {
            "type": "string",
            "description": "The supplier accounting key. For example: `31653639`.",
            "example": "31653639"
          },
          "paymentTerms": {
            "$ref": "#/components/schemas/PaymentTerm"
          },
          "bankName": {
            "type": "string",
            "description": "The supplier bank name. For example: `פועלים`.",
            "example": "פועלים"
          },
          "bankBranch": {
            "type": "string",
            "description": "The supplier bank branch number. For example: `123`.",
            "example": "123"
          },
          "bankAccount": {
            "type": "string",
            "description": "The supplier bank account number. For example: `123456`.",
            "example": "123456"
          },
          "address": {
            "type": "string",
            "description": "The supplier address. For example: `הרצל 12`.",
            "example": "הרצל 12"
          },
          "city": {
            "type": "string",
            "description": "The supplier city. For example: `תל אביב`.",
            "example": "תל אביב"
          },
          "zip": {
            "type": "string",
            "description": "The supplier ZIP code. For example: `6688320`.",
            "example": "6688320"
          },
          "country": {
            "type": "string",
            "description": "2-letter ISO 3166-1 alpha-2 country code. Defaults to `IL` (Israel). Use the [Get Supported Countries](#operation/getSupportedCountries) endpoint to retrieve the full list. For example: `IL`.",
            "example": "IL"
          },
          "phone": {
            "type": "string",
            "description": "The supplier phone number. For example: `0505555555`.",
            "example": "0505555555"
          },
          "fax": {
            "type": "string",
            "description": "The supplier fax number. For example: `0504444444`.",
            "example": "0504444444"
          },
          "mobile": {
            "type": "string",
            "description": "The supplier mobile number. For example: `0504444444`.",
            "example": "0504444444"
          },
          "remarks": {
            "type": "string",
            "description": "Supplier remarks for internal use. For example: `ספק קבוע`.",
            "example": "ספק קבוע"
          },
          "contactPerson": {
            "type": "string",
            "description": "The supplier contact person name. For example: `ישראל ישראלי`.",
            "example": "ישראל ישראלי"
          },
          "emails": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 3,
            "description": "The supplier email addresses (up to 3). For example: `[\"test_test@test.com\"]`.",
            "example": [
              "test_test@test.com"
            ]
          },
          "labels": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 3,
            "description": "Label names to assign to the supplier (up to 3). For example: `[\"אינסטלטורים\"]`.",
            "example": [
              "אינסטלטורים"
            ]
          },
          "balanceAmount": {
            "type": "number",
            "description": "Opening balance for the supplier. This value is primarily computed by the system from the supplier's documents and payments; provide it only to set an initial balance. For example: 0.",
            "example": 0
          }
        }
      },
      "Supplier": {
        "type": "object",
        "required": [
          "id",
          "name",
          "active",
          "paymentTerms",
          "incomeAmount",
          "paymentAmount",
          "balanceAmount",
          "creationDate",
          "lastUpdateDate"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The supplier ID",
            "example": "32770ce2-ca0f-469f-87cf-8d92c7826e9b"
          },
          "name": {
            "type": "string",
            "description": "The supplier name",
            "example": "ישראל ישראלי"
          },
          "active": {
            "type": "boolean",
            "description": "Is the supplier currently active or not",
            "example": true
          },
          "department": {
            "type": "string",
            "description": "The supplier department",
            "example": ""
          },
          "taxId": {
            "type": "string",
            "description": "The supplier tax ID",
            "example": "999317746"
          },
          "accountingKey": {
            "type": "string",
            "description": "The supplier accounting key",
            "example": "31653639"
          },
          "paymentTerms": {
            "$ref": "#/components/schemas/PaymentTerm"
          },
          "bankName": {
            "type": "string",
            "description": "The supplier bank name",
            "example": "פועלים"
          },
          "bankBranch": {
            "type": "string",
            "description": "The supplier bank branch number",
            "example": "123"
          },
          "bankAccount": {
            "type": "string",
            "description": "The supplier bank account number",
            "example": "123456"
          },
          "address": {
            "type": "string",
            "description": "The supplier address",
            "example": "הרצל 12"
          },
          "city": {
            "type": "string",
            "description": "The supplier city",
            "example": "תל אביב"
          },
          "zip": {
            "type": "string",
            "description": "The supplier ZIP code",
            "example": "6688320"
          },
          "country": {
            "type": "string",
            "description": "2-letter ISO 3166-1 alpha-2 country code",
            "example": "IL"
          },
          "phone": {
            "type": "string",
            "description": "The supplier phone number",
            "example": "0505555555"
          },
          "fax": {
            "type": "string",
            "description": "The supplier fax number",
            "example": "0504444444"
          },
          "mobile": {
            "type": "string",
            "description": "The supplier mobile number",
            "example": "0504444444"
          },
          "emails": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The supplier email addresses",
            "example": [
              "test_test@test.com"
            ]
          },
          "labels": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "IDs of the labels assigned to the supplier",
            "example": [
              "775c188f-33a1-4d39-a5f2-cf7b82dd5bd5"
            ]
          },
          "remarks": {
            "type": "string",
            "description": "Supplier remarks for internal use",
            "example": ""
          },
          "contactPerson": {
            "type": "string",
            "description": "The supplier contact person name",
            "example": "ישראל ישראלי"
          },
          "incomeAmount": {
            "type": "number",
            "description": "Total income recorded from the supplier",
            "example": 0
          },
          "paymentAmount": {
            "type": "number",
            "description": "Total amount paid to the supplier so far",
            "example": 0
          },
          "creationDate": {
            "type": "integer",
            "format": "int64",
            "description": "Creation date Unix timestamp (in seconds)",
            "example": 1780919300
          },
          "lastUpdateDate": {
            "type": "integer",
            "format": "int64",
            "description": "Last update date Unix timestamp (in seconds)",
            "example": 1780919300
          },
          "balanceAmount": {
            "type": "number",
            "description": "The supplier balance amount",
            "example": 0
          }
        }
      },
      "UpdateSupplierRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "The supplier name. For example: `ישראל ישראלי`.",
            "example": "ישראל ישראלי"
          },
          "active": {
            "type": "boolean",
            "description": "Is the supplier currently active or not. For example: `true`.",
            "example": true
          },
          "department": {
            "type": "string",
            "description": "The supplier department. For example: `Sales`.",
            "example": "Sales"
          },
          "taxId": {
            "type": "string",
            "description": "The supplier tax ID. For example: `999317746`.",
            "example": "999317746"
          },
          "accountingKey": {
            "type": "string",
            "description": "The supplier accounting key. For example: `31653639`.",
            "example": "31653639"
          },
          "paymentTerms": {
            "$ref": "#/components/schemas/PaymentTerm"
          },
          "bankName": {
            "type": "string",
            "description": "The supplier bank name. For example: `פועלים`.",
            "example": "פועלים"
          },
          "bankBranch": {
            "type": "string",
            "description": "The supplier bank branch number. For example: `123`.",
            "example": "123"
          },
          "bankAccount": {
            "type": "string",
            "description": "The supplier bank account number. For example: `123456`.",
            "example": "123456"
          },
          "address": {
            "type": "string",
            "description": "The supplier address. For example: `הרצל 12`.",
            "example": "הרצל 12"
          },
          "city": {
            "type": "string",
            "description": "The supplier city. For example: `תל אביב`.",
            "example": "תל אביב"
          },
          "zip": {
            "type": "string",
            "description": "The supplier ZIP code. For example: `6688320`.",
            "example": "6688320"
          },
          "country": {
            "type": "string",
            "description": "2-letter ISO 3166-1 alpha-2 country code. Defaults to `IL` (Israel). Use the [Get Supported Countries](#operation/getSupportedCountries) endpoint to retrieve the full list. For example: `IL`.",
            "example": "IL"
          },
          "phone": {
            "type": "string",
            "description": "The supplier phone number. For example: `0505555555`.",
            "example": "0505555555"
          },
          "fax": {
            "type": "string",
            "description": "The supplier fax number. For example: `0504444444`.",
            "example": "0504444444"
          },
          "mobile": {
            "type": "string",
            "description": "The supplier mobile number. For example: `0504444444`.",
            "example": "0504444444"
          },
          "remarks": {
            "type": "string",
            "description": "Supplier remarks for internal use. For example: `ספק קבוע`.",
            "example": "ספק קבוע"
          },
          "contactPerson": {
            "type": "string",
            "description": "The supplier contact person name. For example: `ישראל ישראלי`.",
            "example": "ישראל ישראלי"
          },
          "emails": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 3,
            "description": "The supplier email addresses (up to 3). For example: `[\"test_test@test.com\"]`.",
            "example": [
              "test_test@test.com"
            ]
          },
          "labels": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 3,
            "description": "Label names to assign to the supplier (up to 3). For example: `[\"אינסטלטורים\"]`.",
            "example": [
              "אינסטלטורים"
            ]
          }
        }
      },
      "SearchSuppliersRequest": {
        "type": "object",
        "description": "Filters for the supplier search. All fields are optional.",
        "properties": {
          "page": {
            "type": "integer",
            "description": "Page number to retrieve. Defaults to 1.",
            "default": 1,
            "example": 1
          },
          "pageSize": {
            "type": "integer",
            "description": "Number of results per page. Defaults to 25.",
            "default": 25,
            "example": 25
          },
          "name": {
            "type": "string",
            "description": "Filter by supplier name. For example: `ישראל ישראלי`.",
            "example": "ישראל ישראלי"
          },
          "active": {
            "type": "boolean",
            "description": "Filter by active state. Omit to return both active and inactive suppliers. For example: `true`.",
            "example": true
          },
          "email": {
            "type": "string",
            "description": "Filter by supplier email. For example: `test_test@test.com`.",
            "example": "test_test@test.com"
          },
          "contactPerson": {
            "type": "string",
            "description": "Filter by supplier contact person. For example: `ישראל ישראלי`.",
            "example": "ישראל ישראלי"
          },
          "taxId": {
            "type": "string",
            "description": "Filter by supplier tax ID. For example: `999317746`.",
            "example": "999317746"
          },
          "labels": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Filter by label IDs. For example: `[\"775c188f-33a1-4d39-a5f2-cf7b82dd5bd5\"]`.",
            "example": [
              "775c188f-33a1-4d39-a5f2-cf7b82dd5bd5"
            ]
          }
        }
      },
      "SearchSuppliersResponse": {
        "type": "object",
        "required": [
          "total",
          "page",
          "pageSize",
          "from",
          "to",
          "pages",
          "items"
        ],
        "properties": {
          "total": {
            "type": "integer",
            "description": "Total number of suppliers matching the search",
            "example": 1
          },
          "page": {
            "type": "integer",
            "description": "The requested page number",
            "example": 1
          },
          "pageSize": {
            "type": "integer",
            "description": "The requested page size",
            "example": 25
          },
          "from": {
            "type": "integer",
            "description": "Index of the first supplier in the current page",
            "example": 1
          },
          "to": {
            "type": "integer",
            "description": "Index of the last supplier in the current page",
            "example": 1
          },
          "pages": {
            "type": "integer",
            "description": "Total number of pages available",
            "example": 1
          },
          "items": {
            "type": "array",
            "description": "The suppliers matching the search",
            "items": {
              "$ref": "#/components/schemas/Supplier"
            }
          }
        }
      },
      "MergeSupplierRequest": {
        "type": "object",
        "required": [
          "mergeId"
        ],
        "properties": {
          "mergeId": {
            "type": "string",
            "format": "uuid",
            "description": "The ID of the supplier to merge data from. Must be an inactive supplier — after the merge it is deleted and all of its documents are reassigned to the target supplier. For example: `6e8f79d3-ed3e-4940-ad95-94c5416e9b19`.",
            "example": "6e8f79d3-ed3e-4940-ad95-94c5416e9b19"
          }
        }
      },
      "ExpenseDocumentType": {
        "type": "integer",
        "description": "Expense document type code.\n\n| Code | Type |\n|------|------|\n| 20 | חשבון / אישור תשלום |\n| 305 | חשבונית מס |\n| 320 | חשבונית מס / קבלה |\n| 330 | חשבונית זיכוי |\n| 400 | קבלה |\n| 405 | קבלה על תרומה |",
        "example": 320
      },
      "ExpensePaymentType": {
        "type": "integer",
        "description": "Expense payment method.\n\n| Code | Method |\n|------|--------|\n| -1 | לא שולם |\n| 1 | מזומן |\n| 2 | צ׳ק |\n| 3 | כרטיס אשראי |\n| 4 | העברה בנקאית |\n| 5 | פייפאל |\n| 10 | אפליקציית תשלום |\n| 11 | אחר |",
        "example": 3
      },
      "ExpensePcnClassifications": {
        "type": "string",
        "description": "PCN874 input classification (for the Israeli Tax Authority PCN874 report).\n\n| Value | Meaning |\n|-------|---------|\n| T | תשומה רגילה |\n| R | רשומון יבוא |\n| K | ספק קופה קטנה |\n| P | ספק רשות פלסטינית |\n| C | תשומה חשבונית עצמית |\n| H | מסמך אחר |",
        "example": "T"
      },
      "ExpenseSupplierRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/SupplierRequest"
          },
          {
            "type": "object",
            "properties": {
              "add": {
                "type": "boolean",
                "description": "Whether to also save this supplier to the business's saved suppliers. Defaults to `false`.",
                "example": true
              }
            }
          }
        ]
      },
      "AccountingClassification": {
        "type": "object",
        "description": "Accounting classification (expense category). On the request, send an existing classification's `id` (from the Get Accounting Classifications endpoint), or the details (`irsCode`, `title`, `income`, `vat`) to classify inline.",
        "properties": {
          "id": {
            "type": "string",
            "description": "The classification ID. For example: `451b3028-68b7-4d1a-bf63-9bb8be24ca9d`.",
            "example": "451b3028-68b7-4d1a-bf63-9bb8be24ca9d"
          },
          "key": {
            "type": "string",
            "description": "The classification key. For example: `1310`.",
            "example": "1310"
          },
          "code": {
            "type": "string",
            "description": "The classification code. For example: `1300`.",
            "example": "1300"
          },
          "title": {
            "type": "string",
            "description": "The classification title. For example: `עבודות חוץ וקבלני משנה`.",
            "example": "עבודות חוץ וקבלני משנה"
          },
          "irsCode": {
            "type": "integer",
            "description": "The Israeli Tax Authority code for this classification.",
            "example": 1310
          },
          "type": {
            "type": "integer",
            "description": "The classification type.",
            "example": 20
          },
          "income": {
            "type": "number",
            "description": "Recognised income percentage for this classification.",
            "example": 100
          },
          "vat": {
            "type": "number",
            "description": "Recoverable VAT percentage for this classification.",
            "example": 100
          },
          "mixed": {
            "type": "number",
            "description": "Business-use percentage applied to the expense.",
            "example": 100
          },
          "creationDate": {
            "type": "integer",
            "description": "Creation date, as a Unix timestamp in seconds.",
            "example": 1771231523
          },
          "lastUpdateDate": {
            "type": "integer",
            "description": "Last update date, as a Unix timestamp in seconds.",
            "example": 1779287537
          }
        }
      },
      "ExpenseRequest": {
        "type": "object",
        "required": [
          "documentType",
          "number",
          "date",
          "reportingDate",
          "supplier",
          "accountingClassification"
        ],
        "properties": {
          "documentType": {
            "$ref": "#/components/schemas/ExpenseDocumentType"
          },
          "number": {
            "type": "string",
            "description": "The supplier's document number. For example: `100`.",
            "example": "100"
          },
          "date": {
            "type": "string",
            "description": "Date of the expense, formatted YYYY-MM-DD. Must be 2010-01-01 or later and not in the future. For example: `2026-05-06`.",
            "example": "2026-05-06"
          },
          "reportingDate": {
            "type": "string",
            "description": "VAT reporting date. Must be the first day of the month, formatted YYYY-MM-01. For example: `2026-05-01`.",
            "example": "2026-05-01"
          },
          "paymentType": {
            "$ref": "#/components/schemas/ExpensePaymentType"
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          },
          "currencyRate": {
            "type": "number",
            "description": "Exchange rate relative to ILS. Defaults to 1.",
            "example": 1
          },
          "amount": {
            "type": "number",
            "description": "Total amount of the expense, including VAT. For example: 472.",
            "example": 472
          },
          "vat": {
            "type": "number",
            "description": "VAT portion of the amount. May not exceed `amount`. For example: 72.",
            "example": 72
          },
          "description": {
            "type": "string",
            "description": "Description of the expense. For example: `אינסטלטור`.",
            "example": "אינסטלטור"
          },
          "remarks": {
            "type": "string",
            "description": "Free-text remarks. For example: `אינסטלטור-שולם`.",
            "example": "אינסטלטור-שולם"
          },
          "labels": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Labels used to identify the expense. For example: `[\"דחוף\"]`.",
            "example": [
              "דחוף"
            ]
          },
          "allocationNumber": {
            "type": "string",
            "description": "Tax Authority Allocation Number, when applicable. For example: `166056573`.",
            "example": "166056573"
          },
          "pcnClassification": {
            "$ref": "#/components/schemas/ExpensePcnClassifications"
          },
          "supplier": {
            "$ref": "#/components/schemas/ExpenseSupplierRequest"
          },
          "accountingClassification": {
            "$ref": "#/components/schemas/AccountingClassification"
          },
          "active": {
            "type": "boolean",
            "description": "Whether the expense is active. Defaults to true.",
            "example": true
          }
        }
      },
      "ExpenseStatus": {
        "type": "integer",
        "description": "Expense status.\n\n| Code | Status |\n|------|--------|\n| 10 | הוצאה אושרה לדו״ח |\n| 20 | הוצאה נכללת בדו״ח |\n| 30 | הוצאה שנערכה מחדש |\n| 40 | הוצאה אושרה ע״י מייצג |\n| 100 | הוצאה מחוקה |",
        "example": 10
      },
      "Expense": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The expense ID.",
            "example": "b22f10a6-85f3-4374-b563-e1e039d5528c"
          },
          "businessId": {
            "type": "string",
            "description": "The ID of the business the expense belongs to.",
            "example": "c1e4a7b2-8d3f-4a9c-b5e6-3f4a5b6c7d8e"
          },
          "businessType": {
            "$ref": "#/components/schemas/BusinessType"
          },
          "documentType": {
            "$ref": "#/components/schemas/ExpenseDocumentType"
          },
          "status": {
            "$ref": "#/components/schemas/ExpenseStatus"
          },
          "paymentType": {
            "$ref": "#/components/schemas/ExpensePaymentType"
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          },
          "currencyRate": {
            "type": "number",
            "description": "Exchange rate relative to ILS.",
            "example": 1
          },
          "amount": {
            "type": "number",
            "description": "Total amount of the expense, including VAT.",
            "example": 472
          },
          "vat": {
            "type": "number",
            "description": "VAT portion of the amount.",
            "example": 72
          },
          "amountExcludeVat": {
            "type": "number",
            "description": "Amount excluding VAT (`amount` minus `vat`).",
            "example": 400
          },
          "amountLocal": {
            "type": "number",
            "description": "Total amount converted to local currency (ILS).",
            "example": 472
          },
          "deductibleAmount": {
            "type": "number",
            "description": "Tax-deductible amount, in local currency (ILS).",
            "example": 400
          },
          "deductibleVat": {
            "type": "number",
            "description": "Recoverable (input) VAT, in local currency (ILS).",
            "example": 72
          },
          "date": {
            "type": "string",
            "description": "Date of the expense, formatted YYYY-MM-DD.",
            "example": "2026-05-06"
          },
          "reportingDate": {
            "type": "string",
            "description": "VAT reporting date. Always the first day of the month, formatted YYYY-MM-01. For example: `2026-05-01`.",
            "example": "2026-05-01"
          },
          "number": {
            "type": "string",
            "description": "The supplier's document number.",
            "example": "100"
          },
          "description": {
            "type": "string",
            "description": "Description of the expense.",
            "example": "אינסטלטור"
          },
          "remarks": {
            "type": "string",
            "description": "Free-text remarks.",
            "example": "אינסטלטור-שולם"
          },
          "allocationNumber": {
            "type": "string",
            "description": "Tax Authority Allocation Number, when applicable. For example: `166056573`.",
            "example": "166056573"
          },
          "supplier": {
            "$ref": "#/components/schemas/Supplier"
          },
          "accountingClassification": {
            "$ref": "#/components/schemas/AccountingClassification"
          },
          "url": {
            "type": "string",
            "description": "Download URL for the attached file. Present only when the expense has an attached file."
          },
          "data": {
            "type": "object",
            "description": "Additional expense details.",
            "properties": {
              "labels": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Labels used to identify the expense."
              },
              "pcnClassification": {
                "$ref": "#/components/schemas/ExpensePcnClassifications"
              },
              "pcnTaxId": {
                "type": "string",
                "description": "The supplier tax ID reported for the PCN874 report.",
                "example": "990000002"
              }
            }
          },
          "creationDate": {
            "type": "integer",
            "description": "Creation date, as a Unix timestamp in seconds.",
            "example": 1780991238
          },
          "lastUpdateDate": {
            "type": "integer",
            "description": "Last update date, as a Unix timestamp in seconds.",
            "example": 1780991238
          }
        }
      },
      "SearchExpensesRequest": {
        "type": "object",
        "description": "Filters for searching expenses. All fields are optional; an empty body returns all expenses.",
        "properties": {
          "fromDate": {
            "type": "string",
            "description": "Start of the reporting-date range to filter by. Filters on the expense's reporting date (the VAT reporting period), not its document date. Must be the first day of the month, formatted YYYY-MM-01. For example: `2025-06-01`.",
            "example": "2025-06-01"
          },
          "toDate": {
            "type": "string",
            "description": "End of the reporting-date range to filter by. Filters on the expense's reporting date (the VAT reporting period), not its document date. Must be the first day of the month, formatted YYYY-MM-01. For example: `2026-06-01`.",
            "example": "2026-06-01"
          },
          "description": {
            "type": "string",
            "description": "Filter by expense description. For example: `אינסטלטור`.",
            "example": "אינסטלטור"
          },
          "supplierId": {
            "type": "string",
            "description": "Filter by supplier ID. For example: `28fa4c1d-a29b-11e4-963c-18002725111e`.",
            "example": "28fa4c1d-a29b-11e4-963c-18002725111e"
          },
          "supplierName": {
            "type": "string",
            "description": "Filter by supplier name. For example: `אינסטלטור`.",
            "example": "אינסטלטור"
          },
          "number": {
            "type": "string",
            "description": "Filter by the expense (supplier document) number. For example: `100`.",
            "example": "100"
          },
          "paid": {
            "type": "boolean",
            "description": "Filter by payment state. When omitted, both paid and unpaid expenses are returned. For example: `true`.",
            "example": true
          },
          "minAmount": {
            "type": "number",
            "description": "Minimum expense amount. For example: 100.",
            "example": 100
          },
          "maxAmount": {
            "type": "number",
            "description": "Maximum expense amount. For example: 5000.",
            "example": 5000
          },
          "documentType": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExpenseDocumentType"
            },
            "description": "Filter by one or more expense document types. For example: `[320]`.",
            "example": [
              320
            ]
          },
          "paymentType": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExpensePaymentType"
            },
            "description": "Filter by one or more payment methods. For example: `[3]`.",
            "example": [
              3
            ]
          },
          "status": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExpenseStatus"
            },
            "description": "Filter by one or more expense statuses. For example: `[10]`.",
            "example": [
              10
            ]
          },
          "page": {
            "type": "integer",
            "description": "Page number to retrieve (1-based). Defaults to 1.",
            "example": 1
          },
          "pageSize": {
            "type": "integer",
            "description": "Number of results per page. Defaults to 25.",
            "example": 25
          }
        }
      },
      "SearchExpensesResponse": {
        "type": "object",
        "properties": {
          "total": {
            "type": "integer",
            "description": "Total number of expenses matching the search.",
            "example": 3
          },
          "page": {
            "type": "integer",
            "description": "The page number returned.",
            "example": 1
          },
          "pageSize": {
            "type": "integer",
            "description": "The number of results per page.",
            "example": 25
          },
          "pages": {
            "type": "integer",
            "description": "Total number of pages available.",
            "example": 1
          },
          "from": {
            "type": "integer",
            "description": "1-based index of the first item on this page.",
            "example": 1
          },
          "to": {
            "type": "integer",
            "description": "1-based index of the last item on this page.",
            "example": 3
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Expense"
            },
            "description": "The expenses matching the search."
          }
        }
      },
      "UpdateExpenseRequest": {
        "type": "object",
        "description": "Fields to update on the expense. All fields are optional — only the fields you send are applied.",
        "properties": {
          "documentType": {
            "$ref": "#/components/schemas/ExpenseDocumentType"
          },
          "number": {
            "type": "string",
            "description": "The supplier's document number. For example: `111`.",
            "example": "111"
          },
          "date": {
            "type": "string",
            "description": "Date of the expense, formatted YYYY-MM-DD. Must be 2010-01-01 or later and not in the future. For example: `2026-06-09`.",
            "example": "2026-06-09"
          },
          "reportingDate": {
            "type": "string",
            "description": "VAT reporting date. Must be the first day of the month, formatted YYYY-MM-01. For example: `2026-06-01`.",
            "example": "2026-06-01"
          },
          "paymentType": {
            "$ref": "#/components/schemas/ExpensePaymentType"
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          },
          "currencyRate": {
            "type": "number",
            "description": "Exchange rate relative to ILS. For example: 1.",
            "example": 1
          },
          "amount": {
            "type": "number",
            "description": "Total amount of the expense, including VAT. For example: 2360.",
            "example": 2360
          },
          "vat": {
            "type": "number",
            "description": "VAT portion of the amount. May not exceed `amount`. For example: 360.",
            "example": 360
          },
          "description": {
            "type": "string",
            "description": "Description of the expense. For example: `מאתר נזילות`.",
            "example": "מאתר נזילות"
          },
          "remarks": {
            "type": "string",
            "description": "Free-text remarks. For example: `מאתר נזילות - שולם`.",
            "example": "מאתר נזילות - שולם"
          },
          "labels": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Labels used to identify the expense. For example: `[\"דחוף\"]`.",
            "example": [
              "דחוף"
            ]
          },
          "allocationNumber": {
            "type": "string",
            "description": "Tax Authority Allocation Number, when applicable. For example: `166056573`.",
            "example": "166056573"
          },
          "pcnClassification": {
            "$ref": "#/components/schemas/ExpensePcnClassifications"
          },
          "supplier": {
            "$ref": "#/components/schemas/ExpenseSupplierRequest"
          },
          "accountingClassification": {
            "$ref": "#/components/schemas/AccountingClassification"
          },
          "active": {
            "type": "boolean",
            "description": "Whether the expense is active. For example: `true`.",
            "example": true
          }
        }
      },
      "ExpenseStatusMapItem": {
        "type": "object",
        "required": [
          "id",
          "name"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/ExpenseStatus"
          },
          "name": {
            "type": "string",
            "description": "Localised name of the expense status, in the language indicated by the `lang` query parameter.",
            "example": "הוצאה אושרה לדו״ח"
          }
        }
      },
      "FileUploadUrlResponse": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "The S3 URL to upload the file to in Step 2. Constant per environment.",
            "example": "https://s3.eu-west-1.amazonaws.com/string"
          },
          "fields": {
            "type": "object",
            "description": "Pre-signed form fields. In Step 2, append every one of these to your multipart form-data exactly as returned, alongside the `file`.",
            "properties": {
              "x-amz-meta-account-id": {
                "type": "string"
              },
              "x-amz-meta-user-id": {
                "type": "string"
              },
              "x-amz-meta-business-id": {
                "type": "string"
              },
              "x-amz-meta-file-context": {
                "type": "string",
                "example": "expense"
              },
              "x-amz-meta-file-data": {
                "type": "string",
                "example": "{\"source\":5}"
              },
              "bucket": {
                "type": "string",
                "example": "string"
              },
              "X-Amz-Algorithm": {
                "type": "string",
                "example": "AWS4-HMAC-SHA256"
              },
              "X-Amz-Credential": {
                "type": "string"
              },
              "X-Amz-Date": {
                "type": "string"
              },
              "X-Amz-Security-Token": {
                "type": "string"
              },
              "key": {
                "type": "string",
                "example": "2026/06/09/<businessId>/${filename}"
              },
              "Policy": {
                "type": "string"
              },
              "X-Amz-Signature": {
                "type": "string"
              }
            }
          },
          "maxFileSize": {
            "type": "integer",
            "description": "Maximum allowed file size, in bytes.",
            "example": 20971520
          }
        }
      },
      "ExpenseFileUploadRequest": {
        "type": "object",
        "description": "Multipart form for the S3 upload. Every field except `file` is copied **verbatim** from the `fields` object returned in Step 1 (Get Upload URL).",
        "required": [
          "key",
          "Policy",
          "X-Amz-Algorithm",
          "X-Amz-Credential",
          "X-Amz-Date",
          "X-Amz-Security-Token",
          "X-Amz-Signature",
          "bucket",
          "file"
        ],
        "properties": {
          "key": {
            "type": "string"
          },
          "Policy": {
            "type": "string"
          },
          "X-Amz-Algorithm": {
            "type": "string"
          },
          "X-Amz-Credential": {
            "type": "string"
          },
          "X-Amz-Date": {
            "type": "string"
          },
          "X-Amz-Security-Token": {
            "type": "string"
          },
          "X-Amz-Signature": {
            "type": "string"
          },
          "bucket": {
            "type": "string"
          },
          "file": {
            "type": "string",
            "format": "binary",
            "description": "The file to upload."
          }
        }
      },
      "SearchExpenseDraftsRequest": {
        "type": "object",
        "description": "Filters for searching expense drafts. All fields are optional; an empty body returns all drafts.",
        "properties": {
          "fromDate": {
            "type": "string",
            "description": "Start of the creation date range to filter by, formatted YYYY-MM-DD.",
            "example": "2026-03-01"
          },
          "toDate": {
            "type": "string",
            "description": "End of the creation date range to filter by, formatted YYYY-MM-DD.",
            "example": "2026-06-30"
          },
          "description": {
            "type": "string",
            "description": "Filter by expense draft description."
          },
          "supplierId": {
            "type": "string",
            "description": "Filter by supplier ID."
          },
          "supplierName": {
            "type": "string",
            "description": "Filter by supplier name. For example: `שפע`.",
            "example": "שפע"
          },
          "page": {
            "type": "integer",
            "description": "Page number to retrieve (1-based). Defaults to 1.",
            "example": 1
          },
          "pageSize": {
            "type": "integer",
            "description": "Number of results per page.",
            "example": 20
          }
        }
      },
      "ExpenseDraftStatus": {
        "type": "integer",
        "description": "Expense draft status.\n\n| Code | Status |\n|------|--------|\n| 10 | חדש |\n| 50 | נכשל |\n| 200 | נדחה |",
        "example": 10
      },
      "DraftExpense": {
        "type": "object",
        "description": "The expense data extracted from the uploaded file. Becomes a regular expense once the draft is approved.",
        "properties": {
          "documentType": {
            "$ref": "#/components/schemas/ExpenseDocumentType"
          },
          "number": {
            "type": "string",
            "description": "The supplier's document number.",
            "example": "1003024467"
          },
          "date": {
            "type": "string",
            "description": "Date of the expense, as an ISO-8601 datetime.",
            "example": "2026-03-15T00:00:00"
          },
          "reportingDate": {
            "type": "string",
            "description": "VAT reporting date, as an ISO-8601 datetime.",
            "example": "2026-03-01T00:00:00"
          },
          "paymentType": {
            "$ref": "#/components/schemas/ExpensePaymentType"
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          },
          "currencyRate": {
            "type": "number",
            "description": "Exchange rate relative to ILS.",
            "example": 1
          },
          "amount": {
            "type": "number",
            "description": "Total amount of the expense, including VAT.",
            "example": 49.9
          },
          "vat": {
            "type": "number",
            "description": "VAT portion of the amount.",
            "example": 7.61
          },
          "description": {
            "type": "string",
            "description": "Description of the expense."
          },
          "texts": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Free-text notes associated with the expense."
          },
          "supplier": {
            "$ref": "#/components/schemas/Supplier"
          },
          "accountingClassification": {
            "$ref": "#/components/schemas/AccountingClassification"
          },
          "active": {
            "type": "boolean",
            "description": "Whether the expense is active.",
            "example": true
          },
          "addRecipient": {
            "type": "boolean",
            "description": "Whether to add the supplier as a recipient."
          }
        }
      },
      "ExpenseDraft": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The expense draft ID.",
            "example": "315fd195-8703-486d-a883-88adfd434429"
          },
          "businessId": {
            "type": "string",
            "description": "The ID of the business the draft belongs to.",
            "example": "c1e4a7b2-8d3f-4a9c-b5e6-3f4a5b6c7d8e"
          },
          "status": {
            "$ref": "#/components/schemas/ExpenseDraftStatus"
          },
          "expense": {
            "$ref": "#/components/schemas/DraftExpense"
          },
          "reportingPeriod": {
            "type": "string",
            "description": "The VAT reporting period the draft falls in.",
            "example": "03-04/2026"
          },
          "url": {
            "type": "string",
            "description": "Download URL for the uploaded file."
          },
          "creationDate": {
            "type": "integer",
            "description": "Creation date, as a Unix timestamp in seconds.",
            "example": 1781013227
          },
          "lastUpdateDate": {
            "type": "integer",
            "description": "Last update date, as a Unix timestamp in seconds.",
            "example": 1781015771
          }
        }
      },
      "SearchExpenseDraftsResponse": {
        "type": "object",
        "properties": {
          "total": {
            "type": "integer",
            "description": "Total number of expense drafts matching the search.",
            "example": 1
          },
          "page": {
            "type": "integer",
            "description": "The page number returned.",
            "example": 1
          },
          "pageSize": {
            "type": "integer",
            "description": "The number of results per page.",
            "example": 20
          },
          "pages": {
            "type": "integer",
            "description": "Total number of pages available.",
            "example": 1
          },
          "from": {
            "type": "integer",
            "description": "1-based index of the first item on this page.",
            "example": 1
          },
          "to": {
            "type": "integer",
            "description": "1-based index of the last item on this page.",
            "example": 1
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExpenseDraft"
            },
            "description": "The expense drafts matching the search."
          }
        }
      },
      "BusinessCategory": {
        "type": "object",
        "required": [
          "id",
          "updatedAt",
          "name"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "description": "The business category code (also used as the sub-category code for nested entries)",
            "example": 22
          },
          "updatedAt": {
            "type": "integer",
            "format": "int64",
            "description": "Unix timestamp in milliseconds of when the category was last updated",
            "example": 1718054936930
          },
          "name": {
            "type": "string",
            "description": "The localized category name",
            "example": "אבטחה וחקירות"
          },
          "keywords": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Localized search keywords associated with the category. Omitted when the category has none.",
            "example": [
              "חוקר"
            ]
          },
          "children": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BusinessCategory"
            },
            "description": "Sub-categories of this category. Present only on top-level categories that have sub-categories; sub-categories themselves have no children."
          }
        }
      },
      "CountryObject": {
        "type": "object",
        "required": [
          "alpha2code",
          "alpha3code",
          "name"
        ],
        "properties": {
          "alpha2code": {
            "type": "string",
            "description": "2-letter ISO 3166-1 alpha-2 country code",
            "example": "IL"
          },
          "alpha3code": {
            "type": "string",
            "description": "3-letter ISO 3166-1 alpha-3 country code",
            "example": "ISR"
          },
          "callingCode": {
            "type": "integer",
            "description": "International dialing code",
            "example": 972
          },
          "name": {
            "type": "string",
            "description": "The country full name in the requested language",
            "example": "ישראל"
          },
          "updatedAt": {
            "type": "integer",
            "format": "int64",
            "description": "Unix timestamp in milliseconds of the last update to this record",
            "example": 1718049888858
          }
        }
      },
      "CityObject": {
        "type": "object",
        "required": [
          "country",
          "id",
          "name",
          "updatedAt"
        ],
        "properties": {
          "country": {
            "type": "string",
            "description": "The 2-letter code of the country",
            "example": "IL"
          },
          "id": {
            "type": "integer",
            "description": "The ID of the city object",
            "example": 284
          },
          "updatedAt": {
            "type": "integer",
            "format": "int64",
            "description": "Unix timestamp in milliseconds of the last update to this record",
            "example": 1718052025380
          },
          "name": {
            "type": "string",
            "description": "The name of the city in the specified locale",
            "example": "שדה ורבורג"
          }
        }
      },
      "ExchangeRate": {
        "type": "object",
        "required": [
          "current",
          "previous",
          "change",
          "changePercent"
        ],
        "properties": {
          "current": {
            "type": "number",
            "description": "The current exchange rate",
            "example": 3.693908
          },
          "previous": {
            "type": "number",
            "description": "The previous exchange rate",
            "example": 3.679988
          },
          "change": {
            "type": "number",
            "description": "The absolute change between the current and previous exchange rates",
            "example": 0.01392
          },
          "changePercent": {
            "type": "number",
            "description": "The percentage change between the current and previous exchange rates",
            "example": 0.378262
          }
        }
      },
      "CurrencyExchange": {
        "type": "object",
        "required": [
          "base",
          "code",
          "symbol",
          "updatedAt",
          "rates"
        ],
        "properties": {
          "base": {
            "type": "string",
            "description": "The base currency code",
            "example": "ILS"
          },
          "code": {
            "type": "string",
            "description": "The currency code",
            "example": "USD"
          },
          "symbol": {
            "type": "string",
            "description": "The currency symbol",
            "example": "$"
          },
          "updatedAt": {
            "type": "integer",
            "format": "int64",
            "description": "Unix timestamp in milliseconds of the last update to this record",
            "example": 1720265835875
          },
          "rates": {
            "type": "object",
            "description": "Exchange rate information for this currency",
            "required": [
              "spot",
              "closing"
            ],
            "properties": {
              "spot": {
                "$ref": "#/components/schemas/ExchangeRate",
                "description": "The spot exchange rate (interbank rate)"
              },
              "closing": {
                "$ref": "#/components/schemas/ExchangeRate",
                "description": "The daily closing exchange rate"
              }
            }
          }
        }
      },
      "ConnectedPartnerUser": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The connected user's masked identifier.",
            "example": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4"
          },
          "email": {
            "type": "string",
            "description": "The connected user's email address.",
            "example": "user@example.com"
          }
        }
      },
      "WebhookDocumentCreated": {
        "type": "object",
        "description": "Payload delivered to your webhook URL when a document is created (`document/created`).\n\nFields with no value are omitted from the payload entirely — they are never sent as `null`. Treat every property below as optional and code defensively against its absence.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier of the created document."
          },
          "type": {
            "$ref": "#/components/schemas/DocumentType"
          },
          "number": {
            "type": "integer",
            "description": "Document serial number."
          },
          "businessId": {
            "type": "string",
            "description": "Unique identifier of the business that issued the document."
          },
          "businessType": {
            "$ref": "#/components/schemas/BusinessType"
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          },
          "country": {
            "type": "string",
            "description": "2-letter ISO 3166-1 alpha-2 country code of the issuing business. See the [Get Supported Countries](#operation/getSupportedCountries) endpoint for the full list."
          },
          "date": {
            "type": "string",
            "format": "date",
            "description": "Document date, in `YYYY-MM-DD` format."
          },
          "createdAt": {
            "type": "integer",
            "format": "int64",
            "description": "Unix timestamp in milliseconds of when the document was created."
          },
          "subtotal": {
            "type": "number",
            "description": "Document total before VAT."
          },
          "taxableTotal": {
            "type": "number",
            "description": "Total amount subject to VAT."
          },
          "vatTaxableTotal": {
            "type": "number",
            "description": "Total amount subject to VAT (currently identical to `taxableTotal`)."
          },
          "revenueTaxableTotal": {
            "type": "number",
            "description": "Total revenue subject to income tax."
          },
          "exemptTotal": {
            "type": "number",
            "description": "Total of the VAT-exempt amounts."
          },
          "rounding": {
            "type": "boolean",
            "description": "Whether the document amounts are rounded."
          },
          "custom": {
            "type": "object",
            "additionalProperties": true,
            "description": "Custom data attached to the document. Omitted when no custom data was set."
          },
          "bill": {
            "type": "object",
            "description": "Present when the document is linked to a payment request; omitted otherwise.",
            "properties": {
              "url": {
                "type": "string",
                "description": "URL of the payment page for the linked payment request."
              }
            }
          },
          "discount": {
            "type": "object",
            "description": "Document-level discount. Omitted when no discount was applied.",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "sum",
                  "percentage"
                ],
                "description": "Discount type: `sum` for a fixed amount, `percentage` for a percentage."
              },
              "total": {
                "type": "number",
                "description": "Discount value — a fixed amount when `type` is `sum`, or a percentage when `type` is `percentage`."
              }
            }
          },
          "tax": {
            "type": "array",
            "description": "Tax breakdown lines. Contains a VAT line when VAT applies.",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "Tax name."
                },
                "rate": {
                  "type": "number",
                  "description": "Tax rate as a decimal fraction, e.g. `0.18` for 18%."
                },
                "total": {
                  "type": "number",
                  "description": "Tax amount."
                }
              }
            }
          },
          "total": {
            "type": "number",
            "description": "Document total, including VAT."
          },
          "description": {
            "type": "string",
            "description": "Document title."
          },
          "remarks": {
            "type": "string",
            "description": "Free-text remarks shown on the document."
          },
          "reverseCharge": {
            "type": "boolean",
            "description": "Whether reverse-charge VAT applies to the document."
          },
          "recipient": {
            "type": "object",
            "description": "The party the document was issued to.",
            "properties": {
              "id": {
                "type": "string",
                "description": "Unique identifier of the recipient."
              },
              "name": {
                "type": "string",
                "description": "Recipient name."
              },
              "taxId": {
                "type": "string",
                "description": "Recipient tax ID."
              },
              "department": {
                "type": "string",
                "description": "Recipient department."
              },
              "address": {
                "type": "string",
                "description": "Street address."
              },
              "city": {
                "type": "string",
                "description": "City."
              },
              "zip": {
                "type": "string",
                "description": "Postal code."
              },
              "country": {
                "type": "string",
                "description": "2-letter ISO 3166-1 alpha-2 country code. See the [Get Supported Countries](#operation/getSupportedCountries) endpoint for the full list."
              },
              "phone": {
                "type": "string",
                "description": "Phone number."
              },
              "mobile": {
                "type": "string",
                "description": "Mobile number."
              },
              "emails": {
                "type": "array",
                "description": "Recipient email addresses.",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "items": {
            "type": "array",
            "description": "The document line items.",
            "items": {
              "type": "object",
              "properties": {
                "description": {
                  "type": "string",
                  "description": "Line item description."
                },
                "sku": {
                  "type": "string",
                  "description": "Item catalog number (SKU)."
                },
                "quantity": {
                  "type": "number",
                  "description": "Quantity."
                },
                "price": {
                  "type": "number",
                  "description": "Unit price, in the item's currency."
                },
                "currency": {
                  "$ref": "#/components/schemas/Currency"
                },
                "taxIncludedInPrice": {
                  "type": "boolean",
                  "description": "Whether VAT is already included in the price."
                },
                "tax": {
                  "type": "array",
                  "description": "VAT breakdown for this line item. Omitted when the item is VAT-exempt.",
                  "items": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "description": "Name of the tax, e.g. `VAT`."
                      },
                      "rate": {
                        "type": "number",
                        "description": "Tax rate as a decimal fraction, e.g. `0.18` for 18%."
                      }
                    }
                  }
                },
                "foreignCurrencyRate": {
                  "type": "object",
                  "description": "Exchange rate from the item currency to the document currency, keyed by the document's 3-letter ISO currency code. Present only when the item currency differs from the document currency.",
                  "additionalProperties": {
                    "type": "number"
                  }
                }
              }
            }
          },
          "transactionId": {
            "type": "string",
            "description": "Identifier of the source transaction that triggered the document. Omitted when the document was not generated from a transaction."
          },
          "transactions": {
            "type": "array",
            "description": "Payment transactions recorded on the document. Empty when the document has no payments.",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Unique identifier of the transaction."
                },
                "price": {
                  "type": "number",
                  "description": "Amount paid in this transaction, in the transaction currency."
                },
                "currency": {
                  "$ref": "#/components/schemas/Currency"
                },
                "date": {
                  "type": "string",
                  "format": "date",
                  "description": "Transaction date, in `YYYY-MM-DD` format."
                },
                "paymentMethod": {
                  "type": "object",
                  "description": "Details of how the payment was made.",
                  "properties": {
                    "type": {
                      "type": "string",
                      "description": "Payment method type, e.g. `credit-card`."
                    },
                    "cardNumber": {
                      "type": "string",
                      "description": "Last 4 digits of the card. Present only when paid by credit card."
                    },
                    "accountId": {
                      "type": "string",
                      "description": "Identifier of the linked account, when applicable."
                    },
                    "transactionId": {
                      "type": "string",
                      "description": "Payment-gateway transaction identifier, when applicable."
                    }
                  }
                },
                "foreignCurrencyRate": {
                  "type": "object",
                  "description": "Exchange rate from the transaction currency to the document currency, keyed by the document's 3-letter ISO currency code. Present only when the transaction currency differs from the document currency.",
                  "additionalProperties": {
                    "type": "number"
                  }
                }
              }
            }
          },
          "files": {
            "type": "object",
            "description": "The document's generated files.",
            "properties": {
              "signed": {
                "type": "boolean",
                "description": "Whether the document is digitally signed."
              },
              "downloadLinks": {
                "type": "object",
                "description": "Download URLs for the document PDF.",
                "properties": {
                  "he": {
                    "type": "string",
                    "description": "Download URL for the Hebrew version."
                  },
                  "en": {
                    "type": "string",
                    "description": "Download URL for the English version. Present when an English copy was generated."
                  },
                  "origin": {
                    "type": "string",
                    "description": "Download URL for the original-language version."
                  }
                }
              }
            }
          },
          "allocationNumber": {
            "type": "string",
            "description": "Israeli Tax Authority allocation (confirmation) number, when one was assigned to the document. Omitted otherwise."
          },
          "foreignCurrencyRate": {
            "type": "object",
            "description": "Exchange rate from the document currency to the local currency (ILS), keyed by the 3-letter local currency code. Present only when the document currency is not ILS.",
            "additionalProperties": {
              "type": "number"
            }
          },
          "generatedBy": {
            "type": "object",
            "description": "The user who generated the document.",
            "properties": {
              "id": {
                "type": "string",
                "description": "Unique identifier of the user."
              },
              "name": {
                "type": "string",
                "description": "User's full name."
              }
            }
          }
        },
        "example": {
          "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "type": 320,
          "number": 60873,
          "businessId": "9b7c1e42-8d3a-4f16-b0c5-1e2d3a4b5c6d",
          "businessType": 2,
          "currency": "ILS",
          "country": "IL",
          "date": "2026-07-01",
          "createdAt": 1782893748000,
          "subtotal": 300,
          "taxableTotal": 300,
          "vatTaxableTotal": 300,
          "revenueTaxableTotal": 300,
          "exemptTotal": 0,
          "rounding": false,
          "tax": [
            {
              "name": "VAT",
              "rate": 0.18,
              "total": 54
            }
          ],
          "total": 354,
          "description": "",
          "remarks": "Tax invoice / receipt for transaction invoice 40000468",
          "reverseCharge": false,
          "recipient": {
            "id": "5c1f2e3d-4b5a-4c6d-9e8f-0a1b2c3d4e5f",
            "name": "David Levi",
            "taxId": "514987326",
            "department": "",
            "address": "1 Main St",
            "city": "Nahariya",
            "zip": "18555",
            "country": "IL",
            "phone": "03-1234567",
            "mobile": "",
            "emails": [
              "david@example.com"
            ]
          },
          "items": [
            {
              "description": "UI design hour",
              "sku": "UI-001",
              "quantity": 1,
              "price": 300,
              "currency": "ILS",
              "taxIncludedInPrice": false,
              "tax": [
                {
                  "name": "VAT",
                  "rate": 0.18
                }
              ]
            }
          ],
          "transactionId": "7e8d9c0b-1a2f-4e3d-8c5b-6a7f8e9d0c1b",
          "transactions": [
            {
              "id": "2b3c4d5e-6f70-4819-a2b3-c4d5e6f70819",
              "price": 354,
              "currency": "ILS",
              "date": "2026-07-01",
              "paymentMethod": {
                "type": "credit-card",
                "cardNumber": "0008"
              }
            }
          ],
          "files": {
            "signed": true,
            "downloadLinks": {
              "he": "https://www.greeninvoice.co.il/api/v1/documents/download?d=...",
              "en": "https://www.greeninvoice.co.il/api/v1/documents/download?d=...",
              "origin": "https://www.greeninvoice.co.il/api/v1/documents/download?d=..."
            }
          },
          "generatedBy": {
            "id": "8a2f1c3e-4d5b-4e6f-9a0b-1c2d3e4f5a6b",
            "name": "Noa Cohen"
          }
        }
      },
      "WebhookClientCreated": {
        "type": "object",
        "description": "Payload delivered to your webhook URL when a client is created (`client/created`).\n\nFields with no value are omitted from the payload entirely — they are never sent as `null`. Treat every property below as optional and code defensively against its absence.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier of the client."
          },
          "name": {
            "type": "string",
            "description": "Client name."
          },
          "taxId": {
            "type": "string",
            "description": "Client tax ID."
          },
          "department": {
            "type": "string",
            "description": "Client department."
          },
          "address": {
            "type": "string",
            "description": "Street address."
          },
          "city": {
            "type": "string",
            "description": "City."
          },
          "zip": {
            "type": "string",
            "description": "Postal code."
          },
          "country": {
            "type": "string",
            "description": "2-letter ISO 3166-1 alpha-2 country code. See the [Get Supported Countries](#operation/getSupportedCountries) endpoint for the full list."
          },
          "phone": {
            "type": "string",
            "description": "Phone number."
          },
          "mobile": {
            "type": "string",
            "description": "Mobile number."
          },
          "emails": {
            "type": "array",
            "description": "Client email addresses.",
            "items": {
              "type": "string"
            }
          },
          "contact": {
            "type": "string",
            "description": "Contact person name."
          },
          "createdAt": {
            "type": "integer",
            "format": "int64",
            "description": "Unix timestamp in milliseconds of when the client was created."
          },
          "updatedAt": {
            "type": "integer",
            "format": "int64",
            "description": "Unix timestamp in milliseconds of when the client was last updated."
          }
        },
        "example": {
          "id": "8a1b2c3d-4e5f-4061-9273-8495a6b7c8d9",
          "name": "Dana Cohen",
          "taxId": "512345678",
          "department": "Finance",
          "address": "1 Main St",
          "city": "Tel Aviv",
          "zip": "6120101",
          "country": "IL",
          "phone": "03-0000000",
          "mobile": "050-0000000",
          "emails": [
            "client@example.com"
          ],
          "contact": "Dana",
          "createdAt": 1782896238000,
          "updatedAt": 1782896238000
        }
      },
      "WebhookSupplierCreated": {
        "type": "object",
        "description": "Payload delivered to your webhook URL when a supplier is created (`supplier/created`).\n\nFields with no value are omitted from the payload entirely — they are never sent as `null`. Treat every property below as optional and code defensively against its absence.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier of the supplier."
          },
          "name": {
            "type": "string",
            "description": "Supplier name."
          },
          "taxId": {
            "type": "string",
            "description": "Supplier tax ID."
          },
          "department": {
            "type": "string",
            "description": "Supplier department."
          },
          "address": {
            "type": "string",
            "description": "Street address."
          },
          "city": {
            "type": "string",
            "description": "City."
          },
          "zip": {
            "type": "string",
            "description": "Postal code."
          },
          "country": {
            "type": "string",
            "description": "2-letter ISO 3166-1 alpha-2 country code. See the [Get Supported Countries](#operation/getSupportedCountries) endpoint for the full list."
          },
          "phone": {
            "type": "string",
            "description": "Phone number."
          },
          "mobile": {
            "type": "string",
            "description": "Mobile number."
          },
          "emails": {
            "type": "array",
            "description": "Supplier email addresses.",
            "items": {
              "type": "string"
            }
          },
          "contact": {
            "type": "string",
            "description": "Contact person name."
          },
          "createdAt": {
            "type": "integer",
            "format": "int64",
            "description": "Unix timestamp in milliseconds of when the supplier was created."
          },
          "updatedAt": {
            "type": "integer",
            "format": "int64",
            "description": "Unix timestamp in milliseconds of when the supplier was last updated."
          }
        },
        "example": {
          "id": "4d5e6f70-8192-4a3b-b5c6-d7e8f9012345",
          "name": "Global Supplies Ltd",
          "taxId": "515263748",
          "department": "Finance",
          "address": "10 Trade Ave",
          "city": "Kyiv",
          "zip": "01001",
          "country": "UA",
          "phone": "03-0000000",
          "mobile": "050-0000000",
          "emails": [
            "supplier@example.com"
          ],
          "contact": "Alex",
          "createdAt": 1782896493000,
          "updatedAt": 1782896493000
        }
      },
      "WebhookPaymentReceived": {
        "type": "object",
        "description": "Payload delivered to your webhook URL when a payment is received (`payment/received`).\n\nFields with no value are omitted from the payload entirely — they are never sent as `null`. Treat every property below as optional and code defensively against its absence.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier of the payment request."
          },
          "channel": {
            "type": "string",
            "description": "The channel the payment was made through, e.g. `sale-page`."
          },
          "productId": {
            "type": "string",
            "description": "External product identifier associated with the payment, when applicable."
          },
          "description": {
            "type": "string",
            "description": "Description of the payment request."
          },
          "total": {
            "type": "number",
            "description": "Total amount paid."
          },
          "custom": {
            "type": "object",
            "additionalProperties": true,
            "description": "Custom data attached to the payment request. Omitted when none was set."
          },
          "payer": {
            "type": "object",
            "description": "The party that made the payment.",
            "properties": {
              "name": {
                "type": "string",
                "description": "Payer name."
              },
              "phone": {
                "type": "string",
                "description": "Payer phone number."
              },
              "email": {
                "type": "string",
                "description": "Payer email address."
              }
            }
          },
          "transactions": {
            "type": "array",
            "description": "The payment transactions that make up this payment.",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Unique identifier of the transaction."
                },
                "createdAt": {
                  "type": "integer",
                  "format": "int64",
                  "description": "Unix timestamp in milliseconds of when the transaction was created."
                },
                "currency": {
                  "$ref": "#/components/schemas/Currency"
                },
                "gateway": {
                  "type": "string",
                  "description": "Payment gateway that processed the transaction, e.g. `cardcom`."
                },
                "gatewayTransactionId": {
                  "type": "string",
                  "description": "Identifier of the transaction at the payment gateway."
                },
                "installments": {
                  "type": "integer",
                  "description": "Number of installments the payment was split into."
                },
                "total": {
                  "type": "number",
                  "description": "Amount charged in this transaction, in the transaction currency."
                },
                "authorizationCode": {
                  "type": "string",
                  "description": "Authorization code returned by the payment gateway."
                },
                "payer": {
                  "type": "object",
                  "description": "The payer as recorded on the transaction.",
                  "properties": {
                    "name": {
                      "type": "string",
                      "description": "Cardholder / payer name."
                    }
                  }
                },
                "paymentMethod": {
                  "type": "object",
                  "description": "Details of how the payment was made.",
                  "properties": {
                    "type": {
                      "type": "string",
                      "description": "Payment method type, e.g. `credit-card`."
                    },
                    "cardNumber": {
                      "type": "string",
                      "description": "Last 4 digits of the card. Present only when paid by credit card."
                    }
                  }
                },
                "foreignCurrencyRate": {
                  "type": "object",
                  "description": "Exchange rate from the transaction currency to the local currency (ILS), keyed by the 3-letter local currency code. Present only when the transaction currency is not ILS.",
                  "additionalProperties": {
                    "type": "number"
                  }
                }
              }
            }
          }
        },
        "example": {
          "id": "6f708192-a3b4-4c5d-9e6f-708192a3b4c5",
          "channel": "sale-page",
          "description": "Purchase from sale page",
          "total": 210,
          "payer": {
            "name": "Dana Cohen",
            "email": "payer@example.com"
          },
          "transactions": [
            {
              "id": "0c1b2a3d-4e5f-4607-8918-2a3b4c5d6e7f",
              "createdAt": 1782896958000,
              "currency": "ILS",
              "gateway": "cardcom",
              "gatewayTransactionId": "900112233",
              "installments": 1,
              "total": 210,
              "authorizationCode": "12345",
              "payer": {
                "name": "Card Owner"
              },
              "paymentMethod": {
                "type": "credit-card",
                "cardNumber": "0008"
              }
            }
          ]
        }
      },
      "WebhookSalePagesPageContacted": {
        "type": "object",
        "description": "Payload delivered to your webhook URL when a visitor submits their details on a sale page (`sale-pages/page-contacted`).\n\nThe event is emitted by any sale-page block that collects visitor contact details; the different blocks share the same payload, and which fields are populated depends on the block and its configuration.\n\nOptional fields are omitted from the payload when not provided. Treat every property below as optional and code defensively against its absence.",
        "properties": {
          "firstName": {
            "type": "string",
            "description": "First name entered in the contact form."
          },
          "lastName": {
            "type": "string",
            "description": "Last name entered in the contact form."
          },
          "email": {
            "type": "string",
            "description": "Email address entered in the contact form."
          },
          "phone": {
            "type": "string",
            "description": "Phone number entered in the contact form."
          },
          "newsletter": {
            "type": "boolean",
            "description": "Whether the visitor opted in to the business's mailing list, consenting to receive marketing content by email and/or SMS."
          },
          "message": {
            "type": "string",
            "description": "Free-text message entered by the visitor. Present only when the block includes a message field."
          },
          "pageName": {
            "type": "string",
            "description": "Name of the sale page the contact request was submitted from."
          },
          "streams": {
            "type": "array",
            "description": "Integration (plugin) type codes the contact request was forwarded to. Empty when none are configured.",
            "items": {
              "type": "integer"
            }
          }
        },
        "example": {
          "firstName": "Dana",
          "lastName": "Cohen",
          "email": "dana@example.com",
          "phone": "050-0000000",
          "newsletter": true,
          "message": "What are your opening hours?",
          "pageName": "My Store",
          "streams": []
        }
      },
      "WebhookSalePagesOrderPaid": {
        "type": "object",
        "description": "Payload delivered to your webhook URL when an order is paid on a sale page (`sale-pages/order-paid`).\n\nOptional fields are omitted from the payload when not provided; some fields (such as a discount `total`) may be sent as `null`. Treat every property below as optional and code defensively against its absence.",
        "properties": {
          "businessId": {
            "type": "string",
            "description": "Unique identifier of the business that owns the sale page."
          },
          "pageId": {
            "type": "string",
            "description": "Unique identifier of the sale page."
          },
          "documentId": {
            "type": "string",
            "description": "Unique identifier of the document created for the order, when one was created."
          },
          "orderNumber": {
            "type": "integer",
            "description": "Sequential order number."
          },
          "description": {
            "type": "string",
            "description": "Order description."
          },
          "billing": {
            "type": "object",
            "description": "The customer's billing details.",
            "properties": {
              "name": {
                "type": "string",
                "description": "Customer name."
              },
              "phone": {
                "type": "string",
                "description": "Customer phone number."
              },
              "email": {
                "type": "string",
                "description": "Customer email address."
              },
              "taxId": {
                "type": "string",
                "description": "Customer tax ID."
              },
              "terms": {
                "type": "boolean",
                "description": "Whether the customer accepted the terms."
              },
              "nameOnInvoice": {
                "type": "string",
                "description": "Name to appear on the invoice, when different from the customer name."
              },
              "notes": {
                "type": "string",
                "description": "Free-text notes entered by the customer."
              }
            }
          },
          "shipping": {
            "type": "object",
            "description": "The shipping details, when the order includes shipping.",
            "properties": {
              "name": {
                "type": "string",
                "description": "Recipient name."
              },
              "phone": {
                "type": "string",
                "description": "Recipient phone number."
              },
              "address": {
                "type": "object",
                "description": "The shipping address.",
                "properties": {
                  "formatted": {
                    "type": "string",
                    "description": "The full address as a single formatted string."
                  },
                  "city": {
                    "type": "string",
                    "description": "City."
                  },
                  "country": {
                    "type": "string",
                    "description": "2-letter ISO 3166-1 alpha-2 country code. See the [Get Supported Countries](#operation/getSupportedCountries) endpoint for the full list."
                  },
                  "street": {
                    "type": "string",
                    "description": "Street name."
                  },
                  "streetNumber": {
                    "type": "integer",
                    "description": "Street number."
                  },
                  "entrance": {
                    "type": "string",
                    "description": "Building entrance."
                  },
                  "postalCode": {
                    "type": "string",
                    "description": "Postal code."
                  },
                  "apartmentNumber": {
                    "type": "integer",
                    "description": "Apartment number."
                  }
                }
              },
              "method": {
                "type": "string",
                "description": "Name of the shipping method."
              },
              "price": {
                "type": "number",
                "description": "Shipping price, in the order currency."
              },
              "currency": {
                "$ref": "#/components/schemas/Currency"
              },
              "notes": {
                "type": "string",
                "description": "Free-text shipping notes."
              }
            }
          },
          "tax": {
            "type": "array",
            "description": "VAT breakdown for the order.",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "Name of the tax, e.g. `VAT`."
                },
                "rate": {
                  "type": "number",
                  "description": "Tax rate as a decimal fraction, e.g. `0.18` for 18%."
                }
              }
            }
          },
          "transactions": {
            "type": "object",
            "description": "The payment recorded for the order.",
            "properties": {
              "price": {
                "type": "number",
                "description": "Amount paid, in the order currency."
              },
              "currency": {
                "$ref": "#/components/schemas/Currency"
              },
              "paymentMethod": {
                "type": "string",
                "description": "Payment method used, e.g. `credit-card`."
              }
            }
          },
          "items": {
            "type": "array",
            "description": "The ordered line items.",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "Item name."
                },
                "sku": {
                  "type": "string",
                  "description": "Item catalog number (SKU)."
                },
                "description": {
                  "type": "string",
                  "description": "Item description."
                },
                "quantity": {
                  "type": "number",
                  "description": "Quantity ordered."
                },
                "price": {
                  "type": "number",
                  "description": "Unit price, in the order currency."
                },
                "currency": {
                  "$ref": "#/components/schemas/Currency"
                },
                "discount": {
                  "type": "object",
                  "description": "Discount applied to this line item.",
                  "properties": {
                    "total": {
                      "type": "number",
                      "nullable": true,
                      "description": "Discount amount. `null` when no discount applies."
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "sum",
                        "percentage",
                        "none"
                      ],
                      "description": "Item discount type. `none` when no discount applies."
                    }
                  }
                }
              }
            }
          },
          "discount": {
            "type": "object",
            "description": "Order-level coupon discount. Present only when a coupon was applied.",
            "properties": {
              "code": {
                "type": "string",
                "description": "Coupon code."
              },
              "type": {
                "type": "string",
                "enum": [
                  "percentage",
                  "fixed",
                  "none"
                ],
                "description": "Coupon discount type."
              },
              "total": {
                "type": "number",
                "nullable": true,
                "description": "Discount amount. `null` when the coupon carries no amount."
              }
            }
          },
          "createdAt": {
            "type": "integer",
            "format": "int64",
            "description": "Unix timestamp in milliseconds of when the order was created."
          },
          "paidAt": {
            "type": "integer",
            "format": "int64",
            "description": "Unix timestamp in milliseconds of when the order was paid."
          }
        },
        "example": {
          "businessId": "a1c2e3f4-5b6d-4e7f-8a9b-0c1d2e3f4a5b",
          "pageId": "b2d3f4a5-6c7e-4f8a-9b0c-1d2e3f4a5b6c",
          "documentId": "c3e4a5b6-7d8f-4a9b-8c0d-2e3f4a5b6c7d",
          "orderNumber": 7708,
          "description": "Purchase from sale page",
          "billing": {
            "name": "Dana Cohen",
            "email": "dana@example.com",
            "taxId": "514987326",
            "nameOnInvoice": "Dana Cohen",
            "notes": "Please gift-wrap"
          },
          "shipping": {
            "name": "Dana Cohen",
            "phone": "050-0000000",
            "address": {
              "formatted": "12 Herzl St, Tel Aviv, 6120101, Israel",
              "city": "Tel Aviv",
              "country": "IL",
              "street": "Herzl",
              "streetNumber": 12,
              "entrance": "A",
              "postalCode": "6120101",
              "apartmentNumber": 5
            },
            "method": "Israel Post",
            "price": 10,
            "currency": "ILS",
            "notes": "Leave at the door"
          },
          "tax": [
            {
              "name": "VAT",
              "rate": 0.18
            }
          ],
          "transactions": {
            "price": 210,
            "currency": "ILS",
            "paymentMethod": "credit-card"
          },
          "items": [
            {
              "name": "Sample product 1",
              "description": "Product item",
              "quantity": 2,
              "price": 100,
              "currency": "ILS",
              "discount": {
                "total": null,
                "type": "none"
              }
            }
          ],
          "createdAt": 1782896952762,
          "paidAt": 1782896953000
        }
      },
      "WebhookExpenseDraftParsed": {
        "type": "object",
        "description": "Payload delivered to your webhook URL when an uploaded expense draft has finished parsing (`expense-draft/parsed`).\n\nThe base fields are always present; the expense-derived fields (`subtotal`, `total`, `classification`, `prediction`, `recipient`, etc.) are present once the draft has an associated expense.\n\nFields with no value are omitted from the payload entirely — they are never sent as `null`. Treat every property below as optional and code defensively against its absence.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier of the expense draft."
          },
          "createdAt": {
            "type": "integer",
            "format": "int64",
            "description": "Unix timestamp in milliseconds of when the draft was created."
          },
          "updatedAt": {
            "type": "integer",
            "format": "int64",
            "description": "Unix timestamp in milliseconds of when the draft was last updated."
          },
          "status": {
            "$ref": "#/components/schemas/ExpenseDraftStatus"
          },
          "recognized": {
            "type": "boolean",
            "description": "Whether the draft was recognized and populated with default values from parsing."
          },
          "thumbnail": {
            "type": "string",
            "description": "URL of the draft's thumbnail image."
          },
          "url": {
            "type": "string",
            "description": "URL to download the draft's source file."
          },
          "subtotal": {
            "type": "number",
            "description": "Expense total before VAT."
          },
          "total": {
            "type": "number",
            "description": "Expense total, including VAT."
          },
          "number": {
            "type": "string",
            "description": "Expense document number."
          },
          "source": {
            "type": "integer",
            "description": "Expense source code."
          },
          "description": {
            "type": "string",
            "description": "Expense description."
          },
          "remarks": {
            "type": "string",
            "description": "Free-text remarks on the expense."
          },
          "classification": {
            "type": "object",
            "description": "The accounting classification assigned to the expense.",
            "properties": {
              "id": {
                "type": "string",
                "description": "Unique identifier of the classification."
              },
              "type": {
                "type": "integer",
                "description": "Classification type code."
              },
              "irsCode": {
                "type": "integer",
                "description": "Tax Authority classification code."
              },
              "title": {
                "type": "string",
                "description": "Classification title."
              },
              "code": {
                "type": "string",
                "description": "Classification group code."
              },
              "key": {
                "type": "string",
                "description": "Classification key."
              },
              "income": {
                "type": "number",
                "description": "Recognized income percentage."
              },
              "vat": {
                "type": "number",
                "description": "Recognized VAT percentage."
              },
              "mixed": {
                "type": "number",
                "description": "Recognized mixed-use percentage."
              }
            }
          },
          "prediction": {
            "type": "object",
            "description": "The parsing (OCR) prediction result.",
            "properties": {
              "origin": {
                "type": "string",
                "description": "Origin of the prediction, e.g. `ocr`."
              },
              "fields": {
                "type": "array",
                "description": "The individual predicted fields.",
                "items": {
                  "type": "object",
                  "properties": {
                    "field": {
                      "type": "string",
                      "description": "Name of the predicted field, e.g. `amount`, `date`, `supplier`, `document_type`."
                    },
                    "value": {
                      "description": "The predicted value. Type depends on the field (number, string, etc.); omitted when nothing was recognized."
                    },
                    "confidence": {
                      "type": "string",
                      "enum": [
                        "high",
                        "medium",
                        "low"
                      ],
                      "description": "Confidence level of the prediction."
                    },
                    "coordinates": {
                      "type": "array",
                      "description": "Bounding-box points locating the value on the source document. Empty when not available.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "top": {
                            "type": "number",
                            "description": "Vertical position of the point."
                          },
                          "left": {
                            "type": "number",
                            "description": "Horizontal position of the point."
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "documentType": {
            "$ref": "#/components/schemas/ExpenseDocumentType"
          },
          "uploadTrackingId": {
            "type": "string",
            "description": "Identifier correlating the draft with the original upload."
          },
          "tax": {
            "type": "array",
            "description": "VAT breakdown for the expense.",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "Name of the tax, e.g. `VAT`."
                },
                "rate": {
                  "type": "number",
                  "description": "Tax rate as a decimal fraction, e.g. `0.18` for 18%."
                },
                "total": {
                  "type": "number",
                  "description": "Tax amount."
                }
              }
            }
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          },
          "country": {
            "type": "string",
            "description": "2-letter ISO 3166-1 alpha-2 country code. See the [Get Supported Countries](#operation/getSupportedCountries) endpoint for the full list."
          },
          "foreignCurrencyRate": {
            "type": "object",
            "description": "Exchange rate from the expense currency to the local currency (ILS), keyed by the 3-letter local currency code. Present only when the expense currency is not ILS.",
            "additionalProperties": {
              "type": "number"
            }
          },
          "date": {
            "type": "string",
            "format": "date",
            "description": "Expense date, in `YYYY-MM-DD` format."
          },
          "recipient": {
            "type": "object",
            "description": "The supplier the expense was issued by.",
            "properties": {
              "id": {
                "type": "string",
                "description": "Unique identifier of the supplier."
              },
              "name": {
                "type": "string",
                "description": "Supplier name."
              },
              "taxId": {
                "type": "string",
                "description": "Supplier tax ID."
              },
              "department": {
                "type": "string",
                "description": "Supplier department."
              },
              "address": {
                "type": "string",
                "description": "Street address."
              },
              "city": {
                "type": "string",
                "description": "City."
              },
              "zip": {
                "type": "string",
                "description": "Postal code."
              },
              "country": {
                "type": "string",
                "description": "2-letter ISO 3166-1 alpha-2 country code. See the [Get Supported Countries](#operation/getSupportedCountries) endpoint for the full list."
              },
              "phone": {
                "type": "string",
                "description": "Phone number."
              },
              "mobile": {
                "type": "string",
                "description": "Mobile number."
              },
              "emails": {
                "type": "array",
                "description": "Supplier email addresses.",
                "items": {
                  "type": "string"
                }
              },
              "contact": {
                "type": "string",
                "description": "Contact person name."
              },
              "createdAt": {
                "type": "integer",
                "format": "int64",
                "description": "Unix timestamp in milliseconds of when the supplier was created."
              },
              "updatedAt": {
                "type": "integer",
                "format": "int64",
                "description": "Unix timestamp in milliseconds of when the supplier was last updated."
              }
            }
          },
          "reportingPeriod": {
            "type": "string",
            "description": "The reporting period the expense is associated with, in `YYYY-MM` format."
          }
        },
        "example": {
          "id": "d1e2f3a4-5b6c-4d7e-8f90-1a2b3c4d5e6f",
          "createdAt": 1782900153000,
          "updatedAt": 1782900153000,
          "status": 10,
          "recognized": true,
          "thumbnail": "https://www.greeninvoice.co.il/api/v1/expenses/thumbnail?d=...",
          "url": "https://www.greeninvoice.co.il/api/v1/expenses/download?d=...&ft=1",
          "subtotal": 1,
          "total": 1.18,
          "number": "50002",
          "source": 1,
          "description": "",
          "classification": {
            "type": 20,
            "irsCode": 1390,
            "title": "Other costs",
            "code": "1300",
            "key": "1390",
            "income": 100,
            "vat": 100
          },
          "prediction": {
            "origin": "ocr",
            "fields": [
              {
                "field": "amount",
                "value": 1.18,
                "confidence": "high",
                "coordinates": []
              },
              {
                "field": "net",
                "value": 1,
                "confidence": "high",
                "coordinates": [
                  {
                    "top": 38,
                    "left": 17
                  },
                  {
                    "top": 38,
                    "left": 20
                  },
                  {
                    "top": 39,
                    "left": 20
                  },
                  {
                    "top": 39,
                    "left": 17
                  }
                ]
              },
              {
                "field": "supplier",
                "confidence": "low",
                "coordinates": []
              }
            ]
          },
          "documentType": 305,
          "uploadTrackingId": "e2f3a4b5-6c7d-4e8f-9a0b-1c2d3e4f5a6b",
          "tax": [
            {
              "name": "VAT",
              "rate": 0.18,
              "total": 0.18
            }
          ],
          "currency": "USD",
          "country": "IL",
          "foreignCurrencyRate": {
            "ILS": 3.65
          },
          "date": "2026-06-26",
          "recipient": {
            "id": "f0e1d2c3-b4a5-4968-8778-6a5b4c3d2e1f",
            "name": "Acme Supplies Ltd.",
            "country": "IL",
            "emails": []
          },
          "reportingPeriod": "2026-06"
        }
      },
      "WebhookExpenseDraftDeclined": {
        "type": "object",
        "description": "Payload delivered to your webhook URL when an accountant declines an uploaded expense draft (`expense-draft/declined`).\n\nThis is a human decision: an accountant reviewing uploaded expense drafts in the bookkeeping system rejects a draft they consider invalid, at their own discretion. The specific reason is conveyed in `referenceId`.\n\nFields with no value are omitted from the payload entirely — they are never sent as `null`. Treat every property below as optional and code defensively against its absence.",
        "properties": {
          "hash": {
            "type": "string",
            "description": "Hash of the uploaded file."
          },
          "format": {
            "type": "string",
            "description": "File format / extension of the uploaded file."
          },
          "mimeType": {
            "type": "string",
            "description": "MIME type of the uploaded file."
          },
          "size": {
            "type": "integer",
            "description": "Size of the uploaded file, in bytes."
          },
          "errorCode": {
            "type": "integer",
            "description": "Numeric code associated with the decline."
          },
          "reason": {
            "type": "string",
            "description": "Short machine-readable token for the decline."
          },
          "referenceId": {
            "type": "string",
            "description": "Human-readable text describing why the accountant declined the draft."
          },
          "uploadTrackingId": {
            "type": "string",
            "description": "Identifier correlating the draft with the original upload."
          }
        },
        "example": {
          "hash": "9f8e7d6c5b4a3210fedcba9876543210",
          "format": "pdf",
          "mimeType": "application/pdf",
          "size": 190519,
          "errorCode": 3308,
          "reason": "",
          "referenceId": "Invalid expense document type",
          "uploadTrackingId": "a2b3c4d5-e6f7-4809-9a1b-2c3d4e5f6a7b"
        }
      },
      "WebhookExpenseFileUpdated": {
        "type": "object",
        "description": "Payload delivered to your webhook URL when the file of an **already-approved expense** is updated (`expense/file-updated`).\n\nThis fires only for an approved expense. Updating the file of an expense **draft** does not trigger this event.\n\nFields with no value are omitted from the payload entirely — they are never sent as `null`. Treat every property below as optional and code defensively against its absence.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier of the expense."
          },
          "number": {
            "type": "string",
            "description": "Expense document number."
          },
          "businessId": {
            "type": "string",
            "description": "Unique identifier of the business that owns the expense."
          },
          "businessType": {
            "$ref": "#/components/schemas/BusinessType"
          },
          "createdAt": {
            "type": "integer",
            "format": "int64",
            "description": "Unix timestamp in milliseconds of when the expense was created."
          },
          "updatedAt": {
            "type": "integer",
            "format": "int64",
            "description": "Unix timestamp in milliseconds of when the expense was last updated."
          },
          "active": {
            "type": "boolean",
            "description": "Whether the expense is active."
          },
          "status": {
            "$ref": "#/components/schemas/ExpenseStatus"
          },
          "documentType": {
            "$ref": "#/components/schemas/ExpenseDocumentType"
          },
          "thumbnail": {
            "type": "string",
            "description": "URL of the expense's thumbnail image."
          },
          "url": {
            "type": "string",
            "description": "URL to download the expense's source file."
          },
          "subtotal": {
            "type": "number",
            "description": "Expense total before VAT."
          },
          "total": {
            "type": "number",
            "description": "Expense total, including VAT."
          },
          "classification": {
            "type": "object",
            "description": "The accounting classification assigned to the expense.",
            "properties": {
              "id": {
                "type": "string",
                "description": "Unique identifier of the classification."
              },
              "type": {
                "type": "integer",
                "description": "Classification type code."
              },
              "irsCode": {
                "type": "integer",
                "description": "Tax Authority classification code."
              },
              "title": {
                "type": "string",
                "description": "Classification title."
              },
              "code": {
                "type": "string",
                "description": "Classification group code."
              },
              "key": {
                "type": "string",
                "description": "Classification key."
              },
              "income": {
                "type": "number",
                "description": "Recognized income percentage."
              },
              "vat": {
                "type": "number",
                "description": "Recognized VAT percentage."
              },
              "mixed": {
                "type": "number",
                "description": "Recognized mixed-use percentage."
              }
            }
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          },
          "country": {
            "type": "string",
            "description": "2-letter ISO 3166-1 alpha-2 country code. See the [Get Supported Countries](#operation/getSupportedCountries) endpoint for the full list."
          },
          "tax": {
            "type": "array",
            "description": "VAT breakdown for the expense.",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "Name of the tax, e.g. `VAT`."
                },
                "rate": {
                  "type": "number",
                  "description": "Tax rate as a decimal fraction, e.g. `0.18` for 18%."
                },
                "total": {
                  "type": "number",
                  "description": "Tax amount."
                }
              }
            }
          },
          "date": {
            "type": "string",
            "format": "date",
            "description": "Expense date, in `YYYY-MM-DD` format."
          },
          "recipient": {
            "type": "object",
            "description": "The supplier the expense was issued by.",
            "properties": {
              "id": {
                "type": "string",
                "description": "Unique identifier of the supplier."
              },
              "name": {
                "type": "string",
                "description": "Supplier name."
              },
              "taxId": {
                "type": "string",
                "description": "Supplier tax ID."
              },
              "department": {
                "type": "string",
                "description": "Supplier department."
              },
              "address": {
                "type": "string",
                "description": "Street address."
              },
              "city": {
                "type": "string",
                "description": "City."
              },
              "zip": {
                "type": "string",
                "description": "Postal code."
              },
              "country": {
                "type": "string",
                "description": "2-letter ISO 3166-1 alpha-2 country code. See the [Get Supported Countries](#operation/getSupportedCountries) endpoint for the full list."
              },
              "phone": {
                "type": "string",
                "description": "Phone number."
              },
              "mobile": {
                "type": "string",
                "description": "Mobile number."
              },
              "emails": {
                "type": "array",
                "description": "Supplier email addresses.",
                "items": {
                  "type": "string"
                }
              },
              "contact": {
                "type": "string",
                "description": "Contact person name."
              },
              "createdAt": {
                "type": "integer",
                "format": "int64",
                "description": "Unix timestamp in milliseconds of when the supplier was created."
              },
              "updatedAt": {
                "type": "integer",
                "format": "int64",
                "description": "Unix timestamp in milliseconds of when the supplier was last updated."
              }
            }
          },
          "paymentType": {
            "$ref": "#/components/schemas/ExpensePaymentType"
          },
          "allocationNumber": {
            "type": "string",
            "description": "Israeli Tax Authority allocation (confirmation) number assigned to the expense."
          },
          "transactionId": {
            "type": "string",
            "description": "Identifier of the transaction associated with the expense, when applicable."
          },
          "description": {
            "type": "string",
            "description": "Expense description."
          },
          "foreignCurrencyRate": {
            "type": "object",
            "description": "Exchange rate from the expense currency to the local currency (ILS), keyed by the 3-letter local currency code. Present only when the expense currency is not ILS.",
            "additionalProperties": {
              "type": "number"
            }
          }
        },
        "example": {
          "id": "aa11bb22-cc33-4d44-8e55-6f778899aabb",
          "number": "5001",
          "businessId": "9b7c1e42-8d3a-4f16-b0c5-1e2d3a4b5c6d",
          "businessType": 2,
          "createdAt": 1778148284000,
          "updatedAt": 1780417007000,
          "active": true,
          "status": 20,
          "documentType": 20,
          "thumbnail": "https://www.greeninvoice.co.il/api/v1/expenses/thumbnail?d=...",
          "url": "https://www.greeninvoice.co.il/api/v1/expenses/download?d=...&ft=2",
          "subtotal": 100,
          "total": 100,
          "classification": {
            "id": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
            "irsCode": 1306,
            "title": "Domestic purchases",
            "code": "200",
            "key": "200",
            "income": 100,
            "vat": 66.67,
            "mixed": 100
          },
          "currency": "ILS",
          "country": "IL",
          "tax": [
            {
              "name": "VAT",
              "rate": 0.18,
              "total": 0
            }
          ],
          "date": "2026-05-06",
          "recipient": {
            "id": "d4e5f6a7-b8c9-4d0e-8f1a-2b3c4d5e6f70",
            "name": "ACME Ltd",
            "taxId": "",
            "department": "",
            "address": "",
            "city": "",
            "zip": "",
            "country": "IL",
            "mobile": "",
            "emails": [],
            "contact": "",
            "createdAt": 1770296985000,
            "updatedAt": 1778148616000
          },
          "allocationNumber": "",
          "description": ""
        }
      },
      "WebhookFileInfected": {
        "type": "object",
        "description": "Payload delivered to your webhook URL when an uploaded file is found to be infected and quarantined (`file/infected`).\n\nOptional fields are omitted from the payload when not provided. Treat every property below as optional and code defensively against its absence.",
        "properties": {
          "name": {
            "type": "string",
            "description": "Storage key of the quarantined file (URL-encoded); the path segments include the date and business identifier."
          },
          "key": {
            "type": "string",
            "description": "Storage key of the quarantined file (identical to `name`)."
          },
          "data": {
            "type": "string",
            "description": "A JSON-encoded string of file metadata, e.g. `{\"source\":1,\"uploadTrackingId\":\"...\"}`. Parse it to read fields such as `source` and `uploadTrackingId`."
          }
        },
        "example": {
          "name": "2026/07/01/9b7c1e42-8d3a-4f16-b0c5-1e2d3a4b5c6d/receipt.pdf",
          "key": "2026/07/01/9b7c1e42-8d3a-4f16-b0c5-1e2d3a4b5c6d/receipt.pdf",
          "data": "{\"source\":1,\"uploadTrackingId\":\"a1b2c3d4-e5f6-4708-9192-a3b4c5d6e7f8\"}"
        }
      }
    }
  },
  "x-tagGroups": [
    {
      "name": "Get started",
      "tags": [
        "Authentication"
      ]
    },
    {
      "name": "Resources",
      "tags": [
        "Documents",
        "Items",
        "Clients",
        "Suppliers",
        "Expenses",
        "Payments"
      ]
    },
    {
      "name": "Integrations",
      "tags": [
        "Partners",
        "Webhooks"
      ]
    },
    {
      "name": "Reference",
      "tags": [
        "Reference",
        "Errors"
      ]
    }
  ]
}
