Skip to the page
Docs menu

Docs Lumber and panels

Lumber and panels

Tally lumber bundles and panel units through the API: put bundles into a container, truck load or stack, send each bundle's tally, read any group's packing list and each bundle's tally sheet as JSON or printable HTML, and receive group.measured.

Where it runs. The API, the SDK, the CLI and the test-mode simulator tally lumber and panels, so you can build and test the whole integration. The Timbereye iPhone app's lumber bundle tally and panel unit count are tested in the simulator, not on a real phone.

LiDAR on iPhones with LiDAR. The iPhone app's LiDAR tool finds the end face of a bundle as a plane, sizes each board end and finds set-back boards, with no tag or reference object. Its sizes are not written to a tally and nothing is uploaded: the camera counts, and the operator keys every size.

A bundle of lumber or a unit of panels is a group with product: "lumber" or "panel". Its tally is a list of lines (boards, counted runs of boards, width classes or sheets). Bundles and units go into the physical thing that holds them: a container, a truck load, a stack, or any group of yours. A packing list is the document you read from such a group (GET /groups/{id}/packing_list): its bundles and units, their figures and the totals per product. It is not a kind of group to create. The flow is the one you know: Create → Tally → Sync.

A group with logs, bundles and units#

The API allows a group to hold several products. A container, a truck load or a stack holds logs directly, and bundles and units as child groups directly under it (parent_id the group). The Timbereye apps keep one product per group: the worker chooses Logs, Lumber or Panels when making the group (recorded as the group's holds), and its screen has that product's one action (Start scanning, New bundle, New unit). A group that holds more than one product, because your system put them there, still shows everything in the apps, each product in its own section with its own figures.

Each product keeps its own figures, never added to another's:

WhereLogsBundlesUnits
GET /groups/{id} summary.productssawlog: logs, volume (m³ JAS)lumber: bundles, tallied, pieces, board_feet, mbf, m3panel: units, tallied, sheets, m2, m3
The group's group.measuredpieces, volume (its logs only)products.lumber, a row each in childrenproducts.panel, a row each in children
GET /groups/{id}/packing_list–rows with product: "lumber", totals_by_product.lumberrows with product: "panel", totals_by_product.panel
Each bundle's or unit's own group.measured–its totals (board feet, m³)its totals (sheets, m², m³)

summary.products covers the group and everything inside it, with figures from final tallies; tallied says how many have one. summary.pieces is given only while a group holds one product: there is no piece count of logs, boards and sheets together. A container with 4 logs, 2 bundles and 4 units:

JSON
{
    "summary": {
        "items": 4,
        "volume": { "rule": "jas", "m3": 1.713 },
        "products": {
            "sawlog": { "logs": 4, "volume": { "rule": "jas", "m3": 1.713 } },
            "lumber": { "bundles": 2, "tallied": 2, "pieces": 5, "board_feet": 50, "mbf": 0.05, "m3": 0.118 },
            "panel": { "units": 4, "tallied": 4, "sheets": 200, "m2": 595.36, "m3": 10.716 }
        }
    }
}

The group's group.measured is its next revision whenever its logs settle or a bundle or unit inside it gets a new final tally (reason: "child_tallied"), one by one, as they are tallied. Each revision is final for what the group holds then; there is nothing to close or declare complete. See 3. Sync.

1. Create a container and its bundles#

One call creates the container (or truck load, stack) and up to 500 bundles in it, in one transaction. Create the container without a product (it may hold logs, bundles and units together) and give each bundle its product; or put more bundles into an existing group with parent_id. A bundle number may repeat within a group (under different quality codes), so make external_ref unique. Its packing list is then GET /groups/{id}/packing_list (see Packing lists and tally sheets).

TypeScript
const batch = await timbereye.groups.createBatch({
    parent: { kind: "container", externalRef: "MSKU1234565" },
    groups: [
        {
            externalRef: "BA-2",
            product: "lumber",
            spec: {
                tally: "width_class",
                species: "OKOUME",
                thickness: { value: 38, unit: "mm" },
                length: { value: 1.8, unit: "m" },
            },
            bundle: { number: "2", qualityCode: "BA", drying: "KD" },
        },
    ],
})
curl
curl https://api.timbereye.com/v1/groups/batch \
  -H "Authorization: Bearer $TIMBEREYE_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{ "parent": { "kind": "container", "external_ref": "MSKU1234565" },
        "groups": [ { "external_ref": "BA-2", "product": "lumber",
          "spec": { "tally": "width_class", "species": "OKOUME", "thickness": { "value": 38, "unit": "mm" }, "length": { "value": 1.8, "unit": "m" } },
          "bundle": { "number": "2", "quality_code": "BA", "drying": "KD" } } ] }'
