CropPath cho nhà phát triển

Tài liệu API

Lược đồ dữ liệu

Mọi đối tượng API nhận hoặc trả về, theo tên.

AccountLinkAccept

object

Thuộc tính
TênKiểuMô tả
token
bắt buộc
string
password
bắt buộc
string

A new account's or a reset's new password (12 to 1,024 characters); for an email that already has an account, that account's password.

display_name
không bắt buộc
string | null

A new account's name; ignored for an existing account.

AccountLinkCreated

object

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
link
bắt buộc
string

The link, shown this once: the token is in the URL fragment (/login#invite=... or /login#reset=...), so it never reaches a server log. Only its SHA-256 is stored.

expires_at
bắt buộc
number

Unix seconds: 72 hours after creation for an invitation, 24 hours for a recovery link.

emailed
bắt buộc
boolean

#270. Whether CropPath queued this link's email to its person. False when this server sends no email, or when it cannot email this address (one SMTP cannot carry): the link must then be passed on by hand.

AccountLinkInfo

object

Thuộc tính
TênKiểuMô tả
purpose
bắt buộc
"invite" | "reset" | "admin_recovery"
company
bắt buộc
string

The company's name.

role
bắt buộc
"tenant_admin" | "operator" | "auditor" | "lab" | "agronomist"
email
bắt buộc
string

The account's email; it cannot be changed on the page.

expires_at
bắt buộc
number

Unix seconds.

account_exists
bắt buộc
boolean

Whether the email already has a CropPath account: the invitee then signs in with that account's password instead of choosing one.

AccountLinkToken

object

Thuộc tính
TênKiểuMô tả
token
bắt buộc
string

The token from the link's fragment.

AddressToCode

object

A record whose address is not coded by official administrative unit codes yet (#273, D5): the lot's packing house (facility), its growing area (growing_area) or the company profile (company_profile, in Viet Nam; code null, a company has one).

Thuộc tính
TênKiểuMô tả
kind
bắt buộc
"facility" | "growing_area" | "company_profile"
code
bắt buộc
string | null

The facility or growing-area code; null for the company profile.

AdminHealth

Health & object

What /healthz reports (Health) plus the database, the external timestamp authority and the issuer key store, for the admin health page. Each certificate's not_after is written in UTC with Z (e.g. 2030-01-02T03:04:05Z).

AdminInvitationCreate

object

Thuộc tính
TênKiểuMô tả
email
bắt buộc
string

The first admin's email: their sign-in name, not checked by any email.

display_name
không bắt buộc
string | null

Proposed as the new account's name; the invitee may change it.

reason
không bắt buộc
string | null

Why (one line). Required when the company already has an admin (admin recovery); written to the company's activity log.

AdminUnitCommune

object

A commune-level unit: a commune (xã), a ward (phường) or a special zone (đặc khu).

Thuộc tính
TênKiểuMô tả
code
bắt buộc
string

Its 5-digit official code.

name
bắt buộc
string

Its official name, with its unit word ("Xã", "Phường", "Đặc khu"), in Vietnamese.

kind
bắt buộc
"xã" | "phường" | "đặc khu"

AdminUnitCommunes

object

One province of a catalog version and its communes, by code.

Thuộc tính
TênKiểuMô tả
version
bắt buộc
string

The catalog version: vn- and the date of the official list it holds. Store it with every code taken from it.

valid_from
bắt buộc
string (date)

The day from which this version is the one for new input: the effective date of the newest resolution it reflects.

source
bắt buộc
AdminUnitSource
province
bắt buộc
AdminUnitProvince
communes
bắt buộc
array<AdminUnitCommune>

AdminUnitProvince

object

A province-level unit: a province (tỉnh) or a centrally governed city (thành phố trung ương).

Thuộc tính
TênKiểuMô tả
code
bắt buộc
string

Its 2-digit official code.

name
bắt buộc
string

Its official name, with its unit word ("Tỉnh", "Thành phố"), in Vietnamese.

kind
bắt buộc
"tỉnh" | "thành phố trung ương"

AdminUnitProvinces

object

The provinces of one catalog version, by code.

Thuộc tính
TênKiểuMô tả
version
bắt buộc
string

The catalog version: vn- and the date of the official list it holds. Store it with every code taken from it.

valid_from
bắt buộc
string (date)

The day from which this version is the one for new input: the effective date of the newest resolution it reflects.

source
bắt buộc
AdminUnitSource
provinces
bắt buộc
array<AdminUnitProvince>

AdminUnitSource

object

Who publishes the official list, credited with it.

Thuộc tính
TênKiểuMô tả
publisher
bắt buộc
string
url
bắt buộc
string (uri)

Agronomist

object

#351: a row of the platform's agronomist registry (control/agronomists.py). Personal data: a platform admin reads every row, the person their own; never on a public read.

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
user_id
bắt buộc
integer

The account.

email
bắt buộc
string
legal_name
bắt buộc
string

The name a signature names (snapshotted into each attestation).

organisation
bắt buộc
string
qualification
bắt buộc
string | null
contact
bắt buộc
string | null
note
bắt buộc
string | null
status
bắt buộc
"pending" | "verified" | "suspended"

pending until a platform admin verified the person outside the platform; only a verified agronomist signs; suspended signs nothing.

created_at
bắt buộc
number
updated_at
bắt buộc
number
verified_by
bắt buộc
string | null
verified_at
bắt buộc
number | null
suspended_by
bắt buộc
string | null
suspended_at
bắt buộc
number | null
suspend_reason
bắt buộc
string | null

AgronomistCreate

object

Thuộc tính
TênKiểuMô tả
email
bắt buộc
string

The account's email (the account must exist).

legal_name
bắt buộc
string
organisation
bắt buộc
string
qualification
không bắt buộc
string | null
contact
không bắt buộc
string | null
note
không bắt buộc
string | null

AgronomistPage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<Agronomist>
next_before
bắt buộc
integer | null

Pass as before for the next page.

AgronomistSuspend

object

Thuộc tính
TênKiểuMô tả
reason
bắt buộc
string

AgronomistVerify

object

Thuộc tính
TênKiểuMô tả
note
không bắt buộc
string | null

AgronomyAdvisory

object

#351: advice in words only: no digit (amounts and formulas come from a lab test).

Thuộc tính
TênKiểuMô tả
text
không bắt buộc
AgronomyLocalizedText
attachment_sha256
không bắt buộc
string
requires_lab_test
không bắt buộc
true

AgronomyEt0

object

Thuộc tính
TênKiểuMô tả
krs
không bắt buộc
number

FAO-56 eq. 50 adjustment coefficient. Sanity bounds only: the value is the agronomist's, never a CropPath default.

effective_rain_fraction
không bắt buộc
number

Share of the rain counted as effective. Sanity bounds only: the value is the agronomist's, never a CropPath default.

AgronomyFallbackRule

object

Thuộc tính
TênKiểuMô tả
rule_id
bắt buộc
integer
rule_name
bắt buộc
string
device_id
bắt buộc
string
zones
bắt buộc
array<integer>
reason
bắt buộc
string | null

AgronomyHome

object

#351: the agronomist's home in the selected company.

Thuộc tính
TênKiểuMô tả
generated_at
bắt buộc
number
now
bắt buộc
object

The drafts waiting for a signature, oldest first (at most 20).

today
bắt buộc
object

#352: today's control work resting on sheets the caller signed: the programs composed for today that cite one (newest first, at most 20) and the rules bound to one whose zones are on their fallback schedule.

status
bắt buộc
object

AgronomyLocalizedText

object

#351: a text in each language of the console (all three are needed to sign).

Thuộc tính
TênKiểuMô tả
vi
không bắt buộc
string
en
không bắt buộc
string
zh-Hans
không bắt buộc
string

AgronomyPhotoperiod

object

Thuộc tính
TênKiểuMô tả
start
không bắt buộc
string (date)
end
không bắt buộc
string (date)
night_start_local
không bắt buộc
string
duration_h
không bắt buộc
number

Lamp hours a night. Sanity bounds only: the value is the agronomist's, never a CropPath default.

min_confirmed_h
không bắt buộc
number

Confirmed hours needed, at most the duration. Sanity bounds only: the value is the agronomist's, never a CropPath default.

AgronomySalinity

object

#351: electrical conductivity in mS/cm only. A member named g_per_l (anywhere in the body) is refused: g/L is never used or converted.

Thuộc tính
TênKiểuMô tả
water_ec_limit_ms_cm
không bắt buộc
number

Irrigation water EC limit, mS/cm. Sanity bounds only: the value is the agronomist's, never a CropPath default.

soil_ec_limit_ms_cm
không bắt buộc
number

Soil EC limit, mS/cm. Sanity bounds only: the value is the agronomist's, never a CropPath default.

soil_ec_basis
không bắt buộc
"bulk" | "pore"
action
không bắt buộc
"block" | "alert"

AgronomySheet

object

#351: an agronomic input sheet of the company (control/sheets.py).

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
series_key
bắt buộc
string

<crop>:<variety>:<province>; * for every variety or province.

crop
bắt buộc
string

A code of the crop registry.

variety
bắt buộc
string
province_code
bắt buộc
string
version
bắt buộc
integer
status
bắt buộc
"draft" | "signed" | "superseded" | "revoked"
valid_from
bắt buộc
string (date) | null (date)
valid_to
bắt buộc
string (date) | null (date)
body_sha256
bắt buộc
string

The SHA-256 of the sheet's JCS document (GET .../document): what a signature covers.

created_by
bắt buộc
string
created_at
bắt buộc
number
updated_by
bắt buộc
string | null
updated_at
bắt buộc
number
copied_from_id
bắt buộc
integer | null
supersedes_id
bắt buộc
integer | null
superseded_by_id
bắt buộc
integer | null
signed_at
bắt buộc
number | null
superseded_at
bắt buộc
number | null
revoked_at
bắt buộc
number | null
revoked_by
bắt buộc
string | null
revoke_reason
bắt buộc
string | null
body
bắt buộc
AgronomySheetBody
attestation
bắt buộc
AgronomySheetAttestation | null

AgronomySheetAttestation

object

#351: a signature (append-only): who signed (snapshots of the registry row), the statement agreed to and the hash signed. An in-app attestation recorded by CropPath, not a detached digital signature (ADR 0014).

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
agronomist_id
bắt buộc
integer
user_id
bắt buộc
integer
legal_name
bắt buộc
string
organisation
bắt buộc
string
statement_version
bắt buộc
string
statement_text_sha256
bắt buộc
string
body_sha256
bắt buộc
string
signed_at
bắt buộc
number
second_factor_at
bắt buộc
number

When the session last proved a second factor.

AgronomySheetBody

object

#351: the agritrace.agronomy-sheet/1 body (control/sheets.py). Every value is optional in a draft and none has a default: CropPath ships no agronomic number.

Thuộc tính
TênKiểuMô tả
stages
không bắt buộc
array<AgronomyStage>
stress_windows
không bắt buộc
array<AgronomyStressWindow>
salinity
không bắt buộc
AgronomySalinity
et0
không bắt buộc
AgronomyEt0
lighting
không bắt buộc
object
advisory
không bắt buộc
object
references
không bắt buộc
array<object>

AgronomySheetCreate

object

Thuộc tính
TênKiểuMô tả
crop
bắt buộc
string
variety
không bắt buộc
string

* (the default) for every variety; no :.

province_code
không bắt buộc
string

* (the default) for every province.

valid_from
không bắt buộc
string (date) | null (date)
valid_to
không bắt buộc
string (date) | null (date)
body
không bắt buộc
AgronomySheetBody

AgronomySheetDocument

object

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
spec
bắt buộc
"agritrace.agronomy-sheet/1"
document
bắt buộc
string

The RFC 8785 (JCS) text of {spec, tenant, series_key, version, valid_from, valid_to, body}: hash its UTF-8 bytes to check sha256.

sha256
bắt buộc
string
statement
bắt buộc
object

AgronomySheetPage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<AgronomySheetSummary>
next_before
bắt buộc
integer | null

AgronomySheetRevoke

object

Thuộc tính
TênKiểuMô tả
reason
bắt buộc
string

AgronomySheetSign

object

Thuộc tính
TênKiểuMô tả
body_sha256
bắt buộc
string
statement_version
bắt buộc
string

AgronomySheetSummary

object

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
series_key
bắt buộc
string

<crop>:<variety>:<province>; * for every variety or province.

crop
bắt buộc
string

A code of the crop registry.

variety
bắt buộc
string
province_code
bắt buộc
string
version
bắt buộc
integer
status
bắt buộc
"draft" | "signed" | "superseded" | "revoked"
valid_from
bắt buộc
string (date) | null (date)
valid_to
bắt buộc
string (date) | null (date)
body_sha256
bắt buộc
string

The SHA-256 of the sheet's JCS document (GET .../document): what a signature covers.

created_at
bắt buộc
number
updated_at
bắt buộc
number
signed_at
bắt buộc
number | null
superseded_at
bắt buộc
number | null
revoked_at
bắt buộc
number | null
signed_by
bắt buộc
string | null

The signer's legal name.

AgronomySheetUpdate

object

Each member given replaces the draft's; one left out stays.

Thuộc tính
TênKiểuMô tả
valid_from
không bắt buộc
string (date) | null (date)
valid_to
không bắt buộc
string (date) | null (date)
body
không bắt buộc
AgronomySheetBody

AgronomyStage

object

#351: a crop stage. Every member is optional in a draft; signing needs code, name, start and end, and a value given in one stage given in every stage.

Thuộc tính
TênKiểuMô tả
code
không bắt buộc
string
name
không bắt buộc
AgronomyLocalizedText
start
không bắt buộc
string (date)
end
không bắt buộc
string (date)
kc
không bắt buộc
number

Crop coefficient. Sanity bounds only: the value is the agronomist's, never a CropPath default.

p_depletion
không bắt buộc
number

FAO-56 depletion fraction p. Sanity bounds only: the value is the agronomist's, never a CropPath default.

root_depth_m
không bắt buộc
number

Effective root depth, metres. Sanity bounds only: the value is the agronomist's, never a CropPath default.

schedule_mm_per_day
không bắt buộc
number

Scheduled irrigation depth, mm per day. Sanity bounds only: the value is the agronomist's, never a CropPath default.

moisture_lower_pct
không bắt buộc
number

Soil moisture band, lower edge (%), below the upper. Sanity bounds only: the value is the agronomist's, never a CropPath default.

moisture_upper_pct
không bắt buộc
number

Soil moisture band, upper edge (%). Sanity bounds only: the value is the agronomist's, never a CropPath default.

moisture_basis
không bắt buộc
object

What the band is read on.

AgronomyStressWindow

object

Thuộc tính
TênKiểuMô tả
start
không bắt buộc
string (date)
end
không bắt buộc
string (date)
action
không bắt buộc
"no_irrigation" | "cap_fraction" | "max_mm_per_day"
fraction
không bắt buộc
number

With cap_fraction: the share of the scheduled depth kept. Sanity bounds only: the value is the agronomist's, never a CropPath default.

max_mm_per_day
không bắt buộc
number

With max_mm_per_day: the cap, mm per day. Sanity bounds only: the value is the agronomist's, never a CropPath default.

note
không bắt buộc
string

AgronomyTodayProgram

object

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
device_id
bắt buộc
string
status
bắt buộc
"proposed" | "approved" | "rejected" | "dispatched" | "superseded" | "failed" | "blocked" | "expired" | "withdrawn"
proposed_at
bắt buộc
number
sheets
bắt buộc
array<object>

AlarmAck

object

Thuộc tính
TênKiểuMô tả
note
không bắt buộc
string

Optional: what the person did or will do.

AlarmCounts

object

#361: how many open alarms the caller may read, over every page: urgent, warning and notice count the ones not shelved, shelved the shelved ones of every priority.

Thuộc tính
TênKiểuMô tả
urgent
bắt buộc
integer
warning
bắt buộc
integer
notice
bắt buộc
integer
shelved
bắt buộc
integer

AlarmDetail

object

#361: an alarm (AlarmView) with its history: events, oldest first, at most the 100 newest (events_truncated when older ones exist).

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
kind
bắt buộc
string

The catalog kind (catalog v1: command_refused_security, controller_fault, delivered_over_limit, sheet_hash_mismatch, controller_offline, program_not_installed, command_refused_site, run_no_water, step_missed, rule_blocked, salinity_block, rule_on_fallback, probe_stale_in_use, moisture_outside_band). The catalog grows under management of change (the philosophy), so a client words an unknown kind by its token.

catalog_version
bắt buộc
integer

The catalog version the alarm was raised under.

priority
bắt buộc
"urgent" | "warning" | "notice"
state
bắt buộc
"active_unacked" | "active_acked" | "cleared_unacked" | "shelved" | "closed"
raised_at
bắt buộc
string (date-time)

When the condition was first raised (after its on-delay).

last_active_at
bắt buộc
string (date-time)

When the condition was last seen true.

cleared_at
bắt buộc
string (date-time) | null (date-time)

When the condition returned to normal (after its clear-delay); null while active. A re-raise within 30 minutes of clearing (not closed) reuses the alarm and empties it again.

closed_at
bắt buộc
string (date-time) | null (date-time)
occurrences
bắt buộc
integer

How many times the condition was raised on this alarm (chatter control).

acked
bắt buộc
object | null
shelved
bắt buộc
object | null

The current shelving, null when the alarm is not shelved (or its shelving ended).

subject
bắt buộc
object
detail
bắt buộc
object

Facts the platform observed (the command id and its refusal reason, the measured litres and the command's max_volume_l, the controller's faults, when its gateway was last heard), at most 2 KB, never coordinates.

response_anchor
bắt buộc
string

The anchor of the alarm's documented response in the alarm philosophy (the kind).

under
bắt buộc
integer | null

Suppression by design, computed when read: the id of the open controller_offline alarm of the same controller this alarm is shown under; null otherwise.

events
bắt buộc
array<AlarmEvent>
events_truncated
bắt buộc
boolean

AlarmEvent

object

#361: one change of an alarm's state (alarm_events, append-only).

Thuộc tính
TênKiểuMô tả
at
bắt buộc
string (date-time)
event
bắt buộc
"raised" | "reraised" | "cleared" | "acked" | "shelved" | "unshelved" | "shelve_expired" | "closed"
actor
bắt buộc
string | null

The person (display name, or sign-in when they have none), or system for the evaluator. Null for a person when an agronomist reads it (#363).

reason
bắt buộc
string | null

A code only: for shelved, the shelving's reason code (maintenance, technician_called, known_issue, equipment_off or other); null for every other event. The acknowledgement's note and the shelving's note are the alarm's (acked.note, shelved.note), never the history's, so they can be erased with the person's data.

AlarmPage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<AlarmView>
next_cursor
bắt buộc
string | null

The next page's cursor; null on the last page.

counts
bắt buộc
AlarmCounts | null

With state=open: the open alarms the caller may read, by priority, over every page (not this page only); null with state=closed.

AlarmShelve

object

Thuộc tính
TênKiểuMô tả
until
bắt buộc
string (date-time)

When the shelving ends: in the future, and at most 12 hours ahead for an urgent alarm, 72 hours for a warning or a notice.

reason
bắt buộc
"maintenance" | "technician_called" | "known_issue" | "equipment_off" | "other"
note
không bắt buộc
string

Free text; required when reason is other.

AlarmView

object

#361 (ADR 0015, the alarm philosophy): one alarm of the company, a condition with a lifecycle (control/cockpit/alarms). Its state is derived from the stored times: closed once closed (cleared and acknowledged, or a notice cleared), else shelved while shelved.until is ahead, else active_unacked, active_acked or cleared_unacked. Times are RFC 3339 UTC.

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
kind
bắt buộc
string

The catalog kind (catalog v1: command_refused_security, controller_fault, delivered_over_limit, sheet_hash_mismatch, controller_offline, program_not_installed, command_refused_site, run_no_water, step_missed, rule_blocked, salinity_block, rule_on_fallback, probe_stale_in_use, moisture_outside_band). The catalog grows under management of change (the philosophy), so a client words an unknown kind by its token.

catalog_version
bắt buộc
integer

The catalog version the alarm was raised under.

priority
bắt buộc
"urgent" | "warning" | "notice"
state
bắt buộc
"active_unacked" | "active_acked" | "cleared_unacked" | "shelved" | "closed"
raised_at
bắt buộc
string (date-time)

When the condition was first raised (after its on-delay).

last_active_at
bắt buộc
string (date-time)

When the condition was last seen true.

cleared_at
bắt buộc
string (date-time) | null (date-time)

When the condition returned to normal (after its clear-delay); null while active. A re-raise within 30 minutes of clearing (not closed) reuses the alarm and empties it again.

closed_at
bắt buộc
string (date-time) | null (date-time)
occurrences
bắt buộc
integer

How many times the condition was raised on this alarm (chatter control).

acked
bắt buộc
object | null
shelved
bắt buộc
object | null

The current shelving, null when the alarm is not shelved (or its shelving ended).

subject
bắt buộc
object
detail
bắt buộc
object

Facts the platform observed (the command id and its refusal reason, the measured litres and the command's max_volume_l, the controller's faults, when its gateway was last heard), at most 2 KB, never coordinates.

response_anchor
bắt buộc
string

The anchor of the alarm's documented response in the alarm philosophy (the kind).

under
bắt buộc
integer | null

Suppression by design, computed when read: the id of the open controller_offline alarm of the same controller this alarm is shown under; null otherwise.

Alert

object

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
tenant
bắt buộc
string | null
kind
bắt buộc
string
severity
bắt buộc
string
device_id
bắt buộc
string | null
envelope_id
bắt buộc
string | null
detail
bắt buộc
object

Shape depends on kind (for example reasons, or from and to for a sequence gap).

created_at
bắt buộc
number

Unix seconds.

resolved_at
bắt buộc
number | null

Unix seconds; null while open.

AlertResolution

object

Thuộc tính
TênKiểuMô tả
note
không bắt buộc
string | null

Why the alert is resolved, at most 500 characters (after trimming). Kept in the audit row of the request, not on the alert.

AnchorEvidenceRecord

object

INTEGRITY-2 (#202): an evidence envelope's record in its day's evidence tree, fields in encoding order. It names no device: the SHA-256 of the stored body commits to the device and its sequence number.

Thuộc tính
TênKiểuMô tả
id
bắt buộc
string

The envelope id (the EPCIS eventID without urn:uuid:).

received_at
bắt buộc
number

Reception time, Unix seconds (encoded as binary64).

payload_sha256
bắt buộc
string

SHA-256 of the stored envelope body as UTF-8.

AnchorInclusionProof

object

INTEGRITY-2 (#202): the inclusion proof of one record in its day's anchor. Recompute the leaf from record (the canonical encoding of /developers/downloads/integrity-anchors.md), follow path (RFC 9162 section 2.1.3.2, leaf side first) to the anchor's root of kind (seal_root or evidence_root), then the anchor from its roots; compare the anchor with the one GET /v1/public/anchors publishes for day (/developers/downloads/verify_anchors.py proof does all of it). included is false when the record as stored today is not among the anchored ones (it was changed after its day was anchored); path is then empty.

Thuộc tính
TênKiểuMô tả
kind
bắt buộc
"seal" | "evidence"
day
bắt buộc
string
record
bắt buộc
AnchorSealRecord | AnchorEvidenceRecord

The record's fields in encoding order: an AnchorSealRecord for seal, an AnchorEvidenceRecord for evidence.

leaf_hash
bắt buộc
string
included
bắt buộc
boolean
leaf_index
bắt buộc
integer | null
tree_size
bắt buộc
integer
path
bắt buộc
array<string>
anchor
bắt buộc
IntegrityAnchor

AnchorSealRecord

object

INTEGRITY-2 (#202): a lot seal's record in its day's seal tree, fields in encoding order.

Thuộc tính
TênKiểuMô tả
manifest_sha256
bắt buộc
string

The seal's manifest hash, as the public lot record shows it.

sealed_at
bắt buộc
number

Seal time, Unix seconds (encoded as binary64).

fruit_count
bắt buộc
integer
event_count
bắt buộc
integer

Announcement

object

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
text
bắt buộc
string

Plain text, one line.

level
bắt buộc
"info" | "warning"
starts_at
bắt buộc
number

Shown from this time (seconds since 1970, UTC).

ends_at
bắt buộc
number | null

Shown until this time; null until expired.

state
bắt buộc
"live" | "scheduled" | "ended"

scheduled before starts_at; ended once expired or past ends_at.

created_at
bắt buộc
number
created_by
bắt buộc
string
expired_at
bắt buộc
number | null
expired_by
bắt buộc
string | null

AnnouncementCreate

object

Thuộc tính
TênKiểuMô tả
text
bắt buộc
string

1 to 500 characters after trimming, one line, plain text.

level
không bắt buộc
"info" | "warning"
starts_at
không bắt buộc
number | null

When it starts showing (default now; a past time means now); at most a year ahead.

ends_at
không bắt buộc
number | null

When it stops showing: later than the start and at most a year after it; null shows it until expired.

AnnouncementPage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<Announcement>
next_cursor
bắt buộc
string | null

The next page's cursor; null on the last.

ApiToken

object

A machine API token of the tenant as the admin console lists it: never the token itself, never its hash (only its SHA-256 is stored; the token is shown once, by POST /v1/api-tokens). Unix seconds.

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
name
bắt buộc
string

The operator's label (not unique).

role
bắt buộc
"platform_admin" | "tenant_admin" | "operator" | "lab" | "auditor"

The role the token acts with (tokens made with the users CLI may hold any role).

created_by
bắt buộc
string | null

Who created it: a user's email, or cli.

created_at
bắt buộc
number
last_used_at
bắt buộc
number | null

The last authenticated use, to the minute; null: never.

expires_at
bắt buộc
number | null

null: never expires.

revoked_at
bắt buộc
number | null
revoke_reason
bắt buộc
string | null
revoked_by
bắt buộc
string | null
status
bắt buộc
"active" | "expired" | "revoked"

At the server clock: revoked, else expired once expires_at passed, else active.

ApiTokenCreate

object

role: operator, auditor or tenant_admin (platform_admin and lab tokens are made with the users CLI only). expires_in_days: whole days from 1 to 3650; absent or null, the token never expires.

Thuộc tính
TênKiểuMô tả
name
bắt buộc
string
role
bắt buộc
"tenant_admin" | "operator" | "auditor"
expires_in_days
không bắt buộc
integer | null

ApiTokenCreated

object

The new token and, in secret, the token itself: this response is the only place it ever appears (Authorization: Bearer <secret>). Store it now; a lost token is revoked and replaced.

Thuộc tính
TênKiểuMô tả
token
bắt buộc
ApiToken
secret
bắt buộc
string

ApiTokenPage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<ApiToken>
next_cursor
bắt buộc
string | null

The next page's cursor; null on the last.

ApiTokenRevoke

object

Thuộc tính
TênKiểuMô tả
reason
bắt buộc
string

Why it is revoked, one line (e.g. leaked, no longer used).

ApprovalRequest

object

INTEGRITY-3 (#203). A critical action one admin asked for, waiting for (or decided by) another admin of the company. body is the action's JSON body (public keys, grading rules or a yes/no: never a secret). status expired: it was not decided within 72 hours and can no longer be.

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
action
bắt buộc
string

The action's audit action, e.g. key.create, grading_rule.update.

method
bắt buộc
"POST" | "PUT"
path
bắt buộc
string

The path the action calls.

body
bắt buộc
object

The action's JSON body.

status
bắt buộc
"pending" | "approved" | "rejected" | "expired"
requested_by
bắt buộc
string

Who asked (their sign-in email).

requested_by_user_id
bắt buộc
integer
requested_at
bắt buộc
number

Unix seconds.

expires_at
bắt buộc
number

Unix seconds: a pending request can be decided until then.

decided_by
bắt buộc
string | null
decided_as
bắt buộc
"company_admin" | "platform_support" | null

platform_support: CropPath support decided, acting for the company.

decided_at
bắt buộc
number | null
reason
bắt buộc
string | null

A rejection's reason.

ApprovalRequestApproved

object

Thuộc tính
TênKiểuMô tả
request
bắt buộc
ApprovalRequest
result
bắt buộc
object

The action's own answer, as if it had been called directly.

ApprovalRequestCreate

object

Thuộc tính
TênKiểuMô tả
method
bắt buộc
"POST" | "PUT"
path
bắt buộc
string

The critical action's path, without a query.

body
không bắt buộc
object

The action's JSON body (default {}).

ApprovalRequestPage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<ApprovalRequest>
next_cursor
bắt buộc
string | null

The next page's cursor; null on the last.

ApprovalRequestRejection

object

Thuộc tính
TênKiểuMô tả
reason
không bắt buộc
string

AreaMassBalance

object

Harvested against shipped kg of a growing area in a season, across all tenants (aggregates only).

Thuộc tính
TênKiểuMô tả
growing_area
bắt buộc
string
season
bắt buộc
string
harvested_kg
bắt buộc
number

Accepted harvest and receive envelopes (as the volume) plus the self-declared harvest declarations of the season.

declared_kg
bắt buộc
number

Of which tenant-entered harvest declarations (source self_declared).

shipped_kg
bắt buộc
number

Packed net mass of the area's packed lots of the season.

packed_lots
bắt buộc
integer
violation
bắt buộc
"harvest_not_declared" | "shipped_exceeds_harvest" | null

harvest_not_declared: nothing declared; shipped_exceeds_harvest: more packed than harvested; null when the balance holds.

AttachmentPeaks

object

Waveform peaks: n buckets of [min, max] (normalised to -1..1) over all channels.

Thuộc tính
TênKiểuMô tả
sha256
bắt buộc
string
n
bắt buộc
integer

Buckets returned.

channels
bắt buộc
integer
sample_rate
bắt buộc
integer
frames
bắt buộc
integer
duration_s
bắt buộc
number
peaks
bắt buộc
array<array<number>>

AttachmentStored

object

An uploaded blob as stored for its owner.

Thuộc tính
TênKiểuMô tả
sha256
bắt buộc
string
media_type
bắt buộc
"application/pdf" | "audio/wav" | "image/jpeg" | "image/png"
size
bắt buộc
integer

AuditEntry

object

One append-only audit row. No column ever holds a password, a session, API or CSRF token, a cookie or a raw IP address.

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer

Increasing row id; the list is ordered by it, newest first.

at
bắt buộc
number

Unix seconds.

actor
bắt buộc
string | null

The principal's user (email, token:<name> or legacy user); null for a failed login.

tenant
bắt buộc
string | null
action
bắt buộc
string

For example auth.login, auth.logout, auth.password.change, envelope.review or device.command.issue; .failed is appended when the request answered 400 or more.

entity
bắt buộc
string

user, session, envelope or device.

entity_id
bắt buộc
string | null

The record's id; for a failed login an HMAC of the normalized email, never the email.

before_hash
bắt buộc
string | null

SHA-256 hex of the canonical JSON (sorted keys, compact) of the changed fields' prior state; null when no existing record changed or the request failed.

after
bắt buộc
object | null

Outcome: the HTTP status, plus the error code on failure or a short summary on success. A row the server's command line (cli:*) wrote before #188 has no status; newer ones carry the status the API would have answered (201 for a create, 200 otherwise).

request_id
bắt buộc
string | null

The request's X-Request-Id.

ip_hash
bắt buộc
string | null

HMAC-SHA256 of the client IP.

actor_kind
bắt buộc
"member" | "support" | "api_token" | "api_client" | "server" | "other"

Who the actor is (SELF-1-7, #188): member a signed-in user of the company (by email), support CropPath staff (a platform admin) acting for the company, api_token an API token (token:<name>), api_client an API client (oauth:<client_id>), server the server's command line (cli:*), other anything else (a configured token, or no actor).

actor_name
bắt buộc
string | null

A member's current display name, an API token's name or the API client's name; null when there is none (support staff are named by their email in actor).

AuditPage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<AuditEntry>
next_cursor
bắt buộc
string | null

Pass as cursor for the next (older) page; null on the last page.

AuthSession

object

Thuộc tính
TênKiểuMô tả
user
bắt buộc
User
memberships
bắt buộc
array<Membership>
csrf_token
bắt buộc
string
two_factor
không bắt buộc
TwoFactorState

BackupCodes

object

SELF-1-6 (#187). Ten single-use backup codes (80 random bits each, base32, grouped by four for reading aloud), in this response only; CropPath keeps only slow hashes of them.

Thuộc tính
TênKiểuMô tả
backup_codes
bắt buộc
array<string>

BatchCount

object

Thuộc tính
TênKiểuMô tả
count
bắt buộc
integer

How many records to create (at most 1,000).

BatchItemError

object

One failed item of a batch request.

Thuộc tính
TênKiểuMô tả
index
bắt buộc
integer

The item's position in the request (from 0).

status
bắt buộc
integer

The status the single-item route answers for this item.

error
bắt buộc
string
code
bắt buộc
string

BoundaryWalk

object

#248: one walk with its outline and its raw track.

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer

The walk's id.

growing_area
bắt buộc
string
client_walk_id
bắt buộc
string (uuid)
submitted_by
bắt buộc
string | null

Who sent the walk.

submitted_at
bắt buộc
number

Unix seconds when the walk was received.

started_at
bắt buộc
number

Unix seconds when the walk started (the phone's clock).

finished_at
bắt buộc
number

Unix seconds when the walk finished (the phone's clock).

accuracy_threshold_m
bắt buộc
number

The accuracy threshold of the walk in metres.

polygon_sha256
bắt buộc
string

SHA-256 (hex) of the outline's canonical GeoJSON text (compact, sorted keys, UTF-8): the SHA-256 of the boundary proposal the walk made, and of the version it becomes once a platform admin approves it.

area_ha
bắt buộc
number

The walked area in hectares: the ring area on a sphere of the WGS 84 equatorial radius, as the admin console computes a boundary's area.

registered_area_ha
bắt buộc
number | null

The growing area's registered area_ha when the walk was received.

area_difference_ratio
bắt buộc
number | null

(area_ha - registered_area_ha) / registered_area_ha: negative when the walk found less than registered; null without a registered size.

points_total
bắt buộc
integer

Fixes in the raw track.

points_kept
bắt buộc
integer

Fixes whose accuracy is within the walk's threshold (they may back the outline).

points_dropped
bắt buộc
integer

Fixes less precise than the threshold (kept in the track, never in the outline).

superseded
bắt buộc
boolean

Whether the walk replaced a boundary proposal that was waiting.

polygon
bắt buộc
GeoJsonPolygon
points
bắt buộc
array<array<number>>

The raw track: every fix taken during the walk, the imprecise ones included, at most 20000 (and the whole body at most 1 MiB).

BoundaryWalkCreate

object

#248: a walk around a growing area: the simplified outline and the raw track it came from.

Thuộc tính
TênKiểuMô tả
client_walk_id
bắt buộc
string (uuid)

A UUID in lower case chosen by the phone for this walk: sending the same walk again with it is safe.

polygon
bắt buộc
GeoJsonPolygon

The outline: a Polygon of exactly one closed ring, at most 1000 positions, at least 3 different corners, not crossing itself, at least 0.01 ha, each corner one of points with an accuracy within the threshold.

accuracy_threshold_m
bắt buộc
number

Fixes less precise than this (metres) were not used for the outline.

started_at
bắt buộc
number

Unix seconds when the walk started; at most 300 s ahead of the server.

finished_at
bắt buộc
number

Unix seconds when the walk finished; not before started_at.

points
bắt buộc
array<array<number>>

The raw track: every fix taken during the walk, the imprecise ones included, at most 20000 (and the whole body at most 1 MiB).

BoundaryWalkPage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<BoundaryWalkSummary>

Newest first.

next_cursor
bắt buộc
string | null

BoundaryWalkResult

object

#248: what a submitted walk answers; the same walk sent again answers the same.

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer

The walk's id.

polygon_sha256
bắt buộc
string

SHA-256 (hex) of the outline's canonical GeoJSON text (compact, sorted keys, UTF-8): the SHA-256 of the boundary proposal the walk made, and of the version it becomes once a platform admin approves it.

area_ha
bắt buộc
number

The walked area in hectares: the ring area on a sphere of the WGS 84 equatorial radius, as the admin console computes a boundary's area.

registered_area_ha
bắt buộc
number | null

The growing area's registered area_ha when the walk was received.

area_difference_ratio
bắt buộc
number | null

(area_ha - registered_area_ha) / registered_area_ha: negative when the walk found less than registered; null without a registered size.

points_total
bắt buộc
integer

Fixes in the raw track.

points_kept
bắt buộc
integer

Fixes whose accuracy is within the walk's threshold (they may back the outline).

points_dropped
bắt buộc
integer

Fixes less precise than the threshold (kept in the track, never in the outline).

superseded
bắt buộc
boolean

Whether the walk replaced a boundary proposal that was waiting.

BoundaryWalkSummary

object

#248: a walk kept as the evidence of a boundary proposal, without its track. It is the evidence of the proposal and of the boundary version with the same polygon_sha256.

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer

The walk's id.

growing_area
bắt buộc
string
client_walk_id
bắt buộc
string (uuid)
submitted_by
bắt buộc
string | null

Who sent the walk.

submitted_at
bắt buộc
number

Unix seconds when the walk was received.

started_at
bắt buộc
number

Unix seconds when the walk started (the phone's clock).

finished_at
bắt buộc
number

Unix seconds when the walk finished (the phone's clock).

accuracy_threshold_m
bắt buộc
number

The accuracy threshold of the walk in metres.

polygon_sha256
bắt buộc
string

SHA-256 (hex) of the outline's canonical GeoJSON text (compact, sorted keys, UTF-8): the SHA-256 of the boundary proposal the walk made, and of the version it becomes once a platform admin approves it.

area_ha
bắt buộc
number

The walked area in hectares: the ring area on a sphere of the WGS 84 equatorial radius, as the admin console computes a boundary's area.

registered_area_ha
bắt buộc
number | null

The growing area's registered area_ha when the walk was received.

area_difference_ratio
bắt buộc
number | null

(area_ha - registered_area_ha) / registered_area_ha: negative when the walk found less than registered; null without a registered size.

points_total
bắt buộc
integer

Fixes in the raw track.

points_kept
bắt buộc
integer

Fixes whose accuracy is within the walk's threshold (they may back the outline).

points_dropped
bắt buộc
integer

Fixes less precise than the threshold (kept in the track, never in the outline).

superseded
bắt buộc
boolean

Whether the walk replaced a boundary proposal that was waiting.

BrokerAuthzRequest

object

Missing fields are treated as empty strings (and denied).

Thuộc tính
TênKiểuMô tả
username
không bắt buộc
string
action
không bắt buộc
string
topic
không bắt buộc
string

BrokerAuthzResult

object

Thuộc tính
TênKiểuMô tả
result
bắt buộc
"allow" | "deny"

Calibration

object

SENS-B1d (#234): a calibration record of a device, never changed once recorded. Ingest links each reading of the device to the calibration in force at its time (calibration_id of the reading record): the latest not superseded, made at or before the reading, covering the reading's capability or every capability of the device; when its valid_until is before the reading, the reading is flagged suspect (QC flag 3, reason calibration_expired).

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
device_id
bắt buộc
string
sensor_serial
bắt buộc
string | null
capability
bắt buộc
string | null

The capability covered; null: every capability of the device.

calibrated_at
bắt buộc
number
method
bắt buộc
"ph_buffers" | "ec_reference" | "lab_correlation" | "factory" | "other"
reference_values
bắt buộc
object | array<any> | null
coefficients
bắt buộc
object | array<any> | null
performer
bắt buộc
string
accreditation
bắt buộc
"iso17025_lab" | "in_house" | "manufacturer"
certificate_sha256
bắt buộc
string | null

SHA-256 of the certificate, readable with GET /v1/attachments/{sha256}.

valid_until
bắt buộc
number
supersedes
bắt buộc
integer | null

The calibration this one corrects.

created_at
bắt buộc
number
created_by
không bắt buộc
string

Who recorded it; present for platform admins only.

superseded_by
bắt buộc
integer | null

The calibration that corrects this one; null while it is not corrected.

CalibrationCertificate

object

SENS-B1d (#234): a calibration certificate sent with the calibration. Its bytes must hash to the calibration's certificate_sha256; it is then kept as an upload of the company, as one sent with PUT /v1/attachments/{sha256} would be.

Thuộc tính
TênKiểuMô tả
media_type
bắt buộc
"application/pdf" | "image/jpeg" | "image/png"
content_base64
bắt buộc
string

The certificate's bytes, standard base64 (RFC 4648 §4, with padding), at most 1 MiB decoded (and within the 1 MiB request body).

CalibrationCreate

object

SENS-B1d (#234): a calibration of a device of the company (GLOBALG.A.P. IFA v6 FV-GFS 13.01: measuring equipment calibrated at least yearly, traceably). Times are Unix seconds: calibrated_at from 2020-01-01 and at most 300 s ahead of the server clock, valid_until after it and at most about five years (5 × 366 days) later. The certificate is either uploaded first with PUT /v1/attachments/{sha256} for the same company (a PDF, JPEG or PNG) and named by certificate_sha256, or sent in certificate with certificate_sha256, which its bytes must hash to. A correction is a new calibration naming the one it corrects in supersedes; nothing is ever edited.

Thuộc tính
TênKiểuMô tả
sensor_serial
không bắt buộc
string

The serial of the probe calibrated, when the device carries several.

capability
không bắt buộc
string

The capability the calibration covers: one of the vocabulary's, or an x- extension. Absent: every capability of the device.

calibrated_at
bắt buộc
number

When the calibration was done.

method
bắt buộc
"ph_buffers" | "ec_reference" | "lab_correlation" | "factory" | "other"

ph_buffers: pH buffer solutions (e.g. 4, 7 and 10); ec_reference: an EC reference solution; lab_correlation: against a laboratory analysis; factory: the manufacturer's calibration; other.

reference_values
không bắt buộc
object | array<any>

The reference values used (e.g. the buffers' pH): a JSON object or array of at most 4096 bytes, nested at most 4 deep, finite numbers only, strings of at most 200 characters.

coefficients
không bắt buộc
object | array<any>

The coefficients found (e.g. slope and offset), with the same bounds as reference_values.

performer
bắt buộc
string

Who calibrated: a laboratory, a technician or the manufacturer.

accreditation
bắt buộc
"iso17025_lab" | "in_house" | "manufacturer"

iso17025_lab: a laboratory accredited to ISO/IEC 17025; in_house: the company itself; manufacturer.

certificate_sha256
không bắt buộc
string

SHA-256 of the calibration certificate (PDF, JPEG or PNG).

certificate
không bắt buộc
CalibrationCertificate
valid_until
bắt buộc
number

Until when the calibration is valid: after calibrated_at. A reading made later, while this calibration is the device's latest, is flagged suspect (calibration_expired).

supersedes
không bắt buộc
integer

The id of a calibration of the same device that this one corrects; a calibration is superseded once at most.

Calibrations

object

SENS-B1d (#234): a device's calibrations, newest first (by calibrated_at, then id), at most 1000.

Thuộc tính
TênKiểuMô tả
device_id
bắt buộc
string
items
bắt buộc
array<Calibration>

CapturedEvent

object

An EPCIS event a partner captured: its statement, Self-declared.

Thuộc tính
TênKiểuMô tả
event_id
bắt buộc
string

The EPCIS eventID.

capture_id
bắt buộc
integer

The capture that stored it.

event_type
bắt buộc
"ObjectEvent" | "AggregationEvent" | "TransformationEvent"
biz_step
bắt buộc
"commissioning" | "receiving" | "packing" | "shipping" | "sensor_reporting"

The CBV business step (bare term).

step
bắt buộc
"harvest" | "receive" | "pack" | "ship" | "observe"

The journey step the event records: commissioning is the harvest, receiving, packing, shipping; sensor_reporting (#238) is an observation (observe).

action
bắt buộc
"ADD" | "OBSERVE" | null

The EPCIS action; null for a TransformationEvent.

event_time
bắt buộc
string

eventTime as sent (RFC 3339).

event_time_zone_offset
bắt buộc
string

eventTimeZoneOffset as sent.

read_point
bắt buộc
string | null

readPoint.id as sent.

biz_location
bắt buộc
string | null

bizLocation.id as sent.

source
bắt buộc
"partner_capture"
tier
bắt buộc
"self_declared"
captured_by
bắt buộc
string

Opaque operator id of the capturing principal.

captured_at
bắt buộc
number

Capture time, Unix seconds.

references
bắt buộc
array<object>

The tenant's records the event names.

CapturedEventPage

object

Thuộc tính
TênKiểuMô tả
lot
bắt buộc
string

The lot code.

items
bắt buộc
array<CapturedEvent>
next_cursor
bắt buộc
string | null

Cursor of the next page; null on the last.

Carton

object

A carton of one lot (issue #37); its contents are fruits of that lot.

Thuộc tính
TênKiểuMô tả
tenant
bắt buộc
string
code
bắt buộc
string

C-<lot seq>-<carton number>.

lot
bắt buộc
string

Code of the carton's lot.

carton_no
bắt buộc
integer

Number within the lot.

public_id
bắt buộc
string

128 random bits as hex.

qr_url
bắt buộc
string

What the carton label's QR code carries (ADR 0004): a GS1 Digital Link <resolver>/01/<gtin>/10/<lot>/21/<serial> when the lot has a GTIN and a lot code of at most 20 characters (GS1 AI 10), else <resolver>/q/<public_id>.

net_mass_kg
bắt buộc
number | null

Weighed net mass; null until the contents are set.

fruit_count
bắt buộc
integer
fruit_mass_kg
bắt buộc
number

Sum of the measured (scale) weights of its fruits, 3 decimals.

labels_printed_at
bắt buộc
number

Unix seconds: the carton label's print time (creation).

created_by
bắt buộc
string
created_at
bắt buộc
number

Unix seconds.

updated_at
bắt buộc
number

Unix seconds.

CartonBatchResult

object

The cartons a batch created, by number.

Thuộc tính
TênKiểuMô tả
batch_id
bắt buộc
integer

The stored batch request's id.

count
bắt buộc
integer
items
bắt buộc
array<CartonDetail>

In request order.

CartonContents

object

What the carton holds, replacing its previous contents.

Thuộc tính
TênKiểuMô tả
fruits
bắt buộc
array<string>

Codes of packable fruits of the carton's lot (status recorded or overridden, grade A or B), each in no other carton.

net_mass_kg
bắt buộc
number

The carton's weighed net mass.

CartonContentsBatch

object

Up to 1,000 cartons of the lot, applied in order.

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<CartonContentsBatchItem>

CartonContentsBatchItem

object

One carton's new contents, replacing its previous ones.

Thuộc tính
TênKiểuMô tả
carton
bắt buộc
string

A carton of the path's lot; at most once per batch.

fruits
bắt buộc
array<string>

Codes of packable fruits of the carton's lot (status recorded or overridden, grade A or B), each in no other carton.

net_mass_kg
bắt buộc
number

The carton's weighed net mass.

CartonContentsBatchResult

object

The cartons as a batch left them, in request order.

Thuộc tính
TênKiểuMô tả
batch_id
bắt buộc
integer

The stored batch request's id.

count
bắt buộc
integer
items
bắt buộc
array<CartonDetail>

In request order.

CartonCreate

object

No fields: the number, code and ids are the server's; the contents come with PUT .../fruits.

CartonDetail

object

A carton with the codes of its fruits (by fruit number).

Thuộc tính
TênKiểuMô tả
tenant
bắt buộc
string
code
bắt buộc
string

C-<lot seq>-<carton number>.

lot
bắt buộc
string

Code of the carton's lot.

carton_no
bắt buộc
integer

Number within the lot.

public_id
bắt buộc
string

128 random bits as hex.

qr_url
bắt buộc
string

What the carton label's QR code carries (ADR 0004): a GS1 Digital Link <resolver>/01/<gtin>/10/<lot>/21/<serial> when the lot has a GTIN and a lot code of at most 20 characters (GS1 AI 10), else <resolver>/q/<public_id>.

net_mass_kg
bắt buộc
number | null

Weighed net mass; null until the contents are set.

fruit_count
bắt buộc
integer
fruit_mass_kg
bắt buộc
number

Sum of the measured (scale) weights of its fruits, 3 decimals.

labels_printed_at
bắt buộc
number

Unix seconds: the carton label's print time (creation).

created_by
bắt buộc
string
created_at
bắt buộc
number

Unix seconds.

updated_at
bắt buộc
number

Unix seconds.

fruits
bắt buộc
array<string>

CartonPage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<Carton>
next_cursor
bắt buộc
string | null

Pass as cursor for the next page; null on the last page.

CertificateStatus

object

Thuộc tính
TênKiểuMô tả
path
bắt buộc
string
subject
bắt buộc
string
not_after
bắt buộc
string (date-time)
remaining_s
bắt buộc
integer
remaining_fraction
bắt buộc
number
expired
bắt buộc
boolean

Certification

object

A certification of a growing area (e.g. VietGAP). It is verified when its scheme is one of the fixed list (see CertificationCreate), it has an issuer and an evidence_sha256, and a GLOBALG.A.P. number is a GGN; otherwise (e.g. a record written before #156, or sent without them) it is unverified and never counts towards a lot's trust tier.

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
growing_area
bắt buộc
string
scheme
bắt buộc
string
number
bắt buộc
string
issuer
bắt buộc
string | null
valid_from
bắt buộc
string (date)
valid_to
bắt buộc
string (date)
evidence_sha256
bắt buộc
string | null
created_at
bắt buộc
number

Unix seconds.

status
bắt buộc
"valid" | "expired" | "not_yet_valid"

Against today's UTC date.

verified
không bắt buộc
boolean

#269 review, with listCertifications verified=1 only: whether the server counts this certification as verified (the rule of this object's description; also false for an ISO 22000, FSSC 22000, BRCGS or IFS certification recorded on the growing area since these schemes moved to the facility). Only a verified one counts towards a lot's trust tier.

CertificationCreate

object

#156: a certification is verified when it names its scheme from the fixed list, its certifier (issuer) and the SHA-256 of the certificate document (evidence_sha256), and, for GLOBALG.A.P., a number that is the producer's GGN; the console always sends that shape. A request without them (as released clients send it: any scheme text, no certifier, no hash) is accepted and stored as sent, unverified: an unverified certification never counts towards a lot's trust tier (the harvest step's certification check counts verified certifications only).

Thuộc tính
TênKiểuMô tả
scheme
bắt buộc
string

The certification scheme. A verified certification names one of VietGAP, GLOBALG.A.P., Organic JAS, Organic EU, Organic USDA, ISO 22000, FSSC 22000, BRCGS, IFS and HACCP (compared exactly), as the console sends it; any other text is accepted and stored, and the certification is unverified. ISO 22000, FSSC 22000, BRCGS and IFS certify a packing house (#269): record new ones on the facility (createFacilityCertification). A growing-area certification of these schemes is still accepted and stored as sent, but one recorded from this change on is unverified whatever it holds (it never counts towards a lot's trust tier); one recorded before is judged as before.

number
bắt buộc
string

The certificate number. For a verified GLOBALG.A.P. certification, the producer's GLOBALG.A.P. Number (GGN): its 13 digits without the "GGN" prefix, the last being the GS1 mod-10 check digit of the others.

issuer
không bắt buộc
string | null

The certifier (certification body) that issued the certificate. Optional; without it the certification is unverified.

valid_from
bắt buộc
string (date)
valid_to
bắt buộc
string (date)

Not before valid_from.

evidence_sha256
không bắt buộc
string | null

The SHA-256 of the certificate document, e.g. the PDF uploaded with PUT /v1/attachments/{sha256}. Optional; without it the certification is unverified.

CertificationPage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<Certification>
next_cursor
bắt buộc
string | null

Pass as cursor for the next page; null on the last page.

CockpitDay

object

#365: the farm day (Asia/Ho_Chi_Minh) an answer of the cockpit was computed in (common/farm_day.py).

Thuộc tính
TênKiểuMô tả
date
bắt buộc
string

Its farm date.

starts_at
bắt buộc
string (date-time)

Its local midnight, in UTC.

time_zone
bắt buộc
"Asia/Ho_Chi_Minh"

Command

object

Thuộc tính
TênKiểuMô tả
id
bắt buộc
string
tenant
bắt buộc
string
site
bắt buộc
string
device_id
bắt buộc
string
name
bắt buộc
string
params
bắt buộc
object
issued_by
bắt buộc
string
issued_at
bắt buộc
number

Unix seconds.

status
bắt buộc
"pending" | "sent" | "succeeded" | "failed" | "accepted" | "rejected" | "completed" | "aborted" | "expired"
result
bắt buộc
object | null

The device reply or the dispatch error; null until settled.

completed_at
bắt buộc
number | null

Unix seconds; null until settled.

kind
không bắt buộc
"config" | "actuation"

#242, with getCommand or listDeviceCommands channel=1 only: config (set_model, calibrate, ...: status pending, sent, then succeeded or failed) or actuation (an irrigation controller's run_zone or set_program, a signed command document the controller checks and enforces locally: status pending, sent, then accepted and completed or aborted, or rejected; expired when it was not delivered or accepted before expires_at, or no final report came; failed when the dispatch failed). Without channel=1 the status of an actuation command is still answered.

expires_at
không bắt buộc
number | null

#242, with getCommand or listDeviceCommands channel=1 only: Unix seconds after which the controller refuses the command (null for a config command).

reason
không bắt buộc
string | null

#242, with getCommand or listDeviceCommands channel=1 only: why an actuation command was rejected, aborted or expired, as the controller or the server said it (for example bad_sig, expired, wrong_device, replayed, limit_exceeded, interlock, manual_override_active, clock_unsynced, no_final_report); null otherwise.

accepted_at
không bắt buộc
number | null

#242, with getCommand or listDeviceCommands channel=1 only: Unix seconds when the controller accepted the actuation command; null until then and for a config command.

CommandIssued

object

Thuộc tính
TênKiểuMô tả
id
bắt buộc
string

CommandKey

object

#242: one platform command key's public part.

Thuộc tính
TênKiểuMô tả
kid
bắt buộc
string

platform-cmd- and the first 16 hex digits of the SHA-256 of the public key's SubjectPublicKeyInfo DER.

alg
bắt buộc
"ES256"
jwk
bắt buộc
object

The public key as an RFC 7517 JWK.

CommandKeys

object

Thuộc tính
TênKiểuMô tả
keys
bắt buộc
array<CommandKey>

Empty when the server has no command key.

CommandPage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<Command>
next_cursor
bắt buộc
string | null

Pass as cursor for the next page; null on the last page.

CommandRequest

object

Thuộc tính
TênKiểuMô tả
name
bắt buộc
string
params
không bắt buộc
object

Defaults to an empty object.

CommuneVerdictCounts

object

How many of the company's positions of the area in the range got each commune verdict (#247).

Thuộc tính
TênKiểuMô tả
commune_match
bắt buộc
integer
commune_mismatch
bắt buộc
integer
commune_unknown
bắt buộc
integer

CompanyApiCallDay

object

SELF-2-5 (#194). A company's API calls on one UTC day.

Thuộc tính
TênKiểuMô tả
day
bắt buộc
string (date)

The UTC day, YYYY-MM-DD.

calls
bắt buộc
integer

CompanyExport

object

SELF-2-3 (#192). One request for the selected company's full data archive and its state. The archive layout (files, columns, encoding, times) is documented at /developers/downloads/company-export.md.

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
status
bắt buộc
"queued" | "running" | "ready" | "failed" | "expired"

queued until the background job takes it, running while it builds the archive, ready to download until expires_at, failed when the build failed (request a new one), expired once its 24 hours are over and the file is deleted.

requested_by
bắt buộc
string

Who asked for it (the signed-in user's email).

requested_at
bắt buộc
number

Unix seconds.

started_at
bắt buộc
number | null

Unix seconds when the job started building it.

finished_at
bắt buộc
number | null

Unix seconds when the build ended (ready or failed).

expires_at
bắt buộc
number | null

While ready: Unix seconds after which the download is refused (24 hours after the archive was ready); null otherwise.

size
bắt buộc
integer | null

While ready: the archive's size in bytes.

sha256
bắt buộc
string | null

While ready: the SHA-256 of the archive, to check the downloaded file.

file_name
bắt buộc
string | null

While ready: the file name the download is saved under (croppath-export-<company>-<request time, UTC>.zip).

error
bắt buộc
string | null

Why the build failed: build_failed or interrupted (the server stopped while building it); null otherwise.

CompanyExportList

object

SELF-2-3 (#192). The selected company's 20 newest export requests, newest first, and the limits.

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<CompanyExport>
max_per_day
bắt buộc
integer

How many exports the company may request in any 24 hours.

download_hours
bắt buộc
integer

How long a ready archive can be downloaded.

CompanyLogoStored

object

Thuộc tính
TênKiểuMô tả
sha256
bắt buộc
string
media_type
bắt buộc
"image/png" | "image/jpeg"
size
bắt buộc
integer
width
bắt buộc
integer
height
bắt buộc
integer

CompanyOffboarding

object

SELF-2-4 (#193): whether a company is leaving CropPath. active: no departure. leaving: the read-only window (30 days from started_at to window_ends_at) in which its people still sign in, read and download the full data export, but nothing of the company may change. left: sign-in stopped at left_at; the job then revokes the company's credentials and removes its people's names and emails (steps_done of 3). Sealed lot records, evidence and public lot pages stay until retention_ends_at: the latest seal (or the end of the window when later) plus retention_years, which CropPath sets for each company (no default).

Thuộc tính
TênKiểuMô tả
status
bắt buộc
"active" | "leaving" | "left"
retention_years
bắt buộc
integer | null

Years the sealed lot records are kept, counted from each lot's seal.

started_at
bắt buộc
number | null

Unix seconds; null while the company is active.

window_ends_at
bắt buộc
number | null

Unix seconds; null while the company is active.

left_at
bắt buộc
number | null

Unix seconds; when sign-in stopped (status left).

retention_ends_at
bắt buộc
number | null

Unix seconds; null while the company is active.

steps_done
bắt buộc
integer

The job's steps done: 1 members off, 2 credentials revoked, 3 personal data removed.

CompanyOffboardingStart

object

Thuộc tính
TênKiểuMô tả
retention_years
bắt buộc
integer

How many years the company's sealed lot records, evidence and public lot pages are kept, counted from each lot's seal (owner decision D-S4: no default; CropPath sets it for each company).

CompanyOverview

object

#274. The selected company's overview for the admin home: what needs attention, today's work, its lots and shipments, its devices and gateways, its people and its usage; counts and the company's own codes only. view admin: every section; view auditor (a caller who is no admin): without approvals, team, integrations, email and requests.personal_data_open (absent, not zero). Each section has state: ok with its figures, or unavailable (OverviewSectionUnavailable) when it could not be read.

Thuộc tính
TênKiểuMô tả
tenant
bắt buộc
string

The selected company.

generated_at
bắt buộc
string (date-time)

When the answer was computed (the server serves it for up to max_age_s).

max_age_s
bắt buộc
integer

Seconds the server serves one answer.

day
bắt buộc
object

The day today counts in: the Vietnam calendar day (UTC+7). The API call figures keep the UTC day.

view
bắt buộc
"admin" | "auditor"
sections
bắt buộc
object

CompanyOverviewAlerts

object | OverviewSectionUnavailable

#274. The company's open alerts.

CompanyOverviewApiDay

object

#274. The company's daily API call quota and today's calls (UTC day) against it.

Thuộc tính
TênKiểuMô tả
api_per_day
bắt buộc
integer

API calls a UTC day.

api_calls_today
bắt buộc
integer

API calls counted this UTC day.

api_day_warning
bắt buộc
boolean

api_calls_today is at least 80% of api_per_day.

api_day_reached
bắt buộc
boolean

api_calls_today reached api_per_day.

CompanyOverviewApprovals

object | OverviewSectionUnavailable

#274. Changes waiting for a second admin (admin view only).

CompanyOverviewCertifications

object | OverviewSectionUnavailable

#274. The growing areas' certifications (the latest of each area and scheme: a renewal replaces the older one).

CompanyOverviewEmail

object | OverviewSectionUnavailable

#274. Emails of the company that could not be sent (admin view only).

CompanyOverviewFleet

object | OverviewSectionUnavailable

#274. The company's devices and gateways.

CompanyOverviewIntegrations

object | OverviewSectionUnavailable

#274. The company's webhooks (admin view only).

CompanyOverviewLots

object | OverviewSectionUnavailable

#274. The company's lots per status.

CompanyOverviewQuarantine

object | OverviewSectionUnavailable

#274. Device messages waiting for review (quarantined).

CompanyOverviewRecalls

object | OverviewSectionUnavailable

#274. Recalled and withdrawn lots and the recall notices not yet delivered.

CompanyOverviewRequests

object | OverviewSectionUnavailable

#274. Requests waiting for the company. personal_data_open is in the admin view only.

CompanyOverviewShipments

object | OverviewSectionUnavailable

#274. The company's shipments.

CompanyOverviewTeam

object | OverviewSectionUnavailable

#274. The company's people (admin view only).

CompanyOverviewToday

object | OverviewSectionUnavailable

#274. Today's work, day of the answer (the Vietnam calendar day).

CompanyOverviewUsage

object | OverviewSectionUnavailable

#274. The company's limits, its daily API call quota and its API calls per day, as getCompanyUsage counts them (without what it stores).

CompanyPersonalDataRequest

object

SELF-2-9 (#198). A member's request about their personal data, as the company's admins see it.

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
kind
bắt buộc
"access" | "correction"

access: see more of the personal data held; correction: correct it.

text
bắt buộc
string

Plain text, as typed (trimmed): never HTML or markdown; line breaks are kept.

status
bắt buộc
"open" | "handled"

open (new) or handled (a company admin dealt with it; final).

created_at
bắt buộc
number

Seconds since 1970 (UTC).

handled_at
bắt buộc
number | null

When a company admin marked it handled, or null.

user
bắt buộc
SupportRequestUser
handled_by
bắt buộc
string | null

Who marked it handled (an email), or null.

CompanyPersonalDataRequestPage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<CompanyPersonalDataRequest>
next_cursor
bắt buộc
string | null

The next page's cursor; null on the last.

CompanyProducer

object

#186 (SELF-1-5): the lot's producer as its company profile names it now: the legal name and the address lines, never the trading name, tax number, contacts or website. Read when the label or dossier is built, so it is not part of any seal.

Thuộc tính
TênKiểuMô tả
legal_name
bắt buộc
string
address
bắt buộc
string | null
district
bắt buộc
string | null

District or commune.

province
bắt buộc
string | null
country
bắt buộc
string

ISO 3166-1 alpha-2; VN until set.

commune
không bắt buộc
string | null

#273: the company's commune (official name) when its profile is coded; null otherwise, and null for a household business that has not opted in to its full address. Only with admin_units=1, in getCompanyPublicIdentity's public_producer and in getLotExportLabel's producer; never in a customs dossier or without the parameter.

CompanyProfile

object

The selected company's legal identity. Every field is null until set (country: VN). Changing it never changes a sealed lot: sealed facts and signed credentials keep what they recorded.

Thuộc tính
TênKiểuMô tả
tenant
bắt buộc
string

The company's id (X-Tenant).

name
bắt buộc
string

The company's short display name (tenants.name), unchanged by the profile.

legal_name
bắt buộc
string | null
trading_name
bắt buộc
string | null
address
bắt buộc
string | null
province
bắt buộc
string | null
district
bắt buộc
string | null
country
bắt buộc
string

VN until set.

tax_id
bắt buộc
string | null
contact_name
bắt buộc
string | null
contact_phone
bắt buộc
string | null
contact_email
bắt buộc
string | null
website
bắt buộc
string | null
logo
bắt buộc
CompanyLogo | null
updated_at
bắt buộc
number | null

Seconds since the epoch; null until the profile is first saved.

updated_by
bắt buộc
string | null

Who saved it last; null until then.

commune
không bắt buộc
string | null

The commune's official name (xã, phường or đặc khu) when the record is coded; else null. Only with admin_units=1 on the read (#273); never in a write's answer nor without the parameter.

province_code
không bắt buộc
string | null

The province's official 2-digit code, in the list admin_units_version; null when not coded. Only with admin_units=1 on the read (#273); never in a write's answer nor without the parameter.

commune_code
không bắt buộc
string | null

The commune's official 5-digit code, in the list admin_units_version; null when not coded. A code is only meaningful with its version (codes were reused across the 2025 reform). Only with admin_units=1 on the read (#273); never in a write's answer nor without the parameter.

admin_units_version
không bắt buộc
string | null

The version of the official list the codes were taken from (for example vn-2026-10-17); null without codes. Only with admin_units=1 on the read (#273); never in a write's answer nor without the parameter.

address_before_reform
không bắt buộc
object | null

The province, district and commune text the record held before it was coded, or the text a request gave through the deprecated text path; kept for good once set. Null for a record entered with codes. Only with admin_units=1 on the read (#273); never in a write's answer nor without the parameter.

address_status
không bắt buộc
"coded" | "choose_commune" | "needs_commune" | "outside_vietnam" | null

coded: the codes are set from the official list; choose_commune: the old commune was split, a person picks one of address_candidates; needs_commune: no codes yet (given as text, or before the reform), a person picks the commune; outside_vietnam: a company profile in another country, where the codes do not apply. Null for a record not reviewed since the codes were introduced. Only with admin_units=1 on the read (#273); never in a write's answer nor without the parameter.

address_candidates
không bắt buộc
array<string> | null

For choose_commune: the official commune codes to pick from; else null. Only with admin_units=1 on the read (#273); never in a write's answer nor without the parameter.

CompanyProfileUpdate

object

The whole profile (a PUT replaces it: a field left out, null or blank is cleared). Text is trimmed and may not hold control characters. The logo is set with PUT /v1/company/logo.

Thuộc tính
TênKiểuMô tả
legal_name
bắt buộc
string

As on the business registration. Required; trimmed, not blank.

trading_name
không bắt buộc
string | null
address
không bắt buộc
string | null
province
không bắt buộc
string | null

In Viet Nam (country VN): deprecated (#273), sunset 1 May 2027; send province_code and commune_code instead (with them this must be absent or null), and a profile given as text only is stored as not yet coded and answered with the Deprecation, Sunset and Link headers. Deprecated in Viet Nam only: in another country this stays the free-text region and is not deprecated.

district
không bắt buộc
string | null

District or commune. In Viet Nam (country VN): deprecated (#273), sunset 1 May 2027; Viet Nam has had no district level since 1 July 2025, so send province_code and commune_code instead (with them this must be absent or null, 400 district_with_codes). Deprecated in Viet Nam only: in another country this stays the free-text locality and is not deprecated.

province_code
không bắt buộc
string | null

#273: the province (tỉnh or thành phố trực thuộc trung ương) by its official 2-digit code in the administrative units list in force (getAdminUnits). Sent with commune_code, both or neither; with them province, district and commune must be absent or null and the server writes the official names. Only for an address in Viet Nam (country VN or absent): with another country the codes are refused (400 invalid_country) and province and district stay free text.

commune_code
không bắt buộc
string | null

#273: the commune (xã, phường or đặc khu) by its official 5-digit code in the administrative units list in force (getAdminUnits with province). Sent with province_code, both or neither; the commune must lie in that province by the list, never by its digits.

country
không bắt buộc
string | null

ISO 3166-1 alpha-2 code in capital letters; null or absent: VN.

tax_id
không bắt buộc
string | null

Tax or business registration number. At most 32 characters for every country; the Vietnamese format is not checked yet (the exact rule awaits the owner's confirmation, #186).

contact_name
không bắt buộc
string | null
contact_phone
không bắt buộc
string | null

Digits, spaces and + ( ) . - only, starting with + or a digit.

contact_email
không bắt buộc
string | null

An email address (name@domain.tld).

website
không bắt buộc
string | null

An https:// address with a DNS host name; no user name or password.

CompanyPublicIdentity

object

#208: how the company is named on public outputs (today the lot's public customs file).

Thuộc tính
TênKiểuMô tả
household_business
bắt buộc
boolean

The company is a household business (hộ kinh doanh). Its public customs file then names it by its trading name (or 'Hộ kinh doanh' alone when it has no trading name, never its tax number) and shows its province only, unless it opts in below. False for a company.

public_full_address
bắt buộc
boolean

A household business shows its full address (address and district too) on its public customs file. Always false for a company.

public_legal_name
bắt buộc
boolean

A household business shows its legal name (a person's name) on its public customs file instead of its trading name. Always false for a company.

public_producer
bắt buộc
CompanyProducer | null

The producer as the lot's public customs file shows it now: for a company its legal name and full address; for a household business its trading name (or 'Hộ kinh doanh' alone, never its tax number) in legal_name and its province only, unless it opted in. Null until the profile is saved.

CompanyPublicIdentityUpdate

object

#208: every flag, true or false. The opt-ins are stored false unless household_business is true.

Thuộc tính
TênKiểuMô tả
household_business
bắt buộc
boolean

The company is a household business (hộ kinh doanh). Its public customs file then names it by its trading name (or 'Hộ kinh doanh' alone when it has no trading name, never its tax number) and shows its province only, unless it opts in below. False for a company.

public_full_address
bắt buộc
boolean

A household business shows its full address (address and district too) on its public customs file. Always false for a company.

public_legal_name
bắt buộc
boolean

A household business shows its legal name (a person's name) on its public customs file instead of its trading name. Always false for a company.

CompanySecurity

object

SELF-1-6 (#187). The selected company's sign-in rule and how many of its active members have two-step sign-in on.

Thuộc tính
TênKiểuMô tả
require_two_factor
bắt buộc
boolean

Every member must use two-step sign-in to act for this company.

members
bắt buộc
integer

Active members (active membership and account).

members_with_two_factor
bắt buộc
integer
admin_deadline
bắt buộc
number

Unix seconds from which every company admin must use two-step sign-in (60 days after the release that shipped it).

updated_at
bắt buộc
number | null
updated_by
bắt buộc
string | null

CompanySecurityUpdate

object

Thuộc tính
TênKiểuMô tả
require_two_factor
bắt buộc
boolean

CompanyUsage

object

SELF-2-5 (#194). The selected company's usage of its limits, its API calls per day, its quotas and what it stores (#134), counts only.

Thuộc tính
TênKiểuMô tả
tenant
bắt buộc
string
warn_percent
bắt buộc
integer

An entry warns from this percentage of its limit.

limits
bắt buộc
array<CompanyUsageLimit>

Every limit, in a fixed order.

api_calls
bắt buộc
array<CompanyApiCallDay>

The last 14 UTC days, newest first, today included (0 for a day without calls).

quotas
bắt buộc
CompanyUsageQuotas
stored
bắt buộc
CompanyUsageStored

CompanyUsageLimit

object

SELF-2-5 (#194). One per-company limit: what the company uses of it.

Thuộc tính
TênKiểuMô tả
id
bắt buộc
"members" | "pending_links" | "devices" | "api_tokens" | "api_clients" | "webhooks"

members: active members plus pending invitations (limit 200). pending_links: pending one-time links of every purpose, invitations and new-password links (limit 50). devices: active devices (no limit is enforced: limit null). api_tokens: live API tokens (limit 100). api_clients: live API clients (limit 50). webhooks: webhook subscriptions of every status (limit 20).

used
bắt buộc
integer
limit
bắt buộc
integer | null

The limit the backend enforces; null when there is none.

warning
bắt buộc
boolean

used is at least warn_percent of limit (false without a limit).

reached
bắt buộc
boolean

used is at the limit: the next create is refused (false without a limit).

CompanyUsageQuotas

object

#134. The company's quotas: its API calls per minute and per UTC day (requests made with its API tokens or API clients; over either, 429 with Retry-After), with today's calls, and its device messages per second with a burst (over them the MQTT ingest keeps its messages in its ingest backlog and stores them at that rate; the HTTP ingest answers 429), with the messages waiting in that backlog.

Thuộc tính
TênKiểuMô tả
api_per_minute
bắt buộc
integer

API calls a minute; over it, 429 with Retry-After.

api_per_day
bắt buộc
integer

API calls a UTC day; once reached, 429 until the next UTC midnight.

api_calls_today
bắt buộc
integer

API calls counted this UTC day (as api_calls' first day).

api_day_warning
bắt buộc
boolean

api_calls_today is at least warn_percent of api_per_day.

api_day_reached
bắt buộc
boolean

api_calls_today reached api_per_day: further calls today are refused.

ingest_per_second
bắt buộc
integer

Device messages a second the ingest stores as they arrive.

ingest_burst
bắt buộc
integer

Device messages the ingest stores at once above that rate after a quiet period.

ingest_backlog
bắt buộc
integer

Device messages waiting in the company's ingest backlog.

CompanyUsageStored

object

#134. What the company keeps, counts only (no quota applies to them): its device messages stored, the public scans of its fruits still kept, and its stored files (attachments uploaded for its devices' envelopes and documents its users uploaded) with their total size. Files are content-addressed and shared, so a file two companies hold counts for each; database rows are not counted in storage_bytes.

Thuộc tính
TênKiểuMô tả
envelopes
bắt buộc
integer

Device messages (envelopes) stored for the company, of every status.

scans
bắt buộc
integer

Public scans of the company's fruits still kept (each fruit's scan counter, which keeps its count after the raw scan rows expire).

attachments
bắt buộc
integer

Files stored: device attachments uploaded for the company's envelopes plus documents its users uploaded.

storage_bytes
bắt buộc
integer

The total size of those files, in bytes.

Consignee

object

The immediate subsequent recipient of a shipment (#153; Circular 17/2021 Art. 6, Regulation (EC) 178/2002 Art. 18, FSMA 204). Staff-only: never on a public page or document.

Thuộc tính
TênKiểuMô tả
name
bắt buộc
string

Legal name.

address
bắt buộc
string

Postal address; line breaks allowed.

country
bắt buộc
string

ISO 3166-1 alpha-2 (an assigned code).

gln
bắt buộc
string | null

GS1 Global Location Number with a valid check digit.

registration_id
bắt buộc
string | null

Tax or importer registration id.

ConsigneeInput

object

A consignee as written: gln and registration_id are optional.

Thuộc tính
TênKiểuMô tả
name
bắt buộc
string

Legal name.

address
bắt buộc
string

Postal address; line breaks allowed.

country
bắt buộc
string

ISO 3166-1 alpha-2 (an assigned code).

gln
không bắt buộc
string | null

GS1 Global Location Number with a valid check digit.

registration_id
không bắt buộc
string | null

Tax or importer registration id.

ConsoleHome

object

#286. The console's work home for the selected company within the caller's packing houses (every packing house of the company for a company admin): what is measuring now, the work by next action, open shipments, messages waiting for review, the devices and stations, and today's counts. Codes and counts of the company only, and the names of its packing houses. Each section has state: ok with its figures, or unavailable (OverviewSectionUnavailable) when it could not be read.

Thuộc tính
TênKiểuMô tả
tenant
bắt buộc
string

The selected company.

generated_at
bắt buộc
string (date-time)

When the answer was computed (the server serves it for up to max_age_s).

max_age_s
bắt buộc
integer

Seconds the server serves one answer.

day
bắt buộc
object

The day today counts in: the Vietnam calendar day (UTC+7).

scope
bắt buộc
object

Whose work the answer counts.

sections
bắt buộc
object

ConsoleHomeDevices

object | OverviewSectionUnavailable

#286. The active devices and stations (gateways) of the scope's packing houses. A device belongs to a packing house, not to a line.

ConsoleHomeReview

object | OverviewSectionUnavailable

#286. Device messages of the scope waiting for a company admin's review (quarantined); a lot with such messages cannot be closed until they are reviewed.

ConsoleHomeSessions

object | OverviewSectionUnavailable

#286. The measurement sessions open or paused now, one per busy line, newest first.

ConsoleHomeShipments

object | OverviewSectionUnavailable

#286. Shipments not departed, oldest first (a shipment has no planned departure); #283: and the shipments departed in the last 30 days whose temperature logger readings are missing or incomplete.

ConsoleHomeTask

object

Thuộc tính
TênKiểuMô tả
count
bắt buộc
integer

Lots of the window that need this action.

oldest
bắt buộc
array<object>

The 5 oldest of them, oldest first (by the time of the step the action follows; a lot whose step time is unknown comes last).

ConsoleHomeToday

object | OverviewSectionUnavailable

#286. Today so far, day of the answer (the Vietnam calendar day); lot counts among the newest 1,000 lots of each packing house.

ConsoleHomeWork

object | OverviewSectionUnavailable

#286. The work by next action, read among the newest 1,000 lots of each packing house in scope (of the company for a company-wide answer). A lot may need several actions.

ControlAdvisory

object

#354: the lime and fertiliser advisory view (control/advisory.py): the advice of the signed sheets whose validity covers today and whose signature still holds, by series and version. No amount and no formula: a lab test is required.

Thuộc tính
TênKiểuMô tả
generated_at
bắt buộc
number
today
bắt buộc
string
items
bắt buộc
array<ControlAdvisorySheet>
drafts
bắt buộc
integer

The company's draft sheets (never listed).

withheld
bắt buộc
integer

#354 review M5: the company's signed sheets in force today that are not listed because their signature can no longer be checked (the stored document no longer hashes to what was signed, or the signer is no longer verified); a count only, no detail.

ControlAdvisorySheet

object

#354: a signed sheet in force today, with its lime and fertiliser advice as signed.

Thuộc tính
TênKiểuMô tả
sheet_id
bắt buộc
integer
series_key
bắt buộc
string
crop
bắt buộc
string
version
bắt buộc
integer
valid_from
bắt buộc
string
valid_to
bắt buộc
string
body_sha256
bắt buộc
string
signed_by
bắt buộc
string | null

The signer's legal name as the attestation recorded it.

signed_at
bắt buộc
number | null

When the attestation was signed.

advisory
bắt buộc
object | null

The body's advisory section exactly as signed; null when the sheet has none.

references
bắt buộc
array<object>

The body's references, as signed ([] when none).

growing_areas
bắt buộc
array<string>

The codes of the company's growing areas whose crop is the sheet's crop; [] for a caller who may not read the growing areas (an agronomist holding no role of growing_area_read).

ControlAreaToday

object

#363. The day of the irrigation controllers placed in one growing area.

Thuộc tính
TênKiểuMô tả
generated_at
bắt buộc
string (date-time)

When the answer was computed (the server serves it for up to max_age_s).

max_age_s
bắt buộc
integer
poll_hint_s
bắt buộc
15 | 60

15 while a run is open, a step is scheduled now or a command waits for its controller, else 60.

day
bắt buộc
ControlDay
area
bắt buộc
object
controllers
bắt buộc
array<ControlControllerToday>
truncated
bắt buộc
boolean

A cap left something out (50 controllers, 48 steps, the reads' row caps).

ControlBudgetDay

object

#353: a zone's water on a local date: what the program in force of the day planned for it (the engine's holding rule over a day, control/in_force.py, shared with the zone history) and what the controller reported delivered (control/budget.py). A refused or failed command never reads as planned water. Null where the source holds nothing, never a filled-in 0.

Thuộc tính
TênKiểuMô tả
device_id
bắt buộc
string
zone
bắt buộc
integer
name
bắt buộc
string
growing_area
bắt buộc
string
local_date
bắt buộc
string
plan
bắt buộc
"dispatched" | "withdrawn" | "replaced" | "refused" | "none" | "proposed" | "approved" | "rejected" | "superseded" | "failed" | "blocked" | "expired"

dispatched (the engine's program the controller held that day), withdrawn (the controller no longer ran it: a later row of the day recorded its withdrawal, a person withdrew it, a withdrawal of the controller's program was asked for after its dispatch, or the controller reported it replaced or cancelled, #367 cross-review M1), replaced (a person's own set_program replaced it: no planned water), refused (every program of the day that became a command was refused or failed: no planned water), else the status of the day's latest program, or none.

program_id
bắt buộc
integer | null
rule_id
bắt buộc
integer | null
mode
bắt buộc
string | null
planned_mm
bắt buộc
number | null

planned_l over the zone's irrigated area (1 L/m2 = 1 mm), the water given, before efficiency, the zone history's basis; null without a plan. The depth at the roots stays in the program's provenance and et0.

planned_l
bắt buộc
number | null

The planned litres of the program in force; null without one.

clamps
bắt buộc
array<string>
et0
bắt buộc
object | null

An et0_budget zone's trace: the station day, its ET0 and krs, the estimated inputs, Kc and its stage, the rain and its effective fraction, ETc, the net depth, the trim and the bucket.

applied_l
bắt buộc
number | null

The litres the controller reported; null when it reported nothing.

applied_mm
bắt buộc
number | null

applied_l over the zone's irrigated area, the basis of planned_mm.

ControlBudgetPage

object

#353: planned and applied water per zone and local date (at most 2000 items).

Thuộc tính
TênKiểuMô tả
from
bắt buộc
string
to
bắt buộc
string
items
bắt buộc
array<ControlBudgetDay>
truncated
bắt buộc
boolean

A cap was reached (the items, or one of the reads behind them: zones, program rows, step runs): the answer is not whole.

ControlCommandToday

object

#363. One of a controller's newest actuation commands.

Thuộc tính
TênKiểuMô tả
id
bắt buộc
string
name
bắt buộc
string
status
bắt buộc
"pending" | "sent" | "accepted" | "completed" | "aborted" | "rejected" | "expired" | "failed"
issued_by
bắt buộc
string | null

The person's display name (system for the engine); null for a caller who may not read the device (an agronomist).

issued_at
bắt buộc
string (date-time)
params
bắt buộc
object
expires_at
bắt buộc
string (date-time) | null (date-time)
reason
bắt buộc
string | null
measured
bắt buộc
object | null

ControlControllerDay

object

#363. One irrigation controller's day.

Thuộc tính
TênKiểuMô tả
generated_at
bắt buộc
string (date-time)

When the answer was computed (the server serves it for up to max_age_s).

max_age_s
bắt buộc
integer
poll_hint_s
bắt buộc
15 | 60

15 while a run is open, a step is scheduled now or a command waits for its controller, else 60.

day
bắt buộc
ControlDay
device_id
bắt buộc
string
name
bắt buộc
string | null
link
bắt buộc
ControlLink
hold_until
bắt buộc
string (date-time) | null (date-time)

#367 cross-review M2: the end of the controller's hold in force (a person withdrew today's program; the engine sends nothing automatic until then), or null.

program
bắt buộc
ControlProgramToday
zones
bắt buộc
array<ControlZoneToday>
steps
bắt buộc
array<ControlStepToday>
commands
bắt buộc
array<ControlCommandToday>
area
bắt buộc
null | object
limits
bắt buộc
object

The controller profile's run_zone bounds (minima since #371): installation facts, never an irrigation amount.

truncated
bắt buộc
boolean

ControlControllerToday

object

#363. One controller of an area's day.

Thuộc tính
TênKiểuMô tả
device_id
bắt buộc
string
name
bắt buộc
string | null
link
bắt buộc
ControlLink
hold_until
bắt buộc
string (date-time) | null (date-time)

#367 cross-review M2: the end of the controller's hold in force (a person withdrew today's program; the engine sends nothing automatic until then), or null.

program
bắt buộc
ControlProgramToday
zones
bắt buộc
array<ControlZoneToday>
steps
bắt buộc
array<ControlStepToday>
commands
bắt buộc
array<ControlCommandToday>

ControlDay

object

#363. The farm-local day an answer describes (the backend owns the day).

Thuộc tính
TênKiểuMô tả
date
bắt buộc
string (date)

The farm-local date (Asia/Ho_Chi_Minh).

starts_at
bắt buộc
string (date-time)

Its local midnight, in UTC (17:00:00Z of the day before).

time_zone
bắt buộc
"Asia/Ho_Chi_Minh"

The farm time zone every time of the answer is shown in.

ControlEt0Day

object

#353: the latest stored version (seq) of the reference ET0 (FAO-56 Penman-Monteith, meteorology only: no sheet value) of a weather station's local day (control/et0_inputs.py, et0_daily). A compose appends a version only when the latest was refused or needed the krs and the day now reads differently, a capability's coverage grew, or a plausibility verdict arrived; programs cite the version they used.

Thuộc tính
TênKiểuMô tả
device_id
bắt buộc
string

The weather station.

local_date
bắt buộc
string

The local day (Asia/Ho_Chi_Minh, midnight to midnight).

seq
bắt buộc
integer

The version of the station day (1, 2, ...): the latest is listed.

wind_height_m
bắt buộc
number

The anemometer's height the zone gives (eq. 47).

elevation_m
bắt buộc
number

The station's elevation the zone gives (eqs. 7 and 37).

status
bắt buộc
"ok" | "needs_krs" | "refused"

ok with et0_mm; needs_krs: no usable measured radiation (a daylight hour without a reading, none at all, a suspect sun or night-light check, or a measured Rs above 1.05 x the clear-sky Rso: a sensor fault), each rule estimates it by eq. 50 with its own sheet's krs (the program's provenance has that ET0); refused: no ET0 (reason), the rule falls back.

reason
bắt buộc
string | null

Why not ok: station_not_approved, station_not_placed, temperature_coverage, out_of_range (refused); radiation_coverage, no_radiation, light_suspect, radiation_above_clear_sky (needs_krs).

et0_mm
bắt buộc
number | null

mm/day; null unless ok.

inputs
bắt buộc
object

The daily inputs and how each was found: latitude_deg (the placement's), day_of_year, g (0, eq. 42), coverage (per capability: readings, coverage_h of the 24 local hours, truncated), rain {mm, method, estimated}, tmax and tmin (degC), ea {value kPa, method dew_point|rh_max_min|rh_mean|tdew_tmin, estimated}, u2 {value m/s, method measured|default_2_m_s, estimated}, pressure {value kPa, method measured|elevation}, rs {value MJ m-2 day-1 or null, method measured|eq50_krs, estimated}. Also longitude_deg, daylight_hours (the local hours with the sun up at their midpoint: Rs is the sum of their hourly means x 0.0036, the night counting 0), light_verdicts (the plausibility job's sun and night-light verdicts read), and on pressure a measured_rejected value when the measured pressure was more than 10 % from eq. 7's.

trace
bắt buộc
map<string, number>

Every intermediate of the equations (tmean, pressure_kpa, gamma, delta, es, ea, vpd, ra, rs, rso, rns, rnl, rn, g, u2, et0_mm) and hargreaves_mm, the paper's cross-check only (eq. 52). methods_diverge: Hargreaves more than 25 % from Penman-Monteith (an alert, no change of water); rs_clamped_to_rso on an eq. 50 estimate.

computed_at
bắt buộc
number
estimated
bắt buộc
array<"ea" | "u2" | "rs" | "rain">

The inputs that are estimated.

ControlEt0Page

object

#353: the stored ET0 days of a span of local dates, by station and date (at most 2000).

Thuộc tính
TênKiểuMô tả
from
bắt buộc
string
to
bắt buộc
string
items
bắt buộc
array<ControlEt0Day>
truncated
bắt buộc
boolean

A cap was reached (the items, or one of the reads behind them: zones, program rows, step runs): the answer is not whole.

ControlFleetArea

object

#363. A growing area holding an irrigation controller.

Thuộc tính
TênKiểuMô tả
code
bắt buộc
string
name
bắt buộc
string | null
controllers
bắt buộc
object
zones
bắt buộc
object
water_today
bắt buộc
object
sensors
bắt buộc
object
alarms
bắt buộc
object

ControlFleetAreas

object | OverviewSectionUnavailable

#363. The areas, at most 200 by code.

ControlFleetAttention

object | OverviewSectionUnavailable

#363. What needs attention: exact counts of the open alarms the caller may read, and at most 20 items (alarms not shelved, urgent then warning then notice, the oldest first; then today's programs waiting for approval).

ControlFleetControllers

object | OverviewSectionUnavailable

#363. The controllers, at most 500 by device id.

ControlFleetState

object

#363. The company's water today at a glance. Each section has state: ok with its figures, or unavailable (OverviewSectionUnavailable) when one of its reads failed.

Thuộc tính
TênKiểuMô tả
tenant
bắt buộc
string
generated_at
bắt buộc
string (date-time)

When the answer was computed (the server serves it for up to max_age_s).

max_age_s
bắt buộc
integer
poll_hint_s
bắt buộc
15 | 60

15 while a run is open, a step is scheduled now or a command waits for its controller, else 60.

day
bắt buộc
ControlDay
view
bắt buộc
string
attention
bắt buộc
ControlFleetAttention
areas
bắt buộc
ControlFleetAreas
controllers
bắt buộc
ControlFleetControllers

ControlGateDecision

object

Thuộc tính
TênKiểuMô tả
zone
bắt buộc
integer
rule_id
bắt buộc
integer
decided_at
bắt buộc
number
verdict
bắt buộc
"healthy" | "fallback" | "blocked"
reason
bắt buộc
string | null
detail
bắt buộc
object

Every probe's reading and status, the basis and the peer check (control/health_gate.py).

ControlHome

object

#354: the irrigation control home (control/home.py): what needs a person today, for the controllers in scope.

Thuộc tính
TênKiểuMô tả
generated_at
bắt buộc
number
controllers
bắt buộc
integer

The company's controllers with a control zone in scope.

programs_waiting
bắt buộc
object

The programs still proposed (waiting for a person's approval): their count and the newest 5.

rules
bắt buộc
object

The company's rules in scope by what they need.

salinity
bắt buộc
object

The open alerts of a controller in scope whose zone's water or soil EC (mS/cm) passed its signed sheet's limit: salinity_block (high, the sheet's action blocked the zone's water) and salinity_alert (warning, the zone was watered as decided); their count and the newest 5.

et0
bắt buộc
object

Per weather station a zone in scope names, its latest stored reference ET0 day (meteorology only, as GET /v1/control/et0 answers it), by station.

ControlPreview

object

#352: a dry run of a rule's controller as if the rule were enabled; nothing written or sent.

Thuộc tính
TênKiểuMô tả
generated_at
bắt buộc
number
rule_id
bắt buộc
integer
device_id
bắt buộc
string
provenance
bắt buộc
object

As a program's provenance. A zone's record may carry salinity (#354, control/salinity.py) when its sheet has a salinity section: {state ok|exceeded|not_measured, action block|alert, water {limit_ms_cm, state, sources[]}, soil {limit_ms_cm, basis bulk|pore, capability, state, sources[]}, stale_s}, electrical conductivity in mS/cm only. An exceedance with the action block gives the zone no steps (mode blocked, reason salinity_block), blocks its rule (salinity_block) and raises a high alert salinity_block; with the action alert the zone is watered as decided and a warning alert salinity_alert is raised. not_measured never starts a block. A zone a fallback waters is checked against the salinity sections of both sheets, the fallback rule's and its own rule's (the strictest applies); its record then also carries salinity_sheets [{sheet_id, evaluation}], the sheet watering it first, while salinity is the binding evaluation. A zone blocked by salinity in today's reference program, or named by an open salinity_block alert of the controller, stays blocked while its block section reads not_measured (reason salinity_block, the record's held not_measured), until a usable reading at or below the limit is found. The salinity alerts' detail lists every zone a compose found (zones [{zone, rule_id, sheet_id, action, exceeded}]); a new one is raised when such a zone is in no open alert of its kind, and a person resolves them.

gate
bắt buộc
array<object>
params
bắt buộc
object | null

The set_program params: as sent once dispatched (with the program_version CropPath assigned), else as they would be sent now.

blocked_zones
bắt buộc
array<integer>

ControlProbeHealth

object

#365: one probe of the area at one depth.

Thuộc tính
TênKiểuMô tả
device_id
bắt buộc
string
profile
bắt buộc
string
depth_cm
bắt buộc
number | null
capability
bắt buộc
string | null

The series judged: soil.moisture for a probe a zone names (the series the health gate reads); for a field sensor no zone names, soil.moisture when its profile produces it, else its first capability.

link
bắt buộc
object

The health gate's freshness rule (decision D11): fresh up to 2 poll intervals (at most 1800 s) after the latest reading of any area (which has a value), stale up to 10 poll intervals, offline past that or without a reading.

coverage_30d_pct
bắt buộc
number

Whole hours of the last 720 holding a usable reading (QC pass or not evaluated, a value, Device-recorded), by the reading's own time.

qc_30d
bắt buộc
object
used_by
bắt buộc
array<object>

ControlProgram

object

#352: a program the engine composed (control/programs.py), with the #242 command it became.

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
device_id
bắt buộc
string
local_date
bắt buộc
string
status
bắt buộc
"proposed" | "approved" | "rejected" | "dispatched" | "superseded" | "failed" | "blocked" | "expired" | "withdrawn"
cause
bắt buộc
"daily" | "threshold" | "recompose"
proposed_at
bắt buộc
number
expires_at
bắt buộc
number
decided_by
bắt buộc
string | null
decided_at
bắt buộc
number | null
dispatched_at
bắt buộc
number | null
command_id
bắt buộc
string | null
program_version
bắt buộc
integer | null
error
bắt buộc
string | null
steps
bắt buộc
integer
litres
bắt buộc
number
rules
bắt buộc
array<object>
sheets
bắt buộc
array<object>

Every sheet the program cites: its id, version, series and SHA-256.

withdrew
bắt buộc
boolean

The controller's earlier program was withdrawn with this row.

params
bắt buộc
object | null

The set_program params: as sent once dispatched (with the program_version CropPath assigned), else as they would be sent now.

provenance
bắt buộc
object

What composed it: the rules and how each applied, every sheet cited (id, version, SHA-256, attestation id), each zone's decision, budget and clamps, the day's placed steps (plan), per zone the planned depth and litres with their clamps and an ET0 zone's trace (budget, #353), the weather stations' ET0 days cited (et0, #353) and the decisions' signature (control/engine.py). A zone's record may carry salinity (#354, control/salinity.py) when its sheet has a salinity section: {state ok|exceeded|not_measured, action block|alert, water {limit_ms_cm, state, sources[]}, soil {limit_ms_cm, basis bulk|pore, capability, state, sources[]}, stale_s}, electrical conductivity in mS/cm only. An exceedance with the action block gives the zone no steps (mode blocked, reason salinity_block), blocks its rule (salinity_block) and raises a high alert salinity_block; with the action alert the zone is watered as decided and a warning alert salinity_alert is raised. not_measured never starts a block. A zone a fallback waters is checked against the salinity sections of both sheets, the fallback rule's and its own rule's (the strictest applies); its record then also carries salinity_sheets [{sheet_id, evaluation}], the sheet watering it first, while salinity is the binding evaluation. A zone blocked by salinity in today's reference program, or named by an open salinity_block alert of the controller, stays blocked while its block section reads not_measured (reason salinity_block, the record's held not_measured), until a usable reading at or below the limit is found. The salinity alerts' detail lists every zone a compose found (zones [{zone, rule_id, sheet_id, action, exceeded}]); a new one is raised when such a zone is in no open alert of its kind, and a person resolves them.

decision_note
bắt buộc
string | null
withdrawal
bắt buộc
object | null

#367: who withdrew the program from the controller (null to an agronomist), when (RFC 3339 UTC) and why ([removed] once the company has left); null unless its status is withdrawn.

gate_decisions
bắt buộc
array<ControlGateDecision>
command
bắt buộc
object | null

ControlProgramPage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<ControlProgramSummary>
next_before
bắt buộc
integer | null

ControlProgramReject

object

Thuộc tính
TênKiểuMô tả
reason
không bắt buộc
string

ControlProgramStep

object

Thuộc tính
TênKiểuMô tả
zone
bắt buộc
integer
start_s
bắt buộc
integer
duration_s
bắt buộc
integer
max_volume_l
bắt buộc
number

ControlProgramSummary

object

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
device_id
bắt buộc
string
local_date
bắt buộc
string
status
bắt buộc
"proposed" | "approved" | "rejected" | "dispatched" | "superseded" | "failed" | "blocked" | "expired" | "withdrawn"
cause
bắt buộc
"daily" | "threshold" | "recompose"
proposed_at
bắt buộc
number
expires_at
bắt buộc
number
decided_by
bắt buộc
string | null
decided_at
bắt buộc
number | null
dispatched_at
bắt buộc
number | null
command_id
bắt buộc
string | null
program_version
bắt buộc
integer | null
error
bắt buộc
string | null
steps
bắt buộc
integer
litres
bắt buộc
number
rules
bắt buộc
array<object>
sheets
bắt buộc
array<object>

Every sheet the program cites: its id, version, series and SHA-256.

withdrew
bắt buộc
boolean

The controller's earlier program was withdrawn with this row.

ControlProgramToday

object

#363. Today's program of a controller.

Thuộc tính
TênKiểuMô tả
state
bắt buộc
"none" | "sending" | "installed" | "refused" | "not_installed" | "ended"

The day's newest set_program as the controller reported it.

command_id
bắt buộc
string | null
program_version
bắt buộc
integer | null
control_program_id
bắt buộc
integer | null

The #352 program row that sent it (null: not the rules').

valid_until
bắt buộc
string (date-time) | null (date-time)

The end of its lease.

withdrawable
bắt buộc
boolean

Whether a withdrawal (POST /v1/devices/{id}/program-withdrawal) would be accepted now: a lease in force, a set_program waiting for the controller, or a rule or proposal to hold (#371: before, a lease in force only).

withdraw_effect
bắt buộc
"stop_installed" | "stop_sending" | "hold" | "already_held" | null

#371: what a withdrawal would do now: stop_installed (the controller stops the program it holds), stop_sending (the set_program still waiting for the controller is withdrawn before it is taken), hold (nothing on the controller: the engine is held for the rest of the farm-local day); null when it would answer 409 no_program. already_held (#367 cross-review INFO 5): the controller is held already and nothing else is in force; a withdrawal answers 202 again, idempotently, and the hold stays as it is.

lease_version
bắt buộc
integer | null

#371: the program_version of the program the controller holds now (its lease in force), which the day's newest set_program may not be; null when none is installed.

lease_command_id
bắt buộc
string | null

#371: the set_program command of that program; null when none is installed.

lease_control_program_id
bắt buộc
integer | null

#371: the #352 program row that sent that program (null: none installed, or not the rules').

withdrawal
bắt buộc
null | object

#367 cross-review M2: the withdrawal of the controller's program asked for since its lease was accepted (today when it has none); null when there is none.

ControlRule

object

#352: an irrigation rule (control/rules.py): its kind, controller and zones, the exact signed sheet it reads, its windows, approval and the state the engine last left it in.

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
kind
bắt buộc
"schedule" | "threshold" | "et0_budget" | "lighting"

schedule (the stage's daily depth), threshold (soil moisture against the stage's band, falling back to a schedule rule) or et0_budget (#353: Kc x yesterday's ET0 of the zones' weather station less the rain that counts, falling back to a schedule rule); lighting is recorded but never enabled.

device_id
bắt buộc
string
name
bắt buộc
string
zones
bắt buộc
array<integer>
sheet_id
bắt buộc
integer | null

A signed agronomic input sheet of the company.

windows
bắt buộc
array<object>
fallback_rule_id
bắt buộc
integer | null

A threshold or et0_budget rule's fallback (required to enable one): a disabled schedule rule of the same controller and zones.

eval_interval_s
bắt buộc
integer
min_interval_s
bắt buộc
integer
peer_tolerance_pct
bắt buộc
number | null

The health gate's peer tolerance (percentage points): required by a threshold rule; an et0_budget rule takes it with min_probes or neither (with them its probes trim the depth and measure the bucket).

min_probes
bắt buộc
integer | null

The health gate's minimum of usable probes: required by a threshold rule; an et0_budget rule takes it with peer_tolerance_pct or neither.

approval
bắt buộc
"required" | "auto"
enabled
bắt buộc
boolean
state
bắt buộc
"disabled" | "ok" | "blocked" | "fallback"
state_reason
bắt buộc
string | null

Why blocked or on fallback, e.g. no_signed_sheet, sheet_expired, sheet_hash_mismatch, frozen, stale, disagreeing, fallback_sheet_revoked, manual_override (a person's own program is in force on the controller), salinity_block (#354: a zone's EC reading above its sheet's limit with the action block).

state_at
bắt buộc
number | null
next_run_at
bắt buộc
number | null
last_run_at
bắt buộc
number | null
created_by
bắt buộc
string
created_at
bắt buộc
number
updated_by
bắt buộc
string | null
updated_at
bắt buộc
number
enabled_by
bắt buộc
string | null
enabled_at
bắt buộc
number | null
auto_approval_by
bắt buộc
string | null
auto_approval_at
bắt buộc
number | null
hold_until
bắt buộc
string (date-time) | null (date-time)

#367: the end of the hold on the rule's controller (RFC 3339 UTC): until then the engine proposes and sends nothing automatic for it (a withdrawal holds it until the next farm-local midnight). Null when the controller is not held or its hold has ended.

sheet
bắt buộc
object | null
sheet_gate
bắt buộc
string | null

#354: the reason the rule's sheet would block it today (the sheet gate the engine runs on every compose, on today's local date): no_signed_sheet, sheet_superseded, sheet_revoked, sheet_hash_mismatch, sheet_not_started, sheet_expired, signer_not_verified, sheet_crop_mismatch or sheet_incomplete; null when the sheet is usable.

resumed_command_id
bắt buộc
string | null

The person's own set_program an admin resumed the controller's rules over (POST .../resume), or null.

ControlRuleApproval

object

Thuộc tính
TênKiểuMô tả
approval
bắt buộc
"required" | "auto"

ControlRuleCreate

object

Thuộc tính
TênKiểuMô tả
kind
bắt buộc
"schedule" | "threshold" | "et0_budget" | "lighting"

schedule (the stage's daily depth), threshold (soil moisture against the stage's band, falling back to a schedule rule) or et0_budget (#353: Kc x yesterday's ET0 of the zones' weather station less the rain that counts, falling back to a schedule rule); lighting is recorded but never enabled.

device_id
bắt buộc
string
name
bắt buộc
string
zones
bắt buộc
array<integer>
sheet_id
không bắt buộc
integer | null

A signed agronomic input sheet of the company.

windows
bắt buộc
array<object>
fallback_rule_id
không bắt buộc
integer | null

A threshold or et0_budget rule's fallback (required to enable one): a disabled schedule rule of the same controller and zones.

eval_interval_s
không bắt buộc
integer
min_interval_s
không bắt buộc
integer
peer_tolerance_pct
không bắt buộc
number | null

The health gate's peer tolerance (percentage points): required by a threshold rule; an et0_budget rule takes it with min_probes or neither (with them its probes trim the depth and measure the bucket).

min_probes
không bắt buộc
integer | null

The health gate's minimum of usable probes: required by a threshold rule; an et0_budget rule takes it with peer_tolerance_pct or neither.

ControlRulePage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<ControlRule>
next_before
bắt buộc
integer | null

ControlRuleUpdate

object

Thuộc tính
TênKiểuMô tả
name
không bắt buộc
string
zones
không bắt buộc
array<integer>
sheet_id
không bắt buộc
integer | null

A signed agronomic input sheet of the company.

windows
không bắt buộc
array<object>
fallback_rule_id
không bắt buộc
integer | null

A threshold or et0_budget rule's fallback (required to enable one): a disabled schedule rule of the same controller and zones.

eval_interval_s
không bắt buộc
integer
min_interval_s
không bắt buộc
integer
peer_tolerance_pct
không bắt buộc
number | null

The health gate's peer tolerance (percentage points): required by a threshold rule; an et0_budget rule takes it with min_probes or neither (with them its probes trim the depth and measure the bucket).

min_probes
không bắt buộc
integer | null

The health gate's minimum of usable probes: required by a threshold rule; an et0_budget rule takes it with peer_tolerance_pct or neither.

ControlSensorHealth

object

#365 (CP-5): a growing area's probes, the rules that read them and today's gate decisions (control/cockpit/sensor_health.py).

Thuộc tính
TênKiểuMô tả
generated_at
bắt buộc
string (date-time)

When the answer was computed (the server serves it from its cache for max_age_s).

max_age_s
bắt buộc
integer

How long the server serves this answer from its cache.

poll_hint_s
bắt buộc
integer

How often a screen may ask again.

day
bắt buộc
CockpitDay
area
bắt buộc
string
probes
bắt buộc
array<ControlProbeHealth>
gate_decisions_today
bắt buộc
array<object>

Newest first.

truncated
bắt buộc
boolean

True when more than 200 probes, or more than 200 of the caller's gate decisions of today, were left out.

ControlStepToday

object

#363. A step of the controller's lease today, with what was observed of it.

Thuộc tính
TênKiểuMô tả
zone
bắt buộc
integer
start_s
bắt buộc
integer

Seconds after local midnight.

duration_s
bắt buộc
integer
max_volume_l
bắt buộc
number | null
planned_l
bắt buộc
number | null
actual
bắt buộc
object

ControlZone

object

#352: an irrigation zone of a controller, with its installation facts (control/zones.py).

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
device_id
bắt buộc
string
zone
bắt buộc
integer
growing_area
bắt buộc
string
name
bắt buộc
string
irrigated_area_m2
bắt buộc
number
nominal_flow_lpm
bắt buộc
number
efficiency
bắt buộc
number
max_daily_l
bắt buộc
number
probes
bắt buộc
array<object>

The soil moisture probes that watch the zone: devices of the company whose profile produces soil.moisture (#365).

weather_station
bắt buộc
object | null
controller_utc_offset
bắt buộc
string
field_capacity_pct
bắt buộc
number | null

#353: the zone soil's volumetric water content at field capacity (%), a measurement of the site, never a default; given with wilting_point_pct (above it) or not at all. The et0_budget rule's root-zone bucket needs both.

wilting_point_pct
bắt buộc
number | null

#353: the zone soil's volumetric water content at the permanent wilting point (%), below field_capacity_pct; given with it or not at all.

offset_ok
bắt buộc
boolean

Whether the controller is on Viet Nam time (+07:00): a zone that is not blocks the rules watering it.

created_by
bắt buộc
string
created_at
bắt buộc
number
updated_by
bắt buộc
string | null
updated_at
bắt buộc
number

ControlZoneBand

object

#365 (decision D3): a moisture target band of a stage of a signed sheet, clipped to the range and the sheet's validity. Only from a sheet signed now; never a default.

Thuộc tính
TênKiểuMô tả
from
bắt buộc
string
to
bắt buộc
string
lower_pct
bắt buộc
number
upper_pct
bắt buộc
number
depth_cm
bắt buộc
number

The band's basis depth.

probe_profile
bắt buộc
string | null

The probe profile the band was set for.

stage
bắt buộc
string | null

The stage's code.

stage_name
bắt buộc
AgronomyLocalizedText | null

#372: the stage's name as the sheet words it (vi, en, zh-Hans); null when the stage has none.

sheet
bắt buộc
object

ControlZoneCreate

object

Thuộc tính
TênKiểuMô tả
device_id
bắt buộc
string
zone
bắt buộc
integer
name
bắt buộc
string
irrigated_area_m2
bắt buộc
number
nominal_flow_lpm
bắt buộc
number
efficiency
bắt buộc
number
max_daily_l
bắt buộc
number
probes
không bắt buộc
array<object>
weather_station
không bắt buộc
object | null
controller_utc_offset
bắt buộc
string
field_capacity_pct
không bắt buộc
number | null

#353: the zone soil's volumetric water content at field capacity (%), a measurement of the site, never a default; given with wilting_point_pct (above it) or not at all. The et0_budget rule's root-zone bucket needs both.

wilting_point_pct
không bắt buộc
number | null

#353: the zone soil's volumetric water content at the permanent wilting point (%), below field_capacity_pct; given with it or not at all.

ControlZoneHistory

object

#365 (CP-5): a zone's water per farm day, its runs and the target bands of its signed sheets (control/cockpit/zone_history.py).

Thuộc tính
TênKiểuMô tả
generated_at
bắt buộc
string (date-time)

When the answer was computed (the server serves it from its cache for max_age_s).

max_age_s
bắt buộc
integer

How long the server serves this answer from its cache.

poll_hint_s
bắt buộc
integer

How often a screen may ask again.

day
bắt buộc
CockpitDay
from
bắt buộc
string
to
bắt buộc
string
zone
bắt buộc
object
days
bắt buộc
array<ControlZoneHistoryDay>
runs
bắt buộc
array<ControlZoneRun>

Newest first.

moisture_series
bắt buộc
object | null

What the moisture chart reads from getSensorSeries for the zone's area; null when the zone has neither a band nor a probe.

moisture
bắt buộc
object | null

#372: the soil moisture of the zone's own probes (its probes), read under the zone's scope: one series per probe depth, the basis depth (the first band's, else the first probe's) first, the probes at one depth merged; buckets of an hour up to 14 days, else of a farm day (Asia/Ho_Chi_Minh). Only readings that carry a value are counted (n_missing is 0). Null when the zone names no probe.

bands
bắt buộc
array<ControlZoneBand>
truncated
bắt buộc
boolean

True when older runs than the 500 newest, or more than 5000 set_program commands of the range, were left out.

ControlZoneHistoryDay

object

#365: one farm day of a zone. Every value is null when its source is absent; none is ever filled in.

Thuộc tính
TênKiểuMô tả
date
bắt buộc
string
planned_l
bắt buộc
number | null

The litres the program in force planned for the zone from its dispatch on: the day's newest program that became a command, did not fail and whose command was not refused, unless the controller no longer ran it (a later row records its withdrawal, a person withdrew it, a withdrawal was asked for after its dispatch, or the controller reported it replaced or cancelled) or a person's own set_program (sent outside the engine, a higher version, not refused nor ended, not withdrawn since) was issued before the day ended (the engine's holding rule over a day, control/in_force.py, shared with the budget read); null without one, or when it planned nothing (blocked, no stage).

applied_l
bắt buộc
number | null

Litres the controller reported delivered to the zone that day (water.volume_delivered with meta.zone); null when it reported nothing, never 0 for no data.

planned_mm
bắt buộc
number | null

planned_l over the zone's irrigated area (1 L/m2 = 1 mm), the water given, before efficiency.

applied_mm
bắt buộc
number | null

applied_l over the zone's irrigated area, the basis of planned_mm.

et0_mm
bắt buộc
number | null

Reference evapotranspiration of the day at the zone's weather station (FAO-56, #353): the latest stored version of the station day in et0_daily; null unless its status is ok, and without a station or a stored day.

et0_status
bắt buộc
"ok" | "needs_krs" | "refused" | null

That station day's status: ok, needs_krs (no usable measured radiation: each rule estimates it with its sheet's krs, in the program's provenance) or refused; null without a station or a stored day.

kc_stage
bắt buộc
number | null

The crop coefficient (Kc) the engine applied to the day's ET0: an et0_budget zone's record in a program of the next day, which sizes that day from this one (the Kc control_water_balance's ETc of the day was booked with); null without one.

rain_mm
bắt buộc
number | null

The rain the station's inputs summed for the day (a partial day is a lower bound); null without a station or a stored day.

rule
bắt buộc
object | null

How the newest program row of the day decided the zone; null without one.

program
bắt buộc
object | null

The newest program row of the day for the controller.

ControlZonePage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<ControlZone>

ControlZoneRun

object

#365: one delivery the controller reported for the zone (it reports a run's water when the run ends).

Thuộc tính
TênKiểuMô tả
started_at
bắt buộc
string (date-time) | null (date-time)

When the controller's accepted of a manual run arrived; null for a program step (a controller does not report a step's start).

ended_at
bắt buộc
string (date-time)

The delivered-volume reading's time.

litres
bắt buộc
number
source
bắt buộc
"manual" | "program_step"

manual: a run_zone of the controller completed within 15 minutes of the range, its final report with the same zone and litres within 15 minutes of the reading and its accepted no later than the reading; else program_step.

command_id
bắt buộc
string | null

The run_zone, or the set_program the controller accepted last before the reading, its lease not ended and not withdrawn since; null when none is known.

ControlZoneToday

object

#363. A zone of a controller today.

Thuộc tính
TênKiểuMô tả
zone
bắt buộc
integer
name
bắt buộc
string | null
state
bắt buộc
"idle" | "requested" | "running" | "scheduled_now" | "ended" | "refused" | "fault"

From the reports only: a request waiting for the controller is requested, never running; a program step in its window is scheduled_now (the controllers report no step start).

source
bắt buộc
"run_zone_reply" | "step_water" | "program_reply" | null
since
bắt buộc
string (date-time) | null (date-time)
expected_end
bắt buộc
string (date-time) | null (date-time)
reason
bắt buộc
string | null

The refusal or fault reason token.

today
bắt buộc
object
moisture
bắt buộc
object
sheet
không bắt buộc
null | object

#373: the sheet the zone's enabled rule is bound to, whatever today's band, the rule's state or the sheet's status; null when no enabled rule binds a sheet. status is signed only while today is within the sheet's validity, expired past its last valid day and not_yet_valid before its first, else the sheet's own (draft, superseded, revoked). stage and stage_name are the stage covering today, else null. Optional in the schema, always sent.

nominal_flow_lpm
không bắt buộc
number | null

Controller today only: the installation's nominal flow (#352 control_zones).

max_daily_l
không bắt buộc
number | null

Controller today only: the zone's daily cap (#352 control_zones).

ControlZoneUpdate

object

Thuộc tính
TênKiểuMô tả
name
không bắt buộc
string
irrigated_area_m2
không bắt buộc
number
nominal_flow_lpm
không bắt buộc
number
efficiency
không bắt buộc
number
max_daily_l
không bắt buộc
number
probes
không bắt buộc
array<object>
weather_station
không bắt buộc
object | null
controller_utc_offset
không bắt buộc
string
field_capacity_pct
không bắt buộc
number | null

#353: the zone soil's volumetric water content at field capacity (%), a measurement of the site, never a default; given with wilting_point_pct (above it) or not at all. The et0_budget rule's root-zone bucket needs both.

wilting_point_pct
không bắt buộc
number | null

#353: the zone soil's volumetric water content at the permanent wilting point (%), below field_capacity_pct; given with it or not at all.

Crop

object

A crop of the platform's crop registry.

Thuộc tính
TênKiểuMô tả
code
bắt buộc
string

The crop code that lots (product) and growing areas (crop) name.

names
bắt buộc
CropNames
ripeness_scale
bắt buộc
"levels_1_to_4" | null

The crop's ripeness scale: levels_1_to_4, the four ripeness levels a durian is graded on (1 immature, 2 mature-firm, 3 just ripe, 4 overripe); null when the crop has no ripeness scale.

created_at
bắt buộc
number

Unix seconds (0 for the crop the platform started with).

updated_at
bắt buộc
number

Unix seconds of the last change.

CropCreate

object

Thuộc tính
TênKiểuMô tả
code
bắt buộc
string

The crop code that lots (product) and growing areas (crop) name.

names
bắt buộc
CropNames
ripeness_scale
không bắt buộc
"levels_1_to_4" | null

The crop's ripeness scale: levels_1_to_4, the four ripeness levels a durian is graded on (1 immature, 2 mature-firm, 3 just ripe, 4 overripe); null when the crop has no ripeness scale (never for durian, whose ripeness the knocker grades: a null scale for it is 400 invalid_ripeness_scale).

CropDetail

object

A crop of the registry with its rules per destination market and its grading rules.

Thuộc tính
TênKiểuMô tả
code
bắt buộc
string

The crop code that lots (product) and growing areas (crop) name.

names
bắt buộc
CropNames
ripeness_scale
bắt buộc
"levels_1_to_4" | null

The crop's ripeness scale: levels_1_to_4, the four ripeness levels a durian is graded on (1 immature, 2 mature-firm, 3 just ripe, 4 overripe); null when the crop has no ripeness scale.

created_at
bắt buộc
number

Unix seconds (0 for the crop the platform started with).

updated_at
bắt buộc
number

Unix seconds of the last change.

markets
bắt buộc
array<CropMarketRule>
grading_rules
bắt buộc
array<CropGradingRule>

CropGradingRule

object

The platform's grading rules for one variety of a crop, or for every variety of it (variety null). They apply to a lot whose company has no grading rules of its own for the lot's variety.

Thuộc tính
TênKiểuMô tả
crop
bắt buộc
string
variety
bắt buộc
string | null
rules
bắt buộc
GradingRules
created_at
bắt buộc
number
updated_at
bắt buộc
number

CropGradingRulePut

object

Thuộc tính
TênKiểuMô tả
variety
bắt buộc
string | null

A variety of the crop; null for every variety of it.

rules
bắt buộc
GradingRules

CropList

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<Crop>

Every crop of the registry, by code (at most 200).

configured
bắt buộc
array<string>

The deployment's configured crops (the crops a published code list may name) that have no registry entry: lots and growing areas may name them too, without a sampling rule, a registration protocol or grading rules of their own.

CropMarketRule

object

A crop's rules for one destination market.

Thuộc tính
TênKiểuMô tả
crop
bắt buộc
string
market
bắt buộc
string

ISO 3166-1 alpha-2.

registration_protocol
bắt buộc
boolean

Whether the market's registration protocol applies to the crop: the public lot page then names the protocol for a lot of the crop whose growing area grows it and has a GACC growing-area code.

sampling
bắt buộc
CropSampling | null

The market's sampling rule; null when it sets none (a lot of the crop for this market is then not sampled).

created_at
bắt buộc
number
updated_at
bắt buộc
number

CropMarketRulePut

object

Thuộc tính
TênKiểuMô tả
registration_protocol
bắt buộc
boolean
sampling
bắt buộc
CropSampling | null

CropNames

object

The crop's name in Vietnamese, English and Simplified Chinese (each 1 to 100 characters).

Thuộc tính
TênKiểuMô tả
vi
bắt buộc
string
en
bắt buộc
string
zh-Hans
bắt buộc
string

CropSampling

object

A market's sampling rule for the crop: the share of a lot's export fruits sampled, the lower share once the growing area went clean_days without a failed sample, and the analytes a lab tests.

Thuộc tính
TênKiểuMô tả
rule
bắt buộc
string

The rule's id, unique across crops and markets; every sampling records it.

rule_source
bắt buộc
string

The http(s) address of the published rule.

base_rate
bắt buộc
number

0.02 is 2%.

clean_rate
bắt buộc
number
clean_days
bắt buộc
integer
analytes
bắt buộc
array<string>
analytes_source
không bắt buộc
string | null

The http(s) address that requires these tests; optional.

CropUpdate

object

Thuộc tính
TênKiểuMô tả
names
không bắt buộc
CropNames
ripeness_scale
không bắt buộc
"levels_1_to_4" | null

The crop's ripeness scale: levels_1_to_4, the four ripeness levels a durian is graded on (1 immature, 2 mature-firm, 3 just ripe, 4 overripe); null when the crop has no ripeness scale (never for durian, whose ripeness the knocker grades: a null scale for it is 400 invalid_ripeness_scale).

Device

object

A device and its status read model. last_seen, max_seq and last_model come from the device's ingest state (null before its first message); firmware is device.fw of its newest stored envelope that carries one, and battery_pct / battery_v the newest device.battery / device.battery_voltage reading of a status or event envelope, each among its latest 32 stored (accepted or quarantined) envelopes; last_calibrated_at is when its latest succeeded calibrate command completed. ready is true when the device is active, has an active key that may sign for it (its own, or one of an active gateway at its tenant and site) and was last seen within 24 hours.

Thuộc tính
TênKiểuMô tả
device_id
bắt buộc
string
tenant
bắt buộc
string
site
bắt buộc
string

The site segment of the device's ingest route and MQTT topics.

facility
bắt buộc
string | null

Facility code; null for a device registered before facilities, whose site then stands in for the facility in operator scope.

profile
bắt buộc
string

Device profile id (without version).

status
bắt buộc
string

Only active devices are accepted by ingest and the broker.

display_name
bắt buộc
string | null
vendor_model
bắt buộc
string | null
serial
bắt buộc
string | null
created_at
bắt buộc
number

Unix seconds.

commands
bắt buộc
array<string>

The downlink commands the device's profile declares, sorted by name: the only names POST /v1/devices/{id}/commands accepts for this device (a facility-scoped operator may issue calibrate only).

last_seen
bắt buộc
number | null

Unix seconds (server time of the last message).

max_seq
bắt buộc
integer | null
last_model
bắt buộc
string | null
firmware
bắt buộc
string | null
battery_pct
bắt buộc
number | null
battery_v
bắt buộc
number | null
last_calibrated_at
bắt buộc
number | null

Unix seconds.

ready
bắt buộc
boolean
approval
bắt buộc
"pending" | "approved" | "rejected"

Platform approval (#201): pending until a platform admin approves or rejects it. Only evidence from an approved device, signed by its own key or an approved gateway's, counts as Device-recorded or above; evidence from a pending or rejected one is stored and counts as Self-declared.

approval_reason
bắt buộc
string | null

The reason of a rejection; null otherwise.

approval_at
bắt buộc
number | null

Unix seconds of the last approval decision.

DeviceApproval

object

Thuộc tính
TênKiểuMô tả
keys
bắt buộc
array<string>

The kids of the identity's waiting keys the platform admin saw in the queue (keys of its DeviceApprovalItem with approval pending), possibly none. Exactly these keys are approved; any other waiting key stays pending. 409 when one is no longer an active key of this device or gateway waiting for approval.

DeviceApprovalItem

object

A device or gateway of any company in the platform's approval queue (#201). The pending queue also lists an approved one with an active key no platform admin approved yet.

Thuộc tính
TênKiểuMô tả
kind
bắt buộc
"device" | "gateway"
id
bắt buộc
string

The device or gateway id (one namespace).

tenant
bắt buộc
string

The company that registered it.

tenant_name
bắt buộc
string | null
site
bắt buộc
string
facility
bắt buộc
string | null
profile
bắt buộc
string | null

The device profile; null for a gateway.

display_name
bắt buộc
string | null
registered_by
bắt buộc
string | null

Who registered it (null before #201, or when the platform provisioned it).

registered_at
bắt buộc
number | null

Unix seconds; null for an older gateway.

approval
bắt buộc
"pending" | "approved" | "rejected"
approval_reason
bắt buộc
string | null
approval_at
bắt buộc
number | null

Unix seconds of the last decision.

approval_by
bắt buộc
string | null

Who decided last: a platform admin, provision (the platform's seed) or migration (grandfathered when approval began).

keys
bắt buộc
array<object>

Its active signing keys (never the public key itself), each with its own approval: a key a company registers after the device or gateway was approved waits for the platform; an approval lists the waiting keys it approves (DeviceApproval).

DeviceApprovalPage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<DeviceApprovalItem>
next_cursor
bắt buộc
string | null

Pass as cursor for the next page; null on the last page.

DeviceCreate

object

Thuộc tính
TênKiểuMô tả
device_id
bắt buộc
string

Unique across every tenant's devices and gateways. An id starting with agritrace-, in any letter case, is reserved for the platform's own broker identities and refused (400).

profile
bắt buộc
string

The id of a device profile the server knows; any other id is refused. The profiles, each served as a file: vn.agritrace.air-th-xy-md02 (/developers/downloads/profiles/air-th-xy-md02.json); vn.agritrace.durian-knocker (/developers/downloads/profiles/durian-knocker.json); vn.agritrace.gateway (/developers/downloads/profiles/gateway.json), a gateway's own status heartbeat, refused for a device (invalid profile); vn.agritrace.harvest-app (/developers/downloads/profiles/harvest-app.json); vn.agritrace.irrigation-controller (/developers/downloads/profiles/irrigation-controller.json); vn.agritrace.pack-station (/developers/downloads/profiles/pack-station.json); vn.agritrace.rain-ub-ra-n1 (/developers/downloads/profiles/rain-ub-ra-n1.json); vn.agritrace.reefer-logger (/developers/downloads/profiles/reefer-logger.json); vn.agritrace.scale-serial (/developers/downloads/profiles/scale-serial.json); vn.agritrace.soil-rs485-4in1-ec (/developers/downloads/profiles/soil-rs485-4in1-ec.json); vn.agritrace.soil-rs485-4in1 (/developers/downloads/profiles/soil-rs485-4in1.json).

site
bắt buộc
string
facility
bắt buộc
string

A facility code of the caller's tenant.

display_name
không bắt buộc
string | null
vendor_model
không bắt buộc
string | null
serial
không bắt buộc
string | null

DeviceMetadata

object

SENS-B1d (#234): what a device's readings can be judged by: the placement version in force (#225) and the calibrations not superseded. This is the document an EPCIS deviceMetadata link of the device's readings can name: https://txng.theio.vn/v1/devices/{id}/metadata (on this deployment's origin); readable only by the device's company and CropPath, never public. EPCIS exports do not link it yet.

Thuộc tính
TênKiểuMô tả
device_id
bắt buộc
string
placement
bắt buộc
DevicePlacement | null

The placement version in force at as_of (an installation, or a removal); null when none has started.

calibrations
bắt buộc
array<Calibration>

The calibrations not superseded, newest first, at most 1000.

as_of
bắt buộc
number

The server time the placement in force was read at.

DevicePage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<Device>
next_cursor
bắt buộc
string | null

Pass as cursor for the next page; null on the last page.

DevicePlacement

object

SENS-A2 (#225): one placement version of a device, never changed once recorded: an installation, or a removal (removed_at set, no binding). A version is in force from installed_at (for a removal removed_at, else recorded_at) until valid_until, when the next version starts (null for the current one). Ingest holds an envelope as growing_area_mismatch when the version in force at its time is fixed and bound to another growing area than the one the envelope claims; an envelope timed before the first version is checked against the first version. While a removal is in force, an envelope claiming a growing area raises a device_removed alert and, when the ended installation was fixed, is held (growing_area_mismatch for another area than that installation's, else device_removed).

Thuộc tính
TênKiểuMô tả
device_id
bắt buộc
string
version
bắt buộc
integer

1 for the first placement, then 2, 3, ...

mobility
bắt buộc
"fixed" | "mobile"
key_protection
bắt buộc
"hardware" | "software"
gnss
bắt buộc
boolean
growing_area
bắt buộc
string | null
lat
bắt buộc
number | null
lon
bắt buộc
number | null
accuracy_m
bắt buộc
number | null
fix_at
bắt buộc
number | null
installed_at
bắt buộc
number | null
installer
bắt buộc
string | null
photo_sha256
bắt buộc
string | null
depth_cm
bắt buộc
number | null
sensor_serial
bắt buộc
string | null
note
bắt buộc
string | null
removed_at
bắt buộc
number | null

Set on a removal version: when the device was taken out.

recorded_by
không bắt buộc
string

The CropPath platform admin who recorded it; present for platform admins only.

recorded_at
bắt buộc
number
valid_until
bắt buộc
number | null

When the next version starts; null for the current version.

DevicePlacementCreate

object

SENS-A2 (#225): a new placement version of a device, recorded by a platform admin acting for the device's company (X-Tenant). mobility and key_protection are required. A fixed placement must also give the growing area it is bound to (one of the company's), the surveyed install point (lat, lon, accuracy_m) and the commissioning record: photo_sha256 (a JPEG or PNG the company's records hold, uploaded first with PUT /v1/attachments/{sha256} for the same company), fix_at, installed_at and installer. A mobile placement may leave them out. Times are Unix seconds, from 2020-01-01 and at most 300 s ahead of the server clock; fix_at is at most 7 days before installed_at and never after it (300 s of clock drift allowed).

Thuộc tính
TênKiểuMô tả
mobility
bắt buộc
"fixed" | "mobile"

fixed: a station or probe installed in one place. mobile: a handheld device or phone.

key_protection
bắt buộc
"hardware" | "software"

The platform admin's statement of where the device keeps its signing key: hardware (a secure element, TPM or attested phone key store) or software. Recorded as stated; not verified by the platform. Owner decision Q3 (#223): location claims count as recorded by a device only with hardware, and never for a device registered before placements existed.

gnss
không bắt buộc
boolean

The device has its own GNSS receiver. Default false.

growing_area
không bắt buộc
string

Code of a growing area of the device's company; required for fixed.

lat
không bắt buộc
number

Install point latitude, WGS84.

lon
không bắt buộc
number

Install point longitude, WGS84.

accuracy_m
không bắt buộc
number

Accuracy of the install point fix in metres. lat, lon and accuracy_m come together.

fix_at
không bắt buộc
number

When the GPS fix of the install point was taken: at most 7 days before installed_at, never after it.

installed_at
không bắt buộc
number

When the device was installed there: the version is in force from then (from when it was recorded when absent), and may not start before the current version.

installer
không bắt buộc
string

Who installed it.

photo_sha256
không bắt buộc
string

SHA-256 of the installer's photo of the installed device (JPEG or PNG).

depth_cm
không bắt buộc
number

Probe depth in centimetres.

sensor_serial
không bắt buộc
string

Probe serial number.

note
không bắt buộc
string

Why it was placed or moved.

DevicePlacementRemoval

object

SENS-A2 (#225): the device was taken out. A new placement version that ends the binding of the installation in force (it keeps that version's mobility, key_protection and gnss; growing area, install point and commissioning record are null). Only a device whose current version is an installation can be removed; a later installation is a new version again. While a removal is in force, an envelope of the device that claims a growing area raises a device_removed alert; when the installation the removal ended was fixed, the envelope is also held: as growing_area_mismatch when it claims another growing area than that installation's, else as device_removed.

Thuộc tính
TênKiểuMô tả
removed_at
bắt buộc
number

When the device was taken out, Unix seconds: from 2020-01-01, at most 300 s ahead of the server clock, and not before the current version starts.

note
không bắt buộc
string

Why it was taken out.

DevicePlacements

object

SENS-A2 (#225): a device's placement versions, newest first (at most 1000).

Thuộc tính
TênKiểuMô tả
device_id
bắt buộc
string
registered_before_placements
bắt buộc
boolean

The device existed before placements were introduced (owner decision Q3, #223): its location claims stay Self-declared until it is replaced, whatever its placement says.

items
bắt buộc
array<DevicePlacement>

DeviceRejection

object

Thuộc tính
TênKiểuMô tả
reason
bắt buộc
string

Shown to the company.

DeviceUpdate

object

Thuộc tính
TênKiểuMô tả
status
không bắt buộc
"active" | "inactive"
display_name
không bắt buộc
string | null
vendor_model
không bắt buộc
string | null
serial
không bắt buộc
string | null

DidDocument

object

A DID document (W3C DID Core 1.0) of the did:web method: every active and retired key of the facility as a JsonWebKey2020 verification method, each also an assertion method; a revoked key is left out.

Thuộc tính
TênKiểuMô tả
@context
bắt buộc
array<string>
id
bắt buộc
string
verificationMethod
bắt buộc
array<object>
assertionMethod
bắt buộc
array<string>

EatingWindow

object

When the fruit is expected to be good to eat, counted from the measurement day in Asia/Ho_Chi_Minh; the row of the eating-window table for the effective level, the whole days since the lot's harvest date and the lot's storage band.

Thuộc tính
TênKiểuMô tả
start_days
bắt buộc
integer
end_days
bắt buộc
integer
from_date
bắt buộc
string (date)
to_date
bắt buộc
string (date)
band
bắt buộc
"ambient" | "10-13C" | "14-18C"

Storage temperature band of the lot.

warning
bắt buộc
"immature" | "eat_soon" | "overripe" | null

EatingWindowRow

object

Thuộc tính
TênKiểuMô tả
level
bắt buộc
integer
min_days
bắt buộc
integer
max_days
bắt buộc
integer
band
bắt buộc
"ambient" | "10-13C" | "14-18C"
start_days
bắt buộc
integer
end_days
bắt buộc
integer
warning
bắt buộc
"immature" | "eat_soon" | "overripe" | null

EmailSettings

object

Thuộc tính
TênKiểuMô tả
notifications
bắt buộc
boolean

Whether the person gets the notification, alert and recall emails (on until they turn it off). Invitation and password emails are always sent.

language
bắt buộc
"vi" | "en" | "zh-Hans" | null

The language of the person's emails; null: not known, an email then carries Vietnamese, English and Simplified Chinese.

delivery
bắt buộc
boolean

Whether this server sends email at all (SMTP configured). When false, one-time links are passed on by hand; when true, each one-time link is also emailed to its person.

EmailSettingsUpdate

object

Thuộc tính
TênKiểuMô tả
notifications
bắt buộc
boolean
language
không bắt buộc
"vi" | "en" | "zh-Hans" | null

Omitted or null: not known.

EmailUnsubscribe

object

Thuộc tính
TênKiểuMô tả
token
bắt buộc
string

The token of the email's link (/login#unsubscribe=<token>).

EmailUnsubscribed

object

Thuộc tính
TênKiểuMô tả
notifications
bắt buộc
false

Envelope

object

A signed envelope (envelope version 1, spec agritrace.iot/1.0). The server applies the envelope's full schema, served at /developers/downloads/envelope-v1.schema.json; it is deliberately not duplicated here, so this schema is open. An event envelope's eventType and the context keys it requires are those of /developers/downloads/event-types-v1.json; each reading's capability, unit and range are those of /developers/downloads/capabilities-v1.json; device.profile is <profile id>@<profile version> of a device profile below /developers/downloads/profiles/ (see DeviceCreate.profile).

EnvelopeDetail

object

One stored envelope with its signed payload as stored and its signature checked again.

Thuộc tính
TênKiểuMô tả
id
bắt buộc
string

Envelope id.

device_id
bắt buộc
string
site
bắt buộc
string

Site of the ingest route.

facility
bắt buộc
string | null

The envelope context's facility, null when it names none.

seq
bắt buộc
integer

The device's sequence number.

kind
bắt buộc
"telemetry" | "event" | "status"
event_type
bắt buộc
string | null

Event type; null for telemetry and status.

event_time
bắt buộc
string

The device's time, as sent.

received_at
bắt buộc
number

Server receive time, epoch seconds.

status
bắt buộc
"accepted" | "quarantined" | "rejected_after_review"
reasons
bắt buộc
array<string>

Why ingest quarantined it; empty when accepted on arrival.

lot
bắt buộc
string | null

The envelope context's lot.

growing_area
bắt buộc
string | null

The envelope context's growing area.

payload
bắt buộc
object

The signed envelope exactly as stored (spec envelope v1).

signature
bắt buộc
object

valid: the stored key named by sig.kid verifies the stored payload; invalid: it does not (the payload or the key changed since ingest); unknown_key: no stored key has that kid; unsigned: the payload has no sig. The key itself is never returned.

EnvelopePage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<EnvelopeSummary>
next_cursor
bắt buộc
string | null

Pass as cursor for the next page; null on the last page. A page with fewer items than the limit, or none, may still have one.

EnvelopeSummary

object

One stored envelope of the device message log (#117): routing and outcome columns only.

Thuộc tính
TênKiểuMô tả
id
bắt buộc
string

Envelope id.

device_id
bắt buộc
string
site
bắt buộc
string

Site of the ingest route.

facility
bắt buộc
string | null

The envelope context's facility, null when it names none.

seq
bắt buộc
integer

The device's sequence number.

kind
bắt buộc
"telemetry" | "event" | "status"
event_type
bắt buộc
string | null

Event type; null for telemetry and status.

event_time
bắt buộc
string

The device's time, as sent.

received_at
bắt buộc
number

Server receive time, epoch seconds.

status
bắt buộc
"accepted" | "quarantined" | "rejected_after_review"
reasons
bắt buộc
array<string>

Why ingest quarantined it; empty when accepted on arrival.

lot
bắt buộc
string | null

The envelope context's lot.

EpcisCaptureReport

object

The outcome of one capture, one result per event in document order.

Thuộc tính
TênKiểuMô tả
capture_id
bắt buộc
integer

The capture's id (the audit row's entity id).

events
bắt buộc
integer

Events in the document.

accepted
bắt buộc
integer

Events stored by this capture.

duplicates
bắt buộc
integer

Events already held with the same content.

rejected
bắt buộc
integer

Events refused (nothing written for them).

source
bắt buộc
"partner_capture"

Provenance of captured events.

tier
bắt buộc
"self_declared"

Trust tier of captured events (ADR 0001): always Self-declared.

results
bắt buộc
array<EpcisCaptureResult>

EpcisCaptureResult

object

One event's outcome. step and references only when accepted; code (and usually detail) only when rejected.

Thuộc tính
TênKiểuMô tả
index
bắt buộc
integer

The event's position in eventList.

event_id
bắt buộc
string | null

The event's eventID; null when it sent none usable.

status
bắt buộc
"accepted" | "duplicate" | "rejected"
step
không bắt buộc
"harvest" | "receive" | "pack" | "ship" | "observe"

The journey step the event records: commissioning is the harvest, receiving, packing, shipping; sensor_reporting (#238) is an observation (observe).

references
không bắt buộc
array<object>

The tenant's records the event names.

code
không bắt buộc
"invalid_event" | "unsupported_event_type" | "missing_event_id" | "unsupported_action" | "unsupported_error_declaration" | "unsupported_biz_step" | "event_too_large" | "event_too_deep" | "event_id_conflict" | "no_reference" | "unknown_reference"

Why the event was rejected.

detail
không bắt buộc
string

The member or the identifier at fault (machine text, not translated).

EpcisDocument

object

An EPCIS 2.0 JSON-LD document; its shape is defined by the EPCIS standard, so the schema is open.

Error

object

Every error body. code is the message head reduced to lower-case snake case.

Thuộc tính
TênKiểuMô tả
error
bắt buộc
string
code
bắt buộc
string
items
không bắt buộc
array<BatchItemError>

A batch request (#170) only: the items that failed, by index. Every invalid item on a 400 invalid_batch; the one item the stored state refused on a batch_rejected, with the status the single-item route gives it.

details
không bắt buộc
array<AddressToCode>

A seal refused with address_not_coded (#273, owner decision D5) only: each record whose address must be picked from the official list of administrative units (a province and a commune) before the lot can be packed.

ExportLabel

object

What a lot's export carton and pallet labels print for a market, and why they are not ready for export (problems, empty when ready).

Thuộc tính
TênKiểuMô tả
lot
bắt buộc
string
market
bắt buộc
string
lot_status
bắt buộc
string
template_version
bắt buộc
integer
template
bắt buộc
ExportLabelTemplate
fields
bắt buộc
object
pallet
bắt buộc
object

The selected cartons' totals (the pallet label) and the lot's public URL.

cartons
bắt buộc
array<ExportLabelCarton>
problems
bắt buộc
array<"lot_not_packed" | "lot_recalled" | "shipment_market_mismatch" | "fruit_missing" | "origin_missing" | "export_country_missing" | "orchard_missing" | "packing_house_missing" | "producer_missing" | "packing_date_missing" | "address_not_coded" | "orchard_code_not_cross_checked" | "packing_house_code_not_cross_checked" | "no_cartons">
ready
bắt buộc
boolean
next_cursor
bắt buộc
string | null

ExportLabelCarton

object

Thuộc tính
TênKiểuMô tả
code
bắt buộc
string
carton_no
bắt buộc
integer
net_mass_kg
bắt buộc
number | null
fruit_count
bắt buộc
integer
qr_url
bắt buộc
string (uri)

The carton's public URL: a GS1 Digital Link with the lot's GTIN, else <resolver>/q/<public id>.

label_code
không bắt buộc
string

#288, with label_code=1 only: the carton's lookup code in its grouped form (three groups of five Crockford base 32 characters), derived from the carton's public id. A person types it on the scan page when the QR code cannot be scanned; GET /v1/public/resolve answers it with the carton's lot.

ExportLabelCodeField

object

The orchard (growing area, PUC code) or the packing house (facility, PHC code).

Thuộc tính
TênKiểuMô tả
name
bắt buộc
string | null
code
bắt buộc
string | null

The registration code, only when cross-checked; null otherwise (never printed unchecked).

check
bắt buộc
"matched" | "no_code" | "no_list" | "not_found" | "mismatch" | "suspended" | "revoked" | "expired"

The code against the published code lists (#150): no_list while no list exists.

cross_checked
bắt buộc
boolean

Matched on a list that is not stale.

ExportLabelFieldTemplate

object

A field's caption in Chinese and English and whether the label is refused without a value.

Thuộc tính
TênKiểuMô tả
zh
bắt buộc
string
en
bắt buộc
string
required
bắt buộc
boolean

ExportLabelPrint

object

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
lot
bắt buộc
string
market
bắt buộc
string
kind
bắt buộc
"carton" | "pallet"
from
bắt buộc
integer
to
bắt buộc
integer
cartons
bắt buộc
integer
template_version
bắt buộc
integer
printed_by
bắt buộc
string
printed_at
bắt buộc
number

ExportLabelPrintCreate

object

Thuộc tính
TênKiểuMô tả
market
bắt buộc
string
kind
bắt buộc
"carton" | "pallet"
from
không bắt buộc
integer
to
không bắt buộc
integer
template_version
bắt buộc
integer

The template version of the label the console read and prints (ExportLabel.template_version); 409 label_changed when another version is in force.

cartons
bắt buộc
integer

The selection's carton count the console read (ExportLabel.pallet.cartons); 409 label_changed when the selection now holds another count.

ExportLabelTemplate

object

A destination market's label template, text only: the mark on every package and pallet, the export country, the fruit name of each lot product, each field's captions and whether it is required, whether the PUC and PHC codes must be cross-checked, and the rule it follows. Texts are 1 to 120 characters on one line.

Thuộc tính
TênKiểuMô tả
mark
bắt buộc
ExportLabelText
export_country
bắt buộc
ExportLabelText
products
bắt buộc
map<string, ExportLabelText>

The fruit name per lot product (lots.product, e.g. durian).

fields
bắt buộc
object
require_cross_checked_codes
bắt buộc
boolean

When true, a label whose PUC or PHC code is not cross-checked against the published code lists is not ready for export.

source
bắt buộc
string

ExportLabelTemplateList

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<ExportLabelTemplateView>

ExportLabelTemplateView

object

A market's template in force: version 0 is the built-in default (no edit yet).

Thuộc tính
TênKiểuMô tả
market
bắt buộc
string
version
bắt buộc
integer
template
bắt buộc
ExportLabelTemplate
updated_at
bắt buộc
number | null
updated_by
bắt buộc
string | null

ExportLabelText

object

A text of the label in Chinese (zh) and English (en).

Thuộc tính
TênKiểuMô tả
zh
bắt buộc
string
en
bắt buộc
string

Facility

object

A facility (packing house) of one tenant. Codes created through the API look like VN-TGPH-021; codes from the migration backfill keep their original spelling.

Thuộc tính
TênKiểuMô tả
code
bắt buộc
string
tenant
bắt buộc
string
name
bắt buộc
string
address
bắt buộc
string | null
province
bắt buộc
string | null
district
bắt buộc
string | null
gacc_phc_code
bắt buộc
string | null

GACC registration of the packing house.

lines
bắt buộc
array<string>
source
bắt buộc
"manual" | "backfill"
approved_at
bắt buộc
number | null

Unix seconds; null until approved.

slug
bắt buộc
string
created_at
bắt buộc
number

Unix seconds.

updated_at
bắt buộc
number

Unix seconds.

proposed_at
bắt buộc
number | null

SELF-2-8 (#197): Unix seconds when a company admin proposed the facility (POST /v1/facility-proposals); null for a facility the platform created. A proposal with approved_at null waits for CropPath: no lot, shipment, device, gateway, harvest app key or signing key may name it.

commune
không bắt buộc
string | null

The commune's official name (xã, phường or đặc khu) when the record is coded; else null. Only with admin_units=1 on the read (#273); never in a write's answer nor without the parameter.

province_code
không bắt buộc
string | null

The province's official 2-digit code, in the list admin_units_version; null when not coded. Only with admin_units=1 on the read (#273); never in a write's answer nor without the parameter.

commune_code
không bắt buộc
string | null

The commune's official 5-digit code, in the list admin_units_version; null when not coded. A code is only meaningful with its version (codes were reused across the 2025 reform). Only with admin_units=1 on the read (#273); never in a write's answer nor without the parameter.

admin_units_version
không bắt buộc
string | null

The version of the official list the codes were taken from (for example vn-2026-10-17); null without codes. Only with admin_units=1 on the read (#273); never in a write's answer nor without the parameter.

address_before_reform
không bắt buộc
object | null

The province, district and commune text the record held before it was coded, or the text a request gave through the deprecated text path; kept for good once set. Null for a record entered with codes. Only with admin_units=1 on the read (#273); never in a write's answer nor without the parameter.

address_status
không bắt buộc
"coded" | "choose_commune" | "needs_commune" | "outside_vietnam" | null

coded: the codes are set from the official list; choose_commune: the old commune was split, a person picks one of address_candidates; needs_commune: no codes yet (given as text, or before the reform), a person picks the commune; outside_vietnam: a company profile in another country, where the codes do not apply. Null for a record not reviewed since the codes were introduced. Only with admin_units=1 on the read (#273); never in a write's answer nor without the parameter.

address_candidates
không bắt buộc
array<string> | null

For choose_commune: the official commune codes to pick from; else null. Only with admin_units=1 on the read (#273); never in a write's answer nor without the parameter.

FacilityCertification

object

#269: a packing-house certification of a facility. Shown to the company's staff only: no trust tier and no public page uses them (architect decision on #269; ADR 0001).

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
facility
bắt buộc
string
scheme
bắt buộc
"ISO 22000" | "FSSC 22000" | "BRCGS" | "IFS"

The packing-house certification scheme, compared exactly.

number
bắt buộc
string

The certificate number.

issuer
bắt buộc
string

The certifier (certification body) that issued the certificate.

valid_from
bắt buộc
string (date)

The first valid day.

valid_to
bắt buộc
string (date)

The last valid day, not before valid_from.

evidence_sha256
bắt buộc
string

The SHA-256 of the certificate document, a company upload (GET /v1/attachments/{sha256} for the facility's readers; never public).

created_at
bắt buộc
number

When it was recorded (Unix seconds).

ended_on
bắt buộc
string (date) | null (date)

The day it stopped being in force (withdrawn, suspended or replaced), from valid_from to valid_to; null while it was not ended.

end_reason
bắt buộc
string | null

Why it was ended; null while not.

ended_at
bắt buộc
number | null

When it was ended (Unix seconds); null while not.

status
bắt buộc
"valid" | "expired" | "not_yet_valid" | "ended"

On today's date in Viet Nam: ended from ended_on, else not_yet_valid before valid_from, expired after valid_to, valid otherwise.

FacilityCertificationCreate

object

#269: a packing-house certification to record on a facility.

Thuộc tính
TênKiểuMô tả
scheme
bắt buộc
"ISO 22000" | "FSSC 22000" | "BRCGS" | "IFS"

The packing-house certification scheme, compared exactly.

number
bắt buộc
string

The certificate number.

issuer
bắt buộc
string

The certifier.

valid_from
bắt buộc
string (date)
valid_to
bắt buộc
string (date)

Not before valid_from.

evidence_sha256
bắt buộc
string

The SHA-256 of the certificate document the company uploaded first with PUT /v1/attachments/{sha256}.

FacilityCertificationEnd

object

#269: the end of a facility's certification.

Thuộc tính
TênKiểuMô tả
ended_on
bắt buộc
string (date)

The day it stopped being in force, from valid_from to valid_to.

reason
bắt buộc
string

Why it was ended.

FacilityCertificationList

object

#269: every certification of a facility (at most 100), newest valid_from first.

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<FacilityCertification>

FacilityCreate

object

Thuộc tính
TênKiểuMô tả
code
bắt buộc
string
name
bắt buộc
string
address
không bắt buộc
string | null
province
không bắt buộc
string | null

Deprecated (#273), sunset 1 May 2027: the province as free text. Send province_code and commune_code instead. A body that gives the address as text only is still accepted until the sunset: the record is stored as not yet coded (address_status needs_commune) and the answer carries the Deprecation, Sunset and Link headers.

district
không bắt buộc
string | null

Deprecated (#273), sunset 1 May 2027: Viet Nam has had no district level since 1 July 2025. Send province_code and commune_code instead; with them district must be absent or null (400 district_with_codes).

province_code
không bắt buộc
string | null

#273: the province (tỉnh or thành phố trực thuộc trung ương) by its official 2-digit code in the administrative units list in force (getAdminUnits). Sent with commune_code, both or neither; with them province, district and commune must be absent or null and the server writes the official names.

commune_code
không bắt buộc
string | null

#273: the commune (xã, phường or đặc khu) by its official 5-digit code in the administrative units list in force (getAdminUnits with province). Sent with province_code, both or neither; the commune must lie in that province by the list, never by its digits.

gacc_phc_code
không bắt buộc
string | null
lines
không bắt buộc
array<string>
slug
không bắt buộc
string

FacilityGln

object

#161: a facility's GLN (EPCIS read point and business location of its events).

Thuộc tính
TênKiểuMô tả
facility
bắt buộc
string
gln
bắt buộc
string | null

GS1 Global Location Number: 13 digits, the last the GS1 mod-10 check digit; null when none.

FacilityPage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<Facility>
next_cursor
bắt buộc
string | null

Pass as cursor for the next page; null on the last page.

FacilityProposal

object

SELF-2-8 (#197): a company's facility proposal waiting for CropPath, in the platform's queue.

Thuộc tính
TênKiểuMô tả
code
bắt buộc
string
tenant
bắt buộc
string
tenant_name
bắt buộc
string

The proposing company's name.

name
bắt buộc
string
address
bắt buộc
string | null
province
bắt buộc
string | null
district
bắt buộc
string | null
lines
bắt buộc
array<string>
slug
bắt buộc
string

The default slug of the code; the approval may set another.

proposed_at
bắt buộc
number

Unix seconds.

proposed_by
bắt buộc
string | null

Who proposed it (the account's email).

FacilityProposalApproval

object

SELF-2-8 (#197): what CropPath sets when it approves a proposal (both optional; the slug is the facility's did:web path).

Thuộc tính
TênKiểuMô tả
slug
không bắt buộc
string
gacc_phc_code
không bắt buộc
string | null

FacilityProposalCreate

object

SELF-2-8 (#197): what a company admin gives when proposing a facility. Never the slug or the GACC PHC code: CropPath sets both when it approves the proposal.

Thuộc tính
TênKiểuMô tả
code
bắt buộc
string
name
bắt buộc
string
address
không bắt buộc
string | null
province
không bắt buộc
string | null

Deprecated (#273), sunset 1 May 2027: the province as free text. Send province_code and commune_code instead. A body that gives the address as text only is still accepted until the sunset: the record is stored as not yet coded (address_status needs_commune) and the answer carries the Deprecation, Sunset and Link headers.

district
không bắt buộc
string | null

Deprecated (#273), sunset 1 May 2027: Viet Nam has had no district level since 1 July 2025. Send province_code and commune_code instead; with them district must be absent or null (400 district_with_codes).

province_code
không bắt buộc
string | null

#273: the province (tỉnh or thành phố trực thuộc trung ương) by its official 2-digit code in the administrative units list in force (getAdminUnits). Sent with commune_code, both or neither; with them province, district and commune must be absent or null and the server writes the official names.

commune_code
không bắt buộc
string | null

#273: the commune (xã, phường or đặc khu) by its official 5-digit code in the administrative units list in force (getAdminUnits with province). Sent with province_code, both or neither; the commune must lie in that province by the list, never by its digits.

lines
không bắt buộc
array<string>

FacilityProposalPage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<FacilityProposal>
next_cursor
bắt buộc
string | null

FacilityProposalRejected

object

SELF-2-8 (#197): the proposal CropPath rejected (it is deleted, so its code is free again).

Thuộc tính
TênKiểuMô tả
code
bắt buộc
string
tenant
bắt buộc
string
name
bắt buộc
string
reason
bắt buộc
string

FacilityProposalRejection

object

Thuộc tính
TênKiểuMô tả
reason
bắt buộc
string

Shown to the company in its activity log.

FacilityUpdate

object

gacc_phc_code and slug: platform_admin only.

Thuộc tính
TênKiểuMô tả
name
không bắt buộc
string
address
không bắt buộc
string | null
province
không bắt buộc
string | null

Deprecated (#273), sunset 1 May 2027: the province as free text. Send province_code and commune_code instead. A body that gives the address as text only is still accepted until the sunset: the record is stored as not yet coded (address_status needs_commune) and the answer carries the Deprecation, Sunset and Link headers.

district
không bắt buộc
string | null

Deprecated (#273), sunset 1 May 2027: Viet Nam has had no district level since 1 July 2025. Send province_code and commune_code instead; with them district must be absent or null (400 district_with_codes).

province_code
không bắt buộc
string | null

#273: the province (tỉnh or thành phố trực thuộc trung ương) by its official 2-digit code in the administrative units list in force (getAdminUnits). Sent with commune_code, both or neither; with them province, district and commune must be absent or null and the server writes the official names.

commune_code
không bắt buộc
string | null

#273: the commune (xã, phường or đặc khu) by its official 5-digit code in the administrative units list in force (getAdminUnits with province). Sent with province_code, both or neither; the commune must lie in that province by the list, never by its digits.

gacc_phc_code
không bắt buộc
string | null
lines
không bắt buộc
array<string>
slug
không bắt buộc
string

FourEyesState

object

INTEGRITY-3 (#203). The selected company's second admin approval: whether its critical actions wait for a second admin, how many active company admins it has (fewer than 2: CropPath support is the second approver), how many requests wait for a decision, and how long a request may wait.

Thuộc tính
TênKiểuMô tả
require_second_admin
bắt buộc
boolean
admins
bắt buộc
integer

Active company admins (active membership and account).

pending
bắt buộc
integer

Requests waiting for a decision (not expired).

expires_after_s
bắt buộc
integer

Seconds a request may wait (72 hours).

FourEyesUpdate

object

Thuộc tính
TênKiểuMô tả
require_second_admin
bắt buộc
boolean

Fruit

object

A fruit record: identity, label fields and the measurements bound to it (L3).

Thuộc tính
TênKiểuMô tả
tenant
bắt buộc
string
code
bắt buộc
string

Fruit code Q-<lot seq>-<n>, unique within the tenant.

n
bắt buộc
integer

Position of the fruit in its lot: 1, 2, ... without gaps.

public_id
bắt buộc
string

128 random bits (hex); the public handle of the fruit, never derived from code or n.

lot
bắt buộc
string

Lot code.

session
bắt buộc
string

Measurement session id.

line
bắt buộc
string

The session's line.

operator
bắt buộc
string | null

Opaque operator id user-<id> of the signed-in user who allocated it; null for API tokens.

status
bắt buộc
"awaiting_device" | "recorded" | "overridden" | "rejected" | "remeasured"

Fruit record state; allocation starts at awaiting_device.

labels_printed_at
bắt buộc
number | null

Unix seconds the label was printed (allocation).

created_at
bắt buộc
number

Unix seconds.

updated_at
bắt buộc
number

Unix seconds.

qr_url
bắt buộc
string (uri)

The QR content: a GS1 Digital Link <base>/01/<gtin>/10/<lot>/21/<serial> (20-character random serial) when the lot has a GTIN and a lot code of at most 20 characters, else <base>/q/<public_id>. The base is the deployment's resolver origin, AGRITRACE_RESOLVER_BASE (default https://txng.theio.vn).

level
bắt buộc
integer | null

Effective ripeness level (1 Non, 2 Gia, 3 Chin toi, 4 Chin ruc): level_sensory while an override is bound, else level_pred.

level_pred
bắt buộc
integer | null

The level the knocker sent (produce.ripeness_level); null when it sent none (a mature class is level 2 or 3 and is never guessed).

maturity_class
bắt buộc
"immature" | "mature" | "overripe" | "defect" | "unknown" | null

The knocker's produce.maturity_class.

confidence
bắt buộc
number | null

Model confidence 0-1.

model
bắt buộc
string | null

Model version that made the prediction.

measured_at
bắt buộc
number | null

Unix seconds of the knock (device event time).

weight_kg
bắt buộc
number | null

Net mass from the bound scale reading.

level_sensory
bắt buộc
integer | null

The operator's sensory override (keys 1-4), if bound.

override
bắt buộc
boolean

A sensory override is bound.

pending_review
bắt buộc
boolean

Overlay: a bound envelope is quarantined and waits for review.

grade
bắt buộc
"A" | "B" | "reject" | null

Grade under the tenant's rules for the lot's variety (else the platform default), derived when the fruit was last bound or reviewed; null until a signed knock, a level and a weight are known (a defect or a reject level grades reject at once).

eating_window
bắt buộc
EatingWindow | null
record_tier
bắt buộc
"self_declared" | "device_recorded" | "cross_checked" | "lab_verified" | null

Trust tier of the fruit's own record, derived at read time; null until a knock is bound. Cross-checked needs the per-fruit volume quota, not reconciled yet.

knock_envelope_id
bắt buộc
string | null

The bound knock envelope.

scale_envelope_id
bắt buộc
string | null

The bound scale envelope.

override_envelope_id
bắt buộc
string | null

The bound sensory-override envelope.

FruitActionCommand

object

The re-measure's set_session outcome for one device of the fruit's session, as on allocation (SessionCommand), plus skipped with reason session_not_open when the session is not open (nothing is sent).

Thuộc tính
TênKiểuMô tả
device_id
bắt buộc
string
command_id
bắt buộc
string | null
status
bắt buộc
"pending" | "sent" | "failed" | "refused" | "skipped"
reason
bắt buộc
"not_declared" | "dispatch_failed" | "device_not_found" | "device_not_approved" | "invalid_command" | "session_not_open" | null

FruitActionRequest

object

An operator action on a fruit (L4).

Thuộc tính
TênKiểuMô tả
type
bắt buộc
"accept" | "remeasure" | "reject" | "override"
level
không bắt buộc
integer

The sensory ripeness level (keys 1-4); required for override, refused otherwise.

reason
không bắt buộc
string | null

Optional free text without control characters (U+0000-U+001F, U+007F-U+009F) and with at least one character outside ECMA-262 whitespace (U+FEFF included), stored with the action only (never returned or audited). The pattern is ECMA-262 and ASCII only (\x escapes and ECMA-262's \s/\S), so generated clients copy it verbatim; an engine whose \s is not ECMA-262's (Python re leaves out U+FEFF) must use ECMA-262's set.

idempotency_key
bắt buộc
string

Client-chosen key, unique per tenant (a UUID fits).

client_ts
bắt buộc
string

When the operator acted, ISO 8601 with a zone offset; stored as given.

FruitActionResult

object

The stored outcome of an action: the same body for the first request and every replay.

Thuộc tính
TênKiểuMô tả
action
bắt buộc
object
fruit
bắt buộc
Fruit
accepted_at
bắt buộc
number | null

Unix seconds the fruit was first accepted into the lot (this round); null again once the bound measurement changes.

measurement_round
bắt buộc
integer

Re-measures so far: 0 for the first measurement.

commands
bắt buộc
array<FruitActionCommand>

set_session per device of the session (re-measure only; empty otherwise).

FruitAllocate

object

No fields: the operator is the caller, the line and lot are the session's.

FruitAllocated

object

The new fruit, its label payload and the set_session outcome per device of the session.

Thuộc tính
TênKiểuMô tả
tenant
bắt buộc
string
code
bắt buộc
string

Fruit code Q-<lot seq>-<n>, unique within the tenant.

n
bắt buộc
integer

Position of the fruit in its lot: 1, 2, ... without gaps.

public_id
bắt buộc
string

128 random bits (hex); the public handle of the fruit, never derived from code or n.

lot
bắt buộc
string

Lot code.

session
bắt buộc
string

Measurement session id.

line
bắt buộc
string

The session's line.

operator
bắt buộc
string | null

Opaque operator id user-<id> of the signed-in user who allocated it; null for API tokens.

status
bắt buộc
"awaiting_device" | "recorded" | "overridden" | "rejected" | "remeasured"

Fruit record state; allocation starts at awaiting_device.

labels_printed_at
bắt buộc
number | null

Unix seconds the label was printed (allocation).

created_at
bắt buộc
number

Unix seconds.

updated_at
bắt buộc
number

Unix seconds.

qr_url
bắt buộc
string (uri)

The QR content: a GS1 Digital Link <base>/01/<gtin>/10/<lot>/21/<serial> (20-character random serial) when the lot has a GTIN and a lot code of at most 20 characters, else <base>/q/<public_id>. The base is the deployment's resolver origin, AGRITRACE_RESOLVER_BASE (default https://txng.theio.vn).

label
bắt buộc
FruitLabel
commands
bắt buộc
array<SessionCommand>

The set_session outcome per device of the session.

level
bắt buộc
integer | null

Effective ripeness level (1 Non, 2 Gia, 3 Chin toi, 4 Chin ruc): level_sensory while an override is bound, else level_pred.

level_pred
bắt buộc
integer | null

The level the knocker sent (produce.ripeness_level); null when it sent none (a mature class is level 2 or 3 and is never guessed).

maturity_class
bắt buộc
"immature" | "mature" | "overripe" | "defect" | "unknown" | null

The knocker's produce.maturity_class.

confidence
bắt buộc
number | null

Model confidence 0-1.

model
bắt buộc
string | null

Model version that made the prediction.

measured_at
bắt buộc
number | null

Unix seconds of the knock (device event time).

weight_kg
bắt buộc
number | null

Net mass from the bound scale reading.

level_sensory
bắt buộc
integer | null

The operator's sensory override (keys 1-4), if bound.

override
bắt buộc
boolean

A sensory override is bound.

pending_review
bắt buộc
boolean

Overlay: a bound envelope is quarantined and waits for review.

grade
bắt buộc
"A" | "B" | "reject" | null

Grade under the tenant's rules for the lot's variety (else the platform default), derived when the fruit was last bound or reviewed; null until a signed knock, a level and a weight are known (a defect or a reject level grades reject at once).

eating_window
bắt buộc
EatingWindow | null
record_tier
bắt buộc
"self_declared" | "device_recorded" | "cross_checked" | "lab_verified" | null

Trust tier of the fruit's own record, derived at read time; null until a knock is bound. Cross-checked needs the per-fruit volume quota, not reconciled yet.

knock_envelope_id
bắt buộc
string | null

The bound knock envelope.

scale_envelope_id
bắt buộc
string | null

The bound scale envelope.

override_envelope_id
bắt buộc
string | null

The bound sensory-override envelope.

FruitBatchItem

object

A fruit allocated by a batch with its label payload; a batch issues no device command.

Thuộc tính
TênKiểuMô tả
tenant
bắt buộc
string
code
bắt buộc
string

Fruit code Q-<lot seq>-<n>, unique within the tenant.

n
bắt buộc
integer

Position of the fruit in its lot: 1, 2, ... without gaps.

public_id
bắt buộc
string

128 random bits (hex); the public handle of the fruit, never derived from code or n.

lot
bắt buộc
string

Lot code.

session
bắt buộc
string

Measurement session id.

line
bắt buộc
string

The session's line.

operator
bắt buộc
string | null

Opaque operator id user-<id> of the signed-in user who allocated it; null for API tokens.

status
bắt buộc
"awaiting_device" | "recorded" | "overridden" | "rejected" | "remeasured"

Fruit record state; allocation starts at awaiting_device.

labels_printed_at
bắt buộc
number | null

Unix seconds the label was printed (allocation).

created_at
bắt buộc
number

Unix seconds.

updated_at
bắt buộc
number

Unix seconds.

qr_url
bắt buộc
string (uri)

The QR content: a GS1 Digital Link <base>/01/<gtin>/10/<lot>/21/<serial> (20-character random serial) when the lot has a GTIN and a lot code of at most 20 characters, else <base>/q/<public_id>. The base is the deployment's resolver origin, AGRITRACE_RESOLVER_BASE (default https://txng.theio.vn).

label
bắt buộc
FruitLabel
level
bắt buộc
integer | null

Effective ripeness level (1 Non, 2 Gia, 3 Chin toi, 4 Chin ruc): level_sensory while an override is bound, else level_pred.

level_pred
bắt buộc
integer | null

The level the knocker sent (produce.ripeness_level); null when it sent none (a mature class is level 2 or 3 and is never guessed).

maturity_class
bắt buộc
"immature" | "mature" | "overripe" | "defect" | "unknown" | null

The knocker's produce.maturity_class.

confidence
bắt buộc
number | null

Model confidence 0-1.

model
bắt buộc
string | null

Model version that made the prediction.

measured_at
bắt buộc
number | null

Unix seconds of the knock (device event time).

weight_kg
bắt buộc
number | null

Net mass from the bound scale reading.

level_sensory
bắt buộc
integer | null

The operator's sensory override (keys 1-4), if bound.

override
bắt buộc
boolean

A sensory override is bound.

pending_review
bắt buộc
boolean

Overlay: a bound envelope is quarantined and waits for review.

grade
bắt buộc
"A" | "B" | "reject" | null

Grade under the tenant's rules for the lot's variety (else the platform default), derived when the fruit was last bound or reviewed; null until a signed knock, a level and a weight are known (a defect or a reject level grades reject at once).

eating_window
bắt buộc
EatingWindow | null
record_tier
bắt buộc
"self_declared" | "device_recorded" | "cross_checked" | "lab_verified" | null

Trust tier of the fruit's own record, derived at read time; null until a knock is bound. Cross-checked needs the per-fruit volume quota, not reconciled yet.

knock_envelope_id
bắt buộc
string | null

The bound knock envelope.

scale_envelope_id
bắt buộc
string | null

The bound scale envelope.

override_envelope_id
bắt buộc
string | null

The bound sensory-override envelope.

FruitBatchResult

object

The fruits a batch allocated, by n.

Thuộc tính
TênKiểuMô tả
batch_id
bắt buộc
integer

The stored batch request's id.

count
bắt buộc
integer
items
bắt buộc
array<FruitBatchItem>

In request order.

FruitLabel

object

What the label printer prints for the fruit.

Thuộc tính
TênKiểuMô tả
code
bắt buộc
string
lot
bắt buộc
string
n
bắt buộc
integer
line
bắt buộc
string
operator
bắt buộc
string | null
printed_at
bắt buộc
number | null

Unix seconds.

qr_url
bắt buộc
string (uri)
label_code
không bắt buộc
string

#326, in the fruit batch's answer with label_code=1 only: the fruit's lookup code (#288) in its grouped form (three groups of five Crockford base 32 characters), derived from the fruit's public id. A label prints it beside the QR code, as the console's 40 x 30 mm label does; a person types it on the scan page when the QR code cannot be scanned, and GET /v1/public/resolve answers it with the fruit.

FruitPage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<Fruit>
next_cursor
bắt buộc
string | null

Pass as cursor for the next page; null on the last page.

FsmaRow

object

One row of the FSMA 204 sortable spreadsheet (GET /v1/fsma.csv, GET /v1/lots/{lot}/fsma.csv; #158): every column on every row, in this order, an empty cell an empty string. One row per critical tracking event, sorted by time. The key data elements of 21 CFR 1 Subpart S, checked column by column against FDA's sortable spreadsheet template.

Thuộc tính
TênKiểuMô tả
traceability_lot_code
bắt buộc
string

The traceability lot code: the lot's code. On a transformation row, the NEW lot's code (the lot the merge produced, #91).

critical_tracking_event
bắt buộc
"harvesting" | "receiving" | "cooling" | "initial_packing" | "shipping" | "transformation"

The FSMA 204 critical tracking event: harvesting, receiving, cooling and initial_packing from a signed device event (/developers/downloads/event-types-v1.json), shipping from a signed device event or a departed shipment, transformation from a lot merge (#91).

event_date
bắt buộc
string (date)

The event's date, YYYY-MM-DD: in the offset the device signed for a device event, in Asia/Ho_Chi_Minh (+07:00) for a departure or a merge.

event_time
bắt buộc
string

The event's time with its offset, whole seconds, hh:mm:ss+hh:mm (the same offset as event_date).

location
bắt buộc
string

The code of the facility (or growing area) where the event happened: the device event's facility, the shipment's departure facility, the merge's facility.

quantity
bắt buộc
number | ""

The quantity: the mass.net reading of a device event, the kilograms of the lot's cartons on a departed shipment, or the kilograms the merge produced (transformation); empty without one.

unit_of_measure
bắt buộc
string

The quantity's unit: the reading's unit for a device event, kg for a departure or a merge; empty without a quantity.

growing_area
bắt buộc
string

The growing area code: the device event's, or the lot's for a departure or a merge; empty without one.

parcel
bắt buộc
string

The parcel the device event names; empty otherwise.

producer
bắt buộc
string

The producer the device event names; empty otherwise.

device_id
bắt buộc
string

The id of the device that signed the event; empty on a row the platform recorded (a departure, a merge).

event_id
bắt buộc
string

The signed device event's envelope id, or the merge's event id on a transformation row (the eventID of its EPCIS TransformationEvent without urn:uuid:); empty on a departure.

commodity
bắt buộc
string

The lot's product (for example durian); empty when the lot code is not one of the company's lots.

variety
bắt buộc
string

The lot's variety (for example Ri6); empty without one.

field_name
bắt buộc
string

The name the grower uses for the row's growing area (FSMA 204: the name of the field or other growing area the food was harvested from); empty when the area has no name. The area's code is in growing_area.

traceability_lot_code_source
bắt buộc
string

Where the traceability lot code was assigned: the lot's facility, its name and address (street, district, province); empty when the lot code is not one of the company's lots. #273: a facility coded by official administrative unit codes has its commune and province instead (Viet Nam has had no district level since 2025-07-01).

traceability_lot_code_source_reference
bắt buộc
string

The GS1 GLN of that facility (#161), a reference that may be given instead of the location description; empty without a GLN.

shipper_location_name
bắt buộc
string

Where the food came from. Shipping: the name of the facility it was shipped from. Receiving: the growing area's name (the farm it came from). Empty on other rows.

shipper_location_address
bắt buộc
string

That location's address: the facility's street, district and province, or the growing area's commune, district and province. #273: a facility or growing area coded by official administrative unit codes has its commune and province instead (Viet Nam has had no district level since 2025-07-01).

shipper_location_gln
bắt buộc
string

That location's GS1 GLN (#161); empty without one.

recipient_location_name
bắt buộc
string

Where the food went. Shipping from a departed shipment: the consignee's legal name (the immediate subsequent recipient, #153). Receiving: the name of the facility that received it. Empty on other rows.

recipient_location_address
bắt buộc
string

That location's address: the consignee's postal address and country (ISO 3166-1 alpha-2), or the facility's street, district and province. #273: a facility coded by official administrative unit codes has its commune and province instead (Viet Nam has had no district level since 2025-07-01).

recipient_location_gln
bắt buộc
string

That location's GS1 GLN: the consignee's (#153) or the facility's (#161); empty without one.

reference_document_type
bắt buộc
string

The types of the departed shipment's documents (#153: phytosanitary_certificate, certificate_of_origin, commercial_invoice, packing_list, customs_declaration, bill_of_lading, air_waybill, test_report, other), sorted, separated by "; "; empty on other rows.

reference_document_number
bắt buộc
string

The numbers of those documents, in the same order, separated by "; ".

container
bắt buộc
string

The ISO 6346 container number of the departed shipment; empty otherwise.

input_traceability_lot_code
bắt buộc
string

Transformation row: the code of the lot the merge used (one row per lot used); empty on other rows.

input_quantity
bắt buộc
number | ""

Transformation row: the kilograms the merge took from that lot (unit_of_measure kg); empty on other rows.

Gateway

object

Thuộc tính
TênKiểuMô tả
gateway_id
bắt buộc
string
tenant
bắt buộc
string
site
bắt buộc
string
facility
bắt buộc
string | null
display_name
bắt buộc
string | null
status
bắt buộc
string
approval
bắt buộc
"pending" | "approved" | "rejected"

Platform approval (#201): pending until a platform admin approves or rejects it. Only evidence from an approved device, signed by its own key or an approved gateway's, counts as Device-recorded or above; evidence from a pending or rejected one is stored and counts as Self-declared.

approval_reason
bắt buộc
string | null

The reason of a rejection; null otherwise.

approval_at
bắt buộc
number | null

Unix seconds of the last approval decision.

GatewayCreate

object

Thuộc tính
TênKiểuMô tả
gateway_id
bắt buộc
string

Unique across every tenant's gateways and devices. An id starting with agritrace-, in any letter case, is reserved for the platform's own broker identities and refused (400).

site
bắt buộc
string
facility
không bắt buộc
string | null

A facility code of the caller's tenant.

display_name
không bắt buộc
string | null

GatewayHeartbeat

object

Thuộc tính
TênKiểuMô tả
received_at
bắt buộc
number

Unix seconds when the server received it.

time
bắt buộc
string

The gateway's own time of the heartbeat (ISO 8601 with its UTC offset).

seq
bắt buộc
integer

The gateway's sequence number of the heartbeat.

signed
bắt buộc
boolean

Signed with one of the gateway's own keys (false only where the server accepts unsigned envelopes).

outbox_depth
bắt buộc
integer | null

gateway.outbox_depth: messages waiting in the gateway's store-and-forward queue.

dead_letter_count
bắt buộc
integer | null

gateway.dead_letter_count: messages the server refused for good that the gateway keeps.

link
bắt buộc
GatewayLink | null

gateway.link: the gateway's uplink as it last observed it.

peripherals_ready
bắt buộc
array<GatewayPeripheral> | null

gateway.peripherals_ready: each device the gateway serves and whether its driver is ready.

GatewayHeartbeatStatus

object

Thuộc tính
TênKiểuMô tả
gateway_id
bắt buộc
string
heartbeat
bắt buộc
GatewayHeartbeat | null

The newest heartbeat; null until the gateway sent one.

GatewayPage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<Gateway>
next_cursor
bắt buộc
string | null

Pass as cursor for the next page; null on the last page.

GatewayPeripheral

object

Thuộc tính
TênKiểuMô tả
device
bắt buộc
string
ready
bắt buộc
boolean

GatewayStatusBucket

object

An hourly rollup, or a day's hourly rollups merged.

Thuộc tính
TênKiểuMô tả
bucket_start
bắt buộc
number

Start of the UTC hour or day, Unix seconds.

samples
bắt buộc
integer
outbox_depth
bắt buộc
GatewayStatusStat
dead_letter_count
bắt buộc
GatewayStatusStat
peripherals_ready
bắt buộc
GatewayStatusStat

The devices the gateway listed as ready.

peripherals_total
bắt buộc
GatewayStatusStat

The devices the gateway listed.

link
bắt buộc
object

The samples per uplink state (a sample without one is in none).

GatewayStatusSample

object

The heartbeat stored for one UTC minute. A value the heartbeat did not carry is null.

Thuộc tính
TênKiểuMô tả
minute
bắt buộc
number

Start of the UTC minute of reception, Unix seconds.

received_at
bắt buộc
number

When the server received it, Unix seconds.

time
bắt buộc
string

The gateway's own time of the heartbeat.

seq
bắt buộc
integer
signed
bắt buộc
boolean
outbox_depth
bắt buộc
integer | null
dead_letter_count
bắt buộc
integer | null
link_state
bắt buộc
"connected" | "disconnected" | "unknown" | null
peripherals_ready
bắt buộc
integer | null

The devices listed as ready.

peripherals_total
bắt buộc
integer | null

The devices listed.

GatewayStatusSeries

object

#128: a gateway's status series: samples (grain minute) or rollups (hourly, daily), oldest first.

Thuộc tính
TênKiểuMô tả
gateway_id
bắt buộc
string
grain
bắt buộc
"minute" | "hourly" | "daily"
bucket_s
bắt buộc
number

Bucket width in seconds: 60, 3600 or 86400.

from
bắt buộc
number

Start of the range read, Unix seconds: aligned down to the grain and clipped to what is kept.

to
bắt buộc
number

End of the range (excluded), Unix seconds.

items
bắt buộc
array<GatewayStatusSample | GatewayStatusBucket>

Samples for grain minute, rollups otherwise.

GatewayStatusStat

object

One value over a bucket's samples that carried it.

Thuộc tính
TênKiểuMô tả
min
bắt buộc
integer | null
max
bắt buộc
integer | null
mean
bắt buộc
number | null

Null when no sample carried the value.

count
bắt buộc
integer

The samples that carried the value.

GeofenceVerdict

"inside" | "near" | "outside" | "ambiguous" | "unverifiable" | "no_position" | "no_polygon"

SENS-B1e (#235): a geofence verdict of a position against a growing area's boundary.

GeoJsonPolygon

object

A GeoJSON Polygon or MultiPolygon in WGS 84. Never public: only the owning tenant_admin and platform_admin see it.

Thuộc tính
TênKiểuMô tả
type
bắt buộc
"Polygon" | "MultiPolygon"
coordinates
bắt buộc
array<any>

Polygon: closed rings of [longitude, latitude] (at least 4 positions each, first equals last); MultiPolygon: 1 to 64 such polygons. At most 5000 positions and 256 KiB in all.

GlnChange

object | object

Set the GLN (13 digits with its check digit, a number of the company's own GS1 membership, not under the platform's prefix), clear it (null), or allocate the next GLN of the platform's GS1 company prefix (allocate: true).

GradingRule

object

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer

Server id (the audit entity id).

tenant
bắt buộc
string
variety
bắt buộc
string

The lot variety these rules apply to.

rules
bắt buộc
GradingRules
updated_at
bắt buộc
number

Unix seconds.

updated_by
bắt buộc
string

The principal that last wrote them.

GradingRuleHistory

object

Thuộc tính
TênKiểuMô tả
variety
bắt buộc
string
items
bắt buộc
array<GradingRuleVersion>
next_cursor
bắt buộc
string | null

The next page's cursor; null on the last.

GradingRulePage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<GradingRule>
next_cursor
bắt buộc
string | null

Pass as cursor for the next page; null on the last page.

platform_default
bắt buộc
GradingRules

The platform default rules, normalized: what a variety without rules of its own (and a lot without a variety) is graded with. An editor starts a new variety from it.

GradingRules

object

Grading rules of one variety. Grade: reject for a defect or a level in reject_levels; otherwise none until a level and a weight are known; A for a level in a_levels with the weight in an A band (inclusive), confidence at least a_min_confidence, nothing pending review and no sensory override conflict; else B. A level cannot be in both lists. The platform default (used for a variety without rules) is A levels [2, 3], reject levels [1, 4], A band 2.0-5.0 kg and confidence 0.8: placeholders until the buyer bands are known.

Thuộc tính
TênKiểuMô tả
a_levels
bắt buộc
array<integer>
reject_levels
bắt buộc
array<integer>
a_weight_kg
bắt buộc
array<array<number>>

[min, max] kg bands, 0 < min < max <= 100, strictly non-overlapping.

a_min_confidence
bắt buộc
number
eating_window
bắt buộc
array<EatingWindowRow>

Rows of level x days since cut (min_days..max_days, inclusive) x band; rows of one level and band do not overlap.

GradingRuleVersion

object

One version of a variety's rules: numbered 1, 2, ... per rule, as each PUT wrote it.

Thuộc tính
TênKiểuMô tả
version
bắt buộc
integer
rules
bắt buộc
GradingRules
updated_at
bắt buộc
number

Unix seconds.

updated_by
bắt buộc
string

Who wrote this version.

Grower

object

A grower (personal data) of one tenant, as the caller may see it.

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
tenant
bắt buộc
string
name
không bắt buộc
string

Present only for the owning tenant_admin and platform_admin, or for other readers when public_consent is on.

display_name
bắt buộc
string

The name with public consent, otherwise Co-op member #<id>.

cooperative
bắt buộc
string | null
public_consent
bắt buộc
boolean

Explicit consent to show the grower's name publicly.

consent_at
bắt buộc
number | null

Unix seconds consent was given; null without consent.

consent_date
bắt buộc
string (date) | null (date)

The day the grower gave the consent (YYYY-MM-DD, not after today); null without consent. Staff only, never on a public route.

consent_scope
bắt buộc
string | null

What the consent covers, as recorded from the consent form (staff-only text); null without consent or when not recorded. Never on a public route.

created_at
bắt buộc
number

Unix seconds.

updated_at
bắt buộc
number

Unix seconds.

GrowerBatch

object

Up to 1,000 growers.

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<GrowerCreate>

GrowerBatchResult

object

The growers a batch created, in request order.

Thuộc tính
TênKiểuMô tả
batch_id
bắt buộc
integer

The stored batch request's id.

count
bắt buộc
integer
items
bắt buộc
array<Grower>

In request order.

GrowerConsent

object

#163. One decision of a grower about one purpose and market (append-only); the latest of a (purpose, market) is the one in force.

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
grower_id
bắt buộc
integer
purpose
bắt buộc
"public_name" | "orchard_position"

public_name: the grower's name on the public fruit page; orchard_position: the orchard's position on public pages (no public page shows one today).

market
bắt buộc
string | null

ISO 3166-1 alpha-2 market the decision is for; null: every market.

decision
bắt buộc
"granted" | "withdrawn"
channel
bắt buộc
"paper" | "electronic" | "in_person" | "record_edit" | "migrated" | "data_request"

How the decision reached the company: a signed paper form, an electronic message, in_person or by phone; or, written by the platform, record_edit (the grower form's consent flag), migrated (a consent recorded before #163), data_request (withdrawn while handling the grower's request request_id).

evidence_sha256
bắt buộc
string | null

SHA-256 of the evidence (the scanned form or the message), or null.

consent_date
bắt buộc
string (date) | null (date)

The day on the form (YYYY-MM-DD), or null.

scope
bắt buộc
string | null

What the decision covers (staff-only text), or null.

request_id
bắt buộc
integer | null

The grower data request handled with this withdrawal (data_request), or null.

recorded_at
bắt buộc
number

Seconds since 1970 (UTC).

recorded_by
bắt buộc
string

Who recorded it: an opaque operator id (user-<id>, token-<id>, client-<id>), never an email; system or migration for the platform.

GrowerConsentCreate

object

#163. A grower's decision as staff record it. A grant needs written evidence: channel paper or electronic and evidence_sha256; a withdrawal is accepted however the grower made it.

Thuộc tính
TênKiểuMô tả
purpose
bắt buộc
"public_name" | "orchard_position"

public_name: the grower's name on the public fruit page; orchard_position: the orchard's position on public pages (no public page shows one today).

market
không bắt buộc
string | null

ISO 3166-1 alpha-2 market the decision is for; null: every market.

decision
bắt buộc
"granted" | "withdrawn"
channel
bắt buộc
"paper" | "electronic" | "in_person"
evidence_sha256
không bắt buộc
string | null

SHA-256 of the evidence (64 lowercase hex digits); required for a grant.

consent_date
không bắt buộc
string (date) | null (date)

The day on the form (YYYY-MM-DD), from 2000-01-01, not after today.

scope
không bắt buộc
string | null

What it covers: one line of at most 200 characters (staff-only).

GrowerConsentPage

object

#163. A grower's consents in force and one page of its consent records, newest first.

Thuộc tính
TênKiểuMô tả
grower_id
bắt buộc
integer
in_force
bắt buộc
array<object>

Every (purpose, market) whose latest decision is a grant. The public fruit page names the grower with public_name for the destination market of the shipment its lot is on, or else with public_name for every market (market null); a lot on no shipment has no market, so only the every-market consent names the grower there.

items
bắt buộc
array<GrowerConsent>
next_cursor
bắt buộc
string | null

The next page's cursor; null on the last.

GrowerCreate

object

Thuộc tính
TênKiểuMô tả
name
bắt buộc
string
cooperative
không bắt buộc
string | null
public_consent
không bắt buộc
boolean
consent_date
không bắt buộc
string (date) | null (date)

The day the grower gave the consent (YYYY-MM-DD, not after today). Accepted only when public_consent is (or becomes) true; withdrawing the consent clears it.

consent_scope
không bắt buộc
string | null

What the consent covers (staff-only text). Accepted only when public_consent is (or becomes) true; withdrawing the consent clears it.

GrowerDataRequest

object

#163. A grower's request about their personal data, as the company received it.

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
grower
bắt buộc
object
kind
bắt buộc
"access" | "rectification" | "erasure" | "objection"
channel
bắt buộc
"paper" | "electronic" | "in_person"
text
bắt buộc
string

The grower's request as received: plain text, never HTML or markdown.

received_on
bắt buộc
string (date)
due_on
bắt buộc
string (date)

The day the answer is due: 30 days after received_on (a proposal pending counsel).

overdue
bắt buộc
boolean

Open and past due_on (UTC).

status
bắt buộc
"open" | "handled"
created_at
bắt buộc
number

Seconds since 1970 (UTC).

created_by
bắt buộc
string

Who entered it: an opaque operator id, never an email.

handled_at
bắt buộc
number | null
handled_by
bắt buộc
string | null

An opaque operator id, or null.

answer
bắt buộc
string | null

The answer given to the grower (plain text), or null while open.

withdrawn
bắt buộc
array<object> | null

The consents withdrawn when the request was handled (empty: none), or null while open.

GrowerDataRequestCreate

object

Thuộc tính
TênKiểuMô tả
grower_id
bắt buộc
integer
kind
bắt buộc
"access" | "rectification" | "erasure" | "objection"
channel
bắt buộc
"paper" | "electronic" | "in_person"
received_on
bắt buộc
string (date)

The day the company received it (YYYY-MM-DD), from 2000-01-01, not after today.

text
bắt buộc
string

1 to 2000 characters after trimming; line breaks and tabs allowed, no other control characters. Stored and shown as plain text.

GrowerDataRequestHandle

object

Thuộc tính
TênKiểuMô tả
answer
bắt buộc
string

The answer given to the grower, as plain text (1 to 2000 characters after trimming).

withdraw_public
không bắt buộc
boolean

Erasure or objection only: also withdraw every consent in force (each recorded as a data_request withdrawal); the name leaves the public fruit page at once.

GrowerDataRequestPage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<GrowerDataRequest>
next_cursor
bắt buộc
string | null

The next page's cursor; null on the last.

GrowerPage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<Grower>
next_cursor
bắt buộc
string | null

Pass as cursor for the next page; null on the last page.

GrowerUpdate

object

Thuộc tính
TênKiểuMô tả
name
không bắt buộc
string
cooperative
không bắt buộc
string | null
public_consent
không bắt buộc
boolean
consent_date
không bắt buộc
string (date) | null (date)

The day the grower gave the consent (YYYY-MM-DD, not after today). Accepted only when public_consent is (or becomes) true; withdrawing the consent clears it.

consent_scope
không bắt buộc
string | null

What the consent covers (staff-only text). Accepted only when public_consent is (or becomes) true; withdrawing the consent clears it.

GrowingArea

object

A growing area. The cap is area_ha times yield_kg_per_ha.

Thuộc tính
TênKiểuMô tả
code
bắt buộc
string
tenant
bắt buộc
string | null

Owning tenant; null for an area registered before migration 7 or by seed/provisioning (readable by every tenant, writable by platform_admin only).

name
bắt buộc
string | null
crop
bắt buộc
string | null
variety
bắt buộc
string | null
province
bắt buộc
string | null
district
bắt buộc
string | null
commune
bắt buộc
string | null
area_ha
bắt buộc
number
yield_kg_per_ha
bắt buộc
number
trees
bắt buộc
integer | null
planted_year
bắt buộc
integer | null
grower_id
bắt buộc
integer | null
gacc_puc_code
bắt buộc
string | null

GACC registration of the production unit.

source
bắt buộc
"seed" | "manual"
approved_at
bắt buộc
number | null

Unix seconds; null until a platform admin approves.

created_at
bắt buộc
number | null

Unix seconds; null for a seeded (legacy) area.

updated_at
bắt buộc
number | null

Unix seconds; null for a seeded (legacy) area.

registry_changed_at
bắt buộc
number | null

Unix seconds of the last change of the crop or variety (L8 #33); an approval older than it no longer covers the record.

cap_kg
bắt buộc
number

The volume cap in kg: area_ha times yield_kg_per_ha, recomputed on every read (an edit of either input changes it, and its audit row records the cap before and after). Never public.

approval_current
bắt buộc
boolean

Whether a platform approval covers the record as it is now: given, and newer than registry_changed_at (L8 #33). False until approved, and again after a crop or variety edit until re-approved. A seeded area (source seed) is never approved. Never public.

grower
bắt buộc
Grower | null
polygon
không bắt buộc
GeoJsonPolygon | null

Present only for the owning tenant_admin and platform_admin.

province_code
không bắt buộc
string | null

The province's official 2-digit code, in the list admin_units_version; null when not coded. Only with admin_units=1 on the read (#273); never in a write's answer nor without the parameter.

commune_code
không bắt buộc
string | null

The commune's official 5-digit code, in the list admin_units_version; null when not coded. A code is only meaningful with its version (codes were reused across the 2025 reform). Only with admin_units=1 on the read (#273); never in a write's answer nor without the parameter.

admin_units_version
không bắt buộc
string | null

The version of the official list the codes were taken from (for example vn-2026-10-17); null without codes. Only with admin_units=1 on the read (#273); never in a write's answer nor without the parameter.

address_before_reform
không bắt buộc
object | null

The province, district and commune text the record held before it was coded, or the text a request gave through the deprecated text path; kept for good once set. Null for a record entered with codes. Only with admin_units=1 on the read (#273); never in a write's answer nor without the parameter.

address_status
không bắt buộc
"coded" | "choose_commune" | "needs_commune" | "outside_vietnam" | null

coded: the codes are set from the official list; choose_commune: the old commune was split, a person picks one of address_candidates; needs_commune: no codes yet (given as text, or before the reform), a person picks the commune; outside_vietnam: a company profile in another country, where the codes do not apply. Null for a record not reviewed since the codes were introduced. Only with admin_units=1 on the read (#273); never in a write's answer nor without the parameter.

address_candidates
không bắt buộc
array<string> | null

For choose_commune: the official commune codes to pick from; else null. Only with admin_units=1 on the read (#273); never in a write's answer nor without the parameter.

GrowingAreaCreate

object

Thuộc tính
TênKiểuMô tả
code
bắt buộc
string
area_ha
bắt buộc
number
yield_kg_per_ha
bắt buộc
number
gacc_puc_code
không bắt buộc
string | null
name
không bắt buộc
string | null
crop
không bắt buộc
string | null
variety
không bắt buộc
string | null
province
không bắt buộc
string | null

Deprecated (#273), sunset 1 May 2027: the province as free text. Send province_code and commune_code instead. A body that gives the address as text only is still accepted until the sunset: the record is stored as not yet coded (address_status needs_commune) and the answer carries the Deprecation, Sunset and Link headers.

district
không bắt buộc
string | null

Deprecated (#273), sunset 1 May 2027: Viet Nam has had no district level since 1 July 2025. Send province_code and commune_code instead; with them district must be absent or null (400 district_with_codes).

commune
không bắt buộc
string | null

Deprecated (#273), sunset 1 May 2027: the commune as free text. Send province_code and commune_code instead; the server then writes the official name here.

province_code
không bắt buộc
string | null

#273: the province (tỉnh or thành phố trực thuộc trung ương) by its official 2-digit code in the administrative units list in force (getAdminUnits). Sent with commune_code, both or neither; with them province, district and commune must be absent or null and the server writes the official names.

commune_code
không bắt buộc
string | null

#273: the commune (xã, phường or đặc khu) by its official 5-digit code in the administrative units list in force (getAdminUnits with province). Sent with province_code, both or neither; the commune must lie in that province by the list, never by its digits.

polygon
không bắt buộc
GeoJsonPolygon | null
trees
không bắt buộc
integer | null
planted_year
không bắt buộc
integer | null
grower_id
không bắt buộc
integer | null

A grower of the area's owning tenant.

GrowingAreaGln

object

#161: a growing area's GLN (EPCIS read point of its events in staff documents; never in a public document).

Thuộc tính
TênKiểuMô tả
growing_area
bắt buộc
string
gln
bắt buộc
string | null

GS1 Global Location Number: 13 digits, the last the GS1 mod-10 check digit; null when none.

GrowingAreaPage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<GrowingArea>
next_cursor
bắt buộc
string | null

Pass as cursor for the next page; null on the last page.

GrowingAreaUpdate

object

A tenant_admin of the owner may change name, crop, variety, the address (province_code and commune_code, or the deprecated province, district and commune text), polygon, trees, planted_year and grower_id; a platform_admin also area_ha, yield_kg_per_ha, gacc_puc_code and (once, on an unowned area) tenant.

Thuộc tính
TênKiểuMô tả
name
không bắt buộc
string | null
crop
không bắt buộc
string | null
variety
không bắt buộc
string | null
province
không bắt buộc
string | null

Deprecated (#273), sunset 1 May 2027: the province as free text. Send province_code and commune_code instead. A body that gives the address as text only is still accepted until the sunset: the record is stored as not yet coded (address_status needs_commune) and the answer carries the Deprecation, Sunset and Link headers.

district
không bắt buộc
string | null

Deprecated (#273), sunset 1 May 2027: Viet Nam has had no district level since 1 July 2025. Send province_code and commune_code instead; with them district must be absent or null (400 district_with_codes).

commune
không bắt buộc
string | null

Deprecated (#273), sunset 1 May 2027: the commune as free text. Send province_code and commune_code instead; the server then writes the official name here.

province_code
không bắt buộc
string | null

#273: the province (tỉnh or thành phố trực thuộc trung ương) by its official 2-digit code in the administrative units list in force (getAdminUnits). Sent with commune_code, both or neither; with them province, district and commune must be absent or null and the server writes the official names.

commune_code
không bắt buộc
string | null

#273: the commune (xã, phường or đặc khu) by its official 5-digit code in the administrative units list in force (getAdminUnits with province). Sent with province_code, both or neither; the commune must lie in that province by the list, never by its digits.

polygon
không bắt buộc
GeoJsonPolygon | null
trees
không bắt buộc
integer | null
planted_year
không bắt buộc
integer | null
grower_id
không bắt buộc
integer | null

A grower of the area's owning tenant.

area_ha
không bắt buộc
number
yield_kg_per_ha
không bắt buộc
number
gacc_puc_code
không bắt buộc
string | null
tenant
không bắt buộc
string

platform_admin only: claim an unowned area for a registered tenant (once).

GrowingAreaVolume

object

Volume.cap_kg, declared_kg (summed across all tenants) and the headroom left.

Thuộc tính
TênKiểuMô tả
growing_area
bắt buộc
string
season
bắt buộc
string
declared_kg
bắt buộc
number
cap_kg
bắt buộc
number | null

area_ha times yield_kg_per_ha; null when the growing area is unknown or is a tenant-created area not yet approved by a platform admin.

headroom_kg
bắt buộc
number | null

cap_kg minus declared_kg (negative when over the cap); null when cap_kg is null.

HarvestBatch

object

Up to 1,000 harvest declarations across the tenant's areas.

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<HarvestBatchItem>

HarvestBatchItem

object

One declaration; an area and date at most once per batch.

Thuộc tính
TênKiểuMô tả
growing_area
bắt buộc
string

Code of a growing area the caller may write.

harvest_date
bắt buộc
string (date)

The harvest date; not later than today.

kg
bắt buộc
number

Mass harvested on that date.

HarvestBatchResult

object

The declarations a batch stored, in request order.

Thuộc tính
TênKiểuMô tả
batch_id
bắt buộc
integer

The stored batch request's id.

count
bắt buộc
integer
items
bắt buộc
array<HarvestDeclaration>

In request order.

HarvestDeclaration

object

A tenant-entered harvest of a growing area on one date (Self-declared).

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
growing_area
bắt buộc
string
harvest_date
bắt buộc
string (date)
season
bắt buộc
string

The ingest policy's season of the harvest date.

kg
bắt buộc
number
source
bắt buộc
"self_declared"
declared_by
bắt buộc
string

The user who declared it.

declared_at
bắt buộc
number

Unix time of the declaration.

HarvestDeclarationCreate

object

Thuộc tính
TênKiểuMô tả
harvest_date
bắt buộc
string (date)

The harvest date; not later than today.

kg
bắt buộc
number

Mass harvested on that date.

HarvestDeclarationPage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<HarvestDeclaration>
next_cursor
bắt buộc
string | null

Pass as cursor for the next page; null on the last page.

HarvestKey

object

#160: a harvest app install's request to sign harvest records with its own key. The private key is a non-extractable WebCrypto ECDSA P-256 key that never leaves the browser; the public key's PEM is never returned. kid and device_id derive from fingerprint_sha256, the SHA-256 of the key's SubjectPublicKeyInfo DER. Once approved, the device (profile vn.agritrace.harvest-app, site and facility facility) and its active key exist in the fleet, and the install sends its signed harvest envelopes to POST /v1/ingest/{tenant}/{facility}/{device_id}/event/harvest.

Thuộc tính
TênKiểuMô tả
kid
bắt buộc
string
device_id
bắt buộc
string
tenant
bắt buộc
string
facility
bắt buộc
string

The collection point the install records for.

label
bắt buộc
string

A name people recognise the install by.

status
bắt buộc
"pending" | "approved" | "rejected" | "revoked"

pending until a tenant admin decides; revoked once the approved key was revoked (POST /v1/keys/{kid}/revoke). Rejected and revoked are final: the install makes a new key.

fingerprint_sha256
bắt buộc
string
fingerprint
bắt buộc
string

First four and last four hex characters.

requested_by
bắt buộc
string
requested_at
bắt buộc
number

Unix seconds.

decided_by
bắt buộc
string | null
decided_at
bắt buộc
number | null

Unix seconds.

revoked_at
bắt buộc
number | null

Unix seconds; set only when status is revoked.

revoke_reason
bắt buộc
"rotation" | "compromise" | null

HarvestKeyPage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<HarvestKey>
next_cursor
bắt buộc
string | null

Pass as cursor for the next page; null on the last page.

HarvestKeyRegister

object

Thuộc tính
TênKiểuMô tả
public_key_pem
bắt buộc
string

The install's EC P-256 public key as one PEM SubjectPublicKeyInfo block.

facility
bắt buộc
string

A facility of the caller's tenant (within an operator's facilities).

label
bắt buộc
string

Health

object

Thuộc tính
TênKiểuMô tả
ok
bắt buộc
true
outbound_backlog
bắt buộc
map<string, integer>

Undelivered outbound items per target.

certificates
bắt buộc
array<CertificateStatus>
read_only
không bắt buộc
true

Present (true) only in the read-only maintenance mode of the PostgreSQL cutover (AGRITRACE_READ_ONLY=1, #123): every request but GET, and every audited read (the exports), then answers 503 with Retry-After, and warnings says so.

mqtt
không bắt buộc
object

Present when the MQTT bridge runs.

warnings
không bắt buộc
array<string>

Present when a certificate is expired or due, MQTT is not connected, or the broker has not granted every uplink subscription of the MQTT bridge.

Help

object

Thuộc tính
TênKiểuMô tả
status_page_url
bắt buộc
string (uri) | null (uri)

CropPath's status page (an https address), or null: hide the link.

announcements
bắt buộc
array<LiveAnnouncement>

The announcements showing now, newest first.

IdentityProvider

object

#87. The company's identity provider; never its client secret.

Thuộc tính
TênKiểuMô tả
issuer
bắt buộc
string (uri)
client_id
bắt buộc
string
enabled
bắt buộc
boolean

Whether the company's people can sign in with it now.

created_at
bắt buộc
number

Unix seconds.

updated_at
bắt buộc
number

Unix seconds.

linked_accounts
bắt buộc
integer

Accounts linked to a subject of the provider (by a first sign-in).

IdentityProviderState

object

#87. The company's identity provider (null when none is set up), the company's own redirect URI to register with it ({origin}/login/oidc/{company}; the provider must send the browser back there), and whether this deployment allows sign-in with an identity provider at all (it needs AGRITRACE_PUBLIC_ORIGIN and AGRITRACE_OIDC_ALLOWED_HOSTS).

Thuộc tính
TênKiểuMô tả
available
bắt buộc
boolean
redirect_uri
bắt buộc
string | null

Null when the server has no public origin.

provider
bắt buộc
IdentityProvider | null

IdentityProviderUpdate

object

#87. The company's identity provider as registered there.

Thuộc tính
TênKiểuMô tả
issuer
bắt buộc
string

The provider's issuer: an https:// URL without query or fragment, on a host this deployment allows; {issuer}/.well-known/openid-configuration must name it.

client_id
bắt buộc
string
client_secret
không bắt buộc
string

Required to set a provider up, and whenever the issuer or the client id changes (400 client_secret_is_required); left out otherwise, the stored one is kept. Stored only encrypted and never returned.

enabled
không bắt buộc
boolean

IngestResult

object

Thuộc tính
TênKiểuMô tả
status
bắt buộc
"accepted" | "quarantined" | "duplicate" | "rejected"
id
bắt buộc
string | null

Envelope id; null when the body could not be parsed far enough to read it.

reasons
bắt buộc
array<string>

Quarantine reasons, or the single rejection reason.

IntegrityAnchor

object

INTEGRITY-2 (#202): one closed UTC day's anchor. The day's records (audit log rows, evidence envelopes, lot seals, reviews, and the envelopes not accepted when the day was anchored) are hashed into one Merkle tree per kind (RFC 9162: leaf SHA-256(0x00 || record), node SHA-256(0x01 || left || right), empty SHA-256(""), leaves in the order of their hash); day_root = SHA-256(0x02 || audit_root || evidence_root || seal_root || review_root || held_root); anchor = SHA-256(prev_anchor || day_root || day as ASCII || audit_count || evidence_count || seal_count || review_count || held_count, each count 8 bytes big-endian). The first day's prev_anchor is 64 zeros. The record encoding is /developers/downloads/integrity-anchors.md; /developers/downloads/verify_anchors.py recomputes it with the Python standard library. Written once, never changed.

Thuộc tính
TênKiểuMô tả
day
bắt buộc
string

The UTC day the records were written (YYYY-MM-DD).

seq
bắt buộc
integer

Position in the chain: 0 for the first anchored day, then one per day without gaps.

version
bắt buộc
1

The encoding version.

prev_anchor
bắt buộc
string

The previous day's anchor (64 zeros for seq 0).

audit_root
bắt buộc
string

Root of the day's activity log rows.

evidence_root
bắt buộc
string

Root of the evidence envelopes received that day (accepted, quarantined or rejected after review).

seal_root
bắt buộc
string

Root of the lot seals made that day.

review_root
bắt buộc
string

Root of the reviews made that day (a person's decision on a quarantined envelope) and of the envelopes a pack sent back to quarantine that day (decision requarantine).

held_root
bắt buộc
string

Root of the day's envelopes that were not accepted when the day was anchored, each with that status. A later status must be that one, a lower one, or a review's outcome; an envelope a pack sent back to quarantine is accepted again only after an approve review later than that.

day_root
bắt buộc
string
audit_count
bắt buộc
integer
evidence_count
bắt buộc
integer
seal_count
bắt buộc
integer
review_count
bắt buộc
integer
held_count
bắt buộc
integer
anchor
bắt buộc
string
created_at
bắt buộc
string (date-time)

When the job computed the anchor (UTC).

timestamp
bắt buộc
IntegrityAnchorTimestamp | null

Null while no TSA is configured or the job has not queued the anchor yet.

IntegrityAnchorPage

object

INTEGRITY-2 (#202): one page of anchors, oldest first.

Thuộc tính
TênKiểuMô tả
version
bắt buộc
1
genesis
bắt buộc
string

The prev_anchor of the first day: 64 zeros.

items
bắt buộc
array<IntegrityAnchor>
next_after
bắt buộc
string | null

Pass as after for the next page; null on the last page.

IntegrityAnchorTimestamp

object

INTEGRITY-2 (#202): the RFC 3161 timestamp of an anchor (the anchor's 32 bytes are the message imprint, SHA-256). pending while the job has no verified token (the TSA unreachable, or a token that did not verify; it retries); verified once a token was verified against the configured trust store and stored, then final.

Thuộc tính
TênKiểuMô tả
status
bắt buộc
"pending" | "verified"
gen_time
bắt buộc
string (date-time) | null (date-time)

The token's genTime (UTC); null while pending.

token
bắt buộc
string | null

Base64 of the TimeStampToken's DER (a CMS SignedData of a TSTInfo); null while pending. Check it with openssl ts -verify -digest <anchor> -in token.der -token_in -CAfile <TSA root>.

Invitation

object

SELF-1-4 (#185). An invitation link or a password link of the company; never the link or its token.

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
purpose
bắt buộc
"invite" | "reset"

invite: an invitation to join the company; reset: a password link for a member (email and role are that member's).

email
bắt buộc
string
role
bắt buộc
"tenant_admin" | "operator" | "auditor" | "agronomist"
facilities
bắt buộc
array<string> | null

An operator's facility codes; null = every facility of the company (always null for another role).

display_name
bắt buộc
string | null
status
bắt buộc
"pending" | "used" | "expired" | "revoked"

pending: works until expires_at; used: accepted (used_at, used_by); revoked; expired.

created_by
bắt buộc
string

Who created it (an email, or cli:<user>).

created_at
bắt buộc
number
expires_at
bắt buộc
number
used_at
bắt buộc
number | null
used_by
bắt buộc
string | null
revoked_at
bắt buộc
number | null
revoked_by
bắt buộc
string | null

InvitationCreate

object

Thuộc tính
TênKiểuMô tả
email
bắt buộc
string

The email the person will sign in with.

role
bắt buộc
"tenant_admin" | "operator" | "auditor" | "agronomist"
facilities
không bắt buộc
array<string> | null

Operators only: codes of the company's facilities; null or an empty list = every facility.

display_name
không bắt buộc
string | null

InvitationList

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<Invitation>
next_cursor
bắt buộc
string | null

Pass as cursor for the next page; null on the last.

InvitationRevoked

object

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
status
bắt buộc
"revoked"

IssuerKey

object

A facility's did:web issuer key (#34). The private key is never returned: it is stored encrypted under the deployment's key-encryption key. key_id is the DID URL a credential cites (<did>#key-<n>).

Thuộc tính
TênKiểuMô tả
facility
bắt buộc
string
n
bắt buộc
integer

The key's number within the facility, never reused.

name
bắt buộc
string
did
bắt buộc
string

did:web:<AGRITRACE_DID_DOMAIN>:<facility slug>.

key_id
bắt buộc
string
alg
bắt buộc
"ES256"
public_jwk
bắt buộc
PublicJwk
status
bắt buộc
"active" | "retired" | "revoked"

active: signs. retired: replaced by a rotation, still in the DID document. revoked: compromised, removed from the DID document.

created_by
bắt buộc
string
created_at
bắt buộc
number

Unix seconds.

retired_at
bắt buộc
number | null

Unix seconds.

revoked_at
bắt buộc
number | null

Unix seconds.

revoke_reason
bắt buộc
"compromise" | null
revoked_by
bắt buộc
string | null

IssuerKeyList

object

Every key of the facility by number (at most 100 per facility).

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<IssuerKey>

IssuerKeyRevoke

object

Thuộc tính
TênKiểuMô tả
reason
bắt buộc
"compromise"

Only a compromise revokes; a rotation generates a new key instead.

JudgedPosition

object

SENS-B1e (#235): the latest position of the device judged against the area in the range (WGS84, as the device signed it), with its verdict and when ingest judged it.

Thuộc tính
TênKiểuMô tả
lat
bắt buộc
number
lon
bắt buộc
number
acc_m
bắt buộc
number | null

The accuracy the device reported; null when it reported none.

verdict
bắt buộc
GeofenceVerdict
checked_at
bắt buộc
number

Key

object

A device or gateway public key. The PEM is never returned; fingerprint_sha256 is the SHA-256 of the key's SubjectPublicKeyInfo DER and fingerprint its short display form.

Thuộc tính
TênKiểuMô tả
kid
bắt buộc
string
owner_type
bắt buộc
"device" | "gateway"
owner_id
bắt buộc
string
status
bắt buộc
string

active or revoked; only active keys are accepted by ingest.

created_at
bắt buộc
number

Unix seconds.

revoked_at
bắt buộc
number | null

Unix seconds.

revoke_reason
bắt buộc
"rotation" | "compromise" | null
revoked_by
bắt buộc
string | null
fingerprint_sha256
bắt buộc
string
fingerprint
bắt buộc
string

First four and last four hex characters, e.g. 3f9a…c21e.

approval
bắt buộc
"pending" | "approved"

#201: pending until a platform admin approves its device or gateway listing this key; only evidence signed with an approved key counts as Device-recorded or above (the console shows it as waiting for CropPath).

KeyCreate

object

Thuộc tính
TênKiểuMô tả
kid
bắt buộc
string

Unique across every tenant.

owner_type
bắt buộc
"device" | "gateway"
owner_id
bắt buộc
string

A device or gateway of the caller's tenant.

public_key_pem
bắt buộc
string

One PUBLIC KEY PEM block holding an EC P-256 SubjectPublicKeyInfo.

KeyPage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<Key>
next_cursor
bắt buộc
string | null

Pass as cursor for the next page; null on the last page.

KeyRevoke

object

Thuộc tính
TênKiểuMô tả
reason
bắt buộc
"rotation" | "compromise"

Lab

object

An accredited lab partner (platform record, no tenant). in_force: status active and valid_to today or later (Asia/Ho_Chi_Minh); only labs in force that hold an active key are assigned samples.

Thuộc tính
TênKiểuMô tả
code
bắt buộc
string
name
bắt buộc
string
accreditation
bắt buộc
string
valid_to
bắt buộc
string (date)

Last day the accreditation is valid.

status
bắt buộc
"active" | "suspended"
created_at
bắt buộc
number

Unix seconds.

updated_at
bắt buộc
number

Unix seconds.

in_force
bắt buộc
boolean
accreditation_body
bắt buộc
string | null

Accreditation body, e.g. BoA (VILAS) (#73); null when not recorded.

accreditation_number
bắt buộc
string | null

Accreditation certificate number (#73); null when not recorded.

accreditation_scope
bắt buộc
string | null

The accredited scope: the tests the accreditation covers (#73); null when not recorded.

LabApproval

object

#154: a lab's approval for a destination market (e.g. on the list of labs whose cadmium and auramine O reports GACC accepts for Vietnamese durian). A lab result counts toward Lab-verified for the report's market only when an active approval of its lab for that market, valid on the report's signed date (Asia/Ho_Chi_Minh), lists the analyte; otherwise the lab step stops at Cross-checked (reason lab_not_approved_for_market). A withdrawn approval never counts.

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
lab
bắt buộc
string

Lab code.

market
bắt buộc
string

Destination market, ISO 3166-1 alpha-2.

approving_body
bắt buộc
string
reference
bắt buộc
string

The approval's reference as published (decision or list number).

analytes
bắt buộc
array<string>

Analyte codes the approval covers, sorted.

valid_from
bắt buộc
string (date)

First valid day, inclusive.

valid_to
bắt buộc
string (date)

Last valid day, inclusive.

source_url
bắt buộc
string | null

Where the list is published (http or https); stored and shown, never fetched.

evidence_sha256
bắt buộc
string | null

SHA-256 of the list document kept as evidence.

status
bắt buộc
"active" | "withdrawn"

withdrawn: recorded in error or revoked from the start; it never counts.

in_force
bắt buộc
boolean

Active and valid today (Asia/Ho_Chi_Minh).

created_at
bắt buộc
number
created_by
bắt buộc
string
updated_at
bắt buộc
number
updated_by
bắt buộc
string

LabApprovalCreate

object

A new approval (status active). valid_to is on or after valid_from; source_url and evidence_sha256 are optional.

Thuộc tính
TênKiểuMô tả
market
bắt buộc
string

Destination market, ISO 3166-1 alpha-2.

approving_body
bắt buộc
string
reference
bắt buộc
string

The approval's reference as published (decision or list number).

analytes
bắt buộc
array<string>

Analyte codes the approval covers, sorted.

valid_from
bắt buộc
string (date)

First valid day, inclusive.

valid_to
bắt buộc
string (date)

Last valid day, inclusive.

source_url
không bắt buộc
string | null

Where the list is published (http or https); stored and shown, never fetched.

evidence_sha256
không bắt buộc
string | null

SHA-256 of the list document kept as evidence.

LabApprovalList

object

Every approval of the lab (at most 100), by market, then newest valid_from first.

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<LabApproval>

LabApprovalUpdate

object

Any of the editable fields (the market never changes: record a new approval). null clears source_url or evidence_sha256; status withdrawn withdraws the approval (nothing is deleted).

Thuộc tính
TênKiểuMô tả
approving_body
không bắt buộc
string
reference
không bắt buộc
string

The approval's reference as published (decision or list number).

analytes
không bắt buộc
array<string>

Analyte codes the approval covers, sorted.

valid_from
không bắt buộc
string (date)

First valid day, inclusive.

valid_to
không bắt buộc
string (date)

Last valid day, inclusive.

source_url
không bắt buộc
string | null

Where the list is published (http or https); stored and shown, never fetched.

evidence_sha256
không bắt buộc
string | null

SHA-256 of the list document kept as evidence.

status
không bắt buộc
"active" | "withdrawn"

withdrawn: recorded in error or revoked from the start; it never counts.

LabAssignment

object

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
exporter
bắt buộc
string

Name of the tenant that owns the lot.

lot
bắt buộc
object
facility
bắt buộc
object
analytes
bắt buộc
array<SampleAnalyte>
sample_count
bắt buộc
integer
selected_at
bắt buộc
number

Unix seconds.

samples
bắt buộc
array<SampleItem>
report
bắt buộc
object | null

The report's number and verdict once submitted (P4, #40), else null.

LabAssignmentDetail

object

One sampling assigned to the caller's lab (#73), with its full report (LabReport, null before one) and the lab's active server-held key for portal entries (portal_key, null when the lab holds none: portal entry is then refused 409).

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
exporter
bắt buộc
string

Name of the tenant that owns the lot.

lot
bắt buộc
object
facility
bắt buộc
object
analytes
bắt buộc
array<SampleAnalyte>
sample_count
bắt buộc
integer
selected_at
bắt buộc
number

Unix seconds.

samples
bắt buộc
array<SampleItem>
report
bắt buộc
LabReport | null
portal_key
bắt buộc
object | null

LabAssignmentPage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<LabAssignment>
next_cursor
bắt buộc
string | null

Pass as cursor for the next page; null on the last page.

LabCompany

object

#278: a company a lab serves.

Thuộc tính
TênKiểuMô tả
lab
bắt buộc
string

The lab's code.

tenant
bắt buộc
string

The company's id.

name
bắt buộc
string

The company's name.

linked_at
bắt buộc
number

When the link was made (Unix seconds); for a link migration 113 made from the samplings already assigned, the first of them.

LabCompanyList

object

#278: the companies a lab serves, by company id (at most 500).

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<LabCompany>

LabCreate

object

Thuộc tính
TênKiểuMô tả
code
bắt buộc
string
name
bắt buộc
string
accreditation
bắt buộc
string

Accreditation scheme and number, e.g. VILAS 118 (ISO/IEC 17025).

valid_to
bắt buộc
string (date)
accreditation_body
không bắt buộc
string | null
accreditation_number
không bắt buộc
string | null
accreditation_scope
không bắt buộc
string | null

LabHome

object

#286. The lab portal's home for the caller's lab: whether the lab can sign (its status, accreditation, market approvals and keys) and its work, read among its newest 500 samplings: samplings waiting for results, reports whose PDF original was not sent, and reports sent in the last 7 days. No person's name. Each section has state: ok with its figures, or unavailable (OverviewSectionUnavailable) when it could not be read.

Thuộc tính
TênKiểuMô tả
lab
bắt buộc
object

The caller's lab.

generated_at
bắt buộc
string (date-time)

When the answer was computed (the server serves it for up to max_age_s).

max_age_s
bắt buộc
integer

Seconds the server serves one answer.

window
bắt buộc
object
target_hours
bắt buộc
integer

The time from the draw to the results the lab aims for; waiting.past_target counts the samplings past it.

sections
bắt buộc
object

LabHomePdfMissing

object | OverviewSectionUnavailable

#286. Reports stored without their PDF original, oldest first.

LabHomeSent

object | OverviewSectionUnavailable

#286. Reports stored in the last 7 days, newest first.

LabHomeWaiting

object | OverviewSectionUnavailable

#286. Samplings waiting for the lab's results (no report yet), oldest first.

LabInvitationCreate

object

Thuộc tính
TênKiểuMô tả
email
bắt buộc
string

The lab analyst's email: their sign-in name, not checked by any email.

display_name
không bắt buộc
string | null

Proposed as the new account's name; the invitee may change it.

LabKey

object

A lab's result-signing public key. The PEM is never returned; fingerprint_sha256 is the SHA-256 of the key's SubjectPublicKeyInfo DER and fingerprint its short display form. custody (#73): lab, the lab holds the private key and registered the public one; server, the platform generated the pair and holds the private key (encrypted, never returned) to sign the results the lab's portal users enter, which therefore never count as signed by the accredited lab (ADR 0001).

Thuộc tính
TênKiểuMô tả
kid
bắt buộc
string
lab
bắt buộc
string
status
bắt buộc
"active" | "revoked"
created_at
bắt buộc
number

Unix seconds.

revoked_at
bắt buộc
number | null

Unix seconds.

revoke_reason
bắt buộc
"rotation" | "compromise" | null
revoked_by
bắt buộc
string | null
fingerprint_sha256
bắt buộc
string
fingerprint
bắt buộc
string
custody
bắt buộc
"lab" | "server"

LabKeyCreate

object

Thuộc tính
TênKiểuMô tả
kid
bắt buộc
string

Key id; one namespace with device and gateway keys.

public_key_pem
bắt buộc
string

EC P-256 public key, PEM SubjectPublicKeyInfo.

LabKeyPage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<LabKey>
next_cursor
bắt buộc
string | null

Pass as cursor for the next page; null on the last page.

LabLogins

object

Who signs in for a lab, and its pending invitations. Never a link or its token.

Thuộc tính
TênKiểuMô tả
members
bắt buộc
array<object>

Each person with a lab membership for this lab, in any company record, by email (at most 500). active when one of those memberships and the account are active, else disabled (turned off by CropPath support).

invitations
bắt buộc
array<object>

The lab's invitations still pending (unused, unrevoked, unexpired), newest first.

LabOriginResult

object

One stored origin isotope result (#40 follow-up): passed exactly when it matched.

Thuộc tính
TênKiểuMô tả
sample
bắt buộc
integer
outcome
bắt buộc
"match" | "mismatch"
region
bắt buộc
string
method
bắt buộc
string
passed
bắt buộc
boolean

LabOriginResultSubmission

object

An optional origin isotope result of one drawn sample (#40 follow-up): whether the sample's stable isotope profile matches (match) or not (mismatch) the profile of region, the region it was compared with. A match passes; a mismatch fails the sample and the report (the lot's lab hold), like a failed contaminant.

Thuộc tính
TênKiểuMô tả
sample
bắt buộc
integer

The sample number k of the sampling.

analyte
bắt buộc
"origin_isotopes"
outcome
bắt buộc
"match" | "mismatch"
region
bắt buộc
string

The region the sample was compared with, e.g. Tiền Giang; the same for every origin result of the report.

method
bắt buộc
string

LabPage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<Lab>
next_cursor
bắt buộc
string | null

Pass as cursor for the next page; null on the last page.

LabPortalEntry

object

What a lab portal user enters (#73): the report number, the SHA-256 of the report's PDF and the results, exactly as a signed LabReportSubmission carries them. The server adds the version, the lab, the sampling and the signing time and signs the document with the lab's active server-held key.

Thuộc tính
TênKiểuMô tả
report_no
bắt buộc
string

The lab's report number, once per lab.

report_sha256
bắt buộc
string

SHA-256 of the report's PDF original.

results
bắt buộc
array<LabReportResultSubmission | LabOriginResultSubmission>

LabPortalKeyCreate

object

Thuộc tính
TênKiểuMô tả
kid
bắt buộc
string

Key id; one namespace with device and gateway keys.

LabReport

object

The lab's signed report of a sampling: pass/fail per result (sample and analyte), per analyte and for the lot (passed); origin lists its origin isotope results apart (empty without one, #40 follow-up).

Thuộc tính
TênKiểuMô tả
report_no
bắt buộc
string
lab
bắt buộc
string
kid
bắt buộc
string

The lab key that signed it.

key_custody
bắt buộc
"lab" | "server"

Who holds the key that signed the report (#73): lab, the lab itself (an uploaded signed report); server, the platform, for the lab's portal users (a portal entry, never counted as signed by the accredited lab).

market
bắt buộc
string

ISO 3166-1 alpha-2 of the market whose limits judged it.

signed_at
bắt buộc
number

Unix seconds.

report_sha256
bắt buộc
string
passed
bắt buộc
boolean
analytes
bắt buộc
array<object>
results
bắt buộc
array<LabReportResult>
origin
bắt buộc
array<LabOriginResult>
submitted_by
bắt buộc
string
received_at
bắt buộc
number

Unix seconds.

report_pdf
không bắt buộc
AttachmentStored | null

#73: the report's PDF original once the lab sent it (PUT /v1/lab/samples/{id}/report-pdf), null before. A staff-only attachment owned by the sampling's tenant: only its tenant-wide staff read the bytes with GET /v1/attachments/{sha256}, a facility-scoped grant does not, so GET /v1/lots/{lot}/samples omits this field for a facility-scoped grant. The lab's own views always carry it. The public record never names or serves it (report_url stays null).

LabReportResult

object

One stored result with the market limit that judged it (null when the market sets none).

Thuộc tính
TênKiểuMô tả
sample
bắt buộc
integer
analyte
bắt buộc
LabResultAnalyte
outcome
bắt buộc
"measured" | "not_detected"
value
bắt buộc
number | null
unit
bắt buộc
string
lod
bắt buộc
number
method
bắt buộc
string
limit
bắt buộc
object | null
passed
bắt buộc
boolean

LabReportResultSubmission

object

One result of one drawn sample. measured: value at least the detection limit; not_detected: no value. Values and detection limits are in mg/kg, the unit of the market's limits.

Thuộc tính
TênKiểuMô tả
sample
bắt buộc
integer

The sample number k of the sampling.

analyte
bắt buộc
LabResultAnalyte
outcome
bắt buộc
"measured" | "not_detected"
value
không bắt buộc
number
unit
bắt buộc
"mg/kg"
lod
bắt buộc
number

Detection limit.

method
bắt buộc
string

LabReportSubmission

object

A lab report signed like a device envelope: sig.value is ES256 (base64url r || s) over the canonical JSON (keys sorted, no whitespace, UTF-8) of every other member, made with an active key of the assigned lab. Every drawn sample and every analyte of the test scope exactly once; besides, at most one origin isotope result (LabOriginResultSubmission) per drawn sample, all compared with the same region (#40 follow-up).

Thuộc tính
TênKiểuMô tả
v
bắt buộc
1
lab
bắt buộc
string

The assigned lab's code; it must be the caller's lab.

sampling
bắt buộc
integer

The sampling id of the URL.

report_no
bắt buộc
string

The lab's report number, once per lab.

signed_at
bắt buộc
string (date-time)

When the lab signed, with its UTC offset; not before the samples were drawn, not more than 300 s ahead of the server clock.

report_sha256
bắt buộc
string

SHA-256 of the report's PDF original.

results
bắt buộc
array<LabReportResultSubmission | LabOriginResultSubmission>
sig
bắt buộc
object

LabResultAnalyte

"cadmium" | "auramine_o"

LabUpdate

object

Thuộc tính
TênKiểuMô tả
name
không bắt buộc
string
accreditation
không bắt buộc
string
valid_to
không bắt buộc
string (date)
status
không bắt buộc
"active" | "suspended"
accreditation_body
không bắt buộc
string | null

null clears it.

accreditation_number
không bắt buộc
string | null

null clears it.

accreditation_scope
không bắt buộc
string | null

null clears it.

LandCertificate

object

#250: one land certificate with the corners as typed and the converted outline (WGS 84).

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer

The certificate's id.

growing_area
bắt buộc
string
submitted_at
bắt buộc
number

Unix seconds when the certificate was received.

central_meridian_min
bắt buộc
integer

The central meridian of the parcel map's projection, in minutes of arc east of Greenwich (e.g. 6345 = 105 degrees 45 minutes): one of the provinces' central meridians of Circular 26/2024/TT-BTNMT Appendix 01.

corners_total
bắt buộc
integer

The number of corners.

plane_area_m2
bắt buộc
number

The parcel's area in square metres on the projection plane, from the corners as typed: the figure a certificate prints, so a typing slip shows.

photo_sha256
bắt buộc
string

SHA-256 of the photo of the certificate page, an image the company uploaded (PUT /v1/attachments/{sha256}): never public; read it with GET /v1/attachments/{sha256}.

polygon_sha256
bắt buộc
string

SHA-256 (hex) of the converted outline's canonical GeoJSON text (compact, sorted keys, UTF-8): the SHA-256 of the boundary proposal the certificate made, and of the version it becomes once a platform admin approves it.

area_ha
bắt buộc
number

The converted outline's area in hectares: the ring area on a sphere of the WGS 84 equatorial radius, as the admin console and the boundary walks compute a boundary's area.

registered_area_ha
bắt buộc
number | null

The growing area's registered area_ha when the certificate was received.

area_difference_ratio
bắt buộc
number | null

(area_ha - registered_area_ha) / registered_area_ha: negative when the certificate's parcel is smaller than registered; null without a registered size.

walk
bắt buộc
LandCertificateWalkComparison | null

The certificate against the area's latest boundary walk; null when the area has none.

superseded
bắt buộc
boolean

Whether the certificate replaced a boundary proposal that was waiting.

corners
bắt buộc
array<array<number>>

The corners [X, Y] (VN-2000, metres) as typed, without a repeated first corner.

polygon
bắt buộc
GeoJsonPolygon

LandCertificateCheck

object

#250: the parcel corners of a land-use right certificate to check before its photo is uploaded: LandCertificateCreate without photo_sha256.

Thuộc tính
TênKiểuMô tả
central_meridian_min
bắt buộc
integer

The central meridian of the parcel map's projection, in minutes of arc east of Greenwich (e.g. 6345 = 105 degrees 45 minutes): one of the provinces' central meridians of Circular 26/2024/TT-BTNMT Appendix 01.

corners
bắt buộc
array<array<number>>

The corners in order around the parcel, 3 to 200 (the first may be repeated at the end; it is dropped), at least 3 different.

LandCertificateCheckResult

object

#250: a passed check: the outline the certificate would propose, compared with the area's registered size. Nothing is stored.

Thuộc tính
TênKiểuMô tả
corners_total
bắt buộc
integer

The number of corners.

plane_area_m2
bắt buộc
number

The parcel's area in square metres on the projection plane, from the corners as typed: the figure a certificate prints, so a typing slip shows.

polygon_sha256
bắt buộc
string

SHA-256 (hex) of the converted outline's canonical GeoJSON text (compact, sorted keys, UTF-8): the SHA-256 of the boundary proposal the certificate made, and of the version it becomes once a platform admin approves it.

area_ha
bắt buộc
number

The converted outline's area in hectares: the ring area on a sphere of the WGS 84 equatorial radius, as the admin console and the boundary walks compute a boundary's area.

registered_area_ha
bắt buộc
number | null

The growing area's registered area_ha when the certificate was received.

area_difference_ratio
bắt buộc
number | null

(area_ha - registered_area_ha) / registered_area_ha: negative when the certificate's parcel is smaller than registered; null without a registered size.

polygon
bắt buộc
GeoJsonPolygon

LandCertificateCreate

object

#250: the parcel corners printed on a land-use right certificate's parcel map (VN-2000 plane coordinates) and the photo of the certificate page.

Thuộc tính
TênKiểuMô tả
central_meridian_min
bắt buộc
integer

The central meridian of the parcel map's projection, in minutes of arc east of Greenwich (e.g. 6345 = 105 degrees 45 minutes): one of the provinces' central meridians of Circular 26/2024/TT-BTNMT Appendix 01.

corners
bắt buộc
array<array<number>>

The corners in order around the parcel, 3 to 200 (the first may be repeated at the end; it is dropped), at least 3 different.

photo_sha256
bắt buộc
string

SHA-256 of the photo of the certificate page, an image the company uploaded (PUT /v1/attachments/{sha256}): never public; read it with GET /v1/attachments/{sha256}.

LandCertificatePage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<LandCertificateSummary>

Newest first.

next_cursor
bắt buộc
string | null

LandCertificateSummary

object

#250: a land certificate kept as the evidence of a boundary proposal, without its corners. It is the evidence of the proposal and of the boundary version with the same polygon_sha256: that boundary is "from land certificate".

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer

The certificate's id.

growing_area
bắt buộc
string
submitted_at
bắt buộc
number

Unix seconds when the certificate was received.

central_meridian_min
bắt buộc
integer

The central meridian of the parcel map's projection, in minutes of arc east of Greenwich (e.g. 6345 = 105 degrees 45 minutes): one of the provinces' central meridians of Circular 26/2024/TT-BTNMT Appendix 01.

corners_total
bắt buộc
integer

The number of corners.

plane_area_m2
bắt buộc
number

The parcel's area in square metres on the projection plane, from the corners as typed: the figure a certificate prints, so a typing slip shows.

photo_sha256
bắt buộc
string

SHA-256 of the photo of the certificate page, an image the company uploaded (PUT /v1/attachments/{sha256}): never public; read it with GET /v1/attachments/{sha256}.

polygon_sha256
bắt buộc
string

SHA-256 (hex) of the converted outline's canonical GeoJSON text (compact, sorted keys, UTF-8): the SHA-256 of the boundary proposal the certificate made, and of the version it becomes once a platform admin approves it.

area_ha
bắt buộc
number

The converted outline's area in hectares: the ring area on a sphere of the WGS 84 equatorial radius, as the admin console and the boundary walks compute a boundary's area.

registered_area_ha
bắt buộc
number | null

The growing area's registered area_ha when the certificate was received.

area_difference_ratio
bắt buộc
number | null

(area_ha - registered_area_ha) / registered_area_ha: negative when the certificate's parcel is smaller than registered; null without a registered size.

walk
bắt buộc
LandCertificateWalkComparison | null

The certificate against the area's latest boundary walk; null when the area has none.

superseded
bắt buộc
boolean

Whether the certificate replaced a boundary proposal that was waiting.

LandCertificateWalkComparison

object

#250: a certificate against the area's latest boundary walk (#248).

Thuộc tính
TênKiểuMô tả
walk_id
bắt buộc
integer

The walk's id.

area_ha
bắt buộc
number

The walked area in hectares.

area_difference_ratio
bắt buộc
number | null

(certificate area - walked area) / walked area.

centre_offset_m
bắt buộc
number | null

The distance in metres between the centres of the two outlines (a local approximation, to compare, not a survey).

LiveAnnouncement

object

An announcement showing now in the staff shell.

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
text
bắt buộc
string

Plain text, one line.

level
bắt buộc
"info" | "warning"
starts_at
bắt buộc
number

Shown from this time (seconds since 1970, UTC).

ends_at
bắt buộc
number | null

Shown until this time; null until expired.

LocationCheck

object

#247 (getAreaLocationCheck): which location check ingest makes now for the company's positions of this area, and the area's commune by point. A position is checked against the area's approved plot boundary when it has one in force (plot_boundary); else, once the platform imported commune boundaries (OpenStreetMap, ODbL 1.0), against the area's registered commune (commune: an alert on a mismatch, never a hold, and the location trust is unchanged); else not at all (none: no plot boundary and either no commune boundaries imported or an area not approved yet). A registered commune no unit of the boundary data is named like (name unmatched, e.g. a name from before the 2025-07-01 reform) gets only commune_unknown; position_communes then shows the post-2025 units the area's positions fell in, to change the area's commune to.

Thuộc tính
TênKiểuMô tả
applies
bắt buộc
"plot_boundary" | "commune" | "none"

The check ingest makes now for a position of the area.

registered_commune
bắt buộc
string | null

The commune registered on the area; null: none.

dataset
bắt buộc
string | null

The key of the commune boundary dataset in force (the one imported last); null: none imported.

name
bắt buộc
"matched" | "unmatched" | "missing" | null

Whether a unit of the dataset in force is named like the registered commune (missing: no commune registered); null without a dataset.

commune_verdict_counts
bắt buộc
CommuneVerdictCounts
position_communes
bắt buộc
array<PositionCommune> | null

The units of the dataset in force that contained the area's judged positions in the range, most first (at most 5); null without a dataset or when the caller is not given positions (only a platform admin and the owning company's operators and admins are).

attribution
bắt buộc
string | null

"© OpenStreetMap contributors", to show with any commune named here (ODbL); null without a dataset.

copyright
bắt buộc
string | null

The OpenStreetMap copyright page the attribution links to; null without a dataset.

LoggerCheck

object

The logger cross-check, recomputed by every link, upload and departure: from the seal time (the earliest seal time of the shipment's lots) every reading within setpoint +/- tolerance and no gap above the logger interval up to the departure. Times are Unix seconds. At most 20 gaps and 20 out-of-range readings are listed; all are counted.

Thuộc tính
TênKiểuMô tả
status
bắt buộc
"missing" | "incomplete" | "out_of_range" | "matched"
readings
bắt buộc
integer
considered
bắt buộc
integer

Readings from the seal time on.

first_at
bắt buộc
number | null
last_at
bắt buộc
number | null
min_c
bắt buộc
number | null
max_c
bắt buộc
number | null
seal_at
bắt buộc
number | null
until
bắt buộc
number | null

The departure; null while the shipment is open.

gap_count
bắt buộc
integer
gaps
bắt buộc
array<object>
out_of_range_count
bắt buộc
integer
out_of_range
bắt buộc
array<object>
complete
bắt buộc
boolean
within_setpoint
bắt buộc
boolean

LoggerSeries

object

A temperature series of the shipment's logger, signed ES256 over the canonical JSON (sorted keys, no whitespace, UTF-8) of every member but sig, as a device envelope, with an active key of the device registry owned by the shipment's active logger (sig.kid names it).

Thuộc tính
TênKiểuMô tả
logger
bắt buộc
string

The shipment's logger device id.

shipment
bắt buộc
string

The shipment code.

capability
bắt buộc
"air.temperature"
unit
bắt buộc
"Cel"
readings
bắt buộc
array<object>
sig
bắt buộc
object

LoginRequest

object

Thuộc tính
TênKiểuMô tả
email
bắt buộc
string
password
bắt buộc
string

Lot

object

A lot of one tenant (issue #26). code is unique within the tenant and links the lot to envelopes whose signed context names it; seq is the tenant's lot number (fruit codes); public_id is 128 random bits as hex, never derived from the code or seq. Status in wave 5: draft (created), open (a session was opened), closed (service-level close; the route comes with the seal).

Thuộc tính
TênKiểuMô tả
tenant
bắt buộc
string
code
bắt buộc
string
seq
bắt buộc
integer
public_id
bắt buộc
string
facility
bắt buộc
string
product
bắt buộc
string
variety
bắt buộc
string | null
growing_area
bắt buộc
string | null
harvest_date
bắt buộc
string (date) | null (date)
harvest_event_id
bắt buộc
string | null

Id of the tenant's harvest envelope.

destination
bắt buộc
string | null
gtin
bắt buộc
string | null
status
bắt buộc
"draft" | "open" | "paused" | "closed" | "packed" | "shipped" | "recalled" | "withdrawn"
created_at
bắt buộc
number

Unix seconds.

updated_at
bắt buộc
number

Unix seconds.

closed_at
bắt buộc
number | null

Unix seconds; null until closed.

LotApplication

object

Thuộc tính
TênKiểuMô tả
id
bắt buộc
string

The application record's envelope id.

applied_at
bắt buộc
string (date-time)

When the application started (the event's time), UTC.

input
bắt buộc
string | null

apply.input as recorded: water, fertiliser, pesticide, lime or light (null when the held record has none).

product
bắt buộc
object | null

apply.product: the product's id (a registration number, GTIN or the farm's own code), batch and trade name when recorded.

product_mass_kg
bắt buộc
number | null

apply.product_mass in kg, when recorded.

product_volume_l
bắt buộc
number | null

apply.product_volume in litres, when recorded.

duration_s
bắt buộc
number | null

apply.duration in seconds, when recorded.

phi_days
bắt buộc
number | null

apply.phi_days: the pre-harvest interval the product's label gives, in days, as recorded.

interval_ends_at
bắt buộc
string (date-time) | null (date-time)

When the pre-harvest interval ends, as the check at harvest reads it (the application's end plus the interval); null when the record states none.

status
bắt buộc
"accepted" | "quarantined"

quarantined: held for review.

reasons
bắt buộc
array<string>

Why the record is held (empty when accepted).

device_id
bắt buộc
string

The device or harvest app install that signed it.

operator
bắt buộc
string | null

context.operator: who applied it, as the company's opaque id.

harvest_app
bắt buộc
boolean

Entered by hand in the harvest app: Self-declared.

LotApplications

object

Thuộc tính
TênKiểuMô tả
lot
bắt buộc
string

Lot code.

growing_area
bắt buộc
string | null

The lot's growing area; null: none, and no records.

from
bắt buộc
string (date-time) | null (date-time)

Start of the period listed (included), UTC; null without a growing area.

until
bắt buộc
string (date-time) | null (date-time)

End of the period listed (excluded): the end of the lot's harvest day, UTC; null without a growing area.

items
bắt buộc
array<LotApplication>
more
bắt buộc
boolean

More records than items lists: the older ones were left out.

sprays
bắt buộc
array<object>

#322: the spray records of the lot's growing area (its spray log, GET /v1/growing-areas/{code}/sprays) sprayed from the first day of the period to the harvest day, both included, oldest first (at most 200, the newest kept), each with its withholding status at the harvest day; empty without a growing area. Listed only: they do not hold a harvest.

LotCartonBalance

object

The lot's exportable fruits (L6's export) against those left out of every carton. Stated, not blocking: a lot packs with the gap and keeps it in its packing view.

Thuộc tính
TênKiểuMô tả
exportable_fruits
bắt buộc
integer

Fruits recorded or overridden with grade A or B.

exportable_kg
bắt buộc
number

Their measured weights (unweighed fruits add none).

uncartoned_fruits
bắt buộc
integer

Exportable fruits in no carton.

uncartoned_kg
bắt buộc
number

Their measured weights.

violation
bắt buộc
"fruit_not_cartoned" | null

fruit_not_cartoned: an exportable fruit is in no carton; null when every exportable fruit is cartoned.

LotCloseCheck

object

A lot's close check (O6, #64): the operator console's close dialog. Times are Unix seconds.

Thuộc tính
TênKiểuMô tả
lot
bắt buộc
string

Lot code.

status
bắt buộc
"draft" | "open" | "paused" | "closed" | "packed" | "shipped" | "recalled" | "withdrawn"
sealed
bắt buộc
boolean

Whether the lot has its seal.

counts
bắt buộc
object

The lot's final counts.

sessions
bắt buộc
object

Measurement sessions of the lot not closed yet; the close closes a paused one.

issuer_key
bắt buộc
string | null

The DID URL of the facility's active issuer key, the one the close signs with; null without one.

timestamping
bắt buộc
boolean

Whether an external timestamp authority (RFC 3161) is configured: the seal's manifest hash is then timestamped by the periodic job.

blockers
bắt buộc
array<"already_sealed" | "not_sealable" | "fruits_pending_review" | "session_open" | "envelopes_not_synced" | "no_issuer_key" | "lot_too_large">

Why the close cannot be confirmed now, in this order; empty when nothing blocks. envelopes_not_synced: a fruit awaits its device record or an envelope of the lot is quarantined.

seal
bắt buộc
null | object

LotCloseRequest

object

What the operator confirms before signing: the lot's fruit records as the console showed them.

Thuộc tính
TênKiểuMô tả
confirm_counts
bắt buộc
object

LotCodeSuggestion

object

Thuộc tính
TênKiểuMô tả
code
bắt buộc
string

A code createLot accepts, not used by the company when it was suggested: LO-YYMMDD-NNN.

LotCreate

object

The owner is the tenant the caller acts for; seq, public_id and status are set by the server.

Thuộc tính
TênKiểuMô tả
code
bắt buộc
string
facility
bắt buộc
string

A facility of the caller's tenant (within an operator's facilities).

product
không bắt buộc
string
variety
không bắt buộc
string | null
growing_area
không bắt buộc
string | null

A growing-area code the tenant may read (its own or an unowned one).

harvest_date
không bắt buộc
string (date) | null (date)

YYYY-MM-DD, at most one day after today (UTC).

harvest_event_id
không bắt buộc
string | null

Id of a stored harvest envelope of the tenant.

destination
không bắt buộc
string | null
gtin
không bắt buộc
string | null

GTIN-14 with a valid GS1 check digit.

LotGs1Carton

object

Thuộc tính
TênKiểuMô tả
code
bắt buộc
string
carton_no
bắt buộc
integer
epc
bắt buộc
string
element_string
bắt buộc
string | null

(01)<gtin>(10)<lot>(21)<serial>; null without a GTIN.

digital_link
bắt buộc
string | null

LotGs1Labels

object

#161: what the lot's GS1 labels print. The lot-level element string and Digital Link exist when the lot has a GTIN and its code fits AI 10 (20 characters); the public resolver answers the Digital Link once the lot is sealed (sealed).

Thuộc tính
TênKiểuMô tả
lot
bắt buộc
string
gtin
bắt buộc
string | null
sealed
bắt buộc
boolean
element_string
bắt buộc
string | null

(01)<gtin>(10)<lot>

digital_link
bắt buộc
string | null

<resolver base>/01/<gtin>/10/<lot>

cartons
bắt buộc
array<LotGs1Carton>
pallets
bắt buộc
array<LotGs1Pallet>
next_cursor
bắt buộc
string | null

LotGs1Pallet

object

Thuộc tính
TênKiểuMô tả
sscc
bắt buộc
string

GS1 Serial Shipping Container Code: 18 digits, the last the GS1 mod-10 check digit.

element_string
bắt buộc
string
lot_cartons
bắt buộc
integer
first_carton
bắt buộc
integer

The lowest number of the lot's cartons on the pallet.

last_carton
bắt buộc
integer

The highest number of the lot's cartons on the pallet.

cartons
bắt buộc
integer

Every carton on the pallet, of any lot. The export pallet label prints the pallet's (00) when the pallet holds exactly the cartons the label is printed for.

LotMergeInput

object

One lot the merge consumes, with the kilograms taken from it.

Thuộc tính
TênKiểuMô tả
lot
bắt buộc
string

Code of a lot of the caller's tenant (closed, packed or shipped, never merged before, not on hold, of the output lot's product).

quantity_kg
bắt buộc
number

Kilograms taken from this lot; for a packed lot at most its packed net mass plus the mass tolerance.

LotMergeRequest

object

A lot merge (#91): the input lots and the kilograms the output lot (the path's lot) holds.

Thuộc tính
TênKiểuMô tả
inputs
bắt buộc
array<LotMergeInput>

2 to 50 distinct lots, never the output lot itself.

output_kg
bắt buộc
number

Kilograms of the output lot. Mass balance: it differs from the sum of the inputs' quantity_kg by at most mass_tolerance (5 %) of that sum.

LotPacking

object

A lot's packing (issue #37): totals, seal numbers (newest first, at most 50) and the mass balance with every violation counted (at most 50 listed, in carton order).

Thuộc tính
TênKiểuMô tả
lot
bắt buộc
string
status
bắt buộc
"draft" | "open" | "paused" | "closed" | "packed" | "shipped" | "recalled" | "withdrawn"
packed_at
bắt buộc
number | null

Unix seconds of the pack event (the first seal).

cartons
bắt buộc
integer
fruits
bắt buộc
integer
net_mass_kg
bắt buộc
number

Sum of the cartons' net masses.

fruit_mass_kg
bắt buộc
number

Sum of the packed fruits' measured weights.

seal_numbers
bắt buộc
array<object>
mass_balance
bắt buộc
object

LotPage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<Lot>
next_cursor
bắt buộc
string | null

Pass as cursor for the next page; null on the last page.

LotRecall

object

The recall or withdrawal of a lot (P5, #41) and its outbound notice, stored for the outbound adapter (#90) and not sent yet. recalled_by is an opaque operator id (user-<id>, token-<id> or legacy-<keyed hash>), never an email or a name; cartons and shipments are what the trace found at the recall.

Thuộc tính
TênKiểuMô tả
kind
bắt buộc
"recall" | "withdrawal"
status
bắt buộc
"recalled" | "withdrawn"
reason
bắt buộc
RecallReason
scope
bắt buộc
"consumer" | "retail" | "wholesale"
note
bắt buộc
string
prior_status
bắt buộc
"draft" | "open" | "paused" | "closed" | "packed" | "shipped"
recalled_by
bắt buộc
string
recalled_at
bắt buộc
number

Unix seconds.

cartons
bắt buộc
integer
shipments
bắt buộc
integer
notice
bắt buộc
object | null

LotRecallRequest

object

A recall or withdrawal of the whole lot (P5, #41). kind recall moves the lot to recalled, withdrawal to withdrawn; scope is the recall depth (21 CFR 7.42(b)(1)); note is staff text, never public, never in the audit row or the outbound notice.

Thuộc tính
TênKiểuMô tả
kind
bắt buộc
"recall" | "withdrawal"
reason
bắt buộc
RecallReason
scope
bắt buộc
"consumer" | "retail" | "wholesale"
note
không bắt buộc
string

LotSampling

object

The one sampling of a lot: the rule and the rates it was computed from, the population (the lot's export fruits), the lab the system assigned, the test scope and the fruits drawn.

Thuộc tính
TênKiểuMô tả
lot
bắt buộc
string
lab
bắt buộc
object
rule
bắt buộc
object
population
bắt buộc
integer
sample_count
bắt buộc
integer
analytes
bắt buộc
array<SampleAnalyte>
selected_by
bắt buộc
string
selected_at
bắt buộc
number

Unix seconds.

samples
bắt buộc
array<SampleItem>
report
bắt buộc
LabReport | null

The lab's signed report (P4, #40), null until the lab submits it.

LotSamplingRead

object

Thuộc tính
TênKiểuMô tả
sampling
bắt buộc
LotSampling | null

LotSeal

object

A lot's seal (L10, #35): the signed credential of its manifest and what identifies it. credential is a compact JWS (VC-JOSE: protected header alg ES256, kid the issuer key's DID URL, typ vc+jwt, cty vc) whose payload is a W3C verifiable credential (VC 2.0, type AgriTraceLotSeal, issuer the facility's did:web) with the lot's manifest as credentialSubject: the lot's facts, every fruit record with the SHA-256 of its stored record and its bound envelope ids, every envelope of the lot with the SHA-256 of its stored payload and its signing key, the totals, the packing, the lab report, the shipment and the trust snapshot. The signature verifies with the key listed in https://<domain>/<slug>/did.json. manifest_sha256 is the SHA-256 of the JWS payload bytes. sealed_by is an opaque operator id, never an email or a name: user-<id> for a signed-in user, token-<id> for an API token (its row id), legacy- and 16 hex digits of an HMAC under the server's secret for a legacy token. Times are Unix seconds.

Thuộc tính
TênKiểuMô tả
lot
bắt buộc
string

Lot code.

status
bắt buộc
"closed" | "packed" | "shipped" | "recalled" | "withdrawn"

The lot's status now.

sealed_at
bắt buộc
number
sealed_by
bắt buộc
string
key_id
bắt buộc
string

The signing key's DID URL (<did>#key-<n>).

manifest_sha256
bắt buộc
string
fruit_count
bắt buộc
integer
event_count
bắt buộc
integer
credential
bắt buộc
string

LotSummary

object

Lot summary (L6, #31).

Thuộc tính
TênKiểuMô tả
lot
bắt buộc
string

Lot code.

status
bắt buộc
"draft" | "open" | "paused" | "closed" | "packed" | "shipped" | "recalled" | "withdrawn"
count
bắt buộc
integer

Fruits with a device record: status recorded or overridden, or rejected with at least one bound device envelope (knock, scale or override). Fruits awaiting a device and fruits rejected before any measurement are reported apart.

awaiting_device
bắt buộc
integer

Fruits labelled but without a device record yet.

rejected_unmeasured
bắt buộc
integer

Fruits rejected before any device envelope was bound (no device record); not in count, levels or grades.

kg
bắt buộc
number

Sum of the scale weights of the counted fruits, rounded to 3 decimals.

weighed
bắt buộc
integer

Counted fruits that have a scale weight.

levels
bắt buộc
object

Counted fruits per effective ripeness level (the sensory level when overridden, else the device level); unknown without a level.

grades
bắt buộc
object

Counted fruits per grade; a fruit with status rejected counts as reject.

overrides
bắt buộc
integer

Counted fruits with a sensory override.

avg_confidence
bắt buộc
number | null

Mean device confidence of the counted fruits that have one, 4 decimals; null when none has one.

pending_review
bắt buộc
integer

Fruits of the lot with a bound envelope still in quarantine.

export
bắt buộc
object

Counted fruits graded A or B and not rejected, and their weight.

volume
bắt buộc
GrowingAreaVolume | null

Volume headroom of the lot's growing area for the season of its harvest date (as GET /v1/growing-areas/{code}/volume); null when the lot has no growing area.

LotTrace

object

The affected set of a lot (P5, #41): backward to its facility, growing area and harvest; forward to its cartons (all counted, at most 500 listed in carton order, truncated when more exist) and the shipment carrying it, and through the chain of lot merges (#91) to every lot holding its fruit: the lot a merge produced from it, the lot a merge produced from that one, and so on (a merged lot can be closed and merged again), at most 8 merges: those lots' cartons are counted and listed with the lot's own (after them, in chain order), and the shipment is the first found along the chain, the lot's own first; the other lots of the tenant from the same growing area and harvest date (at most 50, by code). The harvest is the lot's accepted signed harvest event carrying a mass (signed_event), else the growing area's declaration for the harvest date (area_declaration: the whole area's kg), else only the date. On request (getLotTrace merges=1, #259) the trace also names the lots the merges link: forward.merged_into, the lots of the chain after this one in chain order, backward.merged_from, the input lots of the merge that produced this one (empty when no merge did), and each listed carton's lot.

Thuộc tính
TênKiểuMô tả
lot
bắt buộc
object
recall
bắt buộc
LotRecall | null
backward
bắt buộc
object
forward
bắt buộc
object
related_lots
bắt buộc
object

LotTransformation

object

A lot merge (#91; the transform event type, FSMA 204 transformation CTE). Its EPCIS 2.0 TransformationEvent is in the staff EPCIS document of each of its lots.

Thuộc tính
TênKiểuMô tả
event_id
bắt buộc
string (uuid)

The merge's id: the eventID of its TransformationEvent is urn:uuid:<event_id>, and the records export rows of the merge carry it.

lot
bắt buộc
string

The output lot's code.

facility
bắt buộc
string

The facility the merge happened at: the output lot's.

inputs
bắt buộc
array<LotMergeInput>

The lots the merge consumed, by code.

input_kg
bắt buộc
number

The sum of the inputs' quantity_kg.

output_kg
bắt buộc
number

The output lot's kilograms.

mass_tolerance
bắt buộc
number

The share of input_kg by which output_kg may differ (0.05).

recorded_at
bắt buộc
number

When the merge was recorded (Unix seconds).

LotTransformations

object

The lot merges a lot took part in (#91).

Thuộc tính
TênKiểuMô tả
produced_by
bắt buộc
LotTransformation | null

The merge that produced the lot; null when no merge did.

consumed_by
bắt buộc
LotTransformation | null

The merge that consumed the lot; null when no merge did.

LotTrust

object

Thuộc tính
TênKiểuMô tả
lot
bắt buộc
string

Lot code.

snapshot
bắt buộc
null | object
queued
bắt buộc
boolean

The lot waits for a recompute.

holds
bắt buộc
array<object>

The latest recorded holds, newest first.

history
bắt buộc
array<object>
next_cursor
bắt buộc
string | null

LotUpdate

object

Descriptive fields only; code, facility, seq, public_id, tenant and status are immutable here.

Thuộc tính
TênKiểuMô tả
product
không bắt buộc
string
variety
không bắt buộc
string | null
growing_area
không bắt buộc
string | null

A growing-area code the tenant may read (its own or an unowned one).

harvest_date
không bắt buộc
string (date) | null (date)

YYYY-MM-DD, at most one day after today (UTC).

harvest_event_id
không bắt buộc
string | null

Id of a stored harvest envelope of the tenant.

destination
không bắt buộc
string | null
gtin
không bắt buộc
string | null

GTIN-14 with a valid GS1 check digit.

MapPoint

object

SENS-B1e (#235): a placement's surveyed install point (WGS84).

Thuộc tính
TênKiểuMô tả
lat
bắt buộc
number
lon
bắt buộc
number
accuracy_m
bắt buộc
number

MarketLimit

object

One market limit entry: the maximum (kind max, value in mg/kg) or ban (kind banned, no value) of an analyte in a product for a destination market, from valid_from (Asia/Ho_Chi_Minh) until a later entry of the same market, product and analyte supersedes it. status on today's date: in_force (the entry that applies today), scheduled (from a later date) or superseded. Entries are never edited: a lab result keeps a copy of the limit it was judged with.

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
market
bắt buộc
string

ISO 3166-1 alpha-2.

product
bắt buộc
string

As lots.product.

analyte
bắt buộc
string
kind
bắt buộc
"max" | "banned"
value
bắt buộc
number | null

The maximum; null for a ban.

unit
bắt buộc
"mg/kg"
valid_from
bắt buộc
string (date)
source
bắt buộc
string

The regulation it cites.

created_at
bắt buộc
number

Unix seconds.

created_by
bắt buộc
string

Who recorded it (migration: the seeded entries).

status
bắt buộc
"in_force" | "scheduled" | "superseded"

MarketLimitCreate

object

A new entry. value is required for max (above 0, at most 1000 mg/kg) and must be absent or null for banned. valid_from from today (Asia/Ho_Chi_Minh) to 10 years ahead: an entry never reaches back. The unit is always mg/kg.

Thuộc tính
TênKiểuMô tả
market
bắt buộc
string
product
bắt buộc
string
analyte
bắt buộc
string
kind
bắt buộc
"max" | "banned"
value
không bắt buộc
number | null
valid_from
bắt buộc
string (date)
source
bắt buộc
string

MarketLimitPage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<MarketLimit>
today
bắt buộc
string (date)

The date status is computed for.

next_cursor
bắt buộc
string | null

The next page's cursor; null on the last.

Me

object

Thuộc tính
TênKiểuMô tả
user
bắt buộc
User
memberships
bắt buộc
array<Membership>
csrf_token
bắt buộc
string
tenant
bắt buộc
string | null

Tenant the request acts for; null when the user has no membership.

roles
bắt buộc
array<string>
tenant_name
không bắt buộc
string | null

#282 (always present in this answer): the name of the tenant the request acts for (tenant), for the console's top bar; null when that company has no registered name (for example a platform admin acting for a company id that is not registered), and the console then shows tenant.

lab_name
không bắt buộc
string | null

#282 (always present in this answer): for a lab user (roles holds lab), the name of its lab (the membership's lab_id); null otherwise.

two_factor
không bắt buộc
TwoFactorState

MeasurementSession

object

A measurement session of one lot on one line (not a login session). At most one open or paused session holds a line, and a device is in at most one open or paused session.

Thuộc tính
TênKiểuMô tả
id
bắt buộc
string
tenant
bắt buộc
string
lot
bắt buộc
string

Lot code.

facility
bắt buộc
string

The lot's facility.

line
bắt buộc
string
status
bắt buộc
"open" | "paused" | "closed"
opened_by
bắt buộc
string

The principal that opened the session.

opened_at
bắt buộc
number

Unix seconds.

paused_at
bắt buộc
number | null

Unix seconds of the last pause.

closed_at
bắt buộc
number | null

Unix seconds.

updated_at
bắt buộc
number

Unix seconds.

devices
bắt buộc
array<string>

Devices chosen when the session opened.

MeasurementSessionList

object

Every measurement session of one lot, newest first.

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<MeasurementSession>

MeasurementSessionOpen

object

Thuộc tính
TênKiểuMô tả
line
bắt buộc
string
devices
không bắt buộc
array<string>

Active devices of the lot's facility. Default: every one whose profile declares set_session.

MeasurementSessionOpened

object

The new measurement session and the set_session outcome per chosen device.

Thuộc tính
TênKiểuMô tả
id
bắt buộc
string
tenant
bắt buộc
string
lot
bắt buộc
string

Lot code.

facility
bắt buộc
string

The lot's facility.

line
bắt buộc
string
status
bắt buộc
"open" | "paused" | "closed"
opened_by
bắt buộc
string

The principal that opened the session.

opened_at
bắt buộc
number

Unix seconds.

paused_at
bắt buộc
number | null

Unix seconds of the last pause.

closed_at
bắt buộc
number | null

Unix seconds.

updated_at
bắt buộc
number

Unix seconds.

devices
bắt buộc
array<string>

Devices chosen when the session opened.

commands
bắt buộc
array<SessionCommand>

Member

object

SELF-1-4 (#185). Someone who belongs to the company. Never a password, a token or a session.

Thuộc tính
TênKiểuMô tả
user_id
bắt buộc
integer
email
bắt buộc
string

The email the person signs in with.

display_name
bắt buộc
string | null
role
bắt buộc
"tenant_admin" | "operator" | "auditor" | "agronomist" | null

The member's role in this company; null when the person holds only platform-managed roles here (a lab user).

facilities
bắt buộc
array<string> | null

An operator's facility codes; null = every facility of the company (always null for another role).

other_roles
bắt buộc
array<"lab" | "platform_admin">

Platform-managed roles held in this company: shown, never changed here.

lab_id
bắt buộc
string | null

The lab of a lab membership.

status
bắt buộc
"active" | "disabled"

disabled: turned off for this company (the person keeps every other company).

account_status
bắt buộc
"active" | "disabled"

The account itself, managed by CropPath only.

last_sign_in_at
bắt buộc
number | null

Unix seconds of the newest session CropPath still keeps (sessions are deleted 30 days after they end); null: none in that time.

joined_at
bắt buộc
number | null

Unix seconds; null for a membership older than #184.

two_factor
bắt buộc
boolean

SELF-1-6 (#187): the member's two-step sign-in is on.

locked
bắt buộc
boolean

SELF-2-10 (#199): the member is locked out of signing in now (too many wrong passwords or two-step codes; the lock ends by itself after 15 minutes or when a company admin unlocks it). Never how many failures they had.

MemberList

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<Member>
active_admins
bắt buộc
integer

How many company admins are active, with an active account (the last-admin rule).

MemberSessionsRevoke

object

Thuộc tính
TênKiểuMô tả
reason
không bắt buộc
string

Required from a platform admin (CropPath support): one line, kept in the company's activity log. Ignored for a company admin.

MemberSessionsRevoked

object

Thuộc tính
TênKiểuMô tả
user_id
bắt buộc
integer
sessions_revoked
bắt buộc
integer

How many live sessions of the member were ended.

Membership

object

Thuộc tính
TênKiểuMô tả
tenant
bắt buộc
string
role
bắt buộc
string

e.g. tenant_admin, platform_admin, operator, lab, auditor.

facilities
bắt buộc
array<string> | null

null means every facility of the tenant.

lab_id
bắt buộc
string | null

MemberUnlockResult

object

SELF-2-10 (#199). The member's sign-in lockout was cleared.

Thuộc tính
TênKiểuMô tả
user_id
bắt buộc
integer
locked
bắt buộc
false
was_locked
bắt buộc
boolean

The member was locked out when the request ran (false: there was nothing to clear but a count of earlier failures, which is cleared too). Never how many failures they had.

MemberUpdate

object

Thuộc tính
TênKiểuMô tả
role
bắt buộc
"tenant_admin" | "operator" | "auditor" | "agronomist"
facilities
không bắt buộc
array<string> | null

Operators only: codes of the company's facilities; null or an empty list = every facility.

NationalPortalFiling

object

The national-portal filing of the accepted envelopes of the shipment's lots (#299): the outbound rows of the national portal's own target only (a local EPCIS file archive or another EPCIS repository never counts), queue rows, delivered, pending, failing (pending after a failed attempt); filed when there is a row and every one is delivered. With no national portal target configured there is no row and filed is false.

Thuộc tính
TênKiểuMô tả
rows
bắt buộc
integer
delivered
bắt buộc
integer
pending
bắt buộc
integer
failing
bắt buộc
integer
filed
bắt buộc
boolean

Notification

object

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
kind
bắt buộc
NotificationKind
params
bắt buộc
NotificationParams
created_at
bắt buộc
number

Unix seconds.

read_at
bắt buộc
number | null

When the caller read it; null while unread.

NotificationKind

"invitation_accepted" | "invitation_expiring" | "webhook_disabled" | "api_token_expiring" | "facility_approved" | "facility_refused" | "growing_area_approved" | "report_filed" | "signing_key_missing" | "alarm_raised"

What happened. invitation_accepted {email, role}; invitation_expiring {email, role, expires_at}; webhook_disabled {subscription_id, description, failures}; api_token_expiring {token_id, name, expires_at}; facility_approved {code, name}; facility_refused {code, name, reason}; growing_area_approved {code, name}; report_filed {report_id, lot, category}; signing_key_missing {facility, name, open_lots}; alarm_raised {alarm_id, alarm_kind, priority, device, zone, area} (#361: an urgent or warning alarm of the irrigation cockpit was raised, to the company's admins, the operators of its facility getting the email only; GET /v1/alarms/{id}). Clients show an unknown kind generically: new kinds may be added.

NotificationPage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<Notification>
unread
bắt buộc
integer

The caller's unread notifications in this company.

next_cursor
bắt buộc
string | null

The next page's cursor; null on the last.

NotificationParams

object

The kind's parameters (see NotificationKind): identifiers, names and times only, never rendered text.

Thuộc tính
TênKiểuMô tả
email
không bắt buộc
string

The invited person's sign-in email.

role
không bắt buộc
"tenant_admin" | "operator" | "auditor" | "agronomist"

The invited role.

expires_at
không bắt buộc
number

When the invitation or token expires (Unix seconds).

subscription_id
không bắt buộc
integer

The webhook subscription turned off.

description
không bắt buộc
string

The webhook's own description (may be empty).

failures
không bắt buộc
integer

Failed delivery attempts in a row.

token_id
không bắt buộc
integer
name
không bắt buộc
string | null

The token's, facility's or growing area's name.

code
không bắt buộc
string

The facility or growing area code.

reason
không bắt buộc
string

Why CropPath refused the facility proposal.

report_id
không bắt buộc
integer
lot
không bắt buộc
string

The lot code a public report names.

category
không bắt buộc
"label_peeled" | "scanned_many" | "ripeness_off" | "other"
facility
không bắt buộc
string

The facility code missing a signing key.

open_lots
không bắt buộc
integer

Its lots not closed yet (draft, open or paused).

alarm_id
không bắt buộc
integer

#361: the alarm raised (GET /v1/alarms/{id}).

alarm_kind
không bắt buộc
string

#361: the alarm's catalog kind.

priority
không bắt buộc
"urgent" | "warning" | "notice"

#361: the alarm's priority.

device
không bắt buộc
string | null

#361: the alarm's device.

zone
không bắt buộc
integer | null

#361: the alarm's controller zone.

area
không bắt buộc
string | null

#361: the alarm's growing area code.

NotificationsMarkedRead

object

Thuộc tính
TênKiểuMô tả
marked
bắt buộc
integer
unread
bắt buộc
integer

NotificationUnreadCount

object

Thuộc tính
TênKiểuMô tả
unread
bắt buộc
integer

OAuthClient

object

An OAuth2 API client of the tenant as the admin console lists it: never the secret, never its hash. Unix seconds.

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
client_id
bắt buộc
string

The public client identifier the integration authenticates with.

name
bắt buộc
string

The operator's label (not unique).

role
bắt buộc
"tenant_admin" | "operator" | "auditor"
scopes
bắt buộc
array<"aggregate_read" | "attachment_read" | "attachment_upload" | "command_read" | "device_admin" | "device_command" | "device_read" | "envelope_read" | "epcis_capture" | "facility_edit" | "facility_read" | "fruit_action" | "grading_rule_read" | "grading_rule_write" | "growing_area_edit" | "growing_area_read" | "issuer_key_admin" | "lot_read" | "lot_recall" | "lot_write" | "market_limit_read" | "recall_read" | "records_export" | "report_triage" | "review" | "tenant_read" | "trace_read" | "webhook_admin">
facilities
bắt buộc
array<string> | null

An operator client's facility codes; null: every facility.

created_by
bắt buộc
string
created_at
bắt buộc
number
last_token_at
bắt buộc
number | null

When it last got a token; null: never.

revoked_at
bắt buộc
number | null
revoke_reason
bắt buộc
string | null
revoked_by
bắt buộc
string | null
status
bắt buộc
"active" | "revoked"

OAuthClientAllowedIps

object

#205: 1 to 20 distinct networks in CIDR form, IPv4 or IPv6 (a bare address is its /32 or /128; host bits set are refused), or null for any source. The key is required.

Thuộc tính
TênKiểuMô tả
allowed_ips
bắt buộc
array<string> | null

OAuthClientCreate

object

role: tenant_admin, operator or auditor. scopes: distinct permissions the role can hold (credential management, platform and lab permissions are never granted). facilities: an operator client only, 1 to 64 distinct facility codes of the tenant; absent or null, every facility.

Thuộc tính
TênKiểuMô tả
name
bắt buộc
string
role
bắt buộc
"tenant_admin" | "operator" | "auditor"
scopes
bắt buộc
array<"aggregate_read" | "attachment_read" | "attachment_upload" | "command_read" | "device_admin" | "device_command" | "device_read" | "envelope_read" | "epcis_capture" | "facility_edit" | "facility_read" | "fruit_action" | "grading_rule_read" | "grading_rule_write" | "growing_area_edit" | "growing_area_read" | "issuer_key_admin" | "lot_read" | "lot_recall" | "lot_write" | "market_limit_read" | "recall_read" | "records_export" | "report_triage" | "review" | "tenant_read" | "trace_read" | "webhook_admin">
facilities
không bắt buộc
array<string> | null

OAuthClientCreated

object

The new client and, in client_secret, its secret: this response is the only place it ever appears. Store it now; a lost secret means revoking the client and registering a new one.

Thuộc tính
TênKiểuMô tả
client
bắt buộc
OAuthClient
client_secret
bắt buộc
string

OAuthClientDetail

object

#205: an API client as the credential view shows it: the fields of OAuthClient plus its expiry, allowed sources, last use and write scopes. Never the secret, its hash or a client address. Unix seconds.

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
client_id
bắt buộc
string

The public client identifier the integration authenticates with.

name
bắt buộc
string

The operator's label (not unique).

role
bắt buộc
"tenant_admin" | "operator" | "auditor"
scopes
bắt buộc
array<"aggregate_read" | "attachment_read" | "attachment_upload" | "command_read" | "device_admin" | "device_command" | "device_read" | "envelope_read" | "epcis_capture" | "facility_edit" | "facility_read" | "fruit_action" | "grading_rule_read" | "grading_rule_write" | "growing_area_edit" | "growing_area_read" | "issuer_key_admin" | "lot_read" | "lot_recall" | "lot_write" | "market_limit_read" | "recall_read" | "records_export" | "report_triage" | "review" | "tenant_read" | "trace_read" | "webhook_admin">
facilities
bắt buộc
array<string> | null

An operator client's facility codes; null: every facility.

created_by
bắt buộc
string
created_at
bắt buộc
number
last_token_at
bắt buộc
number | null

When it last got a token; null: never.

revoked_at
bắt buộc
number | null
revoke_reason
bắt buộc
string | null
revoked_by
bắt buộc
string | null
status
bắt buộc
"active" | "revoked"
expires_at
bắt buộc
number | null

When the client stops getting tokens and its tokens stop working (Unix seconds); null only for a client an older server registered, which counts as expired.

expired
bắt buộc
boolean

True from expires_at on (or without one): renew it to use it again.

allowed_ips
bắt buộc
array<string> | null

The networks (CIDR form, IPv4 or IPv6) the client may call from; null: any source.

last_used_at
bắt buộc
number | null

When it last got a token or called the API (calls are recorded at most once a minute, and shown within seconds); null: never.

last_used_ip_hash
bắt buộc
string | null

A keyed hash (HMAC-SHA256) of the address of that last use, never the address: equal values mean the same source.

write_scopes
bắt buộc
array<"aggregate_read" | "attachment_read" | "attachment_upload" | "command_read" | "device_admin" | "device_command" | "device_read" | "envelope_read" | "epcis_capture" | "facility_edit" | "facility_read" | "fruit_action" | "grading_rule_read" | "grading_rule_write" | "growing_area_edit" | "growing_area_read" | "issuer_key_admin" | "lot_read" | "lot_recall" | "lot_write" | "market_limit_read" | "recall_read" | "records_export" | "report_triage" | "review" | "tenant_read" | "trace_read" | "webhook_admin">

The client's scopes that open a write (a route other than GET).

broad_scope
bắt buộc
boolean

True when write_scopes is not empty: the client can change the company's records.

OAuthClientDetailPage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<OAuthClientDetail>
next_cursor
bắt buộc
string | null

The next page's cursor; null on the last.

OAuthClientPage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<OAuthClient>
next_cursor
bắt buộc
string | null

The next page's cursor; null on the last.

OAuthClientRenew

object

#205: the new lifetime, counted from now. Absent: 365 days.

Thuộc tính
TênKiểuMô tả
expires_in_days
không bắt buộc
integer

OAuthClientRevoke

object

Thuộc tính
TênKiểuMô tả
reason
bắt buộc
string

Why it is revoked, one line.

OAuthError

object

The error body of the OAuth2 endpoints (RFC 6749 §5.2): error the RFC error code, equal to code, and error_description the text. A request refused before the endpoint ran (a bad X-Request-Id, the rate limit, an Idempotency-Key header) gets the API's usual body, error and code only.

Thuộc tính
TênKiểuMô tả
error
bắt buộc
string
error_description
không bắt buộc
string
code
bắt buộc
string

OAuthRevokeRequest

object

RFC 7009 §2.1. client_id and client_secret only when the client does not use HTTP Basic.

Thuộc tính
TênKiểuMô tả
token
bắt buộc
string
token_type_hint
không bắt buộc
string
client_id
không bắt buộc
string
client_secret
không bắt buộc
string

OAuthToken

object

RFC 6749 §5.1.

Thuộc tính
TênKiểuMô tả
access_token
bắt buộc
string
token_type
bắt buộc
"Bearer"
expires_in
bắt buộc
integer

Seconds.

scope
bắt buộc
string

The scopes granted, space separated.

OAuthTokenRequest

object

RFC 6749 §4.4.2. client_id and client_secret only when the client does not use HTTP Basic. scope: space-separated permissions, a subset of the client's; absent, all of them.

Thuộc tính
TênKiểuMô tả
grant_type
bắt buộc
"client_credentials"
scope
không bắt buộc
string
client_id
không bắt buộc
string
client_secret
không bắt buộc
string

OidcCallback

object

#87. What the identity provider sent back to the company's redirect URI, and that company.

Thuộc tính
TênKiểuMô tả
state
bắt buộc
string
code
bắt buộc
string
company
bắt buộc
string

The company of the redirect URI the provider sent the browser back to ({origin}/login/oidc/{company}); it must be the company the sign-in was started for.

iss
không bắt buộc
string

The iss parameter of the provider's redirect (RFC 9207), when it sent one: it must be the provider's issuer.

OidcStart

object

#87. The company whose identity provider the person signs in with.

Thuộc tính
TênKiểuMô tả
company
bắt buộc
string

The company's id.

OidcStarted

object

#87. Where to send the browser: the company's identity provider, with the authorization code flow's parameters (state, nonce, the PKCE code_challenge with method S256, the company's own redirect URI and scope openid email). The sign-in must finish (POST /v1/auth/oidc/callback) before expires_at, in the same browser.

Thuộc tính
TênKiểuMô tả
authorization_url
bắt buộc
string (uri)
expires_at
bắt buộc
number

Unix seconds (10 minutes after the start).

Onboarding

object

SELF-1-8 (#189). The selected company's getting-started checklist: every step computed from its own records, counts only. Only hidden is stored.

Thuộc tính
TênKiểuMô tả
tenant
bắt buộc
string
complete
bắt buộc
boolean

Every required step is done.

hidden
bắt buộc
boolean

A company admin hid the checklist (the console then stops showing it on /admin).

hidden_at
bắt buộc
number | null

Unix seconds when it was hidden; null while shown.

steps
bắt buộc
array<OnboardingStep>

Every step, in the order a new company works through them.

OnboardingStep

object

SELF-1-8 (#189). One step of the getting-started checklist, judged from the company's own records.

Thuộc tính
TênKiểuMô tả
id
bắt buộc
"profile" | "second_admin" | "admin_two_factor" | "facility" | "growing_areas" | "operators" | "issuer_keys" | "devices" | "first_lot" | "first_sealed_lot" | "first_label" | "integrations"

profile: the company profile holds a legal name, an address and a tax number (count of 3 filled). second_admin: at least two active company admins (count: admins). admin_two_factor: every active company admin has two-step sign-in on (count of total admins). facility: an approved facility (count approved of total; waiting_for_platform while none is approved; a company cannot create facilities in Phase 1). growing_areas: an approved growing area with a grower of the company (count approved of total areas; waiting_for_platform while every area with a grower is unapproved). operators: an active operator (count). issuer_keys: every approved facility has an active signing key (count of total approved facilities). devices: an active device seen within 7 days (count of total active devices). first_lot, first_sealed_lot: a lot, a sealed lot (count). first_label: a fruit or carton label printed or an export label print logged. integrations (optional): an active API token, API client or webhook (count).

required
bắt buộc
boolean

false for an optional step (integrations): the checklist is complete without it.

status
bắt buộc
"done" | "to_do" | "waiting_for_platform"

waiting_for_platform: the company did its part and waits for CropPath (an approval).

count
bắt buộc
integer | null

The number the step is judged by, where one helps.

total
bắt buộc
integer | null

What count is out of, where it applies.

link
bắt buộc
string

The console screen (path and hash) where the step is done.

OnboardingUpdate

object

Thuộc tính
TênKiểuMô tả
hidden
bắt buộc
boolean

true hides the checklist, false shows it again.

OutboundBacklog

object

Thuộc tính
TênKiểuMô tả
targets
bắt buộc
array<OutboundTarget>

Every configured target, and any other target with events waiting, by name.

OutboundTarget

object

B9 (#21): the company's undelivered events for one outbound target (a national system, a buyer's EPCIS repository, an archive).

Thuộc tính
TênKiểuMô tả
target
bắt buộc
string

The target's name, as the deployment configures it.

pending
bắt buộc
integer

Accepted events waiting to be delivered.

held
bắt buộc
integer

Events not delivered because they are no longer accepted (for example sent back to quarantine by a pack), which wait until a review accepts them again.

failing
bắt buộc
integer

Pending events whose delivery failed at least once.

next_attempt_at
bắt buộc
number | null

Unix seconds: the earliest next delivery attempt of a pending event; null when none is pending.

max_attempts
bắt buộc
integer

The most failed attempts of one waiting event.

last_error
bắt buộc
string | null

The error of the waiting event that failed most often (the latest next attempt among equals); null when none failed. One delivery batch carries several companies' events and a partner's error body can echo any of them, so a company sees only a tenant-neutral summary: HTTP <status> when the partner answered with an HTTP error, else delivery_error. A platform admin sees the full text (at most 500 characters).

OverviewSectionUnavailable

object

#274. A section of an overview that could not be read: one of its queries failed. Only that section fails; the other sections answer.

Thuộc tính
TênKiểuMô tả
state
bắt buộc
"unavailable"
reason
bắt buộc
"query_failed"

Pallet

object

#161: a pallet of a facility, identified by its SSCC, with the cartons on it.

Thuộc tính
TênKiểuMô tả
sscc
bắt buộc
string

GS1 Serial Shipping Container Code: 18 digits, the last the GS1 mod-10 check digit.

facility
bắt buộc
string
epc
bắt buộc
string

https://id.gs1.org/00/<sscc>

element_string
bắt buộc
string

GS1-128 element string, (00)<sscc>.

cartons
bắt buộc
array<PalletCarton>
created_by
bắt buộc
string
created_at
bắt buộc
number

Unix seconds.

updated_at
bắt buộc
number

Unix seconds.

PalletCarton

object

Thuộc tính
TênKiểuMô tả
code
bắt buộc
string
lot
bắt buộc
string
epc
bắt buộc
string

The carton's EPC: its SGTIN Digital Link when its lot has a GTIN, else urn:agritrace:carton:<code>.

PalletCartons

object

Thuộc tính
TênKiểuMô tả
cartons
bắt buộc
array<string>
expected_cartons
không bắt buộc
array<string>

The precondition (#267): the codes of every carton the writer read on the pallet (Pallet.cartons, all lots, any order). When given, the set is refused with 409 pallet_changed if the pallet now holds other cartons, so a change made since that read is never overwritten. Without it the set replaces what the pallet holds.

PalletCreate

object

Without sscc, the next SSCC of the platform's GS1 company prefix is allocated.

Thuộc tính
TênKiểuMô tả
facility
bắt buộc
string
sscc
không bắt buộc
string

An SSCC of the company's own GS1 membership.

PalletPage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<PalletSummary>
next_cursor
bắt buộc
string | null

PalletSummary

object

Thuộc tính
TênKiểuMô tả
sscc
bắt buộc
string

GS1 Serial Shipping Container Code: 18 digits, the last the GS1 mod-10 check digit.

facility
bắt buộc
string
epc
bắt buộc
string
element_string
bắt buộc
string
carton_count
bắt buộc
integer
created_by
bắt buộc
string
created_at
bắt buộc
number
updated_at
bắt buộc
number

Passkey

object

#87. One of the signed-in user's passkeys: never its credential id, public key or user handle.

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
nickname
bắt buộc
string

The owner's name for it; empty when none was given.

algorithm
bắt buộc
"ES256" | "RS256" | "EdDSA"
transports
bắt buộc
array<"ble" | "hybrid" | "internal" | "nfc" | "smart-card" | "usb">

How the browser said the authenticator connects (hints).

attestation_format
bắt buộc
string
created_at
bắt buộc
number

Unix seconds.

last_used_at
bắt buộc
number | null

Unix seconds of the last sign-in with it.

clone_warning_at
bắt buộc
number | null

When a sign-in with it was refused because its signature counter did not move forward: the authenticator may have been copied. Remove the passkey if you did not expect this.

PasskeyCreationOptions

object

#87. public_key: PublicKeyCredentialCreationOptions for navigator.credentials.create(), binary values as base64url (challenge, user.id, excludeCredentials[].id).

Thuộc tính
TênKiểuMô tả
public_key
bắt buộc
object

PasskeyList

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<Passkey>

PasskeyLogin

object

#87. The answer of navigator.credentials.get(): the credential's rawId, response.clientDataJSON, response.authenticatorData, response.signature and response.userHandle, each base64url (padding optional).

Thuộc tính
TênKiểuMô tả
credential_id
bắt buộc
string
client_data_json
bắt buộc
string
authenticator_data
bắt buộc
string
signature
bắt buộc
string
user_handle
bắt buộc
string

PasskeyRegistration

object

#87. The answer of navigator.credentials.create(): response.clientDataJSON and response.attestationObject, base64url (padding optional), and response.getTransports().

Thuộc tính
TênKiểuMô tả
client_data_json
bắt buộc
string
attestation_object
bắt buộc
string
transports
không bắt buộc
array<string>

Unknown names are dropped.

nickname
không bắt buộc
string

PasskeyRename

object

Thuộc tính
TênKiểuMô tả
nickname
bắt buộc
string

PasskeyRequestOptions

object

#87. public_key: PublicKeyCredentialRequestOptions for navigator.credentials.get(), the challenge as base64url; no allowed credentials (the authenticator offers the person's passkeys for this site).

Thuộc tính
TênKiểuMô tả
public_key
bắt buộc
object

PasswordChanged

object

Thuộc tính
TênKiểuMô tả
csrf_token
bắt buộc
string

PasswordChangeRequest

object

Thuộc tính
TênKiểuMô tả
current_password
bắt buộc
string
new_password
bắt buộc
string
code
không bắt buộc
string

#187: the 6-digit code from the authenticator app; required (or backup_code) when the account has two-step sign-in.

backup_code
không bắt buộc
string

#187: one unused backup code, instead of code.

PasswordRecovered

object

Thuộc tính
TênKiểuMô tả
backup_codes_left
bắt buộc
integer

The account's unused backup codes after this one.

second_factor
bắt buộc
"required"

The next sign-in asks for the second step after the password.

PasswordRecoveryRequest

object

Thuộc tính
TênKiểuMô tả
email
bắt buộc
string

The email used to sign in.

backup_code
bắt buộc
string

One unused backup code of the account (SELF-1-6, #187), as printed: any case, spaces and hyphens allowed.

new_password
bắt buộc
string

PersonalData

object

SELF-2-9 (#198). What the platform holds about the signed-in member in the selected company. Never a secret: no password hash, session token, address hash, user agent or two-step secret.

Thuộc tính
TênKiểuMô tả
user_id
bắt buộc
integer
email
bắt buộc
string
display_name
bắt buộc
string | null
company
bắt buộc
object
roles
bắt buộc
array<"tenant_admin" | "operator" | "auditor" | "agronomist" | "lab" | "platform_admin">

The member's roles in this company, the company-managed ones first.

facilities
bắt buộc
array<string> | null

An operator's facility codes; null for every facility or for another role.

lab_id
bắt buộc
string | null

The lab of a lab membership, or null.

membership_status
bắt buộc
"active" | "disabled"
account_status
bắt buộc
"active" | "disabled"
account_created_at
bắt buộc
number

Seconds since 1970 (UTC).

joined_at
bắt buộc
number | null

When the member joined this company, or null when not recorded.

notice_accepted_at
bắt buộc
number | null

When the member accepted the staff privacy notice (at the invitation), or null.

two_factor
bắt buộc
boolean

Whether two-step sign-in is on (never its secret).

recent_sign_ins
bắt buộc
array<number>

The times of the account's most recent sign-ins that the database still keeps, newest first (sign-ins are per account, not per company).

agronomist
không bắt buộc
Agronomist | null

#351: with agronomist=1 only: the caller's row of the platform's agronomist registry, or null without one.

PersonalDataRequest

object

SELF-2-9 (#198). A member's request about their personal data, as the member sees it (never who handled it).

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
kind
bắt buộc
"access" | "correction"

access: see more of the personal data held; correction: correct it.

text
bắt buộc
string

Plain text, as typed (trimmed): never HTML or markdown; line breaks are kept.

status
bắt buộc
"open" | "handled"

open (new) or handled (a company admin dealt with it; final).

created_at
bắt buộc
number

Seconds since 1970 (UTC).

handled_at
bắt buộc
number | null

When a company admin marked it handled, or null.

PersonalDataRequestCreate

object

Thuộc tính
TênKiểuMô tả
kind
bắt buộc
"access" | "correction"
text
bắt buộc
string

1 to 2000 characters after trimming; line breaks and tabs allowed, no other control characters. Stored and shown as plain text.

PersonalDataRequestPage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<PersonalDataRequest>
next_cursor
bắt buộc
string | null

The next page's cursor; null on the last.

PlatformOverview

object

#274. The platform overview for platform admins: the service's health, its traffic, the ingest and the queues, the work waiting on CropPath, sign-in security and the companies. The per-minute figures and the traffic are this server's, from when it started (process.started_at). Each section has state: ok with its figures, or unavailable (OverviewSectionUnavailable) when it could not be read.

Thuộc tính
TênKiểuMô tả
generated_at
bắt buộc
string (date-time)

When the answer was computed (the server serves it for up to max_age_s).

max_age_s
bắt buộc
integer

Seconds the server serves one answer.

process
bắt buộc
object
sections
bắt buộc
object

PlatformOverviewCompanies

object | OverviewSectionUnavailable

#274. The companies: at most 50, those that need attention first (open high alerts, open support requests, the daily API quota at its warning level), then by id.

PlatformOverviewCompany

object

#274. One company's figures: its name and code and counts, never a person's data.

Thuộc tính
TênKiểuMô tả
id
bắt buộc
string
name
bắt buộc
string
sandbox
bắt buộc
boolean

A hosted sandbox company.

offboarding
bắt buộc
"leaving" | "left" | null

Whether the company is leaving or has left CropPath; null otherwise.

members_active
bắt buộc
integer
admins_active
bắt buộc
integer

Active company admins.

devices_registered
bắt buộc
integer

Devices of every status.

messages_last_hour
bắt buộc
integer | null

Device messages stored in the last hour; null until the server has measured an hour.

api_calls_today
bắt buộc
integer

API calls this UTC day.

api_day_percent
bắt buộc
integer

api_calls_today as a percentage of the daily API call quota.

open_high_alerts
bắt buộc
integer

Open alerts of severity high.

support_open
bắt buộc
integer

Support requests open.

PlatformOverviewHealth

object | OverviewSectionUnavailable

#274. The service's health, as getAdminHealth reports it, with the last integrity anchor, the last evidence archive and the platform's own open alerts.

PlatformOverviewIngest

object | OverviewSectionUnavailable

#274. The device message ingest of this server since it started, the device messages stored per minute (about: a quarantine review or a correction counts too) and the ingest backlog.

PlatformOverviewIrrigation

object | OverviewSectionUnavailable

#363. The irrigation fleet's health across companies (decision D10: no litres, no zone names).

PlatformOverviewQueues

object | OverviewSectionUnavailable

#274. The queues the platform works through.

PlatformOverviewSecurity

object | OverviewSectionUnavailable

#274. Sign-in security.

PlatformOverviewTraffic

object | OverviewSectionUnavailable

#274. The requests this server answered since it started (since).

PlatformOverviewWaiting

object | OverviewSectionUnavailable

#274. The work waiting on CropPath.

PlatformSupportRequest

object

A support request in the platform's queue.

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
tenant
bắt buộc
string

The company the request came from.

user
bắt buộc
SupportRequestUser
subject
bắt buộc
string

Plain text, as typed (trimmed).

body
bắt buộc
string

Plain text, as typed (trimmed): never HTML or markdown; line breaks are kept.

record_id
bắt buộc
string | null

The record the request is about (a lot code, device id, public id, ...), or null.

status
bắt buộc
"open" | "in_progress" | "answered" | "closed"

open (new), in_progress (CropPath is on it), answered (CropPath replied and waits for the company) or closed.

reply
bắt buộc
string | null

CropPath's reply (plain text), or null.

created_at
bắt buộc
number

Seconds since 1970 (UTC).

updated_at
bắt buộc
number

When the request was sent or CropPath last changed it.

updated_by
bắt buộc
string | null

The platform admin who last changed it; null until then.

PlatformSupportRequestPage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<PlatformSupportRequest>
next_cursor
bắt buộc
string | null

The next page's cursor; null on the last.

PolygonHistory

object

Thuộc tính
TênKiểuMô tả
pending
bắt buộc
PolygonProposal | null
items
bắt buộc
array<PolygonVersion>

The approved versions, newest first.

next_cursor
bắt buộc
string | null

PolygonProposal

object

SENS-A1 (#224): a company admin's change of an approved growing area's boundary, waiting for a platform admin. The proposed boundary and who proposed it are present only for the owning tenant_admin and platform_admin.

Thuộc tính
TênKiểuMô tả
polygon_sha256
bắt buộc
string | null

SHA-256 of the proposed boundary; null proposes removing it.

proposed_at
bắt buộc
number
polygon
không bắt buộc
GeoJsonPolygon | null
proposed_by
không bắt buộc
string | null

PolygonProposalApproval

object

Thuộc tính
TênKiểuMô tả
polygon_sha256
bắt buộc
string | null

The SHA-256 of the proposal reviewed (null for a proposed removal): a proposal replaced meanwhile is refused (409).

PolygonProposalPage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<PolygonProposalQueueItem>
next_cursor
bắt buộc
string | null

PolygonProposalQueueItem

object

SENS-A1 (#224): a company's boundary proposal in the platform's queue, with the boundary in force.

Thuộc tính
TênKiểuMô tả
code
bắt buộc
string
tenant
bắt buộc
string
tenant_name
bắt buộc
string
name
bắt buộc
string | null
polygon
bắt buộc
GeoJsonPolygon | null

The proposed boundary; null proposes removing it.

polygon_sha256
bắt buộc
string | null

Name it when approving (POST /v1/polygon-proposals/{code}/approve).

proposed_at
bắt buộc
number
proposed_by
bắt buộc
string | null
current_version
bắt buộc
integer | null

The latest approved version, null when none.

current_polygon_sha256
bắt buộc
string | null

SHA-256 of the boundary in force; null when none.

current_polygon
bắt buộc
GeoJsonPolygon | null

The boundary in force (the latest approved version's); null when none. Shown beside the proposed boundary so a widening is seen before it is approved.

PolygonProposalRejected

object

SENS-A1 (#224): the boundary proposal CropPath rejected; the boundary in force stays.

Thuộc tính
TênKiểuMô tả
code
bắt buộc
string
tenant
bắt buộc
string
polygon_sha256
bắt buộc
string | null
proposed_at
bắt buộc
number
proposed_by
bắt buộc
string | null
reason
bắt buộc
string

PolygonProposalRejection

object

Thuộc tính
TênKiểuMô tả
reason
bắt buộc
string

Shown to the company in its activity log.

PolygonVersion

object

SENS-A1 (#224): one boundary of a growing area that the platform approved. A version never changes and is addressed by (growing_area, version); it is in force from valid_from until the next version's valid_from. The boundary and who proposed and approved it are present only for the owning tenant_admin and platform_admin; other readers get the SHA-256 and times only.

Thuộc tính
TênKiểuMô tả
growing_area
bắt buộc
string
version
bắt buộc
integer

1, 2, ... per growing area.

polygon_sha256
bắt buộc
string | null

SHA-256 (hex) of the boundary's canonical GeoJSON text (compact, sorted keys, UTF-8); null when this version removed the boundary.

valid_from
bắt buộc
number

Unix seconds from which this version is in force.

origin
bắt buộc
"migration" | "area_approval" | "proposal" | "platform_edit"

How the version came about: recorded when the boundary was locked (migration 69), approved with the area, a company's proposal the platform approved, or a platform admin's own edit.

polygon
không bắt buộc
GeoJsonPolygon | null

Present only for the owning tenant_admin and platform_admin; null: no boundary.

proposed_at
không bắt buộc
number | null

Present only for the owning tenant_admin and platform_admin.

proposed_by
không bắt buộc
string | null

Present only for the owning tenant_admin and platform_admin.

approved_by
không bắt buộc
string | null

Present only for the owning tenant_admin and platform_admin.

PositionCommune

object

#247: a commune-level unit of the boundary data that contained some of the area's judged positions.

Thuộc tính
TênKiểuMô tả
name
bắt buộc
string

The unit's name in OpenStreetMap.

osm_relation
bắt buộc
integer

The unit's OpenStreetMap relation id.

positions
bắt buộc
integer

How many of the area's judged positions in the range it contained.

ProductGtin

object

#161: the GTIN of one of the company's trade items (product, variety, grade; null: any variety, an ungraded item). A lot created without a GTIN takes the GTIN of its ungraded (product, variety).

Thuộc tính
TênKiểuMô tả
product
bắt buộc
string
variety
bắt buộc
string | null
grade
bắt buộc
string | null
gtin
bắt buộc
string

14 digits with the GS1 check digit.

allocated
bắt buộc
boolean

Allocated from the platform's GS1 company prefix.

created_by
bắt buộc
string
created_at
bắt buộc
number

Unix seconds.

ProductGtinCreate

object

Without gtin, the next GTIN of the platform's GS1 company prefix is allocated.

Thuộc tính
TênKiểuMô tả
product
bắt buộc
string
variety
không bắt buộc
string | null
grade
không bắt buộc
string | null
gtin
không bắt buộc
string

A GTIN of the company's own GS1 membership (14 digits, check digit).

ProductGtinList

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<ProductGtin>

ProgramHoldRelease

object

#367: the hold released before its end, and how many of the controller's enabled rules were made due (the engine composes them on its next run).

Thuộc tính
TênKiểuMô tả
released
bắt buộc
object
rules_due
bắt buộc
integer

ProgramWithdrawal

object

#367: the withdrawal recorded as owed (and whether it was handed to the transport), the control program now withdrawn, and the end of the engine's hold. The controller's reports, never this answer, say the program stopped.

Thuộc tính
TênKiểuMô tả
withdrawal
bắt buộc
object
control_program
bắt buộc
object | null

The control program withdrawn; null when the controller held no control program in force (a set_program sent by hand, nothing on the controller any more, or a second withdrawal).

hold_until
bắt buộc
string (date-time) | null (date-time)

The end of the engine's hold on the controller: the next farm-local midnight, or a later hold already set (RFC 3339 UTC).

ProgramWithdrawalRequest

object

#367: why the person withdraws the controller's program, and the program they saw.

Thuộc tính
TênKiểuMô tả
reason
bắt buộc
string

Why (required): 1 to 500 characters after trimming, without control characters but tab and newline, and without format characters (Unicode category Cf).

control_program_id
không bắt buộc
integer

The control program the person saw (optional); it must be one of the device's programs. Whatever the controller holds now is withdrawn.

PublicAnalyte

"cadmium" | "auramine_o" | "origin_isotopes"

PublicCode

string

PublicCommuneMap

object

#293: the commune map of the record's growing area: one SVG image of the commune the record already names in words (its OpenStreetMap boundary on map tiles CropPath renders itself), never the orchard. Precision is the commune: no orchard point or boundary, no packing house. Present only when exactly one commune of the OpenStreetMap commune dataset in force matches the area's commune (by the official name of its commune code when it has one, else by its registered name; among several communes of that name, the one that holds the area's approved boundary, else the one that holds more than half of its judged positions) and a tile dataset is imported; otherwise the member is null. The image carries the attribution "© OpenMapTiles © OpenStreetMap contributors", and a page showing it must show the same text near it, linked to https://openmaptiles.org/ and https://www.openstreetmap.org/copyright.

Thuộc tính
TênKiểuMô tả
url
bắt buộc
PublicSameOriginPath

The image's same-origin path, /v1/public/maps/{style}/{tileset}/{communes}/{osm_id}.svg (GET /v1/public/maps/{style}/{tileset}/{communes}/{osm_id}.svg). It names the drawing's version, the tile dataset, the commune dataset and the commune's OpenStreetMap relation only: never the growing area, its code or a GLN.

osm_relation
bắt buộc
integer

The commune's OpenStreetMap relation id: https://www.openstreetmap.org/relation/{osm_relation} is its page on OpenStreetMap.

PublicConformityCredential

string

#142: a VC-JOSE compact JWS (W3C Securing Verifiable Credentials using JOSE and COSE, Recommendation 2025-05-15): protected header {alg ES256, kid: the lab key's DID URL did:web:<domain>:labs:<lab code>#<kid>, typ vc+jwt, cty vc}, payload a VC 2.0 credential that is a UNTP Digital Conformity Credential 0.6.1 (@context [https://www.w3.org/ns/credentials/v2, https://test.uncefact.org/vocabulary/untp/dcc/0.6.1/]), signature r || s (64 bytes, so 86 base64url characters). See /developers/downloads/verify.md.

PublicCorrections

object

INTEGRITY-4 (#204): how often the journey steps of a public lot (or, for measurement on a fruit's page, the fruit) were corrected before the lot's seal. Counts and local dates only.

Thuộc tính
TênKiểuMô tả
sealed
bắt buộc
boolean

The lot is sealed (closed, or later): no record of it can be corrected any more. False while it is open, when more corrections may follow.

public_since
bắt buộc
PublicIsoDate | null

The local date the lot was first public (its first measurement session opened); null when it has none.

steps
bắt buộc
array<object>

One entry per step with at least one correction, in this order: registration, harvest, measurement, details.

PublicCredential

string

X3 (#44): a VC-JOSE compact JWS (W3C Securing Verifiable Credentials using JOSE and COSE, Recommendation 2025-05-15): protected header {alg ES256, kid: the issuer key's DID URL, typ vc+jwt, cty vc}, payload a VC 2.0 credential, signature r || s (64 bytes, so 86 base64url characters). The payload is a UNTP 0.7.0 credential (@context [https://www.w3.org/ns/credentials/v2, https://vocabulary.uncefact.org/untp/0.7.0/context/]) for a lot sealed since #162: a Digital Product Passport, or the packing facility's Digital Facility Record; a passport sealed before is a UNTP Digital Product Passport 0.6.1 (@context [https://www.w3.org/ns/credentials/v2, https://test.uncefact.org/vocabulary/untp/dpp/0.6.1/]), served as stored. See /developers/downloads/verify.md.

PublicCurrentStatus

object

#177: the current public status of a record, as its own record states it now: status, status_since, status_reason and trust.tier (as tier).

Thuộc tính
TênKiểuMô tả
status
bắt buộc
PublicStatus
status_since
bắt buộc
PublicIsoDateTime | null
status_reason
bắt buộc
RecallReason | null
tier
bắt buộc
PublicTrustTier

PublicCustomsDossier

object

X4 (#45): the code file for China customs (the customs dossier) of a public lot that is packed (so sealed, L8 #33) and on a shipment to the CN market. sealed holds the lot, carton and registry facts frozen when the lot was packed (their members depend on format: a lot packed since addresses are coded by official administrative unit codes, with its packing house or growing area coded, has format 2, #273), and seal their SHA-256 seal digest recorded then, so a registry edit after packing never changes the dossier. The rest is projected from the lot's public record (PublicLot), except producer, the lot's company as its company profile names it now (#186). No field outside the Public Data Allowlist appears: no GACC registration value, seal number, coordinates, grower, container or device. The growing-area and packing-house codes are the tenant's registry entries on the platform (registry_entry gives their tier and source), not GACC registration numbers. The body is the RFC 8785 JSON Canonicalization Scheme (JCS) form of the document, in UTF-8: no whitespace, members sorted by the UTF-16 code units of their names, strings escaped as ECMAScript's JSON.stringify does and numbers in ECMAScript's Number-to-String form (0.00001, not 1e-05; 12, not 12.0). It holds no per-read value and is byte-identical for the same stored facts; digest.value is the SHA-256 (hex) of the JCS form of the document without digest.

Thuộc tính
TênKiểuMô tả
format
bắt buộc
"agritrace-customs-dossier/1" | "agritrace-customs-dossier/2"

The format of the document, that of its sealed record: agritrace-customs-dossier/1 for a lot packed before addresses were coded by official administrative unit codes, or since then with neither its packing house nor its growing area coded (its sealed facts name the district), agritrace-customs-dossier/2 for a lot packed since then with its packing house or growing area coded (#273: Viet Nam has had no district level since 1 July 2025; its sealed facts name the commune and province with their official codes and admin_units_version). A document keeps its format for good. Only sealed differs between the two: a consumer that reads its members switches on format; the seal digest is checked the same way in both.

lang
bắt buộc
"vi" | "zh-Hans" | "en"
status
bắt buộc
PublicStatus
trust_tier
bắt buộc
PublicTrustTier
public_id
bắt buộc
PublicCode
origin_country
bắt buộc
PublicText
sealed
bắt buộc
object | object

The lot, carton and registry facts frozen when the lot was packed, exactly as stored: a registry edit after packing never changes them. seal.value is the SHA-256 of their JCS form, whatever the format. Their members depend on format (#273): format 1 names the district, format 2 the commune and province with their official codes. The locality parts are the lot page's localities, unjoined.

seal
bắt buộc
object

The seal digest recorded when the lot was packed: the SHA-256 (hex) of the JCS form of sealed. basis is transition when it was taken in the pack transaction, migration when the lot was packed before sealed records existed and its facts were captured from the registry when the platform was upgraded.

registry_entry
bắt buộc
object | null

The trust tier and source of the growing-area and packing-house codes: those of the lot's registration step (PublicLotJourneyStep registration; Self-declared from the tenant's own registry entry until a signed or registry source exists, L8 #33), or null when the lot has no growing area. The codes are the tenant's entries on the platform, not GACC orchard (PUC) or packing-house (PHC) registration numbers.

lab_report
bắt buộc
object | null
shipment
bắt buộc
object
protocol
bắt buộc
PublicText | null

The Durian Protocol's name in lang when sealed.durian_protocol is true, else null.

producer
bắt buộc
CompanyProducer | null

#186: the lot's company as its company profile names it now (legal name and address), null until the company saves a profile. Not part of sealed: a profile edit changes this member and digest, never sealed or seal.

digest
bắt buộc
object

PublicDeviceApproval

object

#201: whether the devices whose evidence this step reads are approved by CropPath. approved false: evidence of a device CropPath has not approved is counted as Self-declared. approved_on: the local date of the latest approval, null when one was approved before approvals were recorded.

Thuộc tính
TênKiểuMô tả
approved
bắt buộc
boolean
approved_on
bắt buộc
PublicIsoDate | null

PublicDownloads

object

Thuộc tính
TênKiểuMô tả
epcis_url
bắt buộc
PublicSameOriginPath | null
credential_url
bắt buộc
PublicSameOriginPath | null

X3 (#44): the fruit's UNTP credential (GET /v1/public/fruits/{publicId}/credential), present when the fruit's lot was sealed with public documents and its issuer key is not revoked; null otherwise. A fruit's epcis_url stays null: its events are in its lot's document, which the credential links.

PublicEpcisDocument

object

X3 (#44): an EPCIS 2.0 document (GS1 EPCIS 2.0.0, JSON-LD). Its full schema is GS1's (https://ref.gs1.org/standards/epcis/2.0.0/epcis-json-schema.json); this names only its frame. @context is the GS1 context, then this platform's agri: namespace.

Thuộc tính
TênKiểuMô tả
@context
bắt buộc
array<any>
type
bắt buộc
"EPCISDocument"
schemaVersion
bắt buộc
"2.0"
creationDate
bắt buộc
string

The seal time, UTC.

epcisBody
bắt buộc
object

PublicEvidenceSource

"manual" | "registered_app" | "device" | "lab" | "registry" | "logger"

PublicFruit

object

Thuộc tính
TênKiểuMô tả
status
bắt buộc
PublicStatus
status_since
bắt buộc
PublicIsoDateTime | null
status_reason
bắt buộc
RecallReason | null

P5 (#41): the reason category of a recalled or withdrawn lot (RecallReason), null otherwise. Never the recall's note, depth or who recalled it.

public_id
bắt buộc
PublicCode
code
bắt buộc
PublicCode
crop
bắt buộc
"durian"
variety
bắt buộc
PublicText
harvested_on
bắt buộc
PublicIsoDate
harvest_place
bắt buộc
PublicText | null
carton_no
bắt buộc
integer | null
lot
bắt buộc
object
trust
bắt buộc
object
scan
bắt buộc
object | null
measurement
bắt buộc
object
origin
bắt buộc
object
journey
bắt buộc
array<PublicFruitJourneyStep>
downloads
bắt buộc
PublicDownloads
report
bắt buộc
object

PublicFruitJourneyStep

object | object | object | object | object

PublicIsoDate

string (date)

PublicIsoDateTime

string (date-time)

PublicIssuer

object

Thuộc tính
TênKiểuMô tả
did
bắt buộc
string
key_id
bắt buộc
string

PublicJwk

object

A P-256 public key as a JWK (RFC 7518 §6.2.1).

Thuộc tính
TênKiểuMô tả
kty
bắt buộc
"EC"
crv
bắt buộc
"P-256"
x
bắt buộc
string
y
bắt buộc
string

PublicLabLimit

object | object

PublicLabMarketApproval

object

Thuộc tính
TênKiểuMô tả
market
bắt buộc
PublicMarket
approved
bắt buộc
boolean

True when an active approval of the lab for this market, valid on the signed date, lists every tested analyte. False: the lab is not on the approved list for the market (for at least one analyte), so the results cannot count as Lab-verified for that market and the lab step is at most Cross-checked (reason lab_not_approved_for_market).

reference
bắt buộc
PublicText | null

The approval's reference as published (several joined by "; "); null when not approved.

PublicLabResult

object | object | object

PublicLinkset

object

#162: an IETF link set (RFC 9264) as UNTP's Identity Resolver (UNTP 0.7.0) returns it: one context per thing the code names (the record, then a fruit's lot), each an anchor and its link relations, every relation a list of targets. Relation types: dpp (a UNTP Digital Product Passport), dfr (the packing facility's UNTP Digital Facility Record), dcc (the lab's UNTP Digital Conformity Credential), https://gs1.org/voc/traceability (the lot's EPCIS 2.0 document) and https://gs1.org/voc/pip (a public page, one per language).

Thuộc tính
TênKiểuMô tả
linkset
bắt buộc
array<object>

PublicLinkTarget

object

#162: a link target (RFC 9264).

Thuộc tính
TênKiểuMô tả
href
bắt buộc
string

The target URL.

title
bắt buộc
string

What the target is.

type
không bắt buộc
string

The target's media type.

hreflang
không bắt buộc
array<string>

The target's language, for a public page.

PublicLot

object

Thuộc tính
TênKiểuMô tả
status
bắt buộc
PublicStatus
status_since
bắt buộc
PublicIsoDateTime | null
status_reason
bắt buộc
RecallReason | null

P5 (#41): the reason category of a recalled or withdrawn lot (RecallReason), null otherwise. Never the recall's note, depth or who recalled it.

public_id
bắt buộc
PublicCode
code
bắt buộc
PublicCode
crop
bắt buộc
string
crop_name
không bắt buộc
string

#156: the registry's name of the lot's crop (crop, a code of the crop registry) in lang; only with crop_profile=1.

ripeness_scale
không bắt buộc
"levels_1_to_4" | null

#156: the crop's ripeness scale; null for a crop graded on none, whose lot has no ripeness section (ripeness null) and no public fruit records; only with crop_profile=1.

variety
bắt buộc
PublicText
origin_country
bắt buộc
PublicText
fruit_count
bắt buộc
integer
net_mass_kg
bắt buộc
number
carton_count
bắt buộc
integer | null
packed_on
bắt buộc
PublicIsoDate | null
harvested_on
bắt buộc
PublicIsoDate
facility
bắt buộc
object
growing_area
bắt buộc
object | null
export
bắt buộc
object | null
trust
bắt buộc
object
verification
bắt buộc
object
journey
bắt buộc
array<PublicLotJourneyStep>
ripeness
bắt buộc
object | null
lab
bắt buộc
object | null
downloads
bắt buộc
PublicLotDownloads
issuer
bắt buộc
PublicIssuer | null

PublicLotDownloads

object

Thuộc tính
TênKiểuMô tả
epcis_url
bắt buộc
PublicSameOriginPath | null

X3 (#44): the lot's EPCIS 2.0 document (GET /v1/public/lots/{publicId}/epcis.jsonld), present once the lot was sealed with public documents; null otherwise.

credential_url
bắt buộc
PublicSameOriginPath | null

X3 (#44): the lot's UNTP credential (GET /v1/public/lots/{publicId}/credential), present when the lot was sealed with public documents, its issuer key is not revoked and the lab key its conformity claims cite is not revoked for compromise; null otherwise (then issuer is null too).

customs_dossier_url
bắt buộc
PublicSameOriginPath | null

X4 (#45): the HTML print view of the lot's code file for China customs (its customs dossier, GET /v1/public/lots/{publicId}/customs-dossier/print?lang=…), present only for a packed lot on a shipment to the CN market; null otherwise.

PublicLotFruit

object

U5 (#58): one public fruit of a lot, from an explicit allowlist. Never a tenant, database id, fruit number, session, line, operator, envelope, device id or key.

Thuộc tính
TênKiểuMô tả
public_id
bắt buộc
PublicCode

The fruit's public id (its record: /{locale}/q/{public_id}).

code
bắt buộc
PublicCode

The fruit code printed on its label.

ripeness_level
bắt buộc
integer

The effective level (L3): the operator's sensory level when overridden, else the device's.

model_confidence
bắt buộc
number

The device model's confidence, 0..1.

weight_kg
bắt buộc
number

The bound scale reading, kg.

grade
bắt buộc
"A" | "B" | "reject"

The grade (L3).

tier
bắt buộc
PublicTrustTier

As the fruit record's trust.tier: min(the lot's read-time tier, the fruit's own record tier), capped by the fruit's own quarantine hold. A sensory override makes it Self-declared.

sensory_override
bắt buộc
boolean

An operator replaced the device's level (always true in group overridden, false in measured).

recording_url
bắt buộc
PublicSameOriginPath | null

The original tap recording (GET /v1/public/fruits/{publicId}/recordings/{sha256}); null when the knock has no stored recording.

PublicLotFruitPage

object

U5 (#58): one page of a public lot's fruits in one group, in fruit order.

Thuộc tính
TênKiểuMô tả
lot
bắt buộc
object
group
bắt buộc
"measured" | "overridden"
total
bắt buộc
integer

Public fruits of the lot in this group.

items
bắt buộc
array<PublicLotFruit>
next_cursor
bắt buộc
string | null

Pass as cursor for the next page; null on the last page.

PublicLotJourneyStep

object | object | object | object | object | object

PublicMarket

object

Thuộc tính
TênKiểuMô tả
country_code
bắt buộc
string
short_name
bắt buộc
PublicText
authority
bắt buộc
PublicText

PublicPeak

array<any>

PublicPeriod

object | object

PublicResolution

object

What a scanned or typed code names (#139): open /{locale}/l/{public_id} for a lot and /{locale}/q/{public_id} for a fruit. locale_hint is the locale segment of a scanned record URL, else null.

Thuộc tính
TênKiểuMô tả
kind
bắt buộc
"lot" | "fruit"
public_id
bắt buộc
string
locale_hint
bắt buộc
"vi" | "zh" | "en" | null

PublicSameOriginPath

string

PublicSatelliteCheck

object

Thuộc tính
TênKiểuMô tả
source
bắt buộc
PublicText
image_date
bắt buộc
PublicIsoDate
area_matches_registration
bắt buộc
boolean
deforestation_detected
bắt buộc
boolean

PublicStatus

"normal" | "recalled" | "withdrawn" | "on_hold" | "under_review"

PublicText

string

PublicTrustTier

"self_declared" | "device_recorded" | "cross_checked" | "lab_verified"

QuarantinedEnvelope

object

Thuộc tính
TênKiểuMô tả
id
bắt buộc
string
device_id
bắt buộc
string
seq
bắt buộc
integer
kind
bắt buộc
string
event_type
bắt buộc
string | null
event_time
bắt buộc
string
lot
bắt buộc
string | null
growing_area
bắt buộc
string | null
reasons
bắt buộc
array<string>

ReauthRequest

object

Thuộc tính
TênKiểuMô tả
password
bắt buộc
string
code
không bắt buộc
string

SELF-1-6 (#187): the 6-digit code from the authenticator app; required (or backup_code) when the account has two-step sign-in.

backup_code
không bắt buộc
string

SELF-1-6 (#187): one unused backup code, instead of code.

RecallExport

object

The FSMA-204-style sortable record of a lot's affected records (P5, #41): one row per critical tracking event in time order: harvesting (at the growing area: the signed harvest event's mass, else the area's declared kg for the date, else empty), initial_packing (one per carton, at the lot's facility and pack time) and shipping (one per carton on the departed shipment, at the departure facility), and transformation (#91: a lot merge the lot took part in, at the merge's facility and time: one row per input lot with the kg taken from it and one of the lot it produced with its kg). Through the chain of merges the record follows the fruit both ways: backward, the merge that produced the lot, the merges that produced its inputs, and so on, with each input lot's harvest (breadth first, at most 8 levels and 64 merges); forward, the merge that consumed the lot, the merge that consumed the lot it produced, and so on (at most 8 merges), with the cartons and shipment of each lot they produced. A row of another lot than the requested one carries that lot's code and product. Times are local (Asia/Ho_Chi_Minh, +07:00). Columns: traceability_lot_code, critical_tracking_event, event_date, event_time, location, location_description, product_description, quantity, unit_of_measure, carton, fruit_count, shipment, container, destination, border_gate, recall_kind, recall_reason. An empty cell is an empty string. Each row property documents its unit and format. At most 186,855 rows.

Thuộc tính
TênKiểuMô tả
format
bắt buộc
"agritrace-recall-export/1"
lot
bắt buộc
string
generated_at
bắt buộc
string (date-time)
recall
bắt buộc
object | null
columns
bắt buộc
array<"traceability_lot_code" | "critical_tracking_event" | "event_date" | "event_time" | "location" | "location_description" | "product_description" | "quantity" | "unit_of_measure" | "carton" | "fruit_count" | "shipment" | "container" | "destination" | "border_gate" | "recall_kind" | "recall_reason">
rows
bắt buộc
array<object>

RecallList

object

#322: the company's recalls and withdrawals, newest first, with their counts.

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<object>
total
bắt buộc
integer

Every recall and withdrawal of the company (items lists the newest 100).

notices_pending
bắt buộc
integer

Their outbound notices not sent yet.

RecallReason

"contamination" | "pathogen" | "foreign_matter" | "labelling" | "quality" | "regulatory" | "traceability" | "other"

The reason category of a recall or withdrawal (P5, #41), the only part of it the public pages show: contamination (a chemical residue or contaminant over its limit), pathogen (microbial), foreign_matter, labelling (wrong or missing label or origin information), quality (spoilage or a quality defect), regulatory (a market's rule not met), traceability (the evidence cannot be relied on), other.

RecordsExport

object

The records-request export of one lot (W1-3, #152): one sortable sheet for an authority (Circular 17/2021 Art. 6: one step back, one step forward) or a buyer (FSMA 204's electronic sortable spreadsheet within 24 hours). Rows in time order: the critical tracking events (harvesting, receiving, cooling, initial_packing per carton, shipping per carton), the sealed record, every lab result, the recall when any, and every open or escalated hold of the lot. Times are local (+07:00). Bounded: at most 1,000 signed device events (receiving, cooling, packing, shipping) (truncated when more exist), 9,999 cartons and 384 lab results.

Thuộc tính
TênKiểuMô tả
format
bắt buộc
"agritrace-records-export/1"
lot
bắt buộc
string
status
bắt buộc
"draft" | "open" | "paused" | "closed" | "packed" | "shipped" | "recalled" | "withdrawn"

The lot's status when the export was taken.

generated_at
bắt buộc
string (date-time)
truncated
bắt buộc
boolean

True when the lot has more than 1,000 signed device events (receiving, cooling, packing, shipping) and only the first 1,000 are listed.

sealed_record
bắt buộc
object | null

The registry facts frozen at the pack event (sealed_lot.py) with their seal digest and basis; null while the lot is not packed.

columns
bắt buộc
array<"record_type" | "traceability_lot_code" | "critical_tracking_event" | "event_date" | "event_time" | "record_source" | "event_id" | "location" | "location_description" | "location_address" | "location_registration" | "product_description" | "quantity" | "unit_of_measure" | "area_declared_kg" | "carton" | "fruit_count" | "supplier_name" | "supplier_organisation" | "supplier_code" | "supplier_address" | "supplier_registration" | "harvest_date" | "shipment" | "container" | "seal_number" | "destination" | "border_gate" | "consignee_name" | "consignee_address" | "consignee_country" | "consignee_gln" | "consignee_gacc_record" | "reference_document_type" | "reference_document_number" | "lab_key_custody" | "lab_market" | "sample" | "analyte" | "result_outcome" | "result_value" | "result_unit" | "limit_kind" | "limit_value" | "limit_source" | "verdict" | "sealed_digest" | "sealed_basis" | "recall_kind" | "recall_reason" | "recall_scope" | "hold_kind" | "hold_status" | "device_events_truncated">

The column names in order (the CSV header): every RecordsExportRow property.

rows
bắt buộc
array<RecordsExportRow>

RecordsExportRange

object

One page of the records-request export of the tenant's lots created in [start, end) (W1-3, #152): the rows of each lot of the page, lot by lot in creation order, as RecordsExport lists them. A page holds at most 50 lots whose cartons together stay within 9,999 (always at least one lot); next_cursor names the next page.

Thuộc tính
TênKiểuMô tả
format
bắt buộc
"agritrace-records-export-range/1"
start
bắt buộc
string (date-time)
end
bắt buộc
string (date-time)
generated_at
bắt buộc
string (date-time)
lots
bắt buộc
array<string>

The lot codes of this page, in creation order.

next_cursor
bắt buộc
string | null

The cursor of the next page; null on the last page.

truncated
bắt buộc
boolean

True when a lot of the page had more than 1,000 signed device events (receiving, cooling, packing, shipping).

columns
bắt buộc
array<"record_type" | "traceability_lot_code" | "critical_tracking_event" | "event_date" | "event_time" | "record_source" | "event_id" | "location" | "location_description" | "location_address" | "location_registration" | "product_description" | "quantity" | "unit_of_measure" | "area_declared_kg" | "carton" | "fruit_count" | "supplier_name" | "supplier_organisation" | "supplier_code" | "supplier_address" | "supplier_registration" | "harvest_date" | "shipment" | "container" | "seal_number" | "destination" | "border_gate" | "consignee_name" | "consignee_address" | "consignee_country" | "consignee_gln" | "consignee_gacc_record" | "reference_document_type" | "reference_document_number" | "lab_key_custody" | "lab_market" | "sample" | "analyte" | "result_outcome" | "result_value" | "result_unit" | "limit_kind" | "limit_value" | "limit_source" | "verdict" | "sealed_digest" | "sealed_basis" | "recall_kind" | "recall_reason" | "recall_scope" | "hold_kind" | "hold_status" | "device_events_truncated">

The column names in order (the CSV header): every RecordsExportRow property.

rows
bắt buộc
array<RecordsExportRow>

RecordsExportRow

object

One row of a records-request export (W1-3, #152): every column on every row, an empty cell an empty string. Each property documents which row kinds fill it, its unit and its format.

Thuộc tính
TênKiểuMô tả
record_type
bắt buộc
"cte" | "transformation_input" | "sealed_record" | "lab_result" | "recall" | "hold"

The row kind: cte (a critical tracking event), transformation_input (#91: a lot a merge consumed, with the kg taken from it; its critical_tracking_event is transformation), sealed_record (the registry facts frozen at the pack event), lab_result (one result of the lot's signed lab report), recall, or hold (an open or escalated hold of the lot, at its opening time). The CSV also starts, when a lot's signed device events were cut, with a truncation_notice row per cut lot; a JSON row never has that kind.

traceability_lot_code
bắt buộc
string

The lot code (the traceability lot code of every row).

critical_tracking_event
bắt buộc
"harvesting" | "receiving" | "cooling" | "transformation" | "initial_packing" | "shipping" | ""

The critical tracking event of a cte row: harvesting (at the growing area), receiving and cooling (signed device events at their facility), initial_packing (one per carton at the lot's facility, and a device's signed pack event at its facility) or shipping (one per carton on the departed shipment, at the departure facility, and a device's signed ship event at its facility), or transformation (#91: a lot merge, on the cte row of the lot it produced and on each transformation_input row, at the merge's facility and time, all with the merge's event_id); empty for the other row kinds.

event_date
bắt buộc
string (date)

The row's local date (Asia/Ho_Chi_Minh), YYYY-MM-DD: the event, the pack time (sealed_record), the report's signing time (lab_result) or the recall time.

event_time
bắt buộc
string

The local time with its offset, whole seconds, hh:mm:ss+07:00; empty for a harvest known only by its date.

record_source
bắt buộc
"signed_device_event" | "self_declared" | "system_record" | "sealed_record" | "signed_lab_report" | ""

How the row's fact was recorded: signed_device_event (a signed device or harvest event), self_declared (the growing area's harvest declaration), system_record (the per-carton packing and shipping records, recall), sealed_record or signed_lab_report; empty for a harvest date without any record. A staff label, not a public trust tier.

event_id
bắt buộc
string

The signed event's envelope id (harvesting from a signed event, receiving, cooling, and a device's signed packing or shipping event); the merge's id on a transformation row (#91); empty otherwise.

location
bắt buộc
string

Where: the growing area code (harvesting), the facility code (receiving, cooling, packing, shipping, sealed_record) or the lab code (lab_result); empty for the recall row or an unknown place.

location_description
bắt buộc
string

The growing area's commune, district and province, the facility's name or the lab's name; empty when unknown. #273: a growing area coded by official administrative unit codes has its commune and province instead (Viet Nam has had no district level since 2025-07-01).

location_address
bắt buộc
string

The facility's address, district and province, or the growing area's commune, district and province, comma-separated; empty when unknown. #273: a facility or growing area coded by official administrative unit codes has its commune and province instead (Viet Nam has had no district level since 2025-07-01).

location_registration
bắt buộc
string

The GACC packing-house (PHC) code of the facility or growing-area (PUC) code of the area, as the tenant's registry records it; empty when none.

product_description
bắt buộc
string

The lot's product and variety, space-separated (e.g. durian Ri6).

quantity
bắt buộc
number | ""

The quantity in kilograms (unit_of_measure kg), at most 3 decimals: the lot's signed harvest mass (never an area's declaration, see area_declared_kg), the mass a signed device event carries (receiving, cooling, packing, shipping), a carton's net mass, the sealed lot's net mass, or a merge's kilograms (#91: taken from an input, or of the output); empty without one.

unit_of_measure
bắt buộc
"kg" | ""

kg when quantity is given, else empty.

area_declared_kg
bắt buộc
number | ""

Harvesting row without a signed harvest mass only: the growing area's self-declared harvest in kilograms for the harvest date (the area's harvest declaration). It is the AREA's figure for the day, shared by every lot of that area and day, not this lot's mass: never add it across lots. Empty on every other row.

carton
bắt buộc
string

The carton code (initial_packing, shipping); empty otherwise.

fruit_count
bắt buộc
integer | ""

The fruits in the carton (initial_packing, shipping) or in the sealed lot (sealed_record); empty otherwise.

supplier_name
bắt buộc
string

One step back (Circular 17/2021 Art. 6 supplier): the grower of the lot's growing area, a grower of the lot's own tenant only, as its member label (Co-op member #<id>); empty when none. Never the grower's legal name, for any role or consent: the name may appear only for an allowed role whose grower's recorded consent scope covers traceability or authority disclosure, and no such scope value is defined yet (#152).

supplier_organisation
bắt buộc
string

The grower's cooperative; empty when none.

supplier_code
bắt buộc
string

The growing area code (the sealed record's frozen code on its row); empty without an area.

supplier_address
bắt buộc
string

The growing area's commune, district and province, comma-separated; empty when unknown. #273: a growing area coded by official administrative unit codes has its commune and province instead (Viet Nam has had no district level since 2025-07-01).

supplier_registration
bắt buộc
string

The growing area's GACC growing-area (PUC) code; empty when none.

harvest_date
bắt buộc
string

The lot's harvest date, YYYY-MM-DD; empty when not recorded.

shipment
bắt buộc
string

One step forward: the shipment code (shipping); empty otherwise.

container
bắt buộc
string

The ISO 6346 container number (shipping); empty otherwise.

seal_number
bắt buộc
string

The lot's seal number on the shipment (shipping); empty otherwise.

destination
bắt buộc
string

The destination market, ISO 3166-1 alpha-2 (shipping); empty otherwise.

border_gate
bắt buộc
string

The border gate the shipment heads for (shipping); empty otherwise.

consignee_name
bắt buộc
string

The shipment's consignee (immediate subsequent recipient); empty until the shipment records one (#153).

consignee_address
bắt buộc
string

The consignee's address; empty until recorded (#153).

consignee_country
bắt buộc
string

The consignee's country, ISO 3166-1 alpha-2; empty until recorded (#153).

consignee_gln
bắt buộc
string

The consignee's GS1 GLN; empty until recorded (#153).

consignee_gacc_record
bắt buộc
string

The importer's GACC registration number; empty until recorded (#153).

reference_document_type
bắt buộc
"test_report" | "phytosanitary_certificate" | "certificate_of_origin" | "commercial_invoice" | "packing_list" | ""

The reference document's type: test_report on a lab_result row (the shipment's documents once #153 records them); empty otherwise.

reference_document_number
bắt buộc
string

The reference document's number: the lab's report number on a lab_result row; empty otherwise.

lab_key_custody
bắt buộc
"lab" | "server" | ""

Who holds the key that signed the lab report: lab (uploaded) or server (portal entry); empty on other rows.

lab_market
bắt buộc
string

The market whose limits judged the report, ISO 3166-1 alpha-2; empty on other rows.

sample
bắt buộc
integer | ""

The sample number k (lab_result); empty otherwise.

analyte
bắt buộc
string

The analyte (lab_result), e.g. cadmium, auramine_o; empty otherwise.

result_outcome
bắt buộc
"measured" | "not_detected" | ""

measured or not_detected (lab_result); empty otherwise.

result_value
bắt buộc
number | ""

The measured value in result_unit (lab_result, measured); empty otherwise.

result_unit
bắt buộc
string

The unit the lab signed (lab_result), e.g. mg/kg; empty otherwise.

limit_kind
bắt buộc
"max" | "banned" | ""

The market limit that judged the result: max or banned; empty when the market sets none or on other rows.

limit_value
bắt buộc
number | ""

The maximum in result_unit (limit_kind max); empty otherwise.

limit_source
bắt buộc
string

The source of the limit as it stood when the report was judged; empty when none.

verdict
bắt buộc
"pass" | "fail" | ""

pass or fail (lab_result); empty otherwise.

sealed_digest
bắt buộc
string

The SHA-256 (lower-case hex) of the sealed record (sealed_record); empty otherwise.

sealed_basis
bắt buộc
"transition" | "migration" | ""

How the sealed record was taken: transition (inside the pack transaction) or migration; empty otherwise.

recall_kind
bắt buộc
"recall" | "withdrawal" | ""

recall or withdrawal (recall row); empty otherwise.

recall_reason
bắt buộc
RecallReason | ""

The recall's reason category (recall row); empty otherwise.

recall_scope
bắt buộc
"consumer" | "retail" | "wholesale" | ""

The recall depth: consumer, retail or wholesale (recall row); empty otherwise.

hold_kind
bắt buộc
"report" | "quarantine" | "key_compromise" | "lab_failure" | "rejected_component" | ""

The hold's kind (hold row): an open public report, a quarantined component, a device key revoked for compromise, a failing lab result or a rejected component; empty otherwise. ADR 0001: a hold caps what the lot's evidence shows (a compromised key caps it at Self-declared), so read the lot's signed rows with its holds.

hold_status
bắt buộc
"open" | "escalated" | ""

The hold's status (hold row): open or escalated (still unresolved); empty otherwise. Resolved and withdrawn holds are not listed.

device_events_truncated
bắt buộc
"true" | "false"

On every row: "true" when this row's lot has more than 1,000 signed device events (receiving, cooling, packing, shipping) and the sheet lists only the first 1,000, else "false". The CSV carries it, and starts with a truncation_notice row per cut lot, so a forwarded file still says it is incomplete; the document's truncated says the same for the whole document.

RecoveryLinkCreate

object

Thuộc tính
TênKiểuMô tả
reason
bắt buộc
string

Why (one line); written to the company's activity log.

RegistryList

object

An imported published PUC/PHC code list (#150). On the import's answer, superseded names the list it replaced (null for the first of its kind, market and crop).

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
kind
bắt buộc
"puc" | "phc"

puc: growing-area codes; phc: packing-house codes.

market
bắt buộc
string

The destination market whose protocol the codes are registered for (ISO 3166-1 alpha-2).

crop
bắt buộc
string

One of the platform's crops (AGRITRACE_REGISTRY_CROPS; by default coconut, dragon_fruit, durian, jackfruit, mango).

source_url
bắt buộc
string

The page the list was downloaded from.

source_sha256
bắt buộc
string

SHA-256 of the file the authority published (its spreadsheet or PDF), which the admin converted into the stored CSV. The server computed it when the original was uploaded (PUT /v1/registry-sources/{sha256}); it ties a Cross-checked registration step back to the authority's own file.

source_media_type
bắt buộc
"application/pdf" | "application/vnd.ms-excel" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "text/csv" | null

The media type of the authority's original file source_sha256 names (GET /v1/registry-lists/{id}/source).

published_on
bắt buộc
string (date) | null (date)

The date the authority published the list, when known.

file_name
bắt buộc
string
file_sha256
bắt buộc
string

SHA-256 of the stored file.

file_size
bắt buộc
integer
entry_count
bắt buộc
integer
imported_at
bắt buộc
number

Unix seconds.

imported_by
bắt buộc
string
superseded_by
bắt buộc
integer | null
superseded_at
bắt buộc
number | null

When a later import superseded the list, or when it was retired (then superseded_by is null).

retired_by
bắt buộc
string | null

Who retired the list (POST /v1/registry-lists/{id}/retire); null unless retired.

retire_reason
bắt buộc
string | null

Why the list was retired; null unless retired.

current
bắt buộc
boolean

Neither superseded by a later import nor retired.

stale
bắt buộc
boolean

Current and older than the configured age.

superseded
không bắt buộc
integer | null

Only on the import's answer: the id of the list this import superseded.

RegistryListDetail

object

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
kind
bắt buộc
"puc" | "phc"

puc: growing-area codes; phc: packing-house codes.

market
bắt buộc
string

The destination market whose protocol the codes are registered for (ISO 3166-1 alpha-2).

crop
bắt buộc
string

One of the platform's crops (AGRITRACE_REGISTRY_CROPS; by default coconut, dragon_fruit, durian, jackfruit, mango).

source_url
bắt buộc
string

The page the list was downloaded from.

source_sha256
bắt buộc
string

SHA-256 of the file the authority published (its spreadsheet or PDF), which the admin converted into the stored CSV. The server computed it when the original was uploaded (PUT /v1/registry-sources/{sha256}); it ties a Cross-checked registration step back to the authority's own file.

source_media_type
bắt buộc
"application/pdf" | "application/vnd.ms-excel" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "text/csv" | null

The media type of the authority's original file source_sha256 names (GET /v1/registry-lists/{id}/source).

published_on
bắt buộc
string (date) | null (date)

The date the authority published the list, when known.

file_name
bắt buộc
string
file_sha256
bắt buộc
string

SHA-256 of the stored file.

file_size
bắt buộc
integer
entry_count
bắt buộc
integer
imported_at
bắt buộc
number

Unix seconds.

imported_by
bắt buộc
string
superseded_by
bắt buộc
integer | null
superseded_at
bắt buộc
number | null

When a later import superseded the list, or when it was retired (then superseded_by is null).

retired_by
bắt buộc
string | null

Who retired the list (POST /v1/registry-lists/{id}/retire); null unless retired.

retire_reason
bắt buộc
string | null

Why the list was retired; null unless retired.

current
bắt buộc
boolean

Neither superseded by a later import nor retired.

stale
bắt buộc
boolean

Current and older than the configured age.

status_counts
bắt buộc
object
max_age_days
bắt buộc
integer

RegistryListEntry

object

One row of an imported list: code normalised (NFKC, no whitespace, dashes as '-', upper case), code_raw as written in the file.

Thuộc tính
TênKiểuMô tả
code
bắt buộc
string
code_raw
bắt buộc
string
status
bắt buộc
"active" | "suspended" | "revoked"
holder
bắt buộc
string | null
province
bắt buộc
string | null
district
bắt buộc
string | null
commune
bắt buộc
string | null
area_ha
bắt buộc
number | null
valid_from
bắt buộc
string (date) | null (date)
valid_to
bắt buộc
string (date) | null (date)

RegistryListEntryPage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<RegistryListEntry>
next_cursor
bắt buộc
string | null

RegistryListImport

object

Thuộc tính
TênKiểuMô tả
kind
bắt buộc
"puc" | "phc"
market
bắt buộc
"CN"

A destination market the platform ships to (ISO 3166-1 alpha-2).

crop
bắt buộc
string

The list's crop: one of the platform's crops (AGRITRACE_REGISTRY_CROPS; by default coconut, dragon_fruit, durian, jackfruit, mango; the Vietnamese names of those are accepted), as GET /v1/registry-lists lists them in crops. Any other crop is refused, and so is an import that would make more than 200 lists current.

source_url
bắt buộc
string
source_sha256
bắt buộc
string

SHA-256 of the file the authority published (its spreadsheet or PDF), downloaded from source_url, before the admin converted it to this CSV. It must name an original already uploaded with PUT /v1/registry-sources/{sha256}, whose hash the server computed; any other value is refused. Required: a Cross-checked step must trace back to the authority's own file.

published_on
không bắt buộc
string (date) | null (date)
file_name
bắt buộc
string
file_base64
bắt buộc
string

The CSV file, base64-encoded.

RegistryListPage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<RegistryList>
max_age_days
bắt buộc
integer
crops
bắt buộc
array<string>

The crops an import may name, sorted (AGRITRACE_REGISTRY_CROPS; by default the D7 crops).

next_cursor
bắt buộc
string | null

The next page's cursor; null on the last.

RegistryListRetire

object

Thuộc tính
TênKiểuMô tả
reason
bắt buộc
string

Why the list is retired: 1 to 200 characters on one line.

RegistryMatch

object

A registered code and its check against the current lists.

Thuộc tính
TênKiểuMô tả
code
bắt buộc
string

The growing area's or facility's own code.

tenant
bắt buộc
string | null
name
bắt buộc
string | null
crop
bắt buộc
string | null

The growing area's crop; null for a facility.

registered_code
bắt buộc
string

The PUC or PHC as entered.

normalized_code
bắt buộc
string | null
result
bắt buộc
"matched" | "no_code" | "no_list" | "not_found" | "mismatch" | "suspended" | "revoked" | "expired"
stale
bắt buộc
boolean
list_id
bắt buộc
integer | null

The list that decided (null for mismatch, no_list, no_code).

list_crop
bắt buộc
string | null

RegistryMatchPage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<RegistryMatch>
max_age_days
bắt buộc
integer
next_cursor
bắt buộc
string | null

RegistrySourceStored

object

The authority's original file of a code list as the server stored it: sha256 is computed from the bytes.

Thuộc tính
TênKiểuMô tả
sha256
bắt buộc
string
media_type
bắt buộc
"application/pdf" | "application/vnd.ms-excel" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "text/csv"
size
bắt buộc
integer

Rejection

object

B9 (#21): a device message the server refused (not stored as a record). The payload itself is never returned: raw, untrusted device bytes.

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
route
bắt buộc
string | null

The ingest route the message came on, {tenant}/{site}/{device}/{kind}[/{eventType}] as the sender wrote it (not proof of who sent it).

envelope_id
bắt buộc
string | null

The envelope id, when one could be read.

reason
bắt buộc
string

Why it was refused, for example bad_signature, malformed.

received_at
bắt buộc
number

Unix seconds.

payload_bytes
bắt buộc
integer

Size of the stored payload (at most 65,536 bytes are kept).

RejectionPage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<Rejection>
next_cursor
bắt buộc
string | null

The next page's cursor; null on the last page.

Report

object

A public mismatch report as staff triage sees it, with the contact (null when none was given or once erased, 90 days after the resolution). Times are Unix seconds.

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
fruit
bắt buộc
object
lot
bắt buộc
object
category
bắt buộc
ReportCategory
note
bắt buộc
string
contact
bắt buộc
string | null
status
bắt buộc
"open" | "resolved"
outcome
bắt buộc
"confirmed" | "unfounded" | "duplicate" | null
created_at
bắt buộc
number
resolved_at
bắt buộc
number | null

ReportCategory

"label_peeled" | "scanned_many" | "ripeness_off" | "other"

What does not match: label_peeled (the label was peeled or replaced), scanned_many (the code was scanned many times: a copied label is suspected), ripeness_off (the ripeness does not match the record), other.

ReportChallenge

object

A proof-of-work challenge for a public mismatch report (#46, report_challenge.py). Find a solution (1 to 32 ASCII letters and digits; a decimal counter will do) such that SHA-256 of <challenge>:<solution> (UTF-8) starts with difficulty zero bits, and send both with the report within expires_in seconds. Signed by the backend (<id>.<bits>.<expires>.<HMAC-SHA256>), single-use (a challenge files one report) and refused once the deployment's difficulty (AGRITRACE_REPORT_POW_BITS) changes.

Thuộc tính
TênKiểuMô tả
challenge
bắt buộc
string
difficulty
bắt buộc
integer
expires_in
bắt buộc
integer

ReportDetail

object

A public mismatch report as staff triage sees it (Report) with the reported fruit's scan history (A8, #74). Scans are logged only by the web server's own render of the public fruit page (scans.py) and keep only a coarse place (country, region, city from the CDN's geolocation, any of them null when not forwarded) and a device class; there are no coordinates, and never an address or its hash. Times are Unix seconds.

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
fruit
bắt buộc
object
lot
bắt buộc
object
category
bắt buộc
ReportCategory
note
bắt buộc
string
contact
bắt buộc
string | null
status
bắt buộc
"open" | "resolved"
outcome
bắt buộc
"confirmed" | "unfounded" | "duplicate" | null
created_at
bắt buộc
number
resolved_at
bắt buộc
number | null
scans
bắt buộc
object

ReportPage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<Report>
next_cursor
bắt buộc
string | null

The next page's cursor; null on the last.

ReportReceipt

object

A report was received. Nothing of the report is echoed. #177: fruit and lot are the current public status of the reported fruit and of its lot (the report's hold), read from the origin when the report was filed, so the page can show them at once although an edge-cached record may still show the old status; null when the record is not public.

Thuộc tính
TênKiểuMô tả
status
bắt buộc
"received"
fruit
bắt buộc
PublicCurrentStatus | null
lot
bắt buộc
PublicCurrentStatus | null

ReportResolution

object

confirmed (the mismatch was real and has been dealt with), unfounded (the fruit matches its record) or duplicate (another report covers it). Every outcome resolves the report.

Thuộc tính
TênKiểuMô tả
outcome
bắt buộc
"confirmed" | "unfounded" | "duplicate"

ReportSubmission

object

A public mismatch report on a public fruit. No other field is accepted (no photo: no public upload route exists). note keeps line breaks and no other control character; contact is one line. Both are trimmed; an empty contact is none. The contact is stored for staff triage only, never returned on a public route, and erased 90 days after the report is resolved.

Thuộc tính
TênKiểuMô tả
publicId
bắt buộc
string

The public id of the fruit (its page's).

category
bắt buộc
ReportCategory
note
không bắt buộc
string
contact
không bắt buộc
string | null
challenge
bắt buộc
string

A ReportChallenge's challenge.

solution
bắt buộc
string

ResidueCertificate

object

#157: a lot's lab results judged against its destination market (see getLotResidueCertificate).

Thuộc tính
TênKiểuMô tả
lot
bắt buộc
string
product
bắt buộc
string
report
bắt buộc
object | null

The lab report; null while the lab has not reported.

market
bắt buộc
string | null

The destination market the results are judged against.

market_from
bắt buộc
"shipment" | "lot" | "report" | null

Where the market comes from: the lot's shipment, the lot's own destination, or the lab report.

limits_on
bắt buộc
string (date) | null (date)

The report's signed date (Asia/Ho_Chi_Minh), the day the limits are read for.

verdict
bắt buộc
"pass" | "fail" | "incomplete" | null
analytes
bắt buộc
array<ResidueCertificateAnalyte>
required_analytes
bắt buộc
array<string>
missing_analytes
bắt buộc
array<string>

ResidueCertificateAnalyte

object

Thuộc tính
TênKiểuMô tả
analyte
bắt buộc
string
samples
bắt buộc
integer

The number of results (one per drawn sample).

outcome
bắt buộc
"measured" | "not_detected"

measured when a sample measured it, else not_detected.

value
bắt buộc
number | null

The highest measured value; null when not detected.

lod
bắt buộc
number | null

The highest detection limit of the results; null when measured.

unit
bắt buộc
"mg/kg"
limit
bắt buộc
object | null

The limit the analyte was judged with; null when the market sets none.

verdict
bắt buộc
"pass" | "fail" | "no_limit"

ReviewRequest

object

Thuộc tính
TênKiểuMô tả
decision
bắt buộc
"approve" | "reject"
note
không bắt buộc
string

Optional; recorded with the review.

ReviewResult

object

Thuộc tính
TênKiểuMô tả
id
bắt buộc
string
status
bắt buộc
"accepted" | "rejected_after_review"

SampleAnalyte

"cadmium" | "auramine_o"

SampleItem

object

Thuộc tính
TênKiểuMô tả
k
bắt buộc
integer

Sample number within the lot's sampling.

fruit
bắt buộc
string

Fruit code as printed on the label.

status
bắt buộc
"selected" | "received" | "passed" | "failed"

SandboxAccount

object

A new sandbox company and its API token (#218). The token is shown this once: only its SHA-256 is stored.

Thuộc tính
TênKiểuMô tả
tenant_id
bắt buộc
string

The new company's id, the tenant every record of the token belongs to.

api_token
bắt buộc
string

An API token of the company, role tenant_admin, sent as Authorization: Bearer. Shown once.

expires_at
bắt buộc
number

When the token stops working: 24 hours after the creation, Unix seconds.

base_url
bắt buộc
string (uri)

The sandbox API's address: the requests go to <base_url>/v1/....

SandboxAccountCreate

object

The body of a sandbox account request (#218): empty, or an empty object. The sandbox chooses everything.

SatelliteCheck

object

A satellite check of a growing area.

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
growing_area
bắt buộc
string
image_date
bắt buộc
string (date)
provider
bắt buộc
string
result
bắt buộc
"match" | "mismatch" | "inconclusive"

Whether the image matches the registered area.

cultivated_ha
bắt buộc
number | null
deforestation
bắt buộc
boolean
confidence
bắt buộc
number | null
image_sha256
bắt buộc
string | null

SHA-256 of the image attachment; the blob itself is stored elsewhere.

source
bắt buộc
"manual" | "automatic"

manual for every check recorded through this API.

created_at
bắt buộc
number

Unix seconds.

SatelliteCheckCreate

object

Thuộc tính
TênKiểuMô tả
image_date
bắt buộc
string (date)
provider
bắt buộc
string
result
bắt buộc
"match" | "mismatch" | "inconclusive"
cultivated_ha
không bắt buộc
number | null
deforestation
bắt buộc
boolean
confidence
không bắt buộc
number | null
image_sha256
không bắt buộc
string | null

SatelliteCheckPage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<SatelliteCheck>
next_cursor
bắt buộc
string | null

Pass as cursor for the next page; null on the last page.

SealRequest

object

Thuộc tính
TênKiểuMô tả
seal_no
bắt buộc
string

SecondFactorChallenge

object

SELF-1-6 (#187). The password was right and the account has two-step sign-in: no session yet. Send ticket with a code to POST /v1/auth/login/second-factor before expires_at.

Thuộc tính
TênKiểuMô tả
second_factor
bắt buộc
"required"
ticket
bắt buộc
string

32 random bytes (base64url), valid 5 minutes, for one sign-in and at most 5 codes. Only its SHA-256 is stored.

expires_at
bắt buộc
number

Unix seconds.

SecondFactorLogin

object

Thuộc tính
TênKiểuMô tả
ticket
bắt buộc
string
code
không bắt buộc
string

The 6-digit code from the authenticator app (spaces allowed).

backup_code
không bắt buộc
string

One unused backup code instead (any case, spaces and hyphens allowed).

SecondFactorSession

object

SELF-1-6 (#187). A session opened by the code step: the AuthSession fields plus what proved the second factor.

Thuộc tính
TênKiểuMô tả
user
bắt buộc
User
memberships
bắt buộc
array<Membership>
csrf_token
bắt buộc
string
two_factor
không bắt buộc
TwoFactorState
second_factor
bắt buộc
"code" | "backup_code"

What proved the second factor.

backup_codes_left
bắt buộc
integer

Unused backup codes left (tell the user when it runs low).

SensorSeries

object

SENS-B1e (#235): the hourly, daily (UTC) or farm-day (local_daily, #365) summaries of one capability in a growing area, from the caller's company's devices only, one series per depth (no depth first, then ascending).

Thuộc tính
TênKiểuMô tả
growing_area
bắt buộc
string
capability
bắt buộc
string
unit
bắt buộc
string | null

The vocabulary's UCUM unit of the capability.

grain
bắt buộc
"hourly" | "daily" | "local_daily"
bucket_s
bắt buộc
number

Bucket width in seconds: 3600 or 86400.

from
bắt buộc
number

Start of the range, Unix seconds.

to
bắt buộc
number

End of the range (excluded), Unix seconds.

truncated
bắt buộc
boolean

True when the answer reached the bucket cap (5000 buckets in all): the later depths or buckets were left out.

series
bắt buộc
array<SensorSeriesDepth>
time_zone
không bắt buộc
"Asia/Ho_Chi_Minh"

local_daily only: the farm time zone whose days the buckets are.

day_starts_at
không bắt buộc
number

local_daily only: the local midnight (Unix seconds) that starts the farm day holding from, the first bucket a day may have.

SensorSeriesBucket

object

SENS-B1e (#235): one hourly or daily bucket of a sensor series, as the summary of the reading record stores it. The statistics take only the readings flagged pass or not evaluated that have a value; every reading counts in n_total and in its flag's count (QARTOD flags: 1 pass, 2 not evaluated, 3 suspect, 4 fail, 9 missing).

Thuộc tính
TênKiểuMô tả
bucket_start
bắt buộc
number

Start of the UTC hour or day, or (local_daily) of the farm day: its local midnight. Unix seconds.

min
bắt buộc
number | null

Null when count is 0.

max
bắt buộc
number | null

Null when count is 0.

mean
bắt buộc
number | null

The sum of the values over count; null when count is 0.

count
bắt buộc
integer

Values in the statistics.

n_total
bắt buộc
integer

Every reading of the bucket.

n_pass
bắt buộc
integer

Readings flagged 1 (pass).

n_not_evaluated
bắt buộc
integer

Readings flagged 2 (not evaluated).

n_suspect
bắt buộc
integer

Readings flagged 3 (suspect).

n_fail
bắt buộc
integer

Readings flagged 4 (fail).

n_missing
bắt buộc
integer

Readings flagged 9 (missing value).

SensorSeriesDepth

object

SENS-B1e (#235): the buckets of one depth, oldest first.

Thuộc tính
TênKiểuMô tả
depth_cm
bắt buộc
number | null

The readings' depth in cm; null for readings without a depth.

buckets
bắt buộc
array<SensorSeriesBucket>

SeqGap

object

B9 (#21): an open range of sequence numbers a device has not sent yet (inclusive). It closes, and leaves the list, when the missing messages arrive.

Thuộc tính
TênKiểuMô tả
device_id
bắt buộc
string
start_seq
bắt buộc
integer

First missing sequence number.

end_seq
bắt buộc
integer

Last missing sequence number.

missing
bắt buộc
integer

How many numbers are missing: end_seq - start_seq + 1.

opened_at
bắt buộc
number

Unix seconds: when the server first saw the gap.

alerted
bắt buộc
boolean

Whether the gap has been open long enough to raise a seq_gap alert.

SeqGapPage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<SeqGap>
next_cursor
bắt buộc
string | null

The next page's cursor; null on the last page.

ServerEpoch

object

A signed server epoch value (SENS-B2c, #239). sig is over the canonical JSON of epoch, issuedAt and kid; publicKeyJwk is outside the signed part.

Thuộc tính
TênKiểuMô tả
epoch
bắt buộc
string

The value a device cites in context.epoch: 128 random bits as lower-case hex.

issuedAt
bắt buộc
string (date-time)

When the server issued it (UTC, milliseconds).

kid
bắt buộc
string

The epoch key's id: epoch- and the first 16 hex digits of the SHA-256 of its public key (SubjectPublicKeyInfo DER).

sig
bắt buộc
object
publicKeyJwk
bắt buộc
PublicJwk

SessionCommand

object

The set_session outcome for one chosen device: pending (recorded, no transport configured), sent, failed (the transport refused it; the device's command list shows the failed row), refused (refused before any command was recorded: device_not_found when the device is missing, of another tenant or outside the caller's facilities, device_not_approved (#242) when the platform has not approved the device or no active approved key reaches it, its own or an approved gateway's at its site, invalid_command when its profile or the params do not allow it) or skipped (its profile does not declare set_session).

Thuộc tính
TênKiểuMô tả
device_id
bắt buộc
string
command_id
bắt buộc
string | null
status
bắt buộc
"pending" | "sent" | "failed" | "refused" | "skipped"
reason
bắt buộc
"not_declared" | "dispatch_failed" | "device_not_found" | "device_not_approved" | "invalid_command" | null

SessionFeed

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<SessionFeedItem>
next_after
bắt buộc
integer

The rx_seq of the last item, or the given after when there is none.

session_status
bắt buộc
"open" | "paused" | "closed"
devices
bắt buộc
array<Device>

The devices stored on the session, by id.

scale
bắt buộc
null | object

Scale live weight: the newest mass.net reading of the session's devices, or null.

pending
bắt buộc
object

Fruits of the session still awaiting a device, and those under review.

SessionFeedItem

object

One fruit upsert: the fruit as it is now and the rx_seq of its latest change.

Thuộc tính
TênKiểuMô tả
rx_seq
bắt buộc
integer
fruit
bắt buộc
Fruit

SessionsRevoked

object

Thuộc tính
TênKiểuMô tả
sessions_revoked
bắt buộc
integer

How many live sessions were ended.

Shipment

object

Thuộc tính
TênKiểuMô tả
code
bắt buộc
string
facility
bắt buộc
string
container
bắt buộc
string
border_gate
bắt buộc
string
destination
bắt buộc
string
setpoint_c
bắt buộc
number
tolerance_c
bắt buộc
number
logger_interval_minutes
bắt buộc
integer
logger
bắt buộc
object
status
bắt buộc
"open" | "departed"
created_by
bắt buộc
string
created_at
bắt buộc
number
departed_by
bắt buộc
string | null
departed_at
bắt buộc
number | null
lots
bắt buộc
array<ShipmentLot>
logger_check
bắt buộc
LoggerCheck
national_portal
bắt buộc
NationalPortalFiling
upload
không bắt buộc
object

Only in the answer of an upload: the stored upload, its readings and how many were new.

consignee
bắt buộc
Consignee | null
documents
bắt buộc
array<ShipmentDocument>
paperwork
bắt buộc
ShipmentPaperwork
amendments
bắt buộc
array<ShipmentAmendment>

ShipmentAmendment

object

A change made after the departure: the consignee or the document list before and after it.

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
kind
bắt buộc
"consignee" | "documents"
reason
bắt buộc
string
before
bắt buộc
object

The consignee (or null) or the document list before the change.

after
bắt buộc
object

The consignee or the document list after the change.

amended_by
bắt buộc
string
amended_at
bắt buộc
number

ShipmentConsigneeSet

object

Thuộc tính
TênKiểuMô tả
consignee
bắt buộc
ConsigneeInput
reason
không bắt buộc
string

Required once the shipment departed (the change is kept as an amendment); accepted and not kept before.

ShipmentCreate

object

Thuộc tính
TênKiểuMô tả
code
bắt buộc
string

Unique within the tenant (a lot code's pattern).

facility
bắt buộc
string

The departure facility: one of the tenant's, within the caller's facilities.

container
bắt buộc
string

ISO 6346 container number; its check digit must be valid.

border_gate
bắt buộc
string

The border gate the shipment heads for (a display string).

destination
bắt buộc
"CN"

Destination market, ISO 3166-1 alpha-2.

setpoint_c
bắt buộc
number

Reefer setpoint, Cel.

tolerance_c
không bắt buộc
number

Deviation from the setpoint a logger reading may show, Cel.

logger_interval_minutes
không bắt buộc
integer

The longest interval the logger may leave between readings.

logger
bắt buộc
object

The independent temperature logger: an active device of the tenant's registry at the departure facility whose profile declares air.temperature (vn.agritrace.reefer-logger). The device and its keys are registered by a device admin; the shipment stores no key.

ShipmentDepart

object

An empty object.

ShipmentDocument

object

Thuộc tính
TênKiểuMô tả
type
bắt buộc
"phytosanitary_certificate" | "certificate_of_origin" | "commercial_invoice" | "packing_list" | "customs_declaration" | "bill_of_lading" | "air_waybill" | "test_report" | "other"
number
bắt buộc
string
issued_on
bắt buộc
string (date)
attachment_sha256
bắt buộc
string | null
added_by
bắt buộc
string
added_at
bắt buộc
number

ShipmentDocumentInput

object

Thuộc tính
TênKiểuMô tả
type
bắt buộc
"phytosanitary_certificate" | "certificate_of_origin" | "commercial_invoice" | "packing_list" | "customs_declaration" | "bill_of_lading" | "air_waybill" | "test_report" | "other"
number
bắt buộc
string
issued_on
bắt buộc
string (date)

YYYY-MM-DD, from 2000-01-01 to tomorrow (Asia/Ho_Chi_Minh).

attachment_sha256
không bắt buộc
string | null

A PDF the tenant uploaded (PUT /v1/attachments/{sha256}); staff-only.

ShipmentDocumentsSet

object

Thuộc tính
TênKiểuMô tả
documents
bắt buộc
array<ShipmentDocumentInput>

The whole list, each (type, number) once; it replaces the stored one.

reason
không bắt buộc
string

Required once the shipment departed (the change is kept as an amendment); accepted and not kept before.

ShipmentLot

object

Thuộc tính
TênKiểuMô tả
lot
bắt buộc
string
status
bắt buộc
string
cartons
bắt buộc
integer
seal_no
bắt buộc
string

The lot's seal number when it was linked.

sealed_at
bắt buộc
number
current_seal_no
bắt buộc
string | null

The lot's seal number now.

seal_matches
bắt buộc
boolean
added_by
bắt buộc
string
added_at
bắt buộc
number

ShipmentPaperwork

object

The destination market's paperwork rule (CN: the consignee, the phytosanitary certificate and the test report) and what is still missing. The departure is refused (409 missing_paperwork) while anything is missing.

Thuộc tính
TênKiểuMô tả
required
bắt buộc
array<string>
missing
bắt buộc
array<string>
complete
bắt buộc
boolean

ShipmentSscc

object

#161: the SSCC of a shipment's container load; null until set.

Thuộc tính
TênKiểuMô tả
shipment
bắt buộc
string
sscc
bắt buộc
string | null

GS1 Serial Shipping Container Code: 18 digits, the last the GS1 mod-10 check digit.

epc
bắt buộc
string | null
element_string
bắt buộc
string | null

SignedInSession

object

SELF-2-1 (#190). One live session of the signed-in user: what the browser told CropPath about itself, read into well-known names, and when it was opened and last used, to the minute. Never the session's token, its hash, its CSRF token, the client's IP address or the raw user agent.

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer

The session's id: pass it to revokeMySession.

browser
bắt buộc
string | null

The browser, such as Chrome, Safari, Firefox, Edge, Cốc Cốc, Zalo or Samsung Internet; null when it could not be told.

os
bắt buộc
string | null

The operating system: Windows, macOS, iOS, Android, ChromeOS or Linux; null when it could not be told.

mobile
bắt buộc
boolean

Whether the browser said it runs on a phone.

created_at
bắt buộc
integer

When the session was opened (sign-in), Unix seconds rounded down to the minute.

last_seen_at
bắt buộc
integer

When the session was last used, Unix seconds rounded down to the minute (recorded at most once a minute).

current
bắt buộc
boolean

Whether this is the session making the request.

SignedInSessionList

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<SignedInSession>

The live sessions, the current one first, then the most recently used.

SignedInSessionRevoked

object

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
revoked
bắt buộc
true

SprayRecord

object

A spray record with its withholding status.

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
growing_area
bắt buộc
string
sprayed_on
bắt buộc
string (date)
product
bắt buộc
string
active_ingredient
bắt buộc
string | null
withholding_days
bắt buộc
integer
evidence_sha256
bắt buộc
string | null
created_at
bắt buộc
number

Unix seconds.

safe_from
bắt buộc
string (date)

sprayed_on plus withholding_days: the first day a harvest is allowed.

evaluated_on
bắt buộc
string (date)

The harvest date the status was judged against (today's UTC date when none was given).

withholding_status
bắt buộc
"ok" | "violated"

violated when sprayed_on <= evaluated_on < safe_from.

SprayRecordCreate

object

Thuộc tính
TênKiểuMô tả
sprayed_on
bắt buộc
string (date)
product
bắt buộc
string
active_ingredient
không bắt buộc
string | null
withholding_days
bắt buộc
integer
evidence_sha256
không bắt buộc
string | null

SprayRecordPage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<SprayRecord>
next_cursor
bắt buộc
string | null

Pass as cursor for the next page; null on the last page.

SsccChange

object | object

Set the SSCC (a number of the company's own GS1 membership, not under the platform's prefix), or allocate the next SSCC of the platform's GS1 company prefix.

StationActionRecord

object

#85: an operator's action recorded offline at an edge station, signed with the station's key.

Thuộc tính
TênKiểuMô tả
v
bắt buộc
1
id
bắt buộc
string (uuid)
type
bắt buộc
"accept" | "remeasure" | "print"
gateway
bắt buộc
string
seq
bắt buộc
integer

The station's action counter: replay order.

delegation
bắt buộc
string
operator
bắt buộc
string
fruit
bắt buộc
string
round
không bắt buộc
integer

A re-measure only: the round the station numbered.

recorded_at
bắt buộc
string (date-time)

The station's time, ISO 8601 with a zone offset.

time_source
không bắt buộc
"gnss" | "ntp" | "unsynced"

The station's clock state. unsynced (the station found its clock off): the action is placed in the delegation by since_claim_s alone, and refused (403 unsynced_clock) without it.

since_claim_s
không bắt buộc
integer

Whole seconds (0 to 2^31 - 1) since the station claimed the delegation, by its monotonic clock, rounded up; above the delegation's length plus 300 s the action is refused (403 delegation_expired), whatever recorded_at says.

after
không bắt buộc
array<string (uuid)>

The fruit's envelopes the station recorded before the action.

sig
bắt buộc
StationSignature

StationActionResult

object

Thuộc tính
TênKiểuMô tả
id
bắt buộc
string
type
bắt buộc
"accept" | "remeasure" | "print"
outcome
bắt buộc
"applied"
seq
bắt buộc
integer
fruit
bắt buộc
object

StationClaim

object

Thuộc tính
TênKiểuMô tả
delegation
bắt buộc
object
labels
bắt buộc
array<StationLabel>
last_seq
bắt buộc
integer | null

The highest seq the cloud recorded from the station (null before its first action): the station's action counter moves above it before it records.

time
bắt buộc
number

The cloud's time (Unix seconds): the station counts the delegation's end from it on its monotonic clock.

StationClaimRequest

object

Thuộc tính
TênKiểuMô tả
gateway
bắt buộc
string
time
bắt buộc
string (date-time)

The station's time, ISO 8601 with a zone offset.

code
bắt buộc
string
sig
bắt buộc
StationSignature

StationDelegation

object

#85: a station sign-in (Unix times).

Thuộc tính
TênKiểuMô tả
id
bắt buộc
string
gateway
bắt buộc
string
operator
bắt buộc
string

The operator's opaque id (user-<id>).

state
bắt buộc
"pending" | "unclaimed" | "active" | "expired" | "revoked"

pending: the code not typed yet; unclaimed: the code expired unused; active: claimed by the station; expired: past expires_at; revoked.

issued_at
bắt buộc
number
code_expires_at
bắt buộc
number
expires_at
bắt buộc
number
claimed_at
bắt buộc
number | null
revoked_at
bắt buộc
number | null

StationDelegationList

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<StationDelegation>

StationLabel

object

What the station's printer queue prints a fruit's 40 x 30 mm label from (#66, #92).

Thuộc tính
TênKiểuMô tả
code
bắt buộc
string
lot
bắt buộc
string
n
bắt buộc
integer
round
bắt buộc
integer

The fruit's measurement round.

status
bắt buộc
string
qr_url
bắt buộc
string (uri)
label_code
không bắt buộc
string

#326, with label_code=1 only: the fruit's lookup code (#288) in its grouped form (three groups of five Crockford base 32 characters), derived from the fruit's public id. The station's fruit label prints it beside the QR code; a person types it on the scan page when the QR code cannot be scanned, and GET /v1/public/resolve answers it with the fruit.

StationSignature

object

ES256 over the canonical JSON of every member but sig (an envelope's signature).

Thuộc tính
TênKiểuMô tả
alg
bắt buộc
"ES256"
kid
bắt buộc
string
value
bắt buộc
string

StationSignIn

object

#85: a new station sign-in with its one-time code (shown only in this answer).

Thuộc tính
TênKiểuMô tả
id
bắt buộc
string
gateway
bắt buộc
string
operator
bắt buộc
string

The operator's opaque id (user-<id>).

state
bắt buộc
"pending" | "unclaimed" | "active" | "expired" | "revoked"

pending: the code not typed yet; unclaimed: the code expired unused; active: claimed by the station; expired: past expires_at; revoked.

issued_at
bắt buộc
number
code_expires_at
bắt buộc
number
expires_at
bắt buộc
number
claimed_at
bắt buộc
number | null
revoked_at
bắt buộc
number | null
code
bắt buộc
string

Typed on the station's screen within 10 minutes.

StationSignInRequest

object

#85: a station sign-in; lifetime_s its length (default the most, one shift).

Thuộc tính
TênKiểuMô tả
lifetime_s
không bắt buộc
integer

StationSync

object

Thuộc tính
TênKiểuMô tả
delegations
bắt buộc
map<string, "active" | "revoked" | "expired" | "unknown">
labels
bắt buộc
array<StationLabel>
last_seq
bắt buộc
integer | null

The highest seq the cloud recorded from the station (null before its first action).

time
bắt buộc
number

StationSyncRequest

object

Thuộc tính
TênKiểuMô tả
gateway
bắt buộc
string
time
bắt buộc
string (date-time)

The station's time, ISO 8601 with a zone offset.

delegations
không bắt buộc
array<string>
sig
bắt buộc
StationSignature

StoredEnvelope

object

A stored envelope (envelope version 1, see Envelope: its schema is served at /developers/downloads/envelope-v1.schema.json, its event types at /developers/downloads/event-types-v1.json; open here) plus the server-added _status.

Thuộc tính
TênKiểuMô tả
_status
bắt buộc
string

SupportRequest

object

A support request as its company sees it (never who at CropPath changed it).

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
tenant
bắt buộc
string

The company the request came from.

user
bắt buộc
SupportRequestUser
subject
bắt buộc
string

Plain text, as typed (trimmed).

body
bắt buộc
string

Plain text, as typed (trimmed): never HTML or markdown; line breaks are kept.

record_id
bắt buộc
string | null

The record the request is about (a lot code, device id, public id, ...), or null.

status
bắt buộc
"open" | "in_progress" | "answered" | "closed"

open (new), in_progress (CropPath is on it), answered (CropPath replied and waits for the company) or closed.

reply
bắt buộc
string | null

CropPath's reply (plain text), or null.

created_at
bắt buộc
number

Seconds since 1970 (UTC).

updated_at
bắt buộc
number

When the request was sent or CropPath last changed it.

SupportRequestCreate

object

Thuộc tính
TênKiểuMô tả
subject
bắt buộc
string

1 to 200 characters after trimming; no line breaks or other control characters.

body
bắt buộc
string

1 to 5000 characters after trimming; line breaks and tabs allowed, no other control characters. Stored and shown as plain text.

record_id
không bắt buộc
string | null

Optional: at most 100 letters, digits and . _ : / # -, starting with a letter or digit; blank or null for none.

SupportRequestPage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<SupportRequest>
next_cursor
bắt buộc
string | null

The next page's cursor; null on the last.

SupportRequestUpdate

object

A status, a reply, or both.

Thuộc tính
TênKiểuMô tả
status
không bắt buộc
"open" | "in_progress" | "answered" | "closed"

open (new), in_progress (CropPath is on it), answered (CropPath replied and waits for the company) or closed.

reply
không bắt buộc
string | null

Plain text; line breaks allowed; null or blank clears it.

SupportRequestUser

object

The member who sent the request.

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
email
bắt buộc
string
display_name
bắt buộc
string | null

Tenant

object

Thuộc tính
TênKiểuMô tả
id
bắt buộc
string
name
bắt buộc
string
source
bắt buộc
"manual" | "backfill"
created_at
bắt buộc
number

Unix seconds.

members
bắt buộc
integer

SELF-1-3 (#184): how many people hold an active membership of the tenant (each counted once); SELF-1-4 (#185): a membership the company turned off does not count.

admins
bắt buộc
integer

SELF-1-3 (#184): how many of them are active company admins whose account is active (SELF-1-4, #185).

offboarding
bắt buộc
CompanyOffboarding

SELF-2-4 (#193): whether the company is leaving CropPath.

platform
không bắt buộc
boolean

#282: present only with listTenants platform=1. true for a company that can never be marked as leaving CropPath: the company of CropPath's platform admins (it holds a platform admin's membership; startCompanyOffboarding answers 409 platform company) and (#283) the company record of CropPath's lab logins (croppath-labs; 409 lab logins company).

TenantAdmin

object

Thuộc tính
TênKiểuMô tả
user_id
bắt buộc
integer
email
bắt buộc
string

The email the admin signs in with.

display_name
bắt buộc
string | null
status
bắt buộc
"active" | "disabled"

TenantAdminList

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<TenantAdmin>

TenantCreate

object

Thuộc tính
TênKiểuMô tả
id
bắt buộc
string
name
bắt buộc
string

TenantPage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<Tenant>
next_cursor
bắt buộc
string | null

Pass as cursor for the next page; null on the last page.

TrustReason

object

A machine-readable explanation: a stable code and its parameters, no prose.

Thuộc tính
TênKiểuMô tả
code
bắt buộc
string

A stable reason code of the trust engine (trust.Code).

params
bắt buộc
map<string, string | integer>

TrustTier

"self_declared" | "device_recorded" | "cross_checked" | "lab_verified"

Trust tiers, lowest first.

TwoFactorCode

object

Thuộc tính
TênKiểuMô tả
code
bắt buộc
string

The 6-digit code the app shows now.

TwoFactorDisable

object

Thuộc tính
TênKiểuMô tả
password
bắt buộc
string
code
không bắt buộc
string

The 6-digit code from the app; or send backup_code.

backup_code
không bắt buộc
string
set_up_again
không bắt buộc
boolean

Turning it off to set the app up again at once (a new phone): allowed even when the account must use two-step sign-in.

TwoFactorReset

object

Thuộc tính
TênKiểuMô tả
reason
không bắt buộc
string

Required from a platform admin (CropPath support): one line, kept in the company's activity log. Ignored for a company admin.

TwoFactorResetResult

object

Thuộc tính
TênKiểuMô tả
user_id
bắt buộc
integer
two_factor
bắt buộc
false
sessions_revoked
bắt buộc
integer

The member's sessions ended by the reset.

TwoFactorSetup

object

SELF-1-6 (#187). A new secret for the authenticator app, in this response only: show otpauth_uri as a QR code (never log it or send it anywhere else) and secret as text to type in.

Thuộc tính
TênKiểuMô tả
secret
bắt buộc
string

160 random bits in base32 (RFC 4648, no padding).

otpauth_uri
bắt buộc
string

otpauth://totp/CropPath:<email>?secret=...&issuer=CropPath

issuer
bắt buộc
"CropPath"
account
bắt buộc
string
digits
bắt buộc
6
period
bắt buộc
30

TwoFactorState

object

SELF-1-6 (#187). The signed-in user's own two-step sign-in. Never the secret or a code.

Thuộc tính
TênKiểuMô tả
enabled
bắt buộc
boolean

The authenticator app is on for this account.

backup_codes_left
bắt buộc
integer

Unused backup codes (0 when the app is off).

verified
bắt buộc
boolean

This session proved a second factor (a code at sign-in, at re-authentication or when the app was turned on).

required
bắt buộc
boolean

This account must use two-step sign-in when acting for the selected company (a platform admin; a company admin after the deadline; a member of a company that requires it). When it is true and verified is false, every company route answers 403 two_factor_required and the console shows the setup screen.

deadline
bắt buộc
number | null

For a company admin before the deadline: the Unix time from which two-step sign-in is required (the console prompts until then); null otherwise.

UiTelemetryBeacon

object

A browser beacon (#81): a page kind, the page's Core Web Vitals in the browser's units and the uncaught errors it saw. At least one measure or error. No URL, id, message or stack.

Thuộc tính
TênKiểuMô tả
page
bắt buộc
"landing" | "lot" | "fruit" | "fruit_results" | "privacy" | "accessibility" | "staff" | "other"

The kind of page, never its URL.

lcp_ms
không bắt buộc
number

Largest Contentful Paint, milliseconds.

cls
không bắt buộc
number

Cumulative Layout Shift (largest session window).

inp_ms
không bắt buộc
number

Interaction to Next Paint, milliseconds.

errors
không bắt buộc
array<object>

User

object

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
email
bắt buộc
string
display_name
bắt buộc
string | null

VerdictCounts

object

SENS-B1e (#235): how many positions of the device got each geofence verdict in the range.

Thuộc tính
TênKiểuMô tả
inside
bắt buộc
integer
near
bắt buộc
integer
outside
bắt buộc
integer
ambiguous
bắt buộc
integer
unverifiable
bắt buộc
integer
no_position
bắt buộc
integer
no_polygon
bắt buộc
integer

VerdictMap

object

SENS-B1e (#235): the growing area's devices with their geofence verdicts over a range of reception times.

Thuộc tính
TênKiểuMô tả
growing_area
bắt buộc
string
from
bắt buộc
number

Start of the range of reception times, Unix seconds.

to
bắt buộc
number

End of the range (included), Unix seconds.

coordinates_shown
bắt buộc
boolean

Whether the install points and judged positions are given to this caller.

truncated
bắt buộc
boolean

True when more than 500 devices matched: the rest, by device id, were left out.

devices
bắt buộc
array<VerdictMapDevice>

Ordered by device id.

polygon
không bắt buộc
GeoJsonPolygon | null

The area's boundary, present only for the owning tenant_admin and platform_admin (as the growing-area read); null: no boundary.

VerdictMapDevice

object

SENS-B1e (#235): one device of the caller's company bound to the area or judged against it in the range.

Thuộc tính
TênKiểuMô tả
device_id
bắt buộc
string
profile
bắt buộc
string
placement
bắt buộc
VerdictMapPlacement | null

Null for a device without a placement.

verdict_counts
bắt buộc
VerdictCounts
latest_verdict
bắt buộc
GeofenceVerdict | null
latest_verdict_at
bắt buộc
number | null

When ingest judged the latest position (its reception).

latest_position
không bắt buộc
JudgedPosition | null

Present only when coordinates_shown (a platform admin, or an operator or admin of the area's owning company); never public. Null when no position was judged in the range.

VerdictMapPlacement

object

SENS-B1e (#235): the device's current placement version.

Thuộc tính
TênKiểuMô tả
version
bắt buộc
integer
mobility
bắt buộc
"fixed" | "mobile"
growing_area
bắt buộc
string | null

The area the version binds the device to.

bound_here
bắt buộc
boolean

The version is an installation bound to this area.

depth_cm
bắt buộc
number | null
installed_at
bắt buộc
number | null
removed_at
bắt buộc
number | null

Set when the current version is a removal.

install_point
không bắt buộc
MapPoint | null

Present only when coordinates_shown (a platform admin, or an operator or admin of the area's owning company); never public. Null for a version without one.

Volume

object

Thuộc tính
TênKiểuMô tả
growing_area
bắt buộc
string
season
bắt buộc
string
declared_kg
bắt buộc
number
cap_kg
bắt buộc
number | null

area_ha times yield_kg_per_ha; null when the growing area is unknown or is a tenant-created area not yet approved by a platform admin.

WebhookDelivery

object

One delivery of one event to the subscription: pending (attempted at next_attempt_at), delivered (a 2xx answer) or failed (12 attempts over about 21 hours, or the subscription was disabled). Unix seconds.

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
subscription_id
bắt buộc
integer
event_id
bắt buộc
string

The webhook-id header: the same on every attempt and redelivery.

event_type
bắt buộc
WebhookEventType
status
bắt buộc
"pending" | "delivered" | "failed"
attempts
bắt buộc
integer

Since the delivery was queued or redelivered.

next_attempt_at
bắt buộc
number | null
last_attempt_at
bắt buộc
number | null
last_status
bắt buộc
integer | null

The last attempt's HTTP status; null: none.

last_error
bắt buộc
string | null

Why the last attempt failed: http_status (a non-2xx answer, a redirect included), blocked_address (the host resolved to an address that is not public), dns_failure, connect_failed, tls_error, timeout (10 seconds for the whole attempt), protocol_error, invalid_url, secret_unavailable, subscription_disabled, internal_error.

created_at
bắt buộc
number
delivered_at
bắt buộc
number | null

WebhookDeliveryPage

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<WebhookDelivery>
next_cursor
bắt buộc
string | null

The next page's cursor; null on the last.

WebhookEventLabResultRecorded

object

The body of a lab_result.recorded delivery (compact JSON, UTF-8).

Thuộc tính
TênKiểuMô tả
id
bắt buộc
string

Equals webhook-id.

type
bắt buộc
"lab_result.recorded"
created_at
bắt buộc
string (date-time)

UTC, ISO 8601 with milliseconds.

tenant
bắt buộc
string
data
bắt buộc
WebhookLabResultRecordedData

WebhookEventLotRecalled

object

The body of a lot.recalled delivery (compact JSON, UTF-8).

Thuộc tính
TênKiểuMô tả
id
bắt buộc
string

Equals webhook-id.

type
bắt buộc
"lot.recalled"
created_at
bắt buộc
string (date-time)

UTC, ISO 8601 with milliseconds.

tenant
bắt buộc
string
data
bắt buộc
WebhookLotRecalledData

WebhookEventLotSealed

object

The body of a lot.sealed delivery (compact JSON, UTF-8).

Thuộc tính
TênKiểuMô tả
id
bắt buộc
string

Equals webhook-id.

type
bắt buộc
"lot.sealed"
created_at
bắt buộc
string (date-time)

UTC, ISO 8601 with milliseconds.

tenant
bắt buộc
string
data
bắt buộc
WebhookLotSealedData

WebhookEventLotTrustTierChanged

object

The body of a lot.trust_tier_changed delivery (compact JSON, UTF-8).

Thuộc tính
TênKiểuMô tả
id
bắt buộc
string

Equals webhook-id.

type
bắt buộc
"lot.trust_tier_changed"
created_at
bắt buộc
string (date-time)

UTC, ISO 8601 with milliseconds.

tenant
bắt buộc
string
data
bắt buộc
WebhookTrustTierChangedData

WebhookEventLotWithdrawn

object

The body of a lot.withdrawn delivery (compact JSON, UTF-8).

Thuộc tính
TênKiểuMô tả
id
bắt buộc
string

Equals webhook-id.

type
bắt buộc
"lot.withdrawn"
created_at
bắt buộc
string (date-time)

UTC, ISO 8601 with milliseconds.

tenant
bắt buộc
string
data
bắt buộc
WebhookLotRecalledData

WebhookEventReportFiled

object

The body of a report.filed delivery (compact JSON, UTF-8).

Thuộc tính
TênKiểuMô tả
id
bắt buộc
string

Equals webhook-id.

type
bắt buộc
"report.filed"
created_at
bắt buộc
string (date-time)

UTC, ISO 8601 with milliseconds.

tenant
bắt buộc
string
data
bắt buộc
WebhookReportFiledData

WebhookEventShipmentDeparted

object

The body of a shipment.departed delivery (compact JSON, UTF-8).

Thuộc tính
TênKiểuMô tả
id
bắt buộc
string

Equals webhook-id.

type
bắt buộc
"shipment.departed"
created_at
bắt buộc
string (date-time)

UTC, ISO 8601 with milliseconds.

tenant
bắt buộc
string
data
bắt buộc
WebhookShipmentDepartedData

WebhookEventType

"lot.sealed" | "lot.recalled" | "lot.withdrawn" | "lab_result.recorded" | "shipment.departed" | "lot.trust_tier_changed" | "report.filed"

An event a subscription can take: lot.sealed (a lot closed and signed), lot.recalled and lot.withdrawn (a recall or withdrawal), lab_result.recorded (a lab report stored, from the lab's signature or its portal), shipment.departed (the ship event), lot.trust_tier_changed (the displayed trust tier of a lot moved) and report.filed (a public mismatch report on one of the tenant's fruits).

WebhookLabResultRecordedData

object

lab_result.recorded: a lab report of the lot's sampling was stored; passed is the verdict against the market's limits (the values are read through the API).

Thuộc tính
TênKiểuMô tả
lot
bắt buộc
string
sampling_id
bắt buộc
integer
lab
bắt buộc
string
report_no
bắt buộc
string
market
bắt buộc
string
signed_at
bắt buộc
string (date-time)

UTC, ISO 8601 with milliseconds.

passed
bắt buộc
boolean

WebhookLotRecalledData

object

lot.recalled and lot.withdrawn: the lot's recall or withdrawal (P5). The staff note never appears.

Thuộc tính
TênKiểuMô tả
lot
bắt buộc
string
public_id
bắt buộc
string

The lot's public id (its QR record).

kind
bắt buộc
"recall" | "withdrawal"
reason
bắt buộc
"contamination" | "pathogen" | "foreign_matter" | "labelling" | "quality" | "regulatory" | "traceability" | "other"
scope
bắt buộc
"consumer" | "retail" | "wholesale"
recalled_at
bắt buộc
string (date-time)

UTC, ISO 8601 with milliseconds.

cartons
bắt buộc
integer
shipments
bắt buộc
integer

WebhookLotSealedData

object

lot.sealed: the lot was closed and its manifest signed (L10).

Thuộc tính
TênKiểuMô tả
lot
bắt buộc
string
public_id
bắt buộc
string

The lot's public id (its QR record).

facility
bắt buộc
string
sealed_at
bắt buộc
string (date-time)

UTC, ISO 8601 with milliseconds.

manifest_sha256
bắt buộc
string
fruit_count
bắt buộc
integer
event_count
bắt buộc
integer

WebhookReportFiledData

object

report.filed: a consumer filed a mismatch report on one of the lot's fruits (X5). The note and the contact never appear.

Thuộc tính
TênKiểuMô tả
report_id
bắt buộc
integer
lot
bắt buộc
string
fruit
bắt buộc
string
category
bắt buộc
"label_peeled" | "scanned_many" | "ripeness_off" | "other"
filed_at
bắt buộc
string (date-time)

UTC, ISO 8601 with milliseconds.

WebhookSecret

object

The subscription and, in secret, its signing secret: this response is the only place it appears (Standard Webhooks format: whsec_ + base64 of 32 random bytes; the HMAC key is the decoded bytes). Store it now; a lost secret is rotated.

Thuộc tính
TênKiểuMô tả
subscription
bắt buộc
WebhookSubscription
secret
bắt buộc
string

WebhookShipmentDepartedData

object

shipment.departed: the shipment left its facility; its lots are shipped.

Thuộc tính
TênKiểuMô tả
shipment
bắt buộc
string
facility
bắt buộc
string
container
bắt buộc
string
border_gate
bắt buộc
string
destination
bắt buộc
string
departed_at
bắt buộc
string (date-time)

UTC, ISO 8601 with milliseconds.

lots
bắt buộc
array<string>

WebhookSubscription

object

A webhook subscription of the tenant: never its secret (stored encrypted, shown once by create and by rotate-secret). Unix seconds.

Thuộc tính
TênKiểuMô tả
id
bắt buộc
integer
url
bắt buộc
string

The endpoint: https only, no credentials, no fragment; every address its host resolves to is public (checked when set and again at every delivery).

description
bắt buộc
string
event_types
bắt buộc
array<WebhookEventType>
status
bắt buộc
"active" | "disabled"

Only an active subscription takes new events and is delivered to.

disabled_reason
bắt buộc
"manual" | "failures" | null

manual: turned off by an admin; failures: 50 failed attempts in a row. null while active.

disabled_at
bắt buộc
number | null
consecutive_failures
bắt buộc
integer

Failed delivery attempts since the last success.

created_by
bắt buộc
string
created_at
bắt buộc
number
updated_at
bắt buộc
number

WebhookSubscriptionCreate

object

A tenant holds at most 20 subscriptions. The secret is generated by the server.

Thuộc tính
TênKiểuMô tả
url
bắt buộc
string
event_types
bắt buộc
array<WebhookEventType>
description
không bắt buộc
string | null

One line.

WebhookSubscriptionList

object

Thuộc tính
TênKiểuMô tả
items
bắt buộc
array<WebhookSubscription>

WebhookSubscriptionUpdate

object

At least one field. enabled: false disables the subscription (manual) and fails its pending deliveries (subscription_disabled); enabled: true makes it active again with no failures counted.

Thuộc tính
TênKiểuMô tả
url
không bắt buộc
string
event_types
không bắt buộc
array<WebhookEventType>
description
không bắt buộc
string | null
enabled
không bắt buộc
boolean

WebhookTrustTierChangedData

object

lot.trust_tier_changed: a recompute moved the lot's displayed trust tier (ADR 0001; a hold drops it to self_declared, its resolution restores at most the sealed tier). Not sent for a lot's first snapshot.

Thuộc tính
TênKiểuMô tả
lot
bắt buộc
string
public_id
bắt buộc
string

The lot's public id (its QR record).

tier
bắt buộc
TrustTier
previous_tier
bắt buộc
TrustTier
status
bắt buộc
"normal" | "on_hold"
changed_at
bắt buộc
string (date-time)

UTC, ISO 8601 with milliseconds.