warehouse_id is sent./owner/reports/report/warehouse_stock_balance in your Daftra account. There is no date range: the balance is as of the moment of the request.data.columns instead of assuming keys. Every row object is keyed by columns[].key, plus product_id and unit.| Account setting Show both on-hand and available stock | Total columns | Per selected warehouse |
|---|---|---|
| off | total | warehouse_<id> |
| on | total_on_hand, total_pending, total_available | warehouse_<id>_on_hand, warehouse_<id>_pending, warehouse_<id>_available |
meta.shows_pending_stock tells you which row of the table applies. Without warehouse_id, only the total columns appear.unit, null when the product has none) and are not formatted. Totals carry two decimals. A warehouse cell is null when there is nothing to show for it (with pending stock shown, a selected warehouse the product never moved through), and 0 when the stock there is zero.status, inactive products are left out. The response has no totals row.curl --location --globoff 'https://.daftara.com/api2/reports/warehouse_stock_balance?product_id=1&item_group_id=&brand_id=&category_id=&warehouse_id=&product_branch_id=&status=1' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer ' \
--header 'apikey: ' \
--header 'Content-Type: application/json'{
"result": "successful",
"code": 200,
"data": {
"report": {
"key": "warehouse_stock_balance",
"title": "string"
},
"filters": {
"product_id": 0,
"item_group_id": 0,
"brand_id": 0,
"category_id": 0,
"status": 1,
"warehouse_id": [
0
],
"product_branch_id": [
0
]
},
"columns": [
{
"key": "string",
"label": "string",
"type": "text",
"scope": "total",
"measure": "on_hand",
"warehouse_id": 0,
"warehouse_name": "string"
}
],
"rows": [
{
"product_id": 0,
"unit": "string",
"code": "string",
"name": "string",
"category": "string",
"brand": "string",
"total": 0,
"total_on_hand": 0,
"total_pending": 0,
"total_available": 0,
"property1": 0,
"property2": 0
}
],
"meta": {
"row_count": 0,
"warehouse_count": 0,
"shows_pending_stock": true
}
}
}