CLI
timbereye groups create-batch --data @container-bundles.json --json
JSON
{
    "object": "group_batch",
    "livemode": false,
    "parent": {
        "id": "grp_4LpQ2s",
        "object": "group",
        "kind": "container",
        "product": "sawlog"
    },
    "data": [
        {
            "id": "grp_8RtW1c",
            "object": "group",
            "kind": "bundle",
            "product": "lumber",
            "parent_id": "grp_4LpQ2s",
            "external_ref": "BA-2",
            "rule": { "id": "lumber_m3_width_class", "version": "1" }
        }
    ]
}

A single bundle or unit is POST /groups with the same fields. spec takes tally (the shape, below), species, grade, surfacing, seasoning, panel_type, and thickness, width and length as { value, unit }, { nominal, actual, unit } (a 2x4 is 2 × 1.5 in) or, for hardwood thickness, { quarters } (5 is 5/4). bundle holds trade attributes printed as given (number, buyer_ref, quality_code, drying, width_spec, a free-text spec_line such as "KD 6–8% MC · S2S") and the pack's label (size, dimensions, pieces, source: operator | ocr), which the tally is compared with. rule picks a tally rule and overrides its policies; expected (pieces, m3, board_feet, m2) is compared with the tally and never used in a figure.

2. Tally#

Send a bundle's lines. A submitted tally is final (once its photos are there, when it requires any). A later submission replaces the bundle's lines atomically and is the next revision. It is idempotent by client_id. A phone may send a vision_count (pieces counted on a photo, with the image and regions): the tally reports counted_pieces, count_matches and count_difference beside pieces, and a mismatch blocks nothing.

TypeScript
const tally = await timbereye.groups.tally.submit("grp_8RtW1c", {
    clientId: "tally-BA-2",
    lines: [
        { width: { value: 100, unit: "mm" }, count: 15 },
        { width: { value: 110, unit: "mm" }, count: 10 },
    ],
})
curl
curl https://api.timbereye.com/v1/groups/grp_8RtW1c/tally \
  -H "Authorization: Bearer $TIMBEREYE_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{ "client_id": "tally-BA-2", "lines": [
        { "width": { "value": 100, "unit": "mm" }, "count": 15 },
        { "width": { "value": 110, "unit": "mm" }, "count": 10 } ] }'
CLI
timbereye tally submit grp_8RtW1c --file lines.json --client-id tally-BA-2 --json
JSON
{
    "object": "group_tally",
    "livemode": false,
    "group_id": "grp_8RtW1c",
    "product": "lumber",
    "final": false,
    "pieces": 25,
    "rule": { "id": "lumber_m3_width_class", "version": "1", "primary": "m3" },
    "totals": { "pieces": 25, "m3": 0.181, "m3_exact": "0.18126" },
    "by_width": [
        { "width": { "value": 100, "unit": "mm" }, "pieces": 15 },
        { "width": { "value": 110, "unit": "mm" }, "pieces": 10 }
    ],
    "photos": {
        "required": ["bundle_end", "label"],
        "waived": false,
        "missing": ["bundle_end", "label"],
        "count": 0
    }
}

Read it back with timbereye.groups.tally.retrieve(id) (GET /groups/{id}/tally, timbereye tally get): rule recomputes under another rule, lines=none leaves the lines out, and lines page with limit and starting_after. Each line keeps its dimensions as entered with a source (vision, operator, corrected, group_default, bulk), the machine's original value in measured, and what the rule tallied in tallied. Thickness and length left out of a line come from the spec, with source: group_default.

The three tally shapes#

spec.tallyA line isExample
uniforma count of identical pieces{ "count": 294 } (size from the spec)
per_pieceone board (or count identical boards){ "width": { "value": 9.25, "unit": "in" }, "length": { "value": 10, "unit": "ft" } }
width_classa class width and the pieces in it{ "width": { "value": 100, "unit": "mm" }, "count": 15 }

Panels are uniform: a line is a count of sheets. A board-rule reading can be sent as surface_measure instead of a width.

Rules and their policies#

