Line items
Line items are strictly tied to a specific document: document_id is required in every request.
Warning
Row-by-row editing of document line items (quantities, prices) via the public API is not available: document rows have many calculated columns (amounts, discounts, VAT totals) that are computed by the application. You can edit line items in WorkZeal itself. Deleting line items via the API is also not available.
List of document line items
GET https://do.workzeal.com/document/goods/list?document_id=91234
Query Parameters
| Name | Type | Description |
|---|---|---|
| document_id* | Int | Document ID |
Adding line items from the catalog
POST https://do.workzeal.com/document/goods/insert?document_id=91234&goods_ids=12,15,20
Adds products from the warehouse catalog to the document by their IDs (you can find them in the list of products).
Query Parameters
| Name | Type | Description |
|---|---|---|
| document_id* | Int | Document ID |
| goods_ids* | String | Comma-separated product IDs: 12,15,20 |
Example
cURL
NodeJS (Request)
curl --location --request POST 'https://do.workzeal.com/document/goods/insert?document_id=91234&goods_ids=12,15' \
--header 'Authorization: Bearer XXXX-XXXXXXX-XXXXXXX' \
--header 'Content-Type: application/json' \
--data-raw 'null'
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://do.workzeal.com/document/goods/insert?document_id=91234&goods_ids=12,15',
'headers': {
'Authorization': 'Bearer XXXX-XXXXXXX-XXXXXXX',
'Content-Type': 'application/json'
},
body: 'null'
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
Response
{
"status": "success",
"error": "",
"code": null,
"rows": 0,
"pages": 0,
"page": 0,
"value": "1"
}
// value: 1 - done, 0 - error (the text is in the error field)