Add
Adding a document
POST https://do.workzeal.com/document/insert
Creates a document (invoice, contract, etc.) for a client. If no number is passed, the next number for this document type is generated automatically.
Request Body
| Name | Type | Description |
|---|---|---|
| document* | JSON |
200: OK Standard response object
{
"status": "success",
"error": "",
"code": null,
"rows": 0,
"pages": 0,
"page": 0,
"value": "91234"
}
JSON
All available parameters of the new object
- company_id - * Client code
- type_id - * Document type code (see directories)
- number - Document number. If not passed, it is generated automatically
- date - Document date, for example 2026-08-26. Defaults to today
- sum - Document amount
- note - Note
- status_id - Document flag/status code
- deal_id - Deal code
- contact_id - Contact person code
- user_id - Responsible person code. Defaults to the token owner
- requisites_id - Code of your own company's details
- company_requisites_id - Code of the client's company details
- base_doc_id - Code of the base document
- date_expire - Expiration date, for example 2026-09-26
- tags - Comma-separated tags
{
"company_id": 368132,
"type_id": 1,
"sum": 150000,
"date": "2026-08-26",
"note": "Invoice for packaging supply, August"
}
Note
Required parameters
company_id (Client code)
type_id (Document type code)
The document number is checked for uniqueness within the type; if you pass a number that already exists, an error is returned.
Example
cURL
NodeJS (Request)
curl --location --request POST 'https://do.workzeal.com/document/insert' \
--header 'Authorization: Bearer XXXX-XXXXXXX-XXXXXXX' \
--header 'Content-Type: application/json' \
--data-raw '{
"company_id": 368132,
"type_id": 1,
"sum": 150000,
"note": "Invoice for packaging supply, August"
}
'
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://do.workzeal.com/document/insert',
'headers': {
'Authorization': 'Bearer XXXX-XXXXXXX-XXXXXXX',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"company_id": 368132,
"type_id": 1,
"sum": 150000,
"note": "Invoice for packaging supply, August"
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
Directories
Response
{
"status": "success",
"error": "",
"code": null,
"rows": 0,
"pages": 0,
"page": 0,
"value": "91234"
}
// value - ID of the new document