GET /volume_rules lists the tally rules after the log rules, each with its policies, their defaults and whether the default is confirmed. A bundle gets a rule from its product and shape (for hardwood tallied board by board, from your organisation's board-foot method); pick another with rule.id and override a policy with rule.policies.

RuleFor
lumber_bf_nominalSoftwood units and boards of one size: board feet on nominal sizes, no rounding per piece (the nominal piece tally).
lumber_bf_surface_measureUS hardwood, board by board. Defaults follow the NHLA board measure rule: full widths (width_step: none; also 0.5, 0.25 and 1 in sections rounded down), whole feet rounded down (length_step), surface measure per board to the nearest whole foot with exact halves alternating (sm_round: nearest_whole, sm_tie), net kiln-dried tally (kd_tally: net), decimals for 5/4 and 6/4 (bf_places: auto). sm_round: floor_half is the mill rule; sm_round: exact rounds once, at the bundle.
lumber_bf_width_length_tallyNHLA width and length tally (whole inches, whole feet), as on export tallies.
lumber_m3_width_classATIBT metric: 10 mm width classes, thickness × class width × length. A packing list totals the unrounded bundle volumes by default.
lumber_m3_fixed_widthMetric parcels of one width.
lumber_m3_actualCubic metres on actual (dressed) sizes.
panel_m2_m3_msfPlywood, OSB, particleboard and MDF units: sheets, m², m³ and MSF.

Totals carry reported numbers and exact strings: m3 and m3_exact, board_feet and board_feet_exact.

The phone SDKs are tested against vectors generated from these rules (sdk/swift/Tests/TimbereyeTests/Fixtures/lumber.json, read by the Swift and the Kotlin tests), so a phone and the server agree to the board foot.

Board-foot methods#

A board-foot method is a named way to turn a tally into board feet. A hardwood bundle tallied board by board gets your organisation's board_foot_method unless its request names a rule; units of one size get the nominal piece tally and width-class bundles the width & length tally. Every bundle records its method in rule.method and keeps it, so changing the setting changes only bundles created afterwards.

  • NHLA board measure (nhla_board_measure, the hardwood default). Follows the NHLA board measure rule (NHLA _Rules for the Measurement & Inspection of Hardwood & Cypress_, paragraphs 16 and 18). Each board's surface measure (SM) is its full width in inches, with fractions, × its length in whole feet ÷ 12, rounded to the nearest whole foot; an exact half rounds up the first time in the bundle, down the next, and so on in tally order. Board feet are the bundle's SM × the thickness (4/4 is 1, 5/4 is 1.25, 6/4 is 1.5; under 4/4 counts as 4/4), shown with two decimals when the thickness is not whole inches. _Example, at 5/4:_ a 9 in × 14 ft board is SM 10.5, the bundle's first exact half, so 11; the next board, 6 in × 11 ft, is SM 5.5, so 5. Eight such boards total SM 66: 82.50 BF.
  • Nominal piece tally (nominal_piece_tally, the softwood default). Board feet are nominal thickness × nominal width (inches) × length (feet) ÷ 12 per piece, with no rounding per piece, as in the American Softwood Lumber Standard (PS 20). _Example:_ 294 pieces of 2×4 at 8 ft are 294 × 2 × 4 × 8 ÷ 12 = 1,568 BF.
  • Width & length tally (export) (width_length_tally). Each width is rounded to the nearest whole inch (exact halves alternating) and each length down to whole feet; board feet are the widths × pieces × length ÷ 12 × thickness. In metric it is the width-class rule, lumber_m3_width_class. _Example:_ 42 boards at 14 ft and 6/4 whose widths add to 313 in: 313 × 14 ÷ 12 × 1.5 = 547.75, reported 548 BF.
  • Exact (no rounding) (exact). Each board's surface measure is width × whole feet ÷ 12, not rounded; the bundle rounds once. _Example:_ 9.3 in × 9 ft 3 in at 8/4 is 9.3 × 9 ÷ 12 = 6.975 SM, 13.95 BF.
  • Mill rule: half-foot, round down (mill_half_foot_down). Widths round down to half-inch sections and each board's surface measure down to half feet; the bundle reports a whole board foot. This was the default before 24 November 2026 and is kept exactly. _Example:_ 9.3 in × 9 ft 3 in at 8/4 is a 9 in section at 9 ft, SM 6.75, rounded to 6.5: 13 BF.

The alternation runs over one bundle in tally order, and every change recomputes the bundle from its first board. A correction can therefore flip the boards after it: in the NHLA example, correcting the second board to 6½ in (SM 5.96, so 6, no longer a half) makes the third board's half (7 in × 6 ft, SM 3.5) the second in the bundle, so it now rounds down to 3, and the halves after it flip too. The NHLA rule does not say which way the first half goes or where the alternation restarts; Timbereye starts each bundle up.

Your organisation's lumber settings#

GET /account returns lumber for every caller, phones included:

JSON
{
    "lumber": {
        "enabled": true,
        "board_foot_method": "nhla_board_measure",
        "photos_required": false,
        "products": ["lumber", "panel"]
    }
}

enabled lets phones open lumber groups (on in test mode, off in live mode until you turn it on). products lists what they may open: lumber, panel or both (the default); set ["panel"] for a panel-only mill. board_foot_method is the board-foot method of hardwood bundles tallied board by board: nhla_board_measure (the default), nominal_piece_tally, width_length_tally, exact or mill_half_foot_down. photos_required (default false) makes new bundles and units that state no photos policy need their photos before the tally is final. Change them per mode with a secret key or from the console:

TypeScript
await timbereye.account.updateLumber({ boardFootMethod: "mill_half_foot_down" })
curl
curl -X PATCH https://api.timbereye.com/v1/account/lumber \
  -H "Authorization: Bearer $TIMBEREYE_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "board_foot_method": "mill_half_foot_down" }'
CLI
timbereye account lumber --board-foot-method mill_half_foot_down --json

A bundle's own rule always wins, so one bundle can differ from the organisation's default: name a rule's rounding ("rule": { "id": "lumber_bf_surface_measure", "policies": { "sm_round": "floor_half" } }) and the rest of that method fills in.

Totals: exact or reported#

A packing list adds its bundles up in one of two ways: the rules' total_from policy, totals on a group created with a product, or ?totals= when you read it:

  • exact: the sum of the unrounded bundle volumes, rounded once.
  • reported: the sum of the bundle figures as printed, so re-adding the document gives its total.

They differ by rounding. The 150-bundle metric list in the reference examples totals 330.346 m³ exact and 330.348 m³ reported. The packing list shows both: totals under the list's convention, totals_alternative under the other.

Photos#

Photos are optional: a tally submitted without one is accepted, and the bundle simply has none (photos.no_photo: true, photos.count: 0). Photos can be added to a group at any time, before or after its tally, from your server or a phone, with POST /images (subject group, a kind such as bundle_end, bundle_far_end, label, tally_sheet, unit_edge, overview, weigh_ticket, damage, an optional caption). Pass their ids as image_ids with the tally to link them.

To require them, turn on photos_required in your lumber settings (above): new bundles then need bundle_end and label, new units label and unit_edge, and a tally without them is 409 photos_required, naming what is missing (any qualifying photo already on the group counts). Or require them per group:

JSON
{ "photos": { "required": ["bundle_end", "label"] } }

{ "photos": {} } asks for the product's default kinds. When your organisation requires photos, one group can be let off with a reason, which the tally records (photos.waived, photos.waived_reason):

JSON
{ "photos": { "required": false, "reason": "no camera at the mill" } }

3. Sync#

When a tally is submitted it is final, and group.measured is sent with the tally (without lines) as data.object: product, pieces, totals, rule, revision, and photos with its count and image ids. Its volume, the sawlog figure, is null: a bundle has no logs, and its cubic metres are totals.m3. A handler that reads totals first and volume second is right for sawlogs and lumber alike. A correction or re-tally sends group.measured again with the next revision: make your handler idempotent on the group id and revision. No item.* events are sent for boards or sheets.

A group holding bundles or units (a container, a truck load, a stack, a group a phone opened) sends its next revision as each bundle or unit inside it is tallied or revised, with reason: "child_tallied". Its pieces and volume stay its logs'; products has each product's figures and children a row per bundle and unit:

JSON
{
    "object": "group_tally",
    "group_id": "grp_QR1u7x",
    "kind": "container",
    "product": "sawlog",
    "final": true,
    "revision": 9,
    "reason": "child_tallied",
    "pieces": 4,
    "volume": { "rule": "jas", "m3": 1.713, "items": 4, "refined": 4, "estimated_only": 0, "failed": 0 },
    "products": {
        "sawlog": { "logs": 4, "volume": { "rule": "jas", "m3": 1.713 } },
        "lumber": { "bundles": 2, "tallied": 2, "pieces": 5, "board_feet": 50, "mbf": 0.05, "m3": 0.118 },
        "panel": { "units": 4, "tallied": 4, "sheets": 200, "m2": 595.36, "m3": 10.716 }
    },
    "children": [
        {
            "group_id": "grp_7MWvQH",
            "product": "lumber",
            "kind": "bundle",
            "number": "B-01",
            "revision": 2,
            "board_feet": 35
        }
    ]
}
MomentEvents
First tally of a bundlegroup.updated, then group.measured (revision 1)
A correctiongroup.updated, group.measured (revision 2), and the container's next revision
A bundle moved into a containergroup.updated (new parent_id); the container's next revision; nothing is billed
A bundle in a container talliedthe bundle's events, then group.measured for the container (child_tallied)
TypeScript
const onEvent = timbereye.webhooks.handler(async (event) => {
    if (event.type === "group.measured") {
        const tally = event.data.object
        if (tally.product !== "sawlog") await db.bundles.update(tally.externalRef, { totals: tally.totals })
    }
})

Packing lists and tally sheets#

A packing list is a document you read from any group that holds bundles or units: a container, a truck load, a stack. It is one row per bundle or unit (pieces or sheets, figures, and the width-class histogram for width-class tallies), width_classes, a thickness × length pivot, both totals and complete once every bundle has a final tally. A bundle that leaves the group after its tally was submitted (moved on into another container or a vessel hold) stays on the packing list of the group it was tallied in.

Each row says its product and kind, and totals are per product: totals_by_product.lumber and .panel, each with count, totals and totals_alternative, never added together. totals is the group's one product's, and null while it holds both.

A shipment of several containers is a group of yours with the containers inside it (parent_id the shipment). Its packing list is the one document for the shipment: the bundles and units of every container inside it (at any depth) are its rows, grouped by container, each naming its container in in_group (null for a bundle directly in the shipment), and groups gives each container's own totals_by_product. The printable page heads each container's rows with its totals. A container's own packing list is unchanged.

TypeScript
const list = await timbereye.groups.packingList("grp_4LpQ2s")
const page = await timbereye.groups.packingList("grp_4LpQ2s", { format: "html" })
curl
curl "https://api.timbereye.com/v1/groups/grp_4LpQ2s/packing_list" \
  -H "Authorization: Bearer $TIMBEREYE_SECRET_KEY"
CLI
timbereye packing-list get grp_4LpQ2s --html packing-list.html
JSON
{
    "object": "packing_list",
    "livemode": false,
    "group_id": "grp_4LpQ2s",
    "complete": true,
    "totals_convention": "exact",
    "bundles": [
        {
            "group_id": "grp_8RtW1c",
            "external_ref": "BA-2",
            "pieces": 123,
            "m3": 1.4,
            "histogram": { "100": 15, "110": 10 },
            "in_group": null
        }
    ],
    "groups": [],
    "totals": { "convention": "exact", "bundles": 150, "pieces": 29624, "m3": 330.346 },
    "totals_alternative": { "convention": "reported", "bundles": 150, "pieces": 29624, "m3": 330.348 }
}

totals=reported overrides the convention and include=tally_sheets adds every bundle's tally sheet. A bundle's own tally sheet is GET /groups/{id}/tally_sheet (timbereye tally sheet), with a document block (generated_at, content_sha256). With format=html either one comes back as { "object": "document", "format": "html", "content": "<!doctype html>…" }, a self-contained page to print or attach. The packing list is also a PDF (below).

Logs are on the packing list too. logs lists the logs in the group and in the groups inside it, oldest first within each group, each as stored: its tag (null untagged), species, grade, length, small-end diameters (diameter_short_m, diameter_long_m) and JAS volume (m3), with in_group as for bundles. Their totals are totals_by_product.sawlog (logs, m3, the stored volumes added up) and each container's in groups. weight is the group's weighbridge net weight (net_kg, ticket_ref), and each entry of groups has its own. A list prints at most 5,000 logs (logs_has_more beyond).

The packing list as a PDF#

format=pdf returns the packing list as a document to send a customer or a customs broker: application/pdf, made from the group's data on every request (never stored, nothing to finalise) and never cached. It is the same route as the JSON, with the same keys, sessions and phone sign-ins, because it is the same packing list in another format, as format=html already was.

TypeScript
import { writeFile } from "node:fs/promises"

const pdf = await timbereye.groups.packingList("grp_4LpQ2s", { format: "pdf", paper: "a4" })
await writeFile(pdf.fileName ?? "packing-list.pdf", pdf.data)
curl
curl "https://api.timbereye.com/v1/groups/grp_4LpQ2s/packing_list?format=pdf&paper=a4" \
  -H "Authorization: Bearer $TIMBEREYE_SECRET_KEY" -o packing-list.pdf
CLI
timbereye groups packing-list grp_4LpQ2s --pdf packing-list.pdf --paper a4

The response is the PDF itself (Content-Type: application/pdf, Content-Disposition: inline; filename="packing-list-MSKU1234565.pdf"); the SDK gives its bytes and file name, and the CLI prints where it wrote it:

JSON
{
    "object": "document",
    "format": "pdf",
    "path": "/home/you/packing-list.pdf",
    "file_name": "packing-list-MSKU1234565.pdf",
    "bytes": 41877,
    "sha256": "9f2c…"
}

What it holds:

  • The header: your organisation's logo top left (PUT /account/logo; without one, your organisation's name), the title, the group's kind and reference, its name, the products or containers it holds, the date and, when the group has one, its weighbridge net weight and ticket. In test mode "Test mode" stands beside the title and in every footer, and the file name ends in -test.
  • Shipping details, when the group has any (below): the parties side by side, as on an invoice, then the references, vessel and voyage, ports, incoterm, HS code, country of origin and seal, each under its label. A field that is not set is not printed, and a group with none has the header above and nothing more.
  • Logs: one row per log: its number on the list, tag (a long tag by its last 10 characters), species, length in metres, small-end diameters in centimetres (shortest × longest), grade when any log has one, and m³ JAS as recorded. Totals: logs, m³ JAS and, for a group of logs only, its weighbridge net weight.
  • Lumber: one row per bundle: bundle number, species, grade, thickness, drying, its lengths, pieces, board feet and m³. The board-foot method is named once in a note under the totals ("Board feet: NHLA board measure").
  • Panels: one row per unit: unit, product, thickness, size, sheets, m² and m³.
  • A shipment of containers (a group with containers inside it) is one document: a summary page (each container, its products, counts, m³ and weighbridge weight), then a section per container with its subtotals. A long container runs over as many pages as it needs, the column headings on each.
  • Totals per product, set apart at the bottom right, never added across products. A bundle or unit not tallied is listed, greyed, and left out of the totals, and a note says how many.

