---
title: "Get the data Trackberry extracted from a document"
method: GET
path: "/documents/{id}/data"
tags: ["Documents"]
---

# Get the data Trackberry extracted from a document

`GET /documents/{id}/data`

## Request

- Base URL: `https://trackberry.com/api/v1`
- URL: `https://trackberry.com/api/v1/documents/{id}/data`
- Auth: HTTP bearer

Use this to read the structured content Trackberry parsed out of a document (a packing list's lines, an invoice's totals, a bill of lading's parties and departure and arrival days, a certificate's numbers). Check `data_available` on the document first, or accept an empty result: when nothing was extracted, or the document type has no structured schema, the response is still a 200 with `schema` null and `fields` an empty object.

## Path parameters

- `id` string, required

## Headers

- `Trackberry-Version` string

## Response `200`

The extracted data.

- DocumentData: The structured data Trackberry extracted from one document. The set of fields depends on `schema`.
  - `object` 'document_data', required: Always `document_data`.
  - `document_id` string, required: The document the data was read from.
  - `type` string, required: The document's class name when it has one (finer than `Document.type`, for example `exporter_invoice`, `transport_invoice`, `sanitary_document`), otherwise its `type`.
  - `schema` 'packing_list' | 'transport_document' | 'invoice' | 'certificate' | 'inspection_report' | 'arrival_notice' | 'booking' | 'pre_alert' | 'warehouse_receipt' | 'null', nullable, required: The shape of `fields`. Null when nothing was extracted or the document type has no structured schema, in which case `fields` is empty.
  - `fields` object, required: The extracted values, keys in snake_case, calendar days as `YYYY-MM-DD` strings, amounts and weights as numbers, missing values null, repeated groups as arrays of objects. Fields by `schema`. `packing_list`: packing_list_number, exporter_name, exporter_port, exporter_country, importer_name, importer_country, total_net_weight, total_boxes, diagram_pallet_numbers, container_number, line_items (each with pallet_number, produce_name, variety, size_calibre, quality_category, format, label, produce_type, ggn, comment, number_of_boxes, net_weight_kg, box_weight_kg, gross_weight_kg). `transport_document`: transport_type, shipment_reference, equipment_numbers, package_count, package_unit, consignor, consignee, notify_party, carrier, departure_location and arrival_location (each with location_name and country), etd, eta, temperature_setpoint_celsius, cargo_type, load_type, issuer. `invoice`: seller_name, seller_location, seller_country, buyer_name, buyer_location, buyer_country, invoice_number, invoice_date, total_amount, currency, line_items (each with produce_description, produce_name, variety, calibre, pack_format, box_weight_kg, quantity, unit_price, price_unit, total_amount). `certificate`: exporter_name, exporter_location, exporter_country, importer_name, importer_location, importer_country, certificate_number, certificate_date, produce_description. `inspection_report`: inspection_company, inspector_name, report_number, inspection_date, inspection_location, container_number, produce_description, total_pallets, overall_impression, overall_score, overall_impression_category, general_remarks, results (each with pallet_number, lot_code, produce_name, variety, calibre, score, recommendation, remarks, defects, photo_numbers). `arrival_notice`: carrier_name, bill_of_lading_number, container_numbers, vessel_arrival_date, free_time (each with applies_to, cargo_class, days, hours, basis, from_date, until_date, from_event, estimated, quote). `booking`: load_type, move_type, shipper, consignee, cargo_ready_date, departure_location and arrival_location (each with location_name and country), place_of_delivery, incoterm, po_number, package_count, package_unit, gross_weight_kg, volume_cbm, booking_reference, transport_type. `pre_alert`: forwarder_name, forwarder_reference, house_bill_of_lading, master_bill_of_lading, load_type, vessel, voyage, departure_location and arrival_location (each with location_name and country), etd, forwarder_arrival_date, shipper, consignee, incoterm, container_numbers, package_count, gross_weight_kg, volume_cbm. `warehouse_receipt`: warehouse_name, receipt_number, received_on, container_number, storage_location, supplier_name, total_boxes, total_pallets, lines (each with warehouse_pallet_number, pallet_number, batch_number, description, produce_name, variety, calibre, quality_category, pack_format, number_of_boxes, gross_weight_kg), allocations (each with pallet_number, batch_number, boxes, allocated_on, order_reference, customer). Fields may be added over time.

## Other responses

- `400`: A parameter or header is invalid (`invalid_parameter`, with `param` naming it), a customer link cannot be made for this shipment (`not_shareable`), an uploaded file is empty, over 50 MB or of a type Trackberry does not read (`file_empty`, `file_too_large`, `unsupported_file_type`), an upload's container number is on more than one live shipment (`ambiguous_container`), an `Idempotency-Key` was already used for a different request (`idempotency_key_reused`) or `Trackberry-Version` names an unpublished version (`invalid_version`, with `param` set to `Trackberry-Version`). A parameter that must be a single value but was sent as an array or hash (`status[]=x`, `q[a]=1`) is also a 400.
- `401`: No token was sent (`missing_token`) or the token is wrong, expired, revoked, or its user left the organization (`invalid_token`). The response has a `WWW-Authenticate` header.
- `403`: The token may not do this. `insufficient_scope`: a write endpoint was called with a read-only token. `read_only_member`: a write endpoint was called by a token whose owner is now a read-only member of the organization. `revoke_not_allowed`: the link can only be revoked by an admin or by the member who made it. `billing_blocked`: an upload needed a new shipment and the organization's billing does not allow one.
- `404`: No such object in this organization (`resource_missing`). This is also the answer for an id of another organization, an id with the wrong prefix, or a malformed id, so the API never confirms that an object exists elsewhere.
- `429`: A rate limit was hit (`rate_limited`). Wait the number of seconds in `Retry-After`. A BI feed answers the same way (`feed_in_progress`) when another feed for the organization is still being produced.

---

[API](https://skmtc.dev/trackberry/apis/trackberry-api.md) · [All operations](https://skmtc.dev/trackberry/apis/trackberry-api/llms.txt) · [OpenAPI document](https://skmtc.dev/trackberry/apis/trackberry-api/revisions/be06ee7c17f3?raw)
