Add
Adding a product
POST https://do.workzeal.com/goods/insert
Creates a product or a service in the warehouse catalog.
Request Body
| Name | Type | Description |
|---|---|---|
| good* | JSON |
200: OK Standard response object
{
"status": "success",
"error": "",
"code": null,
"rows": 0,
"pages": 0,
"page": 0,
"value": "3021"
}
JSON
All available parameters of the new object
- name - * Name of the product or service
- code - SKU
- price - Sale price
- price_cost - Cost price
- quantity - Stock balance in the warehouse
- group_id - Catalog section ID
- unit - Unit of measure (pcs, kg, hour)
- note - Note
- vat - VAT rate, %
- currency_id - Currency ID
- min_quantity - Minimum stock balance
- min_price - Minimum price
- type_id - Type: product or service
- manufacturer_id - Manufacturer ID
- external_code - External code (from your accounting system)
- tags - Comma-separated tags
{
"name": "Cardboard box 400x300x200",
"code": "BOX-400",
"price": 45.50,
"quantity": 1000,
"unit": "pcs",
"vat": 20
}
Note
Required parameter: only name (the name).
Example
cURL
NodeJS (Request)
curl --location --request POST 'https://do.workzeal.com/goods/insert' \
--header 'Authorization: Bearer XXXX-XXXXXXX-XXXXXXX' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Cardboard box 400x300x200",
"code": "BOX-400",
"price": 45.50,
"unit": "pcs"
}
'
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://do.workzeal.com/goods/insert',
'headers': {
'Authorization': 'Bearer XXXX-XXXXXXX-XXXXXXX',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "Cardboard box 400x300x200",
"code": "BOX-400",
"price": 45.50,
"unit": "pcs"
})
};
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": "3021"
}
// value - ID of the new line item