paper is a4 or letter (by default Letter when the group's lumber is measured in inches and feet, else A4); detail=tally adds each bundle's and unit's tally lines after the list; totals works as for the JSON. Content-Disposition names the file packing-list-<reference>.pdf.

Shipping details. Give the group the parties and references your shipping documents carry, from your server or in the console, and the PDF prints them as given. Timbereye does not issue, validate or file shipping documents: the details are yours, printed beside the measured contents. A container inside a shipment prints the shipment's details for any field it does not have; each container's seal is its own, in the shipment's summary and in its heading. All the fields and who may set them: Create groups.

TypeScript
await timbereye.groups.update("grp_4LpQ2s", {
    shipping: {
        buyer: { name: "Northwind Lumber Imports Ltd", addressLines: ["Felixstowe, United Kingdom"] },
        vessel: "Example Star",
        voyage: "248E",
        sealNumber: "EX-4471902",
    },
})
const pdf = await timbereye.groups.packingList("grp_4LpQ2s", { format: "pdf" })
curl
curl -X PATCH https://api.timbereye.com/v1/groups/grp_4LpQ2s \
  -H "Authorization: Bearer $TIMBEREYE_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "shipping": { "buyer": { "name": "Northwind Lumber Imports Ltd", "address_lines": ["Felixstowe, United Kingdom"] },
        "vessel": "Example Star", "voyage": "248E", "seal_number": "EX-4471902" } }'
