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.

Use cases: Use the Documents API to automate invoice generation, sync orders from e-commerce platforms, and manage the full document lifecycle.
GET/documents

List documents with filtering by type, date, and client.

Query Parameters

NameTypeDescription
type
stringDocument type: "quotation", "order", "delivery", "return", "invoice", "invoiceReceipt", "refund", "bill", or "receipt".
startDate
stringFilter from date (YYYY-MM-DD).
endDate
stringFilter to date (YYYY-MM-DD).
clientId
numberFilter by client visible ID.
open
booleanIf true, return only open / unpaid documents.
sku
stringFilter documents containing a product with this SKU.
search
stringFree-text search across relevant fields.
page
numberPage number (default 1).
limit
numberItems 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

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
  }
}
GET/documents/id/:visibleId

Get a single document with full details including products, payments, and client info.

Path Parameters

NameTypeDescription
visibleId
numberrequiredThe 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

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"
  }
}
POST/documents/create/{type}

Create a new document of the specified type. The type is part of the URL path.

The "payBy" field is required when creating invoices. For receipts and invoice-receipts, include the "payments" array.

Path Parameters

NameTypeDescription
type
stringrequiredDocument type: "quotation", "order", "delivery", "return", "invoice", "invoiceReceipt", "refund", "bill", or "receipt".

Body Parameters

NameTypeDescription
clientId
numberVisible ID of an existing client. Either clientId or client object should be provided.
client
objectInline client data. Used to create or match a client on-the-fly.
name
stringClient name.
taxId
stringClient tax ID.
email
stringClient email.
type
stringClient type: "MURSHE", "COMPANY", or "PATOOR".
identifyClientBy
stringWhen using the client object, specify how to match an existing client: "taxId", "name", or "email".
title
stringDocument title / subject.
products
object[]Array of line items.
description
stringrequiredLine item description.
units
numberrequiredQuantity.
price
numberrequiredPrice per unit.
sku
stringProduct SKU. If provided, links to an existing product.
typeOfUnit
stringUnit label (e.g. "pcs", "hours").
discount
numberDiscount amount.
discountOn
stringApply discount on "unit" or "row".
discountType
stringDiscount type: "absolute" or "percents".
warehouseId
numberWarehouse to deduct inventory from.
serialNumbers
string[]Serial numbers to associate with this line item.
customFields
object[]Custom field values for this line item.
label
stringCustom field label.
value
stringCustom field value.
payments
object[]Array of payment records (for receipts and invoice-receipts).
amount
numberrequiredPayment amount.
paymentMethod
stringPayment method: "cash", "check", "creditCard", "bankTransfer", "giftCard", "replacement", "note", or "other".
date
stringPayment date (YYYY-MM-DD).
details
string[]Additional payment details (max 5 strings). E.g. check number, last 4 digits.
ledgerId
numberLedger account ID for accounting.
date
stringDocument date (YYYY-MM-DD). Defaults to today.
payBy
stringPayment due date (YYYY-MM-DD). Required for invoices.
tax
numberTax rate override (e.g. 17 for 17%).
discount
numberDocument-level discount.
discountType
stringDiscount type: "absolute" or "percents".
taxMode
string"beforeTax" (prices exclude tax) or "includeTax" (prices include tax).
notes
stringNotes 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
numberVisible ID of the related document.
amount
numberAmount to apply from the related document.
products
object[]Products to carry over from the related document.
sendToClient
booleanIf true, email the document to the client after creation.
emailRecipients
string[]Additional email addresses to send the document to.
skipInventoryActions
booleanIf 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

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"
  }
}
POST/documents/preview/{type}

Generate a PDF preview without saving the document. Accepts the same body as create.

The preview URL is temporary and expires after 1 hour.

Path Parameters

NameTypeDescription
type
stringrequiredDocument type.

Body Parameters

NameTypeDescription
(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

Response
{
  "data": {
    "pdfUrl": "https://api.glance.co.il/preview/tmp-abc123.pdf",
    "expiresAt": "2024-03-20T15:30:00Z"
  }
}
POST/documents/preview/html

Generate an HTML preview of the document. Accepts the same body as create.

Body Parameters

NameTypeDescription
(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

Response
{
  "data": {
    "html": "<html>...</html>"
  }
}
PUT/documents/edit/:visibleId

Edit a quotation or order. Only draft / open documents can be edited.

Only quotations and orders can be edited. Invoices and receipts are immutable once created.

Path Parameters

NameTypeDescription
visibleId
numberrequiredThe document visible ID.

Body Parameters

NameTypeDescription
(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

Response
{
  "data": {
    "visibleId": 1001,
    "type": "quotation",
    "title": "Updated Quotation",
    "total": 7020
  }
}
POST/documents/close/:visibleId

Close or finalize a document (e.g. mark a quotation as accepted).

Path Parameters

NameTypeDescription
visibleId
numberrequiredThe 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

Response
{
  "data": {
    "visibleId": 1001,
    "status": "closed"
  }
}
POST/documents/allocate/:visibleId

Allocate a receipt to one or more invoices.

Path Parameters

NameTypeDescription
visibleId
numberrequiredThe receipt visible ID.

Body Parameters

NameTypeDescription
allocations
object[]requiredArray of allocation targets.
invoiceId
numberVisible ID of the invoice to allocate to.
amount
numberAmount 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

Response
{
  "data": {
    "visibleId": 2001,
    "allocations": [
      {
        "invoiceId": 1001,
        "amount": 3000
      },
      {
        "invoiceId": 1002,
        "amount": 2850
      }
    ]
  }
}
POST/documents/cancel-receipt/:visibleId

Cancel a receipt. This reverses allocations and payments.

Path Parameters

NameTypeDescription
visibleId
numberrequiredThe 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

Response
{
  "data": {
    "visibleId": 2001,
    "status": "cancelled"
  }
}
GET/documents/settings/:route

Get settings for a specific document type, including the next number and tax rate.

Path Parameters

NameTypeDescription
route
stringrequiredThe 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

Response
{
  "data": {
    "lastDate": "2024-03-19",
    "taxRate": 17,
    "nextNumber": 1003
  }
}