Volume
Rules and computed volume.
The volume object#
Volume of a group or an item under a rule. Items without any measurement do not count toward items.
| Field | Description |
|---|---|
objectvolume | String representing the object type. Always volume. |
livemodeboolean | true for objects in the live account, false for objects in the test account. Test and live data never mix. |
rulestring | Rule applied. |
rule_versionstring | Rule version. |
m3number | Volume in cubic metres. |
nativeobject, nullable | Volume in the rule's own unit. An object exactly when the rule's output_unit is not m3 (board-foot rules); null for cubic-metre rules such as jas. Always present. |
native.valuenumber | Value. |
native.unitstring | Unit, e.g. board_feet. |
itemsinteger | Measured items counted (see measured in the group summary). m3 also includes the nominal volume of assigned items, which are not counted here. |
refinedinteger | Items counted whose server refinement has succeeded. |
estimated_onlyinteger | items minus refined: items counted from a device estimate or a manual override only. |
density_kg_m3number, nullable | Net weight over volume, groups only. |
Volume of a group#
GET/v1/groups/{id}/volume
Computes the group's volume under a rule on read, including child groups.
Keys: secret key; restricted key with groups:read.
Parameters
| Field | Description |
|---|---|
id requiredstring, path | Group id. |
rulestring, query | Volume rule id, one of the id values listed by GET /volume_rules (v1: jas). Defaults to the account's default rule. An unknown id is a 400 parameter_invalid with param: rule. |
Request
const result = await timbereye.groups.volume("grp_7QxV3m")curl https://api.timbereye.com/v1/groups/grp_7QxV3m/volume \
-H "Authorization: Bearer $TIMBEREYE_SECRET_KEY"timbereye groups volume grp_7QxV3m --jsonResponse
// 200
{
"object": "volume",
"livemode": true,
"rule": "jas",
"rule_version": "1",
"m3": 21.384,
"native": null,
"items": 142,
"refined": 139,
"estimated_only": 3
}Errors
| Status | When |
|---|---|
400 | invalid_request_error: the request was malformed or a field was invalid. |
401 | authentication_error: missing, malformed, expired or revoked key. |
403 | permission_error: the key lacks the scope, the capture token is limited to other groups, or the resource is read-only to you. |
404 | invalid_request_error, resource_missing: no such object. Objects in another account are also reported as 404. |
429 | rate_limit_error: slow down and retry after the Retry-After delay. |
500 | api_error: something went wrong on our side. Safe to retry with the same Idempotency-Key. |
503 | api_error: isolation_unavailable (the resource's account isolation is not in place), service_unavailable (for example image storage not available in this environment) or model_unavailable (no on-device detector to offer in this environment). Retry later. |
Volume of an item#
GET/v1/items/{id}/volume
Computes one item's volume under a rule.
Keys: secret key; restricted key with items:read.
Parameters
| Field | Description |
|---|---|
id requiredstring, path | Item id. |
rulestring, query | Volume rule id, one of the id values listed by GET /volume_rules (v1: jas). Defaults to the account's default rule. An unknown id is a 400 parameter_invalid with param: rule. |
Request
const result = await timbereye.items.volume("itm_5Lw2Nc")curl https://api.timbereye.com/v1/items/itm_5Lw2Nc/volume \
-H "Authorization: Bearer $TIMBEREYE_SECRET_KEY"timbereye items volume itm_5Lw2Nc --jsonResponse
// 200
{
"object": "volume",
"livemode": true,
"rule": "jas",
"rule_version": "1",
"m3": 21.384,
"native": null,
"items": 142,
"refined": 139,
"estimated_only": 3
}Errors
| Status | When |
|---|---|
400 | invalid_request_error: the request was malformed or a field was invalid. |
401 | authentication_error: missing, malformed, expired or revoked key. |
403 | permission_error: the key lacks the scope, the capture token is limited to other groups, or the resource is read-only to you. |
404 | invalid_request_error, resource_missing: no such object. Objects in another account are also reported as 404. |
429 | rate_limit_error: slow down and retry after the Retry-After delay. |
500 | api_error: something went wrong on our side. Safe to retry with the same Idempotency-Key. |
503 | api_error: isolation_unavailable (the resource's account isolation is not in place), service_unavailable (for example image storage not available in this environment) or model_unavailable (no on-device detector to offer in this environment). Retry later. |
List volume rules#
GET/v1/volume_rules
Returns every rule available to compute volume, in one page: the list is not paginated, so has_more is always false and next_cursor null, and the endpoint takes no limit or starting_after. Rules are pure functions, mirrored by an open-source library with test vectors.
Keys: secret key; restricted key with groups:read; capture token (Allowed); publishable key (Allowed).
Request
A phone does not call this itself: the Swift and Kotlin SDKs make this call for the scanner, with the app's key. See Scan in your app. The samples are for your server.
const page = await timbereye.volumeRules.list()curl https://api.timbereye.com/v1/volume_rules \
-H "Authorization: Bearer $TIMBEREYE_SECRET_KEY"timbereye volume-rules list --jsonResponse
// 200
{
"object": "list",
"data": [
{
"id": "jas",
"object": "volume_rule",
"name": "JAS",
"version": "1",
"description": "Japanese Agricultural Standard log volume from the short diameter and the length.",
"output_unit": "m3"
}
],
"has_more": false,
"next_cursor": null
}Errors
| Status | When |
|---|---|
400 | invalid_request_error: the request was malformed or a field was invalid. |
401 | authentication_error: missing, malformed, expired or revoked key. |
403 | permission_error: the key lacks the scope, the capture token is limited to other groups, or the resource is read-only to you. |
404 | invalid_request_error, resource_missing: no such object. Objects in another account are also reported as 404. |
429 | rate_limit_error: slow down and retry after the Retry-After delay. |
500 | api_error: something went wrong on our side. Safe to retry with the same Idempotency-Key. |