curl "https://api.timbereye.com/v1/groups/grp_4LpQ2s/packing_list?format=pdf" \
  -H "Authorization: Bearer $TIMBEREYE_SECRET_KEY" -o packing-list.pdf
CLI
timbereye groups update grp_4LpQ2s --shipping @shipping.json --json
timbereye groups packing-list grp_4LpQ2s --pdf packing-list.pdf
JSON
{
    "object": "document",
    "format": "pdf",
    "path": "/home/you/packing-list.pdf",
    "file_name": "packing-list-MSKU1234565.pdf",
    "bytes": 44012,
    "sha256": "4be1…"
}

Your logo. PUT /account/logo with { "data": "<base64>" } sets it for your organisation, in both modes: a PNG or JPEG, at most 256 KB, each side 16 to 4,000 pixels (SVG is not accepted). GET /account shows it as logo (its type, size and when it was set), GET /account/logo returns the image, and DELETE /account/logo removes it. In the console: Settings, Organisation. With the CLI: timbereye account logo set --file logo.png. Names in Latin, Greek and Cyrillic letters are set in the document's typeface; a name in another script needs the logo.

Import a packing list CSV#

timbereye import packing-list turns a supplier's metric width-class packing list CSV (one row per bundle, one column per 10 mm width class) into a group holding its bundles and their tallies, and resumes when run again. See CLI.

