Documents
Create and manage business documents: quotations, orders, delivery notes, returns, invoices, invoice-receipts, refunds, bills, and receipts. Documents follow Israeli tax authority (Rashut HaMisim) requirements.
/documentsList documents with filtering by type, date, and client.
Query Parameters
| Name | Type | Description | |
|---|---|---|---|
type | string | Document type: "quotation", "order", "delivery", "return", "invoice", "invoiceReceipt", "refund", "bill", or "receipt". | |
startDate | string | Filter from date (YYYY-MM-DD). | |
endDate | string | Filter to date (YYYY-MM-DD). | |
clientId | number | Filter by client visible ID. | |
open | boolean | If true, return only open / unpaid documents. | |
sku | string | Filter documents containing a product with this SKU. | |
search | string | Free-text search across relevant fields. | |
page | number | Page number (default 1). | |
limit | number | Items per page (default 50). |
Request
curl -X GET "https://api.glance.co.il/documents" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"Response
{
"data": [
{
"visibleId": 1001,
"type": "invoice",
"title": "Invoice #1001",
"client": {
"visibleId": 1,
"name": "Acme Corp"
},
"total": 5850,
"tax": 850,
"date": "2024-03-15",
"status": "open",
"createdAt": "2024-03-15T10:30:00Z"
}
],
"pagination": {
"total": 500,
"limit": 50,
"offset": 0,
"hasMore": true
}
}/documents/id/:visibleIdGet a single document with full details including products, payments, and client info.
Path Parameters
| Name | Type | Description | |
|---|---|---|---|
visibleId | number | required | The document visible ID. |
Request
curl -X GET "https://api.glance.co.il/documents/id/:visibleId" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"Response
{
"data": {
"visibleId": 1001,
"type": "invoice",
"title": "Website Development",
"client": {
"visibleId": 1,
"name": "Acme Corp",
"taxId": "515000000",
"email": "info@acme.com"
},
"products": [
{
"description": "Website Development",
"units": 1,
"price": 5000,
"sku": "SRV-WEB",
"typeOfUnit": "project",
"discount": 0
}
],
"payments": [
{
"amount": 5850,
"paymentMethod": "bankTransfer",
"date": "2024-03-20"
}
],
"subtotal": 5000,
"tax": 850,
"total": 5850,
"date": "2024-03-15",
"payBy": "2024-04-15",
"status": "open",
"notes": "Net 30 payment terms",
"createdAt": "2024-03-15T10:30:00Z"
}
}/documents/create/{type}Create a new document of the specified type. The type is part of the URL path.
Path Parameters
| Name | Type | Description | |
|---|---|---|---|
type | string | required | Document type: "quotation", "order", "delivery", "return", "invoice", "invoiceReceipt", "refund", "bill", or "receipt". |
Body Parameters
| Name | Type | Description | |
|---|---|---|---|
clientId | number | Visible ID of an existing client. Either clientId or client object should be provided. | |
client | object | Inline client data. Used to create or match a client on-the-fly. | |
name | string | Client name. | |
taxId | string | Client tax ID. | |
email | string | Client email. | |
type | string | Client type: "MURSHE", "COMPANY", or "PATOOR". | |
identifyClientBy | string | When using the client object, specify how to match an existing client: "taxId", "name", or "email". | |
title | string | Document title / subject. | |
products | object[] | Array of line items. | |
description | string | required | Line item description. |
units | number | required | Quantity. |
price | number | required | Price per unit. |
sku | string | Product SKU. If provided, links to an existing product. | |
typeOfUnit | string | Unit label (e.g. "pcs", "hours"). | |
discount | number | Discount amount. | |
discountOn | string | Apply discount on "unit" or "row". | |
discountType | string | Discount type: "absolute" or "percents". | |
warehouseId | number | Warehouse to deduct inventory from. | |
serialNumbers | string[] | Serial numbers to associate with this line item. | |
customFields | object[] | Custom field values for this line item. | |
label | string | Custom field label. | |
value | string | Custom field value. | |
payments | object[] | Array of payment records (for receipts and invoice-receipts). | |
amount | number | required | Payment amount. |
paymentMethod | string | Payment method: "cash", "check", "creditCard", "bankTransfer", "giftCard", "replacement", "note", or "other". | |
date | string | Payment date (YYYY-MM-DD). | |
details | string[] | Additional payment details (max 5 strings). E.g. check number, last 4 digits. | |
ledgerId | number | Ledger account ID for accounting. | |
date | string | Document date (YYYY-MM-DD). Defaults to today. | |
payBy | string | Payment due date (YYYY-MM-DD). Required for invoices. | |
tax | number | Tax rate override (e.g. 17 for 17%). | |
discount | number | Document-level discount. | |
discountType | string | Discount type: "absolute" or "percents". | |
taxMode | string | "beforeTax" (prices exclude tax) or "includeTax" (prices include tax). | |
notes | string | Notes to display on the document. | |
withSignature | string[] | Signature fields to include: "company" and/or "client". | |
relatedDocuments | object[] | Link to related documents (e.g. convert a quotation to an invoice). | |
id | number | Visible ID of the related document. | |
amount | number | Amount to apply from the related document. | |
products | object[] | Products to carry over from the related document. | |
sendToClient | boolean | If true, email the document to the client after creation. | |
emailRecipients | string[] | Additional email addresses to send the document to. | |
skipInventoryActions | boolean | If true, do not adjust inventory when creating the document. |
Request
curl -X POST "https://api.glance.co.il/documents/create/{type}" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"clientId": 0,
"client": {},
"identifyClientBy": "example_identifyClientBy",
"title": "example_title",
"products": "example_products",
"payments": "example_payments",
"date": "example_date",
"payBy": "example_payBy",
"tax": 0,
"discount": 0,
"discountType": "example_discountType",
"taxMode": "example_taxMode",
"notes": "example_notes",
"withSignature": "example_withSignature",
"relatedDocuments": "example_relatedDocuments",
"sendToClient": true,
"emailRecipients": "example_emailRecipients",
"skipInventoryActions": true
}'Response
{
"data": {
"visibleId": 1002,
"type": "invoice",
"title": "Consulting Services",
"client": {
"visibleId": 1,
"name": "Acme Corp"
},
"total": 11700,
"tax": 1700,
"date": "2024-03-20",
"payBy": "2024-04-20",
"status": "open",
"pdfUrl": "https://api.glance.co.il/documents/1002/pdf",
"createdAt": "2024-03-20T14:30:00Z"
}
}/documents/preview/{type}Generate a PDF preview without saving the document. Accepts the same body as create.
Path Parameters
| Name | Type | Description | |
|---|---|---|---|
type | string | required | Document type. |
Body Parameters
| Name | Type | Description | |
|---|---|---|---|
(same as create) | Accepts the same body parameters as the create endpoint. |
Request
curl -X POST "https://api.glance.co.il/documents/preview/{type}" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"(same as create)": "example_(same as create)"
}'Response
{
"data": {
"pdfUrl": "https://api.glance.co.il/preview/tmp-abc123.pdf",
"expiresAt": "2024-03-20T15:30:00Z"
}
}/documents/preview/htmlGenerate an HTML preview of the document. Accepts the same body as create.
Body Parameters
| Name | Type | Description | |
|---|---|---|---|
(same as create) | Accepts the same body parameters as the create endpoint. |
Request
curl -X POST "https://api.glance.co.il/documents/preview/html" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"(same as create)": "example_(same as create)"
}'Response
{
"data": {
"html": "<html>...</html>"
}
}/documents/edit/:visibleIdEdit a quotation or order. Only draft / open documents can be edited.
Path Parameters
| Name | Type | Description | |
|---|---|---|---|
visibleId | number | required | The document visible ID. |
Body Parameters
| Name | Type | Description | |
|---|---|---|---|
(same as create) | Accepts the same body parameters as the create endpoint. No fields are required. |
Request
curl -X PUT "https://api.glance.co.il/documents/edit/:visibleId" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"(same as create)": "example_(same as create)"
}'Response
{
"data": {
"visibleId": 1001,
"type": "quotation",
"title": "Updated Quotation",
"total": 7020
}
}/documents/close/:visibleIdClose or finalize a document (e.g. mark a quotation as accepted).
Path Parameters
| Name | Type | Description | |
|---|---|---|---|
visibleId | number | required | The document visible ID. |
Request
curl -X POST "https://api.glance.co.il/documents/close/:visibleId" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"Response
{
"data": {
"visibleId": 1001,
"status": "closed"
}
}/documents/allocate/:visibleIdAllocate a receipt to one or more invoices.
Path Parameters
| Name | Type | Description | |
|---|---|---|---|
visibleId | number | required | The receipt visible ID. |
Body Parameters
| Name | Type | Description | |
|---|---|---|---|
allocations | object[] | required | Array of allocation targets. |
invoiceId | number | Visible ID of the invoice to allocate to. | |
amount | number | Amount to allocate. |
Request
curl -X POST "https://api.glance.co.il/documents/allocate/:visibleId" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"allocations": "example_allocations"
}'Response
{
"data": {
"visibleId": 2001,
"allocations": [
{
"invoiceId": 1001,
"amount": 3000
},
{
"invoiceId": 1002,
"amount": 2850
}
]
}
}/documents/cancel-receipt/:visibleIdCancel a receipt. This reverses allocations and payments.
Path Parameters
| Name | Type | Description | |
|---|---|---|---|
visibleId | number | required | The receipt visible ID. |
Request
curl -X POST "https://api.glance.co.il/documents/cancel-receipt/:visibleId" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"Response
{
"data": {
"visibleId": 2001,
"status": "cancelled"
}
}/documents/settings/:routeGet settings for a specific document type, including the next number and tax rate.
Path Parameters
| Name | Type | Description | |
|---|---|---|---|
route | string | required | The document type route (e.g. invoice, receipt, quotation). |
Request
curl -X GET "https://api.glance.co.il/documents/settings/:route" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"Response
{
"data": {
"lastDate": "2024-03-19",
"taxRate": 17,
"nextNumber": 1003
}
}