> For the complete documentation index, see [llms.txt](https://invoice4u.gitbook.io/invoice4u-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://invoice4u.gitbook.io/invoice4u-docs/he/documents/draft-documents.md).

# טיוטות מסמכים

‫טיוטות הן מסמכים ניתנים לעריכה ולא סופיים: אין להן **מספר מסמך חוקי**, הן אינן צורכות ממכסת המסמכים שלכם, וניתן לעדכן או למחוק אותן בחופשיות. השתמשו בהן להכנת מסמך לפני הפקתו, או לשמירת מסמכים בתהליך מתוך הממשק שלכם.‬

{% hint style="info" %}
‫אין מתודת "הפיכת טיוטה למסמך". כדי להפיק טיוטה: קראו אותה, העבירו את התוכן שלה ל[יצירת מסמך](/invoice4u-docs/he/documents/create-document.md), ואז מחקו את הטיוטה.‬
{% endhint %}

```mermaid
flowchart LR
    classDef step fill:#E7D9FC,stroke:#9B6DD6,color:#333
    classDef dec fill:#D2F0D2,stroke:#4CAF50,color:#333
    classDef err fill:#FFD9A0,stroke:#E8A33D,color:#333
    classDef cb fill:#BBDEFB,stroke:#42A5F5,color:#333

    A[CreateOrUpdateDraftDocument]:::step --> B{Token valid?}:::dec
    B -- ✗ --> E1[UnauthorizedUser 80]:::err
    B -- ✓ --> C{ClientID sent?}:::dec
    C -- "✓ but not found" --> E2[ClientIDDoesntExists 37]:::err
    C -- "✓ / not required" --> D[Draft saved — editable,<br/>no legal number, no quota]:::step
    D --> F{Ready to issue?}:::dec
    F -- "✗ — keep editing" --> A
    F -- ✓ --> G[CreateDocument with<br/>the draft's content]:::step
    G --> H[DeleteDraftDocument]:::step
    H --> I[Legal document issued]:::cb
```

## יצירה או עדכון — `CreateOrUpdateDraftDocument`

|             |                                                |
| ----------- | ---------------------------------------------- |
| ‫**מתודה**‬ | `POST`                                         |
| ‫**נתיב**‬  | `/CreateOrUpdateDraftDocument`                 |
| ‫**גוף**‬   | `{ "doc": { ... }, "token": "<token>" }`       |
| ‫**תשובה**‬ | ‫הטיוטה שנשמרה (`Document` עם `ID` מסוג GUID)‬ |

‫הבדלי התנהגות מול [יצירת מסמך](/invoice4u-docs/he/documents/create-document.md):‬

* ‫**ולידציה מרוככת** — פריטים אופציונליים (הסכומים מאופסים בהיעדרם), תשלומים אופציונליים, אין בדיקות טווח תאריכים או מכסה.‬
* ‫הלקוח נבדק **רק אם נשלח `ClientID`** (`ClientIDDoesntExists`, 37); טיוטות הפקדה מדלגות על בדיקת לקוח לגמרי.‬
* ‫שליחת `ID` של טיוטה קיימת **מעדכנת** אותה.‬
* ‫`IsPreviewDocument: true` מכוון למשבצת **מסמך התצוגה המקדימה** היחידה של הארגון (upsert) — ראו [`GetPreviewDocumentByToken`](#getpreviewdocumentbytoken).‬

```http
POST /Services/ApiService.svc/CreateOrUpdateDraftDocument HTTP/1.1
Host: apiqa.invoice4u.co.il
Content-Type: application/json

{
  "doc": {
    "DocumentType": 1,
    "Subject": "Draft for order #10052",
    "ClientID": 88231,
    "Items": [
      { "Name": "Widget", "Quantity": 2, "Price": 50.0 }
    ]
  },
  "token": "<token>"
}
```

## שליפת טיוטה — `GetDraftDocument`

```json
{ "docId": "7f6a2c1e-8b4d-4f2a-9c3e-0d1e2f3a4b5c", "token": "<token>" }
```

‫`POST /GetDraftDocument` — מחזיר את הטיוטה (`Document`); `null` על GUID לא תקין.‬

## חיפוש — `GetDraftDocuments`

```json
{ "dr": { "DocumentType": 1 }, "token": "<token>" }
```

‫`POST /GetDraftDocuments` — אותם פילטרים של `DocumentsRequest` כמו ב[חיפוש מסמכים](/invoice4u-docs/he/documents/search-documents.md); מחזיר `CommonCollection<Document[]>` של טיוטות.‬

## בדיקת קיום — `CheckIfDraftExistsByDocumentType`

```json
{ "docType": 1, "token": "<token>" }
```

‫`POST /CheckIfDraftExistsByDocumentType` — מחזיר `true`/`false`; ‏`null` כאשר הטוקן לא תקין.‬

## מחיקה — `DeleteDraftDocument` / `DeleteDraftDocuments`

```json
{ "docId": "7f6a2c1e-8b4d-4f2a-9c3e-0d1e2f3a4b5c", "token": "<token>" }
```

‫`POST /DeleteDraftDocument` — טיוטה בודדת. וריאציית האצווה `POST /DeleteDraftDocuments` מקבלת `{ "docIds": ["...", "..."], "token": "..." }`.‬

## מסמך תצוגה מקדימה — `GetPreviewDocumentByToken` <a href="#getpreviewdocumentbytoken" id="getpreviewdocumentbytoken"></a>

```json
{ "token": "<token>" }
```

‫`POST /GetPreviewDocumentByToken` — מחזיר את מסמך התצוגה המקדימה של הארגון (זה שנשמר עם `IsPreviewDocument: true`). משבצת אחת לארגון.‬

## שגיאות

| ‫שגיאה (ID)‬                       | ‫משמעות‬                                            |
| ---------------------------------- | --------------------------------------------------- |
| `UnauthorizedUser` (80)            | ‫טוקן לא תקין.‬                                     |
| `ClientIDDoesntExists` (37)        | ‫נשלח `ClientID` אך אין לקוח כזה.‬                  |
| `ServerErrorOnDocumentCreate` (11) | ‫לא ניתן היה לשמור את הטיוטה.‬                      |
| `DraftDocumentDeleteError` (135)   | ‫הטיוטה לא נמצאה / לא ניתן היה למחוק (פר `docId`).‬ |
| `GeneralError` (0)                 | ‫שגיאת שרת.‬                                        |

## נסו את זה

## Create or update a draft document

> Saves an editable draft: no legal number, no quota usage, relaxed validation. Sending an existing draft ID updates it. IsPreviewDocument targets the organization's single preview slot.

```json
{"openapi":"3.0.3","info":{"title":"Invoice4U API","version":"1.0.0"},"tags":[{"name":"Documents","description":"Create and retrieve documents (invoices, receipts, etc.)."}],"servers":[{"url":"https://api.invoice4u.co.il/Services/ApiService.svc","description":"Production"},{"url":"https://apiqa.invoice4u.co.il/Services/ApiService.svc","description":"QA (staging)"}],"paths":{"/CreateOrUpdateDraftDocument":{"post":{"tags":["Documents"],"operationId":"CreateOrUpdateDraftDocument","summary":"Create or update a draft document","description":"Saves an editable draft: no legal number, no quota usage, relaxed validation. Sending an existing draft ID updates it. IsPreviewDocument targets the organization's single preview slot.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["doc","token"],"properties":{"doc":{"$ref":"#/components/schemas/Document"},"token":{"type":"string"}}}}}},"responses":{"200":{"description":"The saved draft.","content":{"application/json":{"schema":{"type":"object","properties":{"CreateOrUpdateDraftDocumentResult":{"$ref":"#/components/schemas/Document"}}}}}}}}}},"components":{"schemas":{"Document":{"allOf":[{"$ref":"#/components/schemas/CommonObject"},{"type":"object","required":["DocumentType"],"properties":{"ID":{"type":"string","format":"uuid","readOnly":true},"DocumentNumber":{"type":"integer","format":"int64","readOnly":true,"description":"Legal sequential number, per type."},"DocumentType":{"type":"integer","description":"1 Invoice, 2 Receipt, 3 InvoiceReceipt, 4 InvoiceCredit, 5 ProformaInvoice, 6 InvoiceOrder, 7 InvoiceQuote, 8 InvoiceShip, 9 Deposits, 10 SupplierInvoiceToInventory, 13 PurchaseOrder.","enum":[1,2,3,4,5,6,7,8,9,10,13]},"Subject":{"type":"string","nullable":true},"ClientID":{"type":"integer","nullable":true,"description":"Existing customer ID. Required unless GeneralCustomer is supplied or the type doesn't need a customer."},"GeneralCustomer":{"$ref":"#/components/schemas/GenerelCustomer"},"Items":{"type":"array","nullable":true,"items":{"$ref":"#/components/schemas/DocumentItem"}},"Payments":{"type":"array","nullable":true,"items":{"$ref":"#/components/schemas/Payment"}},"Invoices":{"type":"array","nullable":true,"description":"Referenced documents (each with ID and ReceiptAmount). Requires DocumentReffType.","items":{"type":"object","properties":{"ID":{"type":"string","format":"uuid"},"ReceiptAmount":{"type":"number","format":"double"}}}},"DocumentReffType":{"type":"integer","description":"Type of the referenced documents."},"IssueDate":{"type":"string","format":"date-time","nullable":true,"description":"Defaults to today. Not in the future; not before your latest document of the type."},"Currency":{"type":"string","nullable":true},"ConversionRate":{"type":"number","format":"double","description":"Auto-resolved when 0."},"TaxPercentage":{"type":"number","format":"double","nullable":true},"TaxIncluded":{"type":"boolean","description":"Whether item prices include VAT."},"Discount":{"$ref":"#/components/schemas/Discount"},"BranchID":{"type":"integer","nullable":true,"description":"Defaults to the organization's default branch."},"Language":{"type":"integer","description":"1 Hebrew, 2 English."},"AssociatedEmails":{"type":"array","nullable":true,"items":{"$ref":"#/components/schemas/AssociatedEmail"}},"ExternalComments":{"type":"string","nullable":true,"maxLength":5000},"InternalComments":{"type":"string","nullable":true},"EmailCustomComment":{"type":"string","nullable":true},"ApiIdentifier":{"type":"string","nullable":true,"description":"Idempotency key. Auto-generated if missing."},"ApiDuplicityTimeValidation":{"type":"integer","description":"Duplicate-detection window in seconds. Default 60."},"PaymentDueDate":{"type":"string","format":"date-time","nullable":true},"Deduction":{"type":"number","format":"double","description":"Withholding-tax deduction (receipts)."},"CloseReceipt":{"type":"boolean"},"IsSelfInvoice":{"type":"boolean"},"SupplierId":{"type":"integer","nullable":true},"SupplierName":{"type":"string","nullable":true},"UseDecimalValues":{"type":"boolean"},"AutoFixPaymentsMismatchItems":{"type":"boolean","description":"Auto-fix ±0.01 rounding gaps between payments and items."},"AutoFixMismatchItemName":{"type":"string","nullable":true},"Total":{"type":"number","format":"double","readOnly":true},"TotalWithoutTax":{"type":"number","format":"double","readOnly":true},"TotalTaxAmount":{"type":"number","format":"double","readOnly":true},"StatusID":{"type":"integer","readOnly":true,"description":"1 Open, 2 Closed, 3 FullyCredited, 4 PartiallyCredited, 5 Cancelled."},"PrintOriginalPDFLink":{"type":"string","readOnly":true},"PrintCertifiedCopyPDFLink":{"type":"string","readOnly":true},"CipherText":{"type":"string","readOnly":true},"CipherTextOriginal":{"type":"string","readOnly":true},"AllocationNumber":{"type":"string","nullable":true,"readOnly":true},"Paid":{"type":"number","format":"double","readOnly":true},"CreditAmount":{"type":"number","format":"double","readOnly":true},"Balance":{"type":"number","format":"double","readOnly":true}}}]},"CommonObject":{"type":"object","description":"Response envelope inherited by most objects. Server-generated — never send these fields in requests. Always check Errors before using the payload.","properties":{"Errors":{"type":"array","readOnly":true,"items":{"$ref":"#/components/schemas/CommonError"}},"Info":{"type":"array","readOnly":true,"items":{"$ref":"#/components/schemas/CommonInfo"}},"OpenInfo":{"type":"object","readOnly":true,"additionalProperties":{"type":"string"},"nullable":true}}},"CommonError":{"type":"object","properties":{"ID":{"type":"integer","description":"Numeric error code, e.g. 80 = UnauthorizedUser, 134 = DocumentAlreadyCreated."},"Error":{"type":"string","description":"Error name."},"Paramters":{"type":"string","nullable":true,"description":"Optional context, e.g. \"Row Number - 0\"."}}},"CommonInfo":{"type":"object","properties":{"ID":{"type":"integer"},"Info":{"type":"string"},"Paramters":{"type":"string","nullable":true}}},"GenerelCustomer":{"type":"object","required":["Name"],"description":"One-off (general) customer for documents without a stored customer record.","properties":{"ID":{"type":"integer"},"Name":{"type":"string"},"Identifier":{"type":"string","description":"VAT/ID number."}}},"DocumentItem":{"type":"object","required":["Name","Quantity","Price"],"properties":{"Name":{"type":"string"},"Description":{"type":"string","nullable":true},"Price":{"type":"number","format":"double","description":"Unit price."},"PriceIncludeTax":{"type":"number","format":"double","description":"Price including VAT (when TaxIncluded)."},"Quantity":{"type":"number","format":"double"},"TaxPercentage":{"type":"number","format":"double","nullable":true,"description":"Per-item VAT override."},"Discount":{"$ref":"#/components/schemas/Discount"},"Code":{"type":"string","nullable":true,"description":"Catalog code."},"LawyerIdentifier":{"type":"string","nullable":true,"description":"Lawyer accounts: \"1\" deposits, \"2\" expenses."},"InventoryId":{"type":"integer","nullable":true},"WarehouseId":{"type":"integer","nullable":true},"Total":{"type":"number","format":"double","readOnly":true},"TotalWithoutTax":{"type":"number","format":"double","readOnly":true},"TotalTax":{"type":"number","format":"double","readOnly":true}}},"Discount":{"type":"object","required":["Value"],"properties":{"Value":{"type":"number","format":"double"},"IsNominal":{"type":"boolean","description":"true = fixed amount, false = percent."},"BeforeTax":{"type":"boolean"}}},"Payment":{"type":"object","required":["PaymentType","Amount"],"properties":{"ID":{"type":"integer","description":"Existing payment ID — used for Deposits documents."},"PaymentType":{"type":"integer","description":"1 CreditCard, 2 Check, 3 MoneyTransfer, 4 Cash, 5 Credit, 6 WithholdingTax, 7 Other, 8 Bit, 9 PayBox.","enum":[1,2,3,4,5,6,7,8,9]},"Amount":{"type":"number","format":"double"},"Date":{"type":"string","format":"date-time","nullable":true},"DateStr":{"type":"string","nullable":true,"description":"Alternative string date when Date is not set."},"NumberOfPayments":{"type":"integer","description":"Credit-card installments."},"CreditCardName":{"type":"string","nullable":true,"description":"Card brand name; resolved against configured credit companies."},"CreditCardType":{"type":"integer","nullable":true},"PaymentNumber":{"type":"string","nullable":true,"description":"Check number / last 4 card digits."},"BankName":{"type":"string","nullable":true},"BranchName":{"type":"string","nullable":true},"AccountNumber":{"type":"string","nullable":true},"PayerID":{"type":"string","nullable":true},"ExpirationDate":{"type":"string","nullable":true},"PaymentTypeOtherId":{"type":"integer","description":"Sub-type when PaymentType=7 (Other)."},"PaymentTypeLiteral":{"type":"string","nullable":true}}},"AssociatedEmail":{"type":"object","required":["Mail"],"properties":{"Mail":{"type":"string","format":"email"},"IsUserMail":{"type":"boolean","description":"true marks the copy sent to the account owner."},"ClientId":{"type":"integer","nullable":true},"IsSendDoc":{"type":"boolean","nullable":true}}}}}}
```

## POST /GetDraftDocuments

> Search draft documents

```json
{"openapi":"3.0.3","info":{"title":"Invoice4U API","version":"1.0.0"},"tags":[{"name":"Documents","description":"Create and retrieve documents (invoices, receipts, etc.)."}],"servers":[{"url":"https://api.invoice4u.co.il/Services/ApiService.svc","description":"Production"},{"url":"https://apiqa.invoice4u.co.il/Services/ApiService.svc","description":"QA (staging)"}],"paths":{"/GetDraftDocuments":{"post":{"tags":["Documents"],"operationId":"GetDraftDocuments","summary":"Search draft documents","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["dr","token"],"properties":{"dr":{"$ref":"#/components/schemas/DocumentsRequest"},"token":{"type":"string"}}}}}},"responses":{"200":{"description":"Matching drafts.","content":{"application/json":{"schema":{"type":"object","properties":{"GetDraftDocumentsResult":{"$ref":"#/components/schemas/DocumentCollection"}}}}}}}}}},"components":{"schemas":{"DocumentsRequest":{"type":"object","required":["DocumentType"],"properties":{"DocumentType":{"type":"integer","description":"Single document type filter."},"DocumentTypes":{"type":"string","nullable":true,"description":"Comma-separated list of types."},"From":{"type":"string","format":"date-time","nullable":true},"To":{"type":"string","format":"date-time","nullable":true},"FromActualCreationDate":{"type":"string","format":"date-time","nullable":true},"ToActualCreationDate":{"type":"string","format":"date-time","nullable":true},"FromPaymentDueDate":{"type":"string","format":"date-time","nullable":true},"ToPaymentDueDate":{"type":"string","format":"date-time","nullable":true},"Status":{"type":"integer","description":"Document status filter."},"CustomerID":{"type":"integer","nullable":true},"CustomerName":{"type":"string","nullable":true},"BranchID":{"type":"integer"},"DocumentNumber":{"type":"integer"},"ExectDocumentNumber":{"type":"integer","description":"Exact document number."},"FromNumber":{"type":"integer","nullable":true},"ToNumber":{"type":"integer","nullable":true},"FromAmount":{"type":"number","format":"float","nullable":true},"ToAmount":{"type":"number","format":"float","nullable":true},"Currency":{"type":"string","nullable":true},"PaymentType":{"type":"integer"},"ItemCode":{"type":"string","nullable":true},"ItemDescription":{"type":"string","nullable":true},"ItemsIncluded":{"type":"boolean","nullable":true,"description":"Include full Items in results."},"PaymentsIncluded":{"type":"boolean","nullable":true,"description":"Include full Payments in results."},"OnlyGeneralClient":{"type":"boolean","nullable":true},"GeneralClientName":{"type":"string","nullable":true}}},"DocumentCollection":{"allOf":[{"$ref":"#/components/schemas/CommonObject"},{"type":"object","properties":{"Response":{"type":"array","nullable":true,"items":{"$ref":"#/components/schemas/Document"}}}}]},"CommonObject":{"type":"object","description":"Response envelope inherited by most objects. Server-generated — never send these fields in requests. Always check Errors before using the payload.","properties":{"Errors":{"type":"array","readOnly":true,"items":{"$ref":"#/components/schemas/CommonError"}},"Info":{"type":"array","readOnly":true,"items":{"$ref":"#/components/schemas/CommonInfo"}},"OpenInfo":{"type":"object","readOnly":true,"additionalProperties":{"type":"string"},"nullable":true}}},"CommonError":{"type":"object","properties":{"ID":{"type":"integer","description":"Numeric error code, e.g. 80 = UnauthorizedUser, 134 = DocumentAlreadyCreated."},"Error":{"type":"string","description":"Error name."},"Paramters":{"type":"string","nullable":true,"description":"Optional context, e.g. \"Row Number - 0\"."}}},"CommonInfo":{"type":"object","properties":{"ID":{"type":"integer"},"Info":{"type":"string"},"Paramters":{"type":"string","nullable":true}}},"Document":{"allOf":[{"$ref":"#/components/schemas/CommonObject"},{"type":"object","required":["DocumentType"],"properties":{"ID":{"type":"string","format":"uuid","readOnly":true},"DocumentNumber":{"type":"integer","format":"int64","readOnly":true,"description":"Legal sequential number, per type."},"DocumentType":{"type":"integer","description":"1 Invoice, 2 Receipt, 3 InvoiceReceipt, 4 InvoiceCredit, 5 ProformaInvoice, 6 InvoiceOrder, 7 InvoiceQuote, 8 InvoiceShip, 9 Deposits, 10 SupplierInvoiceToInventory, 13 PurchaseOrder.","enum":[1,2,3,4,5,6,7,8,9,10,13]},"Subject":{"type":"string","nullable":true},"ClientID":{"type":"integer","nullable":true,"description":"Existing customer ID. Required unless GeneralCustomer is supplied or the type doesn't need a customer."},"GeneralCustomer":{"$ref":"#/components/schemas/GenerelCustomer"},"Items":{"type":"array","nullable":true,"items":{"$ref":"#/components/schemas/DocumentItem"}},"Payments":{"type":"array","nullable":true,"items":{"$ref":"#/components/schemas/Payment"}},"Invoices":{"type":"array","nullable":true,"description":"Referenced documents (each with ID and ReceiptAmount). Requires DocumentReffType.","items":{"type":"object","properties":{"ID":{"type":"string","format":"uuid"},"ReceiptAmount":{"type":"number","format":"double"}}}},"DocumentReffType":{"type":"integer","description":"Type of the referenced documents."},"IssueDate":{"type":"string","format":"date-time","nullable":true,"description":"Defaults to today. Not in the future; not before your latest document of the type."},"Currency":{"type":"string","nullable":true},"ConversionRate":{"type":"number","format":"double","description":"Auto-resolved when 0."},"TaxPercentage":{"type":"number","format":"double","nullable":true},"TaxIncluded":{"type":"boolean","description":"Whether item prices include VAT."},"Discount":{"$ref":"#/components/schemas/Discount"},"BranchID":{"type":"integer","nullable":true,"description":"Defaults to the organization's default branch."},"Language":{"type":"integer","description":"1 Hebrew, 2 English."},"AssociatedEmails":{"type":"array","nullable":true,"items":{"$ref":"#/components/schemas/AssociatedEmail"}},"ExternalComments":{"type":"string","nullable":true,"maxLength":5000},"InternalComments":{"type":"string","nullable":true},"EmailCustomComment":{"type":"string","nullable":true},"ApiIdentifier":{"type":"string","nullable":true,"description":"Idempotency key. Auto-generated if missing."},"ApiDuplicityTimeValidation":{"type":"integer","description":"Duplicate-detection window in seconds. Default 60."},"PaymentDueDate":{"type":"string","format":"date-time","nullable":true},"Deduction":{"type":"number","format":"double","description":"Withholding-tax deduction (receipts)."},"CloseReceipt":{"type":"boolean"},"IsSelfInvoice":{"type":"boolean"},"SupplierId":{"type":"integer","nullable":true},"SupplierName":{"type":"string","nullable":true},"UseDecimalValues":{"type":"boolean"},"AutoFixPaymentsMismatchItems":{"type":"boolean","description":"Auto-fix ±0.01 rounding gaps between payments and items."},"AutoFixMismatchItemName":{"type":"string","nullable":true},"Total":{"type":"number","format":"double","readOnly":true},"TotalWithoutTax":{"type":"number","format":"double","readOnly":true},"TotalTaxAmount":{"type":"number","format":"double","readOnly":true},"StatusID":{"type":"integer","readOnly":true,"description":"1 Open, 2 Closed, 3 FullyCredited, 4 PartiallyCredited, 5 Cancelled."},"PrintOriginalPDFLink":{"type":"string","readOnly":true},"PrintCertifiedCopyPDFLink":{"type":"string","readOnly":true},"CipherText":{"type":"string","readOnly":true},"CipherTextOriginal":{"type":"string","readOnly":true},"AllocationNumber":{"type":"string","nullable":true,"readOnly":true},"Paid":{"type":"number","format":"double","readOnly":true},"CreditAmount":{"type":"number","format":"double","readOnly":true},"Balance":{"type":"number","format":"double","readOnly":true}}}]},"GenerelCustomer":{"type":"object","required":["Name"],"description":"One-off (general) customer for documents without a stored customer record.","properties":{"ID":{"type":"integer"},"Name":{"type":"string"},"Identifier":{"type":"string","description":"VAT/ID number."}}},"DocumentItem":{"type":"object","required":["Name","Quantity","Price"],"properties":{"Name":{"type":"string"},"Description":{"type":"string","nullable":true},"Price":{"type":"number","format":"double","description":"Unit price."},"PriceIncludeTax":{"type":"number","format":"double","description":"Price including VAT (when TaxIncluded)."},"Quantity":{"type":"number","format":"double"},"TaxPercentage":{"type":"number","format":"double","nullable":true,"description":"Per-item VAT override."},"Discount":{"$ref":"#/components/schemas/Discount"},"Code":{"type":"string","nullable":true,"description":"Catalog code."},"LawyerIdentifier":{"type":"string","nullable":true,"description":"Lawyer accounts: \"1\" deposits, \"2\" expenses."},"InventoryId":{"type":"integer","nullable":true},"WarehouseId":{"type":"integer","nullable":true},"Total":{"type":"number","format":"double","readOnly":true},"TotalWithoutTax":{"type":"number","format":"double","readOnly":true},"TotalTax":{"type":"number","format":"double","readOnly":true}}},"Discount":{"type":"object","required":["Value"],"properties":{"Value":{"type":"number","format":"double"},"IsNominal":{"type":"boolean","description":"true = fixed amount, false = percent."},"BeforeTax":{"type":"boolean"}}},"Payment":{"type":"object","required":["PaymentType","Amount"],"properties":{"ID":{"type":"integer","description":"Existing payment ID — used for Deposits documents."},"PaymentType":{"type":"integer","description":"1 CreditCard, 2 Check, 3 MoneyTransfer, 4 Cash, 5 Credit, 6 WithholdingTax, 7 Other, 8 Bit, 9 PayBox.","enum":[1,2,3,4,5,6,7,8,9]},"Amount":{"type":"number","format":"double"},"Date":{"type":"string","format":"date-time","nullable":true},"DateStr":{"type":"string","nullable":true,"description":"Alternative string date when Date is not set."},"NumberOfPayments":{"type":"integer","description":"Credit-card installments."},"CreditCardName":{"type":"string","nullable":true,"description":"Card brand name; resolved against configured credit companies."},"CreditCardType":{"type":"integer","nullable":true},"PaymentNumber":{"type":"string","nullable":true,"description":"Check number / last 4 card digits."},"BankName":{"type":"string","nullable":true},"BranchName":{"type":"string","nullable":true},"AccountNumber":{"type":"string","nullable":true},"PayerID":{"type":"string","nullable":true},"ExpirationDate":{"type":"string","nullable":true},"PaymentTypeOtherId":{"type":"integer","description":"Sub-type when PaymentType=7 (Other)."},"PaymentTypeLiteral":{"type":"string","nullable":true}}},"AssociatedEmail":{"type":"object","required":["Mail"],"properties":{"Mail":{"type":"string","format":"email"},"IsUserMail":{"type":"boolean","description":"true marks the copy sent to the account owner."},"ClientId":{"type":"integer","nullable":true},"IsSendDoc":{"type":"boolean","nullable":true}}}}}}
```