Corrections and revisions#

Correct lines after upload with update, split (take pieces off a counted line into a new one), remove or add, each with a reason. A person replacing a machine or default value makes its source corrected; the original stays in measured. Each correction is a new revision and sends group.measured with it; billing posts only the difference as an adjustment.

TypeScript
await timbereye.groups.tally.correct("grp_8RtW1c", {
    corrections: [
        {
            action: "split",
            itemId: "itm_5Hc2",
            count: 2,
            set: { length: { value: 7, unit: "ft" } },
            reason: "two boards cut back",
        },
    ],
})
curl
curl https://api.timbereye.com/v1/groups/grp_8RtW1c/tally/corrections \
  -H "Authorization: Bearer $TIMBEREYE_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{ "corrections": [ { "action": "split", "item_id": "itm_5Hc2", "count": 2,
        "set": { "length": { "value": 7, "unit": "ft" } }, "reason": "two boards cut back" } ] }'
CLI
timbereye tally correct grp_8RtW1c --file corrections.json --json
JSON
{
    "object": "group_tally",
    "group_id": "grp_8RtW1c",
    "final": false,
    "pieces": 5,
    "lines": [
        { "item_id": "itm_9Qa1", "count": 2, "length": { "value": 7, "unit": "ft", "source": "corrected" } }
    ]
}

GET /groups/{id}/tally/revisions (timbereye tally revisions) lists every change, oldest first, with action, field, from, to, reason and who made it; filter with item_id.

On a phone#

