Returns a resource's details.
v1/resources/get_entry.php
Parameters
| Field |
Type |
Required |
Description |
| resource_id |
int |
Yes |
Resource ID |
Response
An object resource with the resource's fields and its categories. The categories from the response can be sent to v1/resources/edit unchanged.
| 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
{
"resource_id": 58
}
Example response
{
"success": true,
"resource": {
"id": 58,
"name": "Overhead",
"type": "percent",
"dynamic": 0,
"base": "cost",
"unit": null,
"price": 0,
"percent": 10,
"initial_cost": 0,
"useful_life": 0,
"left_life": 0,
"notes": "",
"archived": 0,
"categories": []
}
}
Errors
| Error |
Reason |
| No resource_id in input |
resource_id is missing |
| Resource not found or access denied |
Resource not found or deleted |