Returns the company's resources, sorted by name. Archived resources are included too.
v1/resources/get_list.php
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| limit | int | No | Page size, from 1 to 1000 |
| offset | int | No | How many records to skip |
Without limit the whole list is returned. See Common Rules for pagination.
Response
An array resources with the resource's fields and its categories. The total field holds the total number of resources.
| Field | Type | Description |
|---|---|---|
| id | int | Resource ID |
| name | string | Name |
| type | string | Calculation type: "rate", "percent" or "amortized" |
| dynamic | int | 1 if the price or percentage is specified in the product components |
| base | string | Calculation basis of a percentage resource: "cost" or "price". null for other types |
| unit | string | Unit of measure, a code from Units of Measure. Present only for a fixed rate and depreciation, null for the rest |
| price | float | Price per unit |
| percent | float | Percentage of a percentage resource |
| initial_cost | float | Initial cost of the equipment |
| useful_life | float | Useful life, in the resource's units |
| left_life | float | Remaining useful life. Decreases when the resource is consumed in production |
| notes | string | Notes |
| archived | int | 1 if the resource is archived |
| categories | array | The resource's categories: objects with id and name |
Example request
{
"limit": 100,
"offset": 0
}
Example response
{
"success": true,
"resources": [
{
"id": 57,
"name": "Carpenter's work",
"type": "rate",
"dynamic": 0,
"base": null,
"unit": "h",
"price": 600,
"percent": 0,
"initial_cost": 0,
"useful_life": 0,
"left_life": 0,
"notes": "",
"archived": 0,
"categories": [
{
"id": 31,
"name": "Staff"
}
]
},
{
"id": 59,
"name": "Milling machine",
"type": "amortized",
"dynamic": 0,
"base": null,
"unit": "h",
"price": 300,
"percent": 0,
"initial_cost": 600000,
"useful_life": 2000,
"left_life": 1874.5,
"notes": "",
"archived": 0,
"categories": []
}
],
"total": 2
}
Errors
| Error | Reason |
|---|---|
| Invalid limit value. Must be between 1 and 1000 | Invalid limit |
| Invalid offset value. Must be 0 or greater | Invalid offset |
| Offset requires limit | offset passed without limit |