Returns an audit with its lines: the expected and actual stock and the difference for each item.
v1/audits/get_entry.php
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| audit_id | int | Yes | Audit ID |
Response
An object audit with the audit's fields:
| Field | Type | Description |
|---|---|---|
| id | int | Audit ID |
| num | int | Number. Assigned automatically |
| date | string | Audit date, YYYY-MM-DD |
| status | int | Status: 0 Planned, 1 Completed |
| storage_id | int | Storage location the audit is carried out at |
| storage_name | string | Storage location name |
| lines | int | Number of lines |
| surplus_cost | float | Surpluses at cost |
| shortage_cost | float | Shortages at cost, a negative number |
| total_cost | float | Total at cost: surplus_cost plus shortage_cost |
| surplus_price | float | Surpluses at sale price. Products only, 0 for materials |
| shortage_price | float | Shortages at sale price, a negative number. Products only |
| total_price | float | Total at sale price: surplus_price plus shortage_price |
And lines in two arrays: materials and products. Only the array of the type the audit counts is filled; the other comes empty.
| Field | Type | Description |
|---|---|---|
| id | int | Material or product ID |
| sku | string | SKU |
| name | string | Name |
| unit | string | Unit of measure |
| expected | float | Expected stock on the audit date |
| actual | float | Actual stock |
| difference | float | Difference: actual minus expected. Positive means a surplus, negative a shortage |
| notes | string | Line notes |
| position | int | Line number, from 0 |
The lines from the response can be sent to v1/audits/edit unchanged: the method takes id, actual and notes from them.
Example request
{
"audit_id": 1699
}
Example response
{
"success": true,
"audit": {
"id": 1699,
"num": 24,
"date": "2026-09-30",
"status": 1,
"storage_id": 3998,
"storage_name": "Main",
"lines": 2,
"surplus_cost": 0,
"shortage_cost": -57900,
"total_cost": -57900,
"surplus_price": 0,
"shortage_price": 0,
"total_price": 0,
"materials": [
{
"id": 2051,
"sku": "M010",
"name": "Oak board",
"unit": "cu m",
"expected": 4.2,
"actual": 3.8,
"difference": -0.4,
"notes": "",
"position": 0
},
{
"id": 2077,
"sku": "M022",
"name": "Furniture varnish",
"unit": "L",
"expected": 6,
"actual": 0,
"difference": -6,
"notes": "Not found at the storage location",
"position": 1
}
],
"products": []
}
}
Errors
| Error | Reason |
|---|---|
| No audit_id in input | audit_id is missing |
| Audit not found or access denied | Audit not found or deleted |