A phone signed in to the Timbereye app (or your app with a publishable key) tallies the bundles it opens:

  1. POST /groups/open with product: "lumber" opens a bundle (kind: "bundle", parent_id the container, truck load or stack it goes into, existing: "new"), with spec, bundle, rule and photos as in POST /groups/batch. They apply when the call creates the group. The parent can be any group the phone may use: one it opened itself (the Timbereye app opens a container with its own POST /groups/open, no product, then puts bundles and units under it) or one your server created whose id it presents. 403 product_not_enabled when lumber.enabled is off or the product is not in lumber.products; the refusal is not stored, so the same request under the same key goes through once the product is on. The capture_group it returns carries product, parent_id, spec, bundle and rule, never figures.
  2. Any photos go up as group images (kind: bundle_end), then the tally: POST /groups/{id}/tally, with replaces_revision, the revision the phone last saw (0 for a new bundle). When the office corrected the bundle meanwhile the call is 409 tally_replaced, so a phone never silently overwrites a correction; the same client_id sent again is a replay. When the bundle requires a photo, a tally sent before it is 409 photos_required, not stored: the same request, under the same key, succeeds once a photo is on the bundle.
  3. It reads the bundle's tally (GET /groups/{id}/tally) and its list (GET /groups/{id}/packing_list) for the groups it may capture into. The app's list of what is waiting is GET /capture_groups?product=lumber (the bundles your system created, and the groups holding them); without product it lists sawlog groups as before. Each entry has item_count and volume ({ "rule": "jas", "m3": … }) as the server has them, removed logs left out; volume is null for lumber and panel groups.
JSON
{
    "client_id": "B-03:tally:1",
    "replaces_revision": 0,
    "image_ids": ["img_7Dk2"],
    "lines": [
        { "width": { "value": 9.3, "unit": "in" }, "length": { "value": 9.25, "unit": "ft" }, "count": 1 }
    ],
    "vision_count": {
        "counted_pieces": 43,
        "image_id": "img_7Dk2",
        "method": "operator_taps",
        "regions": [{ "x": 812, "y": 455 }]
    }
}

