Purchase Documents
Create and manage purchase-side documents: purchase orders, purchase receipts, and supplier invoices.
Use cases: Use purchase documents to manage your procurement workflow, from PO creation through to supplier invoice reconciliation.
GET
/purchaseList purchase documents.
Query Parameters
| Name | Type | Description | |
|---|---|---|---|
type | string | Purchase document type: "purchaseOrder", "purchaseReceipt", or "supplierInvoice". | |
page | number | Page number (default 1). | |
limit | number | Items per page (default 50). |
Request
curl -X GET "https://api.glance.co.il/purchase" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"Response
Response
{
"data": [
{
"visibleId": 501,
"type": "purchaseOrder",
"vendor": {
"visibleId": 1,
"name": "Supplier Co"
},
"total": 12500,
"date": "2024-03-10",
"status": "open",
"createdAt": "2024-03-10T09:00:00Z"
}
],
"pagination": {
"total": 35,
"limit": 50,
"offset": 0,
"hasMore": false
}
}GET
/purchase/id/:visibleIdGet a single purchase document with full details.
Path Parameters
| Name | Type | Description | |
|---|---|---|---|
visibleId | number | required | The purchase document visible ID. |
Request
curl -X GET "https://api.glance.co.il/purchase/id/:visibleId" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"Response
Response
{
"data": {
"visibleId": 501,
"type": "purchaseOrder",
"vendor": {
"visibleId": 1,
"name": "Supplier Co",
"taxId": "514000000"
},
"products": [
{
"description": "Widget Pro - Bulk Order",
"units": 500,
"price": 25,
"sku": "WDG-001"
}
],
"subtotal": 12500,
"tax": 2125,
"total": 14625,
"date": "2024-03-10",
"status": "open",
"createdAt": "2024-03-10T09:00:00Z"
}
}POST
/purchase/create/{type}Create a new purchase document.
Path Parameters
| Name | Type | Description | |
|---|---|---|---|
type | string | required | Purchase document type: "purchaseOrder", "purchaseReceipt", or "supplierInvoice". |
Body Parameters
| Name | Type | Description | |
|---|---|---|---|
vendorId | number | Visible ID of the vendor. | |
title | string | Document title. | |
products | object[] | Array of line items (same structure as sales documents). | |
description | string | required | Line item description. |
units | number | required | Quantity. |
price | number | required | Price per unit. |
sku | string | Product SKU. | |
date | string | Document date (YYYY-MM-DD). | |
tax | number | Tax rate override. | |
notes | string | Notes. | |
relatedDocuments | object[] | Related documents to link. | |
id | number | Related document visible ID. | |
amount | number | Amount from the related document. |
Request
curl -X POST "https://api.glance.co.il/purchase/create/{type}" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"vendorId": 0,
"title": "example_title",
"products": "example_products",
"date": "example_date",
"tax": 0,
"notes": "example_notes",
"relatedDocuments": "example_relatedDocuments"
}'Response
Response
{
"data": {
"visibleId": 502,
"type": "purchaseOrder",
"vendor": {
"visibleId": 1,
"name": "Supplier Co"
},
"total": 7020,
"date": "2024-03-20",
"status": "open",
"createdAt": "2024-03-20T14:30:00Z"
}
}POST
/purchase/close/:visibleIdClose / finalize a purchase document.
Path Parameters
| Name | Type | Description | |
|---|---|---|---|
visibleId | number | required | The purchase document visible ID. |
Request
curl -X POST "https://api.glance.co.il/purchase/close/:visibleId" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"Response
Response
{
"data": {
"visibleId": 501,
"status": "closed"
}
}GET
/purchase/settings/:routeGet settings for a purchase document type.
Path Parameters
| Name | Type | Description | |
|---|---|---|---|
route | string | required | The purchase document type route (e.g. purchaseOrder). |
Request
curl -X GET "https://api.glance.co.il/purchase/settings/:route" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"Response
Response
{
"data": {
"lastDate": "2024-03-19",
"taxRate": 17,
"nextNumber": 503
}
}