vision_count.method says who counted: operator_taps (the operator tapped each board end on the photo), operator_label (typed from the pack's label) or model (a counting model; the default). The tally reports it as count_method beside counted_pieces and count_matches. Where the server offers the board-end counter (GET /models/board-end-counter, 0.9.0), the iPhone app proposes the count with it and sends model once the operator has corrected and confirmed it; otherwise the operator taps. Tested in the simulator; no counting model is run on a phone.

With method: model, send what the model found and what the operator changed, so every confirmed count is a labelled example for the next model version:

JSON
"vision_count": {
    "counted_pieces": 142,
    "proposed_pieces": 143,
    "method": "model",
    "model": "timbereye-board-end-counter@0.9.0",
    "confirmed": true,
    "image_id": "img_7Dk2",
    "area": { "x": 0.08, "y": 0.11, "width": 0.84, "height": 0.77 },
    "proposal": {
        "boxes": [{ "x": 0.1632, "y": 0.15, "width": 0.0681, "height": 0.0375, "score": 0.92 }],
        "area": { "x": 0.08, "y": 0.11, "width": 0.84, "height": 0.77 },
        "area_trusted": true,
        "raw_count": 151
    },
    "corrections": { "added": [{ "x": 0.5, "y": 0.62 }], "removed": [3, 7] }
}
  • proposal.boxes: every board end the model found on the photo (up to 5,000), normalised to it (origin top left), each with its score; strap_merged: true marks one board found as two halves either side of a strap.
  • proposal.area: the model's own counting area; area_trusted: false when it found no bundle and proposed the whole photo. area (outside proposal) is the area the operator counted in, which may differ.
  • A detector's box can overhang the photo by a pixel or two. Coordinates from -0.05 to 1.05 (boxes, both areas, corrections.added, and a score up to 1.05) are accepted and clipped to the photo, never refused; a box is never dropped, so the indices in corrections.removed hold. Anything further out is 400 parameter_invalid.
  • sizes (optional, with proposal): what a phone with depth measured on the boxes: readings, at most one per box (box is the index into proposal.boxes), each with width_in, thickness_in, their …_plus_minus_in, setback_in (how far the end sits behind the bundle's face), blank (why there is no size) and proposed_width_in (what went into the tally). A proposal: the confirmed sizes are the lines.
  • trimbacks (optional, with proposal): boards shorter than the bundle. levels: the lengths proposed from the setbacks (length_ft, setback_in, boxes, confident); marks: the lengths the operator left marked, by box or, for an added board end, by x and y; rule (nearest_foot or rounded_down), threshold_in, nominal_ft. The confirmed lengths are the lines. Both are stored as sent and read back; neither is billed.
  • corrections.removed: indices into proposal.boxes the operator took out; corrections.added: board ends the model missed. A removed index that names no box is 400 parameter_invalid; corrections needs proposal.
  • A count by hand (operator_taps, operator_label) never stores a proposal.
  • The tally reads them back as sent under submission.vision_count; the photo is a group image like any other.
  • Timbereye uses the confirmed counts to measure each model version (exact, within 2, mean and median error, bias, corrections per bundle) before it ships a new one.

Panels on a phone#

Panels go the same way with product: "panel": each unit kind: "unit", inside its container or stack, with spec.panel_type (plywood, osb, particleboard, mdf), thickness, width and length as stated on the unit (4 × 8 ft stays in feet; 1220 × 2440 mm in millimetres), rule: panel_m2_m3_msf, and photos.required: ["unit_edge"] only when your organisation requires photos. Its tally is one line, the sheets the operator counted:

JSON
{
    "client_id": "U-02:tally:1",
    "replaces_revision": 0,
    "image_ids": ["img_4Hq8"],
    "lines": [{ "count": 50, "count_source": "operator" }]
}

There is no vision for panels: the count is the operator's (a number, or taps on the unit's edge sent as vision_count with method: operator_taps). The Timbereye app enters many identical units as one entry with one photo of the set; on the server each is its own unit with its own tally and a copy of that photo, captioned as the set's ("One photo for 18 identical units, U-02 to U-19"). The phone SDK's figures are a port of panel_m2_m3_msf, tested against the server's panel_vectors.

Moving a tallied bundle#

A tallied bundle may always move into another container, or be assigned to a vessel hold by your system (PATCH /groups/{id} with parent_id); the packing list of the group it was tallied in keeps listing it. Its tally does not change and nothing is billed again. GET /groups/{id}/parents (timbereye groups parents) is where it has been: parent_id, joined_at, left_at and current.

Try it with no phone#

In test mode, one call builds a whole tallied group of bundles and reads its packing list: hardwood_packing_list, metric_width_class_list, softwood_units or panel_units (with group_id, into a group you already have, such as a container). Each bundle gets placeholder photos and its tally, so group.measured arrives for each bundle and for the group.

TypeScript
const simulated = await timbereye.testMode.simulatePackingList({
    scenario: "metric_width_class_list",
    seed: 7,
})
curl
curl https://api.timbereye.com/v1/test/packing_lists/simulate \
  -H "Authorization: Bearer $TIMBEREYE_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{ "scenario": "metric_width_class_list", "seed": 7 }'
CLI
timbereye simulate packing-list --scenario metric_width_class_list --seed 7 --json
JSON
{
    "object": "simulated_packing_list",
    "livemode": false,
    "scenario": "metric_width_class_list",
    "packing_list": {
        "object": "packing_list",
        "group_id": "grp_2SmN7d",
        "complete": true,
        "totals": { "pieces": 29624 }
    }
}

The figures are simulated. With group_id the bundles or units go into a group you have, say a container with simulated logs, which then holds several products; packing_list is that group's:

TypeScript
await timbereye.testMode.simulatePackingList({ scenario: "panel_units", bundles: 2, groupId: "grp_7QxV3m" })
curl
curl https://api.timbereye.com/v1/test/packing_lists/simulate \
  -H "Authorization: Bearer $TIMBEREYE_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{ "scenario": "panel_units", "bundles": 2, "group_id": "grp_7QxV3m" }'
CLI
timbereye simulate packing-list --scenario panel_units --bundles 2 --group grp_7QxV3m --json
JSON
{
    "object": "simulated_packing_list",
    "scenario": "panel_units",
    "packing_list": {
        "group_id": "grp_7QxV3m",
        "kind": "container",
        "product": null,
        "totals_by_product": {
            "panel": { "count": 2, "totals": { "bundles": 2, "pieces": 166, "m2": 493.5 } }
        }
    }
}

Billing and usage#

One price for every forest product: $0.20 per m³, billed once when a bundle's or unit's tally is final, on nominal m³ (a board-foot tally is converted at 1 BF = 0.002359737216 m³). The price is the same with or without a camera or a photo opt-out. Corrections after billing are adjustments; moving a bundle never bills; test mode never bills. A group holding logs, bundles and units bills each log at its refinement and each bundle and unit at its final tally; the group itself bills nothing, so nothing is counted twice. GET /usage reports lumber (m3, board_feet, pieces, photos) and panels (m3, m2, pieces, photos). Only lumber_m3 and panel_m3 are charged; pieces, board feet, m² and photos are counts for display. See Billing.

Errors#

CodeStatusWhen
photos_required409Submitting a tally whose required photos are missing (the group or your organisation requires them); the message names them. Not stored: retry the same request once a photo is there.
tally_replaced409replaces or replaces_revision does not name the current tally.
product_not_enabled403A phone opens a product that lumber.enabled or lumber.products rules out.
client_id_conflict409A different tally under a client_id already used.
product_not_lumber422A tally call on a sawlog group.
tally_line_incomplete422A line lacks a dimension its shape needs.
rule_shape_mismatch422The rule does not fit the tally shape.
width_class_out_of_range422A width class outside the rule's range.
tally_not_allowed422Tallying a group that holds bundles (tally its bundles).

See Errors, idempotency and pagination for the error object.