数据结构
API 读取或返回的所有对象,按名称排列。
- AccountLinkAccept
- AccountLinkCreated
- AccountLinkInfo
- AccountLinkToken
- AddressToCode
- AdminHealth
- AdminInvitationCreate
- AdminUnitCommune
- AdminUnitCommunes
- AdminUnitProvince
- AdminUnitProvinces
- AdminUnitSource
- Agronomist
- AgronomistCreate
- AgronomistPage
- AgronomistSuspend
- AgronomistVerify
- AgronomyAdvisory
- AgronomyEt0
- AgronomyFallbackRule
- AgronomyHome
- AgronomyLocalizedText
- AgronomyPhotoperiod
- AgronomySalinity
- AgronomySheet
- AgronomySheetAttestation
- AgronomySheetBody
- AgronomySheetCreate
- AgronomySheetDocument
- AgronomySheetPage
- AgronomySheetRevoke
- AgronomySheetSign
- AgronomySheetSummary
- AgronomySheetUpdate
- AgronomyStage
- AgronomyStressWindow
- AgronomyTodayProgram
- AlarmAck
- AlarmCounts
- AlarmDetail
- AlarmEvent
- AlarmPage
- AlarmShelve
- AlarmView
- Alert
- AlertResolution
- AnchorEvidenceRecord
- AnchorInclusionProof
- AnchorSealRecord
- Announcement
- AnnouncementCreate
- AnnouncementPage
- ApiToken
- ApiTokenCreate
- ApiTokenCreated
- ApiTokenPage
- ApiTokenRevoke
- ApprovalRequest
- ApprovalRequestApproved
- ApprovalRequestCreate
- ApprovalRequestPage
- ApprovalRequestRejection
- AreaMassBalance
- AttachmentPeaks
- AttachmentStored
- AuditEntry
- AuditPage
- AuthSession
- BackupCodes
- BatchCount
- BatchItemError
- BoundaryWalk
- BoundaryWalkCreate
- BoundaryWalkPage
- BoundaryWalkResult
- BoundaryWalkSummary
- BrokerAuthzRequest
- BrokerAuthzResult
- Calibration
- CalibrationCertificate
- CalibrationCreate
- Calibrations
- CapturedEvent
- CapturedEventPage
- Carton
- CartonBatchResult
- CartonContents
- CartonContentsBatch
- CartonContentsBatchItem
- CartonContentsBatchResult
- CartonCreate
- CartonDetail
- CartonPage
- CertificateStatus
- Certification
- CertificationCreate
- CertificationPage
- CockpitDay
- Command
- CommandIssued
- CommandKey
- CommandKeys
- CommandPage
- CommandRequest
- CommuneVerdictCounts
- CompanyApiCallDay
- CompanyExport
- CompanyExportList
- CompanyLogo
- CompanyLogoStored
- CompanyOffboarding
- CompanyOffboardingStart
- CompanyOverview
- CompanyOverviewAlerts
- CompanyOverviewApiDay
- CompanyOverviewApprovals
- CompanyOverviewCertifications
- CompanyOverviewEmail
- CompanyOverviewFleet
- CompanyOverviewIntegrations
- CompanyOverviewLots
- CompanyOverviewQuarantine
- CompanyOverviewRecalls
- CompanyOverviewRequests
- CompanyOverviewShipments
- CompanyOverviewTeam
- CompanyOverviewToday
- CompanyOverviewUsage
- CompanyPersonalDataRequest
- CompanyPersonalDataRequestPage
- CompanyProducer
- CompanyProfile
- CompanyProfileUpdate
- CompanyPublicIdentity
- CompanyPublicIdentityUpdate
- CompanySecurity
- CompanySecurityUpdate
- CompanyUsage
- CompanyUsageLimit
- CompanyUsageQuotas
- CompanyUsageStored
- Consignee
- ConsigneeInput
- ConsoleHome
- ConsoleHomeDevices
- ConsoleHomeReview
- ConsoleHomeSessions
- ConsoleHomeShipments
- ConsoleHomeTask
- ConsoleHomeToday
- ConsoleHomeWork
- ControlAdvisory
- ControlAdvisorySheet
- ControlAreaToday
- ControlBudgetDay
- ControlBudgetPage
- ControlCommandToday
- ControlControllerDay
- ControlControllerToday
- ControlDay
- ControlEt0Day
- ControlEt0Page
- ControlFleetArea
- ControlFleetAreas
- ControlFleetAttention
- ControlFleetControllers
- ControlFleetState
- ControlGateDecision
- ControlHome
- ControlLink
- ControlPreview
- ControlProbeHealth
- ControlProgram
- ControlProgramPage
- ControlProgramReject
- ControlProgramStep
- ControlProgramSummary
- ControlProgramToday
- ControlRule
- ControlRuleApproval
- ControlRuleCreate
- ControlRulePage
- ControlRuleUpdate
- ControlSensorHealth
- ControlStepToday
- ControlZone
- ControlZoneBand
- ControlZoneCreate
- ControlZoneHistory
- ControlZoneHistoryDay
- ControlZonePage
- ControlZoneRun
- ControlZoneToday
- ControlZoneUpdate
- Crop
- CropCreate
- CropDetail
- CropGradingRule
- CropGradingRulePut
- CropList
- CropMarketRule
- CropMarketRulePut
- CropNames
- CropSampling
- CropUpdate
- Device
- DeviceApproval
- DeviceApprovalItem
- DeviceApprovalPage
- DeviceCreate
- DeviceMetadata
- DevicePage
- DevicePlacement
- DevicePlacementCreate
- DevicePlacementRemoval
- DevicePlacements
- DeviceRejection
- DeviceUpdate
- DidDocument
- EatingWindow
- EatingWindowRow
- EmailSettings
- EmailSettingsUpdate
- EmailUnsubscribe
- EmailUnsubscribed
- Envelope
- EnvelopeDetail
- EnvelopePage
- EnvelopeSummary
- EpcisCaptureReport
- EpcisCaptureResult
- EpcisDocument
- Error
- ExportLabel
- ExportLabelCarton
- ExportLabelCodeField
- ExportLabelFieldTemplate
- ExportLabelPrint
- ExportLabelPrintCreate
- ExportLabelTemplate
- ExportLabelTemplateList
- ExportLabelTemplateView
- ExportLabelText
- Facility
- FacilityCertification
- FacilityCertificationCreate
- FacilityCertificationEnd
- FacilityCertificationList
- FacilityCreate
- FacilityGln
- FacilityPage
- FacilityProposal
- FacilityProposalApproval
- FacilityProposalCreate
- FacilityProposalPage
- FacilityProposalRejected
- FacilityProposalRejection
- FacilityUpdate
- FourEyesState
- FourEyesUpdate
- Fruit
- FruitActionCommand
- FruitActionRequest
- FruitActionResult
- FruitAllocate
- FruitAllocated
- FruitBatchItem
- FruitBatchResult
- FruitLabel
- FruitPage
- FsmaRow
- Gateway
- GatewayCreate
- GatewayHeartbeat
- GatewayHeartbeatStatus
- GatewayLink
- GatewayPage
- GatewayPeripheral
- GatewayStatusBucket
- GatewayStatusSample
- GatewayStatusSeries
- GatewayStatusStat
- GeofenceVerdict
- GeoJsonPolygon
- GlnChange
- GradingRule
- GradingRuleHistory
- GradingRulePage
- GradingRules
- GradingRuleVersion
- Grower
- GrowerBatch
- GrowerBatchResult
- GrowerConsent
- GrowerConsentCreate
- GrowerConsentPage
- GrowerCreate
- GrowerDataRequest
- GrowerDataRequestCreate
- GrowerDataRequestHandle
- GrowerDataRequestPage
- GrowerPage
- GrowerUpdate
- GrowingArea
- GrowingAreaCreate
- GrowingAreaGln
- GrowingAreaPage
- GrowingAreaUpdate
- GrowingAreaVolume
- HarvestBatch
- HarvestBatchItem
- HarvestBatchResult
- HarvestDeclaration
- HarvestDeclarationCreate
- HarvestDeclarationPage
- HarvestKey
- HarvestKeyPage
- HarvestKeyRegister
- Health
- Help
- IdentityProvider
- IdentityProviderState
- IdentityProviderUpdate
- IngestResult
- IntegrityAnchor
- IntegrityAnchorPage
- IntegrityAnchorTimestamp
- Invitation
- InvitationCreate
- InvitationList
- InvitationRevoked
- IssuerKey
- IssuerKeyList
- IssuerKeyRevoke
- JudgedPosition
- Key
- KeyCreate
- KeyPage
- KeyRevoke
- Lab
- LabApproval
- LabApprovalCreate
- LabApprovalList
- LabApprovalUpdate
- LabAssignment
- LabAssignmentDetail
- LabAssignmentPage
- LabCompany
- LabCompanyList
- LabCreate
- LabHome
- LabHomePdfMissing
- LabHomeSent
- LabHomeWaiting
- LabInvitationCreate
- LabKey
- LabKeyCreate
- LabKeyPage
- LabLogins
- LabOriginResult
- LabOriginResultSubmission
- LabPage
- LabPortalEntry
- LabPortalKeyCreate
- LabReport
- LabReportResult
- LabReportResultSubmission
- LabReportSubmission
- LabResultAnalyte
- LabUpdate
- LandCertificate
- LandCertificateCheck
- LandCertificateCheckResult
- LandCertificateCreate
- LandCertificatePage
- LandCertificateSummary
- LandCertificateWalkComparison
- LiveAnnouncement
- LocationCheck
- LoggerCheck
- LoggerSeries
- LoginRequest
- Lot
- LotApplication
- LotApplications
- LotCartonBalance
- LotCloseCheck
- LotCloseRequest
- LotCodeSuggestion
- LotCreate
- LotGs1Carton
- LotGs1Labels
- LotGs1Pallet
- LotMergeInput
- LotMergeRequest
- LotPacking
- LotPage
- LotRecall
- LotRecallRequest
- LotSampling
- LotSamplingRead
- LotSeal
- LotSummary
- LotTrace
- LotTransformation
- LotTransformations
- LotTrust
- LotUpdate
- MapPoint
- MarketLimit
- MarketLimitCreate
- MarketLimitPage
- Me
- MeasurementSession
- MeasurementSessionList
- MeasurementSessionOpen
- MeasurementSessionOpened
- Member
- MemberList
- MemberSessionsRevoke
- MemberSessionsRevoked
- Membership
- MemberUnlockResult
- MemberUpdate
- NationalPortalFiling
- Notification
- NotificationKind
- NotificationPage
- NotificationParams
- NotificationsMarkedRead
- NotificationUnreadCount
- OAuthClient
- OAuthClientAllowedIps
- OAuthClientCreate
- OAuthClientCreated
- OAuthClientDetail
- OAuthClientDetailPage
- OAuthClientPage
- OAuthClientRenew
- OAuthClientRevoke
- OAuthError
- OAuthRevokeRequest
- OAuthToken
- OAuthTokenRequest
- OidcCallback
- OidcStart
- OidcStarted
- Onboarding
- OnboardingStep
- OnboardingUpdate
- OutboundBacklog
- OutboundTarget
- OverviewSectionUnavailable
- Pallet
- PalletCarton
- PalletCartons
- PalletCreate
- PalletPage
- PalletSummary
- Passkey
- PasskeyCreationOptions
- PasskeyList
- PasskeyLogin
- PasskeyRegistration
- PasskeyRename
- PasskeyRequestOptions
- PasswordChanged
- PasswordChangeRequest
- PasswordRecovered
- PasswordRecoveryRequest
- PersonalData
- PersonalDataRequest
- PersonalDataRequestCreate
- PersonalDataRequestPage
- PlatformOverview
- PlatformOverviewCompanies
- PlatformOverviewCompany
- PlatformOverviewHealth
- PlatformOverviewIngest
- PlatformOverviewIrrigation
- PlatformOverviewQueues
- PlatformOverviewSecurity
- PlatformOverviewTraffic
- PlatformOverviewWaiting
- PlatformSupportRequest
- PlatformSupportRequestPage
- PolygonHistory
- PolygonProposal
- PolygonProposalApproval
- PolygonProposalPage
- PolygonProposalQueueItem
- PolygonProposalRejected
- PolygonProposalRejection
- PolygonVersion
- PositionCommune
- ProductGtin
- ProductGtinCreate
- ProductGtinList
- ProgramHoldRelease
- ProgramWithdrawal
- ProgramWithdrawalRequest
- PublicAnalyte
- PublicCode
- PublicCommuneMap
- PublicConformityCredential
- PublicCorrections
- PublicCredential
- PublicCurrentStatus
- PublicCustomsDossier
- PublicDeviceApproval
- PublicDownloads
- PublicEpcisDocument
- PublicEvidenceSource
- PublicFruit
- PublicFruitJourneyStep
- PublicIsoDate
- PublicIsoDateTime
- PublicIssuer
- PublicJwk
- PublicLabLimit
- PublicLabMarketApproval
- PublicLabResult
- PublicLinkset
- PublicLinkTarget
- PublicLot
- PublicLotDownloads
- PublicLotFruit
- PublicLotFruitPage
- PublicLotJourneyStep
- PublicMarket
- PublicPeak
- PublicPeriod
- PublicResolution
- PublicSameOriginPath
- PublicSatelliteCheck
- PublicStatus
- PublicText
- PublicTrustTier
- QuarantinedEnvelope
- ReauthRequest
- RecallExport
- RecallList
- RecallReason
- RecordsExport
- RecordsExportRange
- RecordsExportRow
- RecoveryLinkCreate
- RegistryList
- RegistryListDetail
- RegistryListEntry
- RegistryListEntryPage
- RegistryListImport
- RegistryListPage
- RegistryListRetire
- RegistryMatch
- RegistryMatchPage
- RegistrySourceStored
- Rejection
- RejectionPage
- Report
- ReportCategory
- ReportChallenge
- ReportDetail
- ReportPage
- ReportReceipt
- ReportResolution
- ReportSubmission
- ResidueCertificate
- ResidueCertificateAnalyte
- ReviewRequest
- ReviewResult
- SampleAnalyte
- SampleItem
- SandboxAccount
- SandboxAccountCreate
- SatelliteCheck
- SatelliteCheckCreate
- SatelliteCheckPage
- SealRequest
- SecondFactorChallenge
- SecondFactorLogin
- SecondFactorSession
- SensorSeries
- SensorSeriesBucket
- SensorSeriesDepth
- SeqGap
- SeqGapPage
- ServerEpoch
- SessionCommand
- SessionFeed
- SessionFeedItem
- SessionsRevoked
- Shipment
- ShipmentAmendment
- ShipmentConsigneeSet
- ShipmentCreate
- ShipmentDepart
- ShipmentDocument
- ShipmentDocumentInput
- ShipmentDocumentsSet
- ShipmentLot
- ShipmentLotLink
- ShipmentPaperwork
- ShipmentSscc
- SignedInSession
- SignedInSessionList
- SignedInSessionRevoked
- SprayRecord
- SprayRecordCreate
- SprayRecordPage
- SsccChange
- StationActionRecord
- StationActionResult
- StationClaim
- StationClaimRequest
- StationDelegation
- StationDelegationList
- StationLabel
- StationSignature
- StationSignIn
- StationSignInRequest
- StationSync
- StationSyncRequest
- StoredEnvelope
- SupportRequest
- SupportRequestCreate
- SupportRequestPage
- SupportRequestUpdate
- SupportRequestUser
- Tenant
- TenantAdmin
- TenantAdminList
- TenantCreate
- TenantPage
- TrustReason
- TrustTier
- TwoFactorCode
- TwoFactorDisable
- TwoFactorReset
- TwoFactorResetResult
- TwoFactorSetup
- TwoFactorState
- UiTelemetryBeacon
- User
- VerdictCounts
- VerdictMap
- VerdictMapDevice
- VerdictMapPlacement
- Volume
- WebhookDelivery
- WebhookDeliveryPage
- WebhookEventLabResultRecorded
- WebhookEventLotRecalled
- WebhookEventLotSealed
- WebhookEventLotTrustTierChanged
- WebhookEventLotWithdrawn
- WebhookEventReportFiled
- WebhookEventShipmentDeparted
- WebhookEventType
- WebhookLabResultRecordedData
- WebhookLotRecalledData
- WebhookLotSealedData
- WebhookReportFiledData
- WebhookSecret
- WebhookShipmentDepartedData
- WebhookSubscription
- WebhookSubscriptionCreate
- WebhookSubscriptionList
- WebhookSubscriptionUpdate
- WebhookTrustTierChangedData
AccountLinkAccept
object
| 名称 | 类型 | 说明 |
|---|---|---|
token必填 | string | |
password必填 | 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可选 | string | null | A new account's name; ignored for an existing account. |
AccountLinkCreated
object
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
link必填 | string | The link, shown this once: the token is in the URL fragment ( |
expires_at必填 | number | Unix seconds: 72 hours after creation for an invitation, 24 hours for a recovery link. |
emailed必填 | 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
| 名称 | 类型 | 说明 |
|---|---|---|
purpose必填 | "invite" | "reset" | "admin_recovery" | |
company必填 | string | The company's name. |
role必填 | "tenant_admin" | "operator" | "auditor" | "lab" | "agronomist" | |
email必填 | string | The account's email; it cannot be changed on the page. |
expires_at必填 | number | Unix seconds. |
account_exists必填 | 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
| 名称 | 类型 | 说明 |
|---|---|---|
token必填 | 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).
| 名称 | 类型 | 说明 |
|---|---|---|
kind必填 | "facility" | "growing_area" | "company_profile" | |
code必填 | 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
| 名称 | 类型 | 说明 |
|---|---|---|
email必填 | string | The first admin's email: their sign-in name, not checked by any email. |
display_name可选 | string | null | Proposed as the new account's name; the invitee may change it. |
reason可选 | 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).
| 名称 | 类型 | 说明 |
|---|---|---|
code必填 | string | Its 5-digit official code. |
name必填 | string | Its official name, with its unit word ("Xã", "Phường", "Đặc khu"), in Vietnamese. |
kind必填 | "xã" | "phường" | "đặc khu" |
AdminUnitCommunes
object
One province of a catalog version and its communes, by code.
| 名称 | 类型 | 说明 |
|---|---|---|
version必填 | string | The catalog version: |
valid_from必填 | string (date) | The day from which this version is the one for new input: the effective date of the newest resolution it reflects. |
source必填 | AdminUnitSource | |
province必填 | AdminUnitProvince | |
communes必填 | array<AdminUnitCommune> |
AdminUnitProvince
object
A province-level unit: a province (tỉnh) or a centrally governed city (thành phố trung ương).
| 名称 | 类型 | 说明 |
|---|---|---|
code必填 | string | Its 2-digit official code. |
name必填 | string | Its official name, with its unit word ("Tỉnh", "Thành phố"), in Vietnamese. |
kind必填 | "tỉnh" | "thành phố trung ương" |
AdminUnitProvinces
object
The provinces of one catalog version, by code.
| 名称 | 类型 | 说明 |
|---|---|---|
version必填 | string | The catalog version: |
valid_from必填 | string (date) | The day from which this version is the one for new input: the effective date of the newest resolution it reflects. |
source必填 | AdminUnitSource | |
provinces必填 | array<AdminUnitProvince> |
AdminUnitSource
object
Who publishes the official list, credited with it.
| 名称 | 类型 | 说明 |
|---|---|---|
publisher必填 | string | |
url必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
user_id必填 | integer | The account. |
email必填 | string | |
legal_name必填 | string | The name a signature names (snapshotted into each attestation). |
organisation必填 | string | |
qualification必填 | string | null | |
contact必填 | string | null | |
note必填 | string | null | |
status必填 | "pending" | "verified" | "suspended" |
|
created_at必填 | number | |
updated_at必填 | number | |
verified_by必填 | string | null | |
verified_at必填 | number | null | |
suspended_by必填 | string | null | |
suspended_at必填 | number | null | |
suspend_reason必填 | string | null |
AgronomistCreate
object
| 名称 | 类型 | 说明 |
|---|---|---|
email必填 | string | The account's email (the account must exist). |
legal_name必填 | string | |
organisation必填 | string | |
qualification可选 | string | null | |
contact可选 | string | null | |
note可选 | string | null |
AgronomistPage
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<Agronomist> | |
next_before必填 | integer | null | Pass as |
AgronomistSuspend
object
| 名称 | 类型 | 说明 |
|---|---|---|
reason必填 | string |
AgronomistVerify
object
| 名称 | 类型 | 说明 |
|---|---|---|
note可选 | string | null |
AgronomyAdvisory
object
#351: advice in words only: no digit (amounts and formulas come from a lab test).
| 名称 | 类型 | 说明 |
|---|---|---|
text可选 | AgronomyLocalizedText | |
attachment_sha256可选 | string | |
requires_lab_test可选 | true |
AgronomyEt0
object
| 名称 | 类型 | 说明 |
|---|---|---|
krs可选 | number | FAO-56 eq. 50 adjustment coefficient. Sanity bounds only: the value is the agronomist's, never a CropPath default. |
effective_rain_fraction可选 | number | Share of the rain counted as effective. Sanity bounds only: the value is the agronomist's, never a CropPath default. |
AgronomyFallbackRule
object
| 名称 | 类型 | 说明 |
|---|---|---|
rule_id必填 | integer | |
rule_name必填 | string | |
device_id必填 | string | |
zones必填 | array<integer> | |
reason必填 | string | null |
AgronomyHome
object
#351: the agronomist's home in the selected company.
| 名称 | 类型 | 说明 |
|---|---|---|
generated_at必填 | number | |
now必填 | object | The drafts waiting for a signature, oldest first (at most 20). |
today必填 | 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必填 | object |
AgronomyLocalizedText
object
#351: a text in each language of the console (all three are needed to sign).
| 名称 | 类型 | 说明 |
|---|---|---|
vi可选 | string | |
en可选 | string | |
zh-Hans可选 | string |
AgronomyPhotoperiod
object
| 名称 | 类型 | 说明 |
|---|---|---|
start可选 | string (date) | |
end可选 | string (date) | |
night_start_local可选 | string | |
duration_h可选 | number | Lamp hours a night. Sanity bounds only: the value is the agronomist's, never a CropPath default. |
min_confirmed_h可选 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
water_ec_limit_ms_cm可选 | 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可选 | number | Soil EC limit, mS/cm. Sanity bounds only: the value is the agronomist's, never a CropPath default. |
soil_ec_basis可选 | "bulk" | "pore" | |
action可选 | "block" | "alert" |
AgronomySheet
object
#351: an agronomic input sheet of the company (control/sheets.py).
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
series_key必填 | string |
|
crop必填 | string | A code of the crop registry. |
variety必填 | string | |
province_code必填 | string | |
version必填 | integer | |
status必填 | "draft" | "signed" | "superseded" | "revoked" | |
valid_from必填 | string (date) | null (date) | |
valid_to必填 | string (date) | null (date) | |
body_sha256必填 | string | The SHA-256 of the sheet's JCS document (GET .../document): what a signature covers. |
created_by必填 | string | |
created_at必填 | number | |
updated_by必填 | string | null | |
updated_at必填 | number | |
copied_from_id必填 | integer | null | |
supersedes_id必填 | integer | null | |
superseded_by_id必填 | integer | null | |
signed_at必填 | number | null | |
superseded_at必填 | number | null | |
revoked_at必填 | number | null | |
revoked_by必填 | string | null | |
revoke_reason必填 | string | null | |
body必填 | AgronomySheetBody | |
attestation必填 | 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).
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
agronomist_id必填 | integer | |
user_id必填 | integer | |
legal_name必填 | string | |
organisation必填 | string | |
statement_version必填 | string | |
statement_text_sha256必填 | string | |
body_sha256必填 | string | |
signed_at必填 | number | |
second_factor_at必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
stages可选 | array<AgronomyStage> | |
stress_windows可选 | array<AgronomyStressWindow> | |
salinity可选 | AgronomySalinity | |
et0可选 | AgronomyEt0 | |
lighting可选 | object | |
advisory可选 | object | |
references可选 | array<object> |
AgronomySheetCreate
object
| 名称 | 类型 | 说明 |
|---|---|---|
crop必填 | string | |
variety可选 | string |
|
province_code可选 | string |
|
valid_from可选 | string (date) | null (date) | |
valid_to可选 | string (date) | null (date) | |
body可选 | AgronomySheetBody |
AgronomySheetDocument
object
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
spec必填 | "agritrace.agronomy-sheet/1" | |
document必填 | 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必填 | string | |
statement必填 | object |
AgronomySheetPage
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<AgronomySheetSummary> | |
next_before必填 | integer | null |
AgronomySheetRevoke
object
| 名称 | 类型 | 说明 |
|---|---|---|
reason必填 | string |
AgronomySheetSign
object
| 名称 | 类型 | 说明 |
|---|---|---|
body_sha256必填 | string | |
statement_version必填 | string |
AgronomySheetSummary
object
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
series_key必填 | string |
|
crop必填 | string | A code of the crop registry. |
variety必填 | string | |
province_code必填 | string | |
version必填 | integer | |
status必填 | "draft" | "signed" | "superseded" | "revoked" | |
valid_from必填 | string (date) | null (date) | |
valid_to必填 | string (date) | null (date) | |
body_sha256必填 | string | The SHA-256 of the sheet's JCS document (GET .../document): what a signature covers. |
created_at必填 | number | |
updated_at必填 | number | |
signed_at必填 | number | null | |
superseded_at必填 | number | null | |
revoked_at必填 | number | null | |
signed_by必填 | string | null | The signer's legal name. |
AgronomySheetUpdate
object
Each member given replaces the draft's; one left out stays.
| 名称 | 类型 | 说明 |
|---|---|---|
valid_from可选 | string (date) | null (date) | |
valid_to可选 | string (date) | null (date) | |
body可选 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
code可选 | string | |
name可选 | AgronomyLocalizedText | |
start可选 | string (date) | |
end可选 | string (date) | |
kc可选 | number | Crop coefficient. Sanity bounds only: the value is the agronomist's, never a CropPath default. |
p_depletion可选 | number | FAO-56 depletion fraction p. Sanity bounds only: the value is the agronomist's, never a CropPath default. |
root_depth_m可选 | number | Effective root depth, metres. Sanity bounds only: the value is the agronomist's, never a CropPath default. |
schedule_mm_per_day可选 | number | Scheduled irrigation depth, mm per day. Sanity bounds only: the value is the agronomist's, never a CropPath default. |
moisture_lower_pct可选 | 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可选 | number | Soil moisture band, upper edge (%). Sanity bounds only: the value is the agronomist's, never a CropPath default. |
moisture_basis可选 | object | What the band is read on. |
AgronomyStressWindow
object
| 名称 | 类型 | 说明 |
|---|---|---|
start可选 | string (date) | |
end可选 | string (date) | |
action可选 | "no_irrigation" | "cap_fraction" | "max_mm_per_day" | |
fraction可选 | number | With |
max_mm_per_day可选 | number | With |
note可选 | string |
AgronomyTodayProgram
object
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
device_id必填 | string | |
status必填 | "proposed" | "approved" | "rejected" | "dispatched" | "superseded" | "failed" | "blocked" | "expired" | "withdrawn" | |
proposed_at必填 | number | |
sheets必填 | array<object> |
AlarmAck
object
| 名称 | 类型 | 说明 |
|---|---|---|
note可选 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
urgent必填 | integer | |
warning必填 | integer | |
notice必填 | integer | |
shelved必填 | integer |
AlarmDetail
object
#361: an alarm (AlarmView) with its history: events, oldest first, at most the 100 newest (events_truncated when older ones exist).
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
kind必填 | 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必填 | integer | The catalog version the alarm was raised under. |
priority必填 | "urgent" | "warning" | "notice" | |
state必填 | "active_unacked" | "active_acked" | "cleared_unacked" | "shelved" | "closed" | |
raised_at必填 | string (date-time) | When the condition was first raised (after its on-delay). |
last_active_at必填 | string (date-time) | When the condition was last seen true. |
cleared_at必填 | 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必填 | string (date-time) | null (date-time) | |
occurrences必填 | integer | How many times the condition was raised on this alarm (chatter control). |
acked必填 | object | null | |
shelved必填 | object | null | The current shelving, null when the alarm is not shelved (or its shelving ended). |
subject必填 | object | |
detail必填 | 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必填 | string | The anchor of the alarm's documented response in the alarm philosophy (the kind). |
under必填 | integer | null | Suppression by design, computed when read: the id of the open |
events必填 | array<AlarmEvent> | |
events_truncated必填 | boolean |
AlarmEvent
object
#361: one change of an alarm's state (alarm_events, append-only).
| 名称 | 类型 | 说明 |
|---|---|---|
at必填 | string (date-time) | |
event必填 | "raised" | "reraised" | "cleared" | "acked" | "shelved" | "unshelved" | "shelve_expired" | "closed" | |
actor必填 | string | null | The person (display name, or sign-in when they have none), or |
reason必填 | string | null | A code only: for |
AlarmPage
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<AlarmView> | |
next_cursor必填 | string | null | The next page's |
counts必填 | AlarmCounts | null | With |
AlarmShelve
object
| 名称 | 类型 | 说明 |
|---|---|---|
until必填 | 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必填 | "maintenance" | "technician_called" | "known_issue" | "equipment_off" | "other" | |
note可选 | string | Free text; required when |
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.
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
kind必填 | 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必填 | integer | The catalog version the alarm was raised under. |
priority必填 | "urgent" | "warning" | "notice" | |
state必填 | "active_unacked" | "active_acked" | "cleared_unacked" | "shelved" | "closed" | |
raised_at必填 | string (date-time) | When the condition was first raised (after its on-delay). |
last_active_at必填 | string (date-time) | When the condition was last seen true. |
cleared_at必填 | 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必填 | string (date-time) | null (date-time) | |
occurrences必填 | integer | How many times the condition was raised on this alarm (chatter control). |
acked必填 | object | null | |
shelved必填 | object | null | The current shelving, null when the alarm is not shelved (or its shelving ended). |
subject必填 | object | |
detail必填 | 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必填 | string | The anchor of the alarm's documented response in the alarm philosophy (the kind). |
under必填 | integer | null | Suppression by design, computed when read: the id of the open |
Alert
object
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
tenant必填 | string | null | |
kind必填 | string | |
severity必填 | string | |
device_id必填 | string | null | |
envelope_id必填 | string | null | |
detail必填 | object | Shape depends on |
created_at必填 | number | Unix seconds. |
resolved_at必填 | number | null | Unix seconds; null while open. |
AlertResolution
object
| 名称 | 类型 | 说明 |
|---|---|---|
note可选 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | string | The envelope id (the EPCIS eventID without |
received_at必填 | number | Reception time, Unix seconds (encoded as binary64). |
payload_sha256必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
kind必填 | "seal" | "evidence" | |
day必填 | string | |
record必填 | AnchorSealRecord | AnchorEvidenceRecord | The record's fields in encoding order: an AnchorSealRecord for |
leaf_hash必填 | string | |
included必填 | boolean | |
leaf_index必填 | integer | null | |
tree_size必填 | integer | |
path必填 | array<string> | |
anchor必填 | IntegrityAnchor |
AnchorSealRecord
object
INTEGRITY-2 (#202): a lot seal's record in its day's seal tree, fields in encoding order.
| 名称 | 类型 | 说明 |
|---|---|---|
manifest_sha256必填 | string | The seal's manifest hash, as the public lot record shows it. |
sealed_at必填 | number | Seal time, Unix seconds (encoded as binary64). |
fruit_count必填 | integer | |
event_count必填 | integer |
Announcement
object
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
text必填 | string | Plain text, one line. |
level必填 | "info" | "warning" | |
starts_at必填 | number | Shown from this time (seconds since 1970, UTC). |
ends_at必填 | number | null | Shown until this time; null until expired. |
state必填 | "live" | "scheduled" | "ended" |
|
created_at必填 | number | |
created_by必填 | string | |
expired_at必填 | number | null | |
expired_by必填 | string | null |
AnnouncementCreate
object
| 名称 | 类型 | 说明 |
|---|---|---|
text必填 | string | 1 to 500 characters after trimming, one line, plain text. |
level可选 | "info" | "warning" | |
starts_at可选 | number | null | When it starts showing (default now; a past time means now); at most a year ahead. |
ends_at可选 | number | null | When it stops showing: later than the start and at most a year after it; null shows it until expired. |
AnnouncementPage
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<Announcement> | |
next_cursor必填 | string | null | The next page's |
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.
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
name必填 | string | The operator's label (not unique). |
role必填 | "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必填 | string | null | Who created it: a user's email, or |
created_at必填 | number | |
last_used_at必填 | number | null | The last authenticated use, to the minute; null: never. |
expires_at必填 | number | null | null: never expires. |
revoked_at必填 | number | null | |
revoke_reason必填 | string | null | |
revoked_by必填 | string | null | |
status必填 | "active" | "expired" | "revoked" | At the server clock: revoked, else expired once |
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.
| 名称 | 类型 | 说明 |
|---|---|---|
name必填 | string | |
role必填 | "tenant_admin" | "operator" | "auditor" | |
expires_in_days可选 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
token必填 | ApiToken | |
secret必填 | string |
ApiTokenPage
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<ApiToken> | |
next_cursor必填 | string | null | The next page's |
ApiTokenRevoke
object
| 名称 | 类型 | 说明 |
|---|---|---|
reason必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
action必填 | string | The action's audit action, e.g. |
method必填 | "POST" | "PUT" | |
path必填 | string | The path the action calls. |
body必填 | object | The action's JSON body. |
status必填 | "pending" | "approved" | "rejected" | "expired" | |
requested_by必填 | string | Who asked (their sign-in email). |
requested_by_user_id必填 | integer | |
requested_at必填 | number | Unix seconds. |
expires_at必填 | number | Unix seconds: a pending request can be decided until then. |
decided_by必填 | string | null | |
decided_as必填 | "company_admin" | "platform_support" | null |
|
decided_at必填 | number | null | |
reason必填 | string | null | A rejection's reason. |
ApprovalRequestApproved
object
| 名称 | 类型 | 说明 |
|---|---|---|
request必填 | ApprovalRequest | |
result必填 | object | The action's own answer, as if it had been called directly. |
ApprovalRequestCreate
object
| 名称 | 类型 | 说明 |
|---|---|---|
method必填 | "POST" | "PUT" | |
path必填 | string | The critical action's path, without a query. |
body可选 | object | The action's JSON body (default |
ApprovalRequestPage
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<ApprovalRequest> | |
next_cursor必填 | string | null | The next page's |
ApprovalRequestRejection
object
| 名称 | 类型 | 说明 |
|---|---|---|
reason可选 | string |
AreaMassBalance
object
Harvested against shipped kg of a growing area in a season, across all tenants (aggregates only).
| 名称 | 类型 | 说明 |
|---|---|---|
growing_area必填 | string | |
season必填 | string | |
harvested_kg必填 | number | Accepted harvest and receive envelopes (as the volume) plus the self-declared harvest declarations of the season. |
declared_kg必填 | number | Of which tenant-entered harvest declarations (source self_declared). |
shipped_kg必填 | number | Packed net mass of the area's packed lots of the season. |
packed_lots必填 | integer | |
violation必填 | "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.
| 名称 | 类型 | 说明 |
|---|---|---|
sha256必填 | string | |
n必填 | integer | Buckets returned. |
channels必填 | integer | |
sample_rate必填 | integer | |
frames必填 | integer | |
duration_s必填 | number | |
peaks必填 | array<array<number>> |
AttachmentStored
object
An uploaded blob as stored for its owner.
| 名称 | 类型 | 说明 |
|---|---|---|
sha256必填 | string | |
media_type必填 | "application/pdf" | "audio/wav" | "image/jpeg" | "image/png" | |
size必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | Increasing row id; the list is ordered by it, newest first. |
at必填 | number | Unix seconds. |
actor必填 | string | null | The principal's user (email, |
tenant必填 | string | null | |
action必填 | string | For example |
entity必填 | string |
|
entity_id必填 | string | null | The record's id; for a failed login an HMAC of the normalized email, never the email. |
before_hash必填 | 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必填 | 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 ( |
request_id必填 | string | null | The request's X-Request-Id. |
ip_hash必填 | string | null | HMAC-SHA256 of the client IP. |
actor_kind必填 | "member" | "support" | "api_token" | "api_client" | "server" | "other" | Who the actor is (SELF-1-7, #188): |
actor_name必填 | 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 |
AuditPage
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<AuditEntry> | |
next_cursor必填 | string | null | Pass as |
AuthSession
object
| 名称 | 类型 | 说明 |
|---|---|---|
user必填 | User | |
memberships必填 | array<Membership> | |
csrf_token必填 | string | |
two_factor可选 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
backup_codes必填 | array<string> |
BatchCount
object
| 名称 | 类型 | 说明 |
|---|---|---|
count必填 | integer | How many records to create (at most 1,000). |
BatchItemError
object
One failed item of a batch request.
| 名称 | 类型 | 说明 |
|---|---|---|
index必填 | integer | The item's position in the request (from 0). |
status必填 | integer | The status the single-item route answers for this item. |
error必填 | string | |
code必填 | string |
BoundaryWalk
object
#248: one walk with its outline and its raw track.
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | The walk's id. |
growing_area必填 | string | |
client_walk_id必填 | string (uuid) | |
submitted_by必填 | string | null | Who sent the walk. |
submitted_at必填 | number | Unix seconds when the walk was received. |
started_at必填 | number | Unix seconds when the walk started (the phone's clock). |
finished_at必填 | number | Unix seconds when the walk finished (the phone's clock). |
accuracy_threshold_m必填 | number | The accuracy threshold of the walk in metres. |
polygon_sha256必填 | 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必填 | 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必填 | number | null | The growing area's registered |
area_difference_ratio必填 | 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必填 | integer | Fixes in the raw track. |
points_kept必填 | integer | Fixes whose accuracy is within the walk's threshold (they may back the outline). |
points_dropped必填 | integer | Fixes less precise than the threshold (kept in the track, never in the outline). |
superseded必填 | boolean | Whether the walk replaced a boundary proposal that was waiting. |
polygon必填 | GeoJsonPolygon | |
points必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
client_walk_id必填 | string (uuid) | A UUID in lower case chosen by the phone for this walk: sending the same walk again with it is safe. |
polygon必填 | 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 |
accuracy_threshold_m必填 | number | Fixes less precise than this (metres) were not used for the outline. |
started_at必填 | number | Unix seconds when the walk started; at most 300 s ahead of the server. |
finished_at必填 | number | Unix seconds when the walk finished; not before |
points必填 | 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
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<BoundaryWalkSummary> | Newest first. |
next_cursor必填 | string | null |
BoundaryWalkResult
object
#248: what a submitted walk answers; the same walk sent again answers the same.
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | The walk's id. |
polygon_sha256必填 | 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必填 | 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必填 | number | null | The growing area's registered |
area_difference_ratio必填 | 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必填 | integer | Fixes in the raw track. |
points_kept必填 | integer | Fixes whose accuracy is within the walk's threshold (they may back the outline). |
points_dropped必填 | integer | Fixes less precise than the threshold (kept in the track, never in the outline). |
superseded必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | The walk's id. |
growing_area必填 | string | |
client_walk_id必填 | string (uuid) | |
submitted_by必填 | string | null | Who sent the walk. |
submitted_at必填 | number | Unix seconds when the walk was received. |
started_at必填 | number | Unix seconds when the walk started (the phone's clock). |
finished_at必填 | number | Unix seconds when the walk finished (the phone's clock). |
accuracy_threshold_m必填 | number | The accuracy threshold of the walk in metres. |
polygon_sha256必填 | 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必填 | 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必填 | number | null | The growing area's registered |
area_difference_ratio必填 | 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必填 | integer | Fixes in the raw track. |
points_kept必填 | integer | Fixes whose accuracy is within the walk's threshold (they may back the outline). |
points_dropped必填 | integer | Fixes less precise than the threshold (kept in the track, never in the outline). |
superseded必填 | boolean | Whether the walk replaced a boundary proposal that was waiting. |
BrokerAuthzRequest
object
Missing fields are treated as empty strings (and denied).
| 名称 | 类型 | 说明 |
|---|---|---|
username可选 | string | |
action可选 | string | |
topic可选 | string |
BrokerAuthzResult
object
| 名称 | 类型 | 说明 |
|---|---|---|
result必填 | "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).
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
device_id必填 | string | |
sensor_serial必填 | string | null | |
capability必填 | string | null | The capability covered; null: every capability of the device. |
calibrated_at必填 | number | |
method必填 | "ph_buffers" | "ec_reference" | "lab_correlation" | "factory" | "other" | |
reference_values必填 | object | array<any> | null | |
coefficients必填 | object | array<any> | null | |
performer必填 | string | |
accreditation必填 | "iso17025_lab" | "in_house" | "manufacturer" | |
certificate_sha256必填 | string | null | SHA-256 of the certificate, readable with GET /v1/attachments/{sha256}. |
valid_until必填 | number | |
supersedes必填 | integer | null | The calibration this one corrects. |
created_at必填 | number | |
created_by可选 | string | Who recorded it; present for platform admins only. |
superseded_by必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
media_type必填 | "application/pdf" | "image/jpeg" | "image/png" | |
content_base64必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
sensor_serial可选 | string | The serial of the probe calibrated, when the device carries several. |
capability可选 | string | The capability the calibration covers: one of the vocabulary's, or an |
calibrated_at必填 | number | When the calibration was done. |
method必填 | "ph_buffers" | "ec_reference" | "lab_correlation" | "factory" | "other" |
|
reference_values可选 | 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可选 | object | array<any> | The coefficients found (e.g. slope and offset), with the same bounds as |
performer必填 | string | Who calibrated: a laboratory, a technician or the manufacturer. |
accreditation必填 | "iso17025_lab" | "in_house" | "manufacturer" |
|
certificate_sha256可选 | string | SHA-256 of the calibration certificate (PDF, JPEG or PNG). |
certificate可选 | CalibrationCertificate | |
valid_until必填 | number | Until when the calibration is valid: after |
supersedes可选 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
device_id必填 | string | |
items必填 | array<Calibration> |
CapturedEvent
object
An EPCIS event a partner captured: its statement, Self-declared.
| 名称 | 类型 | 说明 |
|---|---|---|
event_id必填 | string | The EPCIS eventID. |
capture_id必填 | integer | The capture that stored it. |
event_type必填 | "ObjectEvent" | "AggregationEvent" | "TransformationEvent" | |
biz_step必填 | "commissioning" | "receiving" | "packing" | "shipping" | "sensor_reporting" | The CBV business step (bare term). |
step必填 | "harvest" | "receive" | "pack" | "ship" | "observe" | The journey step the event records: commissioning is the harvest, receiving, packing, shipping; sensor_reporting (#238) is an observation ( |
action必填 | "ADD" | "OBSERVE" | null | The EPCIS action; null for a TransformationEvent. |
event_time必填 | string | eventTime as sent (RFC 3339). |
event_time_zone_offset必填 | string | eventTimeZoneOffset as sent. |
read_point必填 | string | null | readPoint.id as sent. |
biz_location必填 | string | null | bizLocation.id as sent. |
source必填 | "partner_capture" | |
tier必填 | "self_declared" | |
captured_by必填 | string | Opaque operator id of the capturing principal. |
captured_at必填 | number | Capture time, Unix seconds. |
references必填 | array<object> | The tenant's records the event names. |
CapturedEventPage
object
| 名称 | 类型 | 说明 |
|---|---|---|
lot必填 | string | The lot code. |
items必填 | array<CapturedEvent> | |
next_cursor必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
tenant必填 | string | |
code必填 | string |
|
lot必填 | string | Code of the carton's lot. |
carton_no必填 | integer | Number within the lot. |
public_id必填 | string | 128 random bits as hex. |
qr_url必填 | string | What the carton label's QR code carries (ADR 0004): a GS1 Digital Link |
net_mass_kg必填 | number | null | Weighed net mass; null until the contents are set. |
fruit_count必填 | integer | |
fruit_mass_kg必填 | number | Sum of the measured (scale) weights of its fruits, 3 decimals. |
labels_printed_at必填 | number | Unix seconds: the carton label's print time (creation). |
created_by必填 | string | |
created_at必填 | number | Unix seconds. |
updated_at必填 | number | Unix seconds. |
CartonBatchResult
object
The cartons a batch created, by number.
| 名称 | 类型 | 说明 |
|---|---|---|
batch_id必填 | integer | The stored batch request's id. |
count必填 | integer | |
items必填 | array<CartonDetail> | In request order. |
CartonContents
object
What the carton holds, replacing its previous contents.
| 名称 | 类型 | 说明 |
|---|---|---|
fruits必填 | 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必填 | number | The carton's weighed net mass. |
CartonContentsBatch
object
Up to 1,000 cartons of the lot, applied in order.
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<CartonContentsBatchItem> |
CartonContentsBatchItem
object
One carton's new contents, replacing its previous ones.
| 名称 | 类型 | 说明 |
|---|---|---|
carton必填 | string | A carton of the path's lot; at most once per batch. |
fruits必填 | 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必填 | number | The carton's weighed net mass. |
CartonContentsBatchResult
object
The cartons as a batch left them, in request order.
| 名称 | 类型 | 说明 |
|---|---|---|
batch_id必填 | integer | The stored batch request's id. |
count必填 | integer | |
items必填 | 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).
| 名称 | 类型 | 说明 |
|---|---|---|
tenant必填 | string | |
code必填 | string |
|
lot必填 | string | Code of the carton's lot. |
carton_no必填 | integer | Number within the lot. |
public_id必填 | string | 128 random bits as hex. |
qr_url必填 | string | What the carton label's QR code carries (ADR 0004): a GS1 Digital Link |
net_mass_kg必填 | number | null | Weighed net mass; null until the contents are set. |
fruit_count必填 | integer | |
fruit_mass_kg必填 | number | Sum of the measured (scale) weights of its fruits, 3 decimals. |
labels_printed_at必填 | number | Unix seconds: the carton label's print time (creation). |
created_by必填 | string | |
created_at必填 | number | Unix seconds. |
updated_at必填 | number | Unix seconds. |
fruits必填 | array<string> |
CartonPage
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<Carton> | |
next_cursor必填 | string | null | Pass as |
CertificateStatus
object
| 名称 | 类型 | 说明 |
|---|---|---|
path必填 | string | |
subject必填 | string | |
not_after必填 | string (date-time) | |
remaining_s必填 | integer | |
remaining_fraction必填 | number | |
expired必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
growing_area必填 | string | |
scheme必填 | string | |
number必填 | string | |
issuer必填 | string | null | |
valid_from必填 | string (date) | |
valid_to必填 | string (date) | |
evidence_sha256必填 | string | null | |
created_at必填 | number | Unix seconds. |
status必填 | "valid" | "expired" | "not_yet_valid" | Against today's UTC date. |
verified可选 | boolean | #269 review, with listCertifications |
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).
| 名称 | 类型 | 说明 |
|---|---|---|
scheme必填 | 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必填 | 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可选 | string | null | The certifier (certification body) that issued the certificate. Optional; without it the certification is unverified. |
valid_from必填 | string (date) | |
valid_to必填 | string (date) | Not before valid_from. |
evidence_sha256可选 | 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
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<Certification> | |
next_cursor必填 | string | null | Pass as |
CockpitDay
object
#365: the farm day (Asia/Ho_Chi_Minh) an answer of the cockpit was computed in (common/farm_day.py).
| 名称 | 类型 | 说明 |
|---|---|---|
date必填 | string | Its farm date. |
starts_at必填 | string (date-time) | Its local midnight, in UTC. |
time_zone必填 | "Asia/Ho_Chi_Minh" |
Command
object
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | string | |
tenant必填 | string | |
site必填 | string | |
device_id必填 | string | |
name必填 | string | |
params必填 | object | |
issued_by必填 | string | |
issued_at必填 | number | Unix seconds. |
status必填 | "pending" | "sent" | "succeeded" | "failed" | "accepted" | "rejected" | "completed" | "aborted" | "expired" | |
result必填 | object | null | The device reply or the dispatch error; null until settled. |
completed_at必填 | number | null | Unix seconds; null until settled. |
kind可选 | "config" | "actuation" | #242, with getCommand or listDeviceCommands |
expires_at可选 | number | null | #242, with getCommand or listDeviceCommands |
reason可选 | string | null | #242, with getCommand or listDeviceCommands |
accepted_at可选 | number | null | #242, with getCommand or listDeviceCommands |
CommandIssued
object
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | string |
CommandKey
object
#242: one platform command key's public part.
| 名称 | 类型 | 说明 |
|---|---|---|
kid必填 | string |
|
alg必填 | "ES256" | |
jwk必填 | object | The public key as an RFC 7517 JWK. |
CommandKeys
object
| 名称 | 类型 | 说明 |
|---|---|---|
keys必填 | array<CommandKey> | Empty when the server has no command key. |
CommandPage
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<Command> | |
next_cursor必填 | string | null | Pass as |
CommandRequest
object
| 名称 | 类型 | 说明 |
|---|---|---|
name必填 | string | |
params可选 | 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).
| 名称 | 类型 | 说明 |
|---|---|---|
commune_match必填 | integer | |
commune_mismatch必填 | integer | |
commune_unknown必填 | integer |
CompanyApiCallDay
object
SELF-2-5 (#194). A company's API calls on one UTC day.
| 名称 | 类型 | 说明 |
|---|---|---|
day必填 | string (date) | The UTC day, YYYY-MM-DD. |
calls必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
status必填 | "queued" | "running" | "ready" | "failed" | "expired" |
|
requested_by必填 | string | Who asked for it (the signed-in user's email). |
requested_at必填 | number | Unix seconds. |
started_at必填 | number | null | Unix seconds when the job started building it. |
finished_at必填 | number | null | Unix seconds when the build ended (ready or failed). |
expires_at必填 | number | null | While ready: Unix seconds after which the download is refused (24 hours after the archive was ready); null otherwise. |
size必填 | integer | null | While ready: the archive's size in bytes. |
sha256必填 | string | null | While ready: the SHA-256 of the archive, to check the downloaded file. |
file_name必填 | string | null | While ready: the file name the download is saved under (croppath-export-<company>-<request time, UTC>.zip). |
error必填 | string | null | Why the build failed: |
CompanyExportList
object
SELF-2-3 (#192). The selected company's 20 newest export requests, newest first, and the limits.
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<CompanyExport> | |
max_per_day必填 | integer | How many exports the company may request in any 24 hours. |
download_hours必填 | integer | How long a ready archive can be downloaded. |
CompanyLogo
object
The logo as stored: a PNG or JPEG the company uploaded (an attachment of the company).
| 名称 | 类型 | 说明 |
|---|---|---|
sha256必填 | string | |
media_type必填 | "image/png" | "image/jpeg" | |
size必填 | integer |
CompanyLogoStored
object
| 名称 | 类型 | 说明 |
|---|---|---|
sha256必填 | string | |
media_type必填 | "image/png" | "image/jpeg" | |
size必填 | integer | |
width必填 | integer | |
height必填 | 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).
| 名称 | 类型 | 说明 |
|---|---|---|
status必填 | "active" | "leaving" | "left" | |
retention_years必填 | integer | null | Years the sealed lot records are kept, counted from each lot's seal. |
started_at必填 | number | null | Unix seconds; null while the company is active. |
window_ends_at必填 | number | null | Unix seconds; null while the company is active. |
left_at必填 | number | null | Unix seconds; when sign-in stopped (status left). |
retention_ends_at必填 | number | null | Unix seconds; null while the company is active. |
steps_done必填 | integer | The job's steps done: 1 members off, 2 credentials revoked, 3 personal data removed. |
CompanyOffboardingStart
object
| 名称 | 类型 | 说明 |
|---|---|---|
retention_years必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
tenant必填 | string | The selected company. |
generated_at必填 | string (date-time) | When the answer was computed (the server serves it for up to |
max_age_s必填 | integer | Seconds the server serves one answer. |
day必填 | object | The day |
view必填 | "admin" | "auditor" | |
sections必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
api_per_day必填 | integer | API calls a UTC day. |
api_calls_today必填 | integer | API calls counted this UTC day. |
api_day_warning必填 | boolean |
|
api_day_reached必填 | boolean |
|
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.
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
kind必填 | "access" | "correction" |
|
text必填 | string | Plain text, as typed (trimmed): never HTML or markdown; line breaks are kept. |
status必填 | "open" | "handled" |
|
created_at必填 | number | Seconds since 1970 (UTC). |
handled_at必填 | number | null | When a company admin marked it handled, or null. |
user必填 | SupportRequestUser | |
handled_by必填 | string | null | Who marked it handled (an email), or null. |
CompanyPersonalDataRequestPage
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<CompanyPersonalDataRequest> | |
next_cursor必填 | string | null | The next page's |
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.
| 名称 | 类型 | 说明 |
|---|---|---|
legal_name必填 | string | |
address必填 | string | null | |
district必填 | string | null | District or commune. |
province必填 | string | null | |
country必填 | string | ISO 3166-1 alpha-2; VN until set. |
commune可选 | 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 |
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.
| 名称 | 类型 | 说明 |
|---|---|---|
tenant必填 | string | The company's id (X-Tenant). |
name必填 | string | The company's short display name (tenants.name), unchanged by the profile. |
legal_name必填 | string | null | |
trading_name必填 | string | null | |
address必填 | string | null | |
province必填 | string | null | |
district必填 | string | null | |
country必填 | string | VN until set. |
tax_id必填 | string | null | |
contact_name必填 | string | null | |
contact_phone必填 | string | null | |
contact_email必填 | string | null | |
website必填 | string | null | |
logo必填 | CompanyLogo | null | |
updated_at必填 | number | null | Seconds since the epoch; null until the profile is first saved. |
updated_by必填 | string | null | Who saved it last; null until then. |
commune可选 | string | null | The commune's official name (xã, phường or đặc khu) when the record is coded; else null. Only with |
province_code可选 | string | null | The province's official 2-digit code, in the list |
commune_code可选 | string | null | The commune's official 5-digit code, in the list |
admin_units_version可选 | string | null | The version of the official list the codes were taken from (for example |
address_before_reform可选 | 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 |
address_status可选 | "coded" | "choose_commune" | "needs_commune" | "outside_vietnam" | null |
|
address_candidates可选 | array<string> | null | For |
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.
| 名称 | 类型 | 说明 |
|---|---|---|
legal_name必填 | string | As on the business registration. Required; trimmed, not blank. |
trading_name可选 | string | null | |
address可选 | string | null | |
province可选 | string | null | In Viet Nam ( |
district可选 | string | null | District or commune. In Viet Nam ( |
province_code可选 | 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 ( |
commune_code可选 | string | null | #273: the commune (xã, phường or đặc khu) by its official 5-digit code in the administrative units list in force ( |
country可选 | string | null | ISO 3166-1 alpha-2 code in capital letters; null or absent: VN. |
tax_id可选 | 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可选 | string | null | |
contact_phone可选 | string | null | Digits, spaces and + ( ) . - only, starting with + or a digit. |
contact_email可选 | string | null | An email address (name@domain.tld). |
website可选 | 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).
| 名称 | 类型 | 说明 |
|---|---|---|
household_business必填 | 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必填 | 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必填 | 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必填 | 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 |
CompanyPublicIdentityUpdate
object
#208: every flag, true or false. The opt-ins are stored false unless household_business is true.
| 名称 | 类型 | 说明 |
|---|---|---|
household_business必填 | 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必填 | 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必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
require_two_factor必填 | boolean | Every member must use two-step sign-in to act for this company. |
members必填 | integer | Active members (active membership and account). |
members_with_two_factor必填 | integer | |
admin_deadline必填 | number | Unix seconds from which every company admin must use two-step sign-in (60 days after the release that shipped it). |
updated_at必填 | number | null | |
updated_by必填 | string | null |
CompanySecurityUpdate
object
| 名称 | 类型 | 说明 |
|---|---|---|
require_two_factor必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
tenant必填 | string | |
warn_percent必填 | integer | An entry warns from this percentage of its limit. |
limits必填 | array<CompanyUsageLimit> | Every limit, in a fixed order. |
api_calls必填 | array<CompanyApiCallDay> | The last 14 UTC days, newest first, today included (0 for a day without calls). |
quotas必填 | CompanyUsageQuotas | |
stored必填 | CompanyUsageStored |
CompanyUsageLimit
object
SELF-2-5 (#194). One per-company limit: what the company uses of it.
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | "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: |
used必填 | integer | |
limit必填 | integer | null | The limit the backend enforces; null when there is none. |
warning必填 | boolean |
|
reached必填 | boolean |
|
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.
| 名称 | 类型 | 说明 |
|---|---|---|
api_per_minute必填 | integer | API calls a minute; over it, 429 with |
api_per_day必填 | integer | API calls a UTC day; once reached, 429 until the next UTC midnight. |
api_calls_today必填 | integer | API calls counted this UTC day (as |
api_day_warning必填 | boolean |
|
api_day_reached必填 | boolean |
|
ingest_per_second必填 | integer | Device messages a second the ingest stores as they arrive. |
ingest_burst必填 | integer | Device messages the ingest stores at once above that rate after a quiet period. |
ingest_backlog必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
envelopes必填 | integer | Device messages (envelopes) stored for the company, of every status. |
scans必填 | 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必填 | integer | Files stored: device attachments uploaded for the company's envelopes plus documents its users uploaded. |
storage_bytes必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
name必填 | string | Legal name. |
address必填 | string | Postal address; line breaks allowed. |
country必填 | string | ISO 3166-1 alpha-2 (an assigned code). |
gln必填 | string | null | GS1 Global Location Number with a valid check digit. |
registration_id必填 | string | null | Tax or importer registration id. |
ConsigneeInput
object
A consignee as written: gln and registration_id are optional.
| 名称 | 类型 | 说明 |
|---|---|---|
name必填 | string | Legal name. |
address必填 | string | Postal address; line breaks allowed. |
country必填 | string | ISO 3166-1 alpha-2 (an assigned code). |
gln可选 | string | null | GS1 Global Location Number with a valid check digit. |
registration_id可选 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
tenant必填 | string | The selected company. |
generated_at必填 | string (date-time) | When the answer was computed (the server serves it for up to |
max_age_s必填 | integer | Seconds the server serves one answer. |
day必填 | object | The day |
scope必填 | object | Whose work the answer counts. |
sections必填 | 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
| 名称 | 类型 | 说明 |
|---|---|---|
count必填 | integer | Lots of the window that need this action. |
oldest必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
generated_at必填 | number | |
today必填 | string | |
items必填 | array<ControlAdvisorySheet> | |
drafts必填 | integer | The company's draft sheets (never listed). |
withheld必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
sheet_id必填 | integer | |
series_key必填 | string | |
crop必填 | string | |
version必填 | integer | |
valid_from必填 | string | |
valid_to必填 | string | |
body_sha256必填 | string | |
signed_by必填 | string | null | The signer's legal name as the attestation recorded it. |
signed_at必填 | number | null | When the attestation was signed. |
advisory必填 | object | null | The body's advisory section exactly as signed; null when the sheet has none. |
references必填 | array<object> | The body's references, as signed ([] when none). |
growing_areas必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
generated_at必填 | string (date-time) | When the answer was computed (the server serves it for up to |
max_age_s必填 | integer | |
poll_hint_s必填 | 15 | 60 | 15 while a run is open, a step is scheduled now or a command waits for its controller, else 60. |
day必填 | ControlDay | |
area必填 | object | |
controllers必填 | array<ControlControllerToday> | |
truncated必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
device_id必填 | string | |
zone必填 | integer | |
name必填 | string | |
growing_area必填 | string | |
local_date必填 | string | |
plan必填 | "dispatched" | "withdrawn" | "replaced" | "refused" | "none" | "proposed" | "approved" | "rejected" | "superseded" | "failed" | "blocked" | "expired" |
|
program_id必填 | integer | null | |
rule_id必填 | integer | null | |
mode必填 | string | null | |
planned_mm必填 | number | null |
|
planned_l必填 | number | null | The planned litres of the program in force; null without one. |
clamps必填 | array<string> | |
et0必填 | 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必填 | number | null | The litres the controller reported; null when it reported nothing. |
applied_mm必填 | number | null |
|
ControlBudgetPage
object
#353: planned and applied water per zone and local date (at most 2000 items).
| 名称 | 类型 | 说明 |
|---|---|---|
from必填 | string | |
to必填 | string | |
items必填 | array<ControlBudgetDay> | |
truncated必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | string | |
name必填 | string | |
status必填 | "pending" | "sent" | "accepted" | "completed" | "aborted" | "rejected" | "expired" | "failed" | |
issued_by必填 | string | null | The person's display name ( |
issued_at必填 | string (date-time) | |
params必填 | object | |
expires_at必填 | string (date-time) | null (date-time) | |
reason必填 | string | null | |
measured必填 | object | null |
ControlControllerDay
object
#363. One irrigation controller's day.
| 名称 | 类型 | 说明 |
|---|---|---|
generated_at必填 | string (date-time) | When the answer was computed (the server serves it for up to |
max_age_s必填 | integer | |
poll_hint_s必填 | 15 | 60 | 15 while a run is open, a step is scheduled now or a command waits for its controller, else 60. |
day必填 | ControlDay | |
device_id必填 | string | |
name必填 | string | null | |
link必填 | ControlLink | |
hold_until必填 | 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必填 | ControlProgramToday | |
zones必填 | array<ControlZoneToday> | |
steps必填 | array<ControlStepToday> | |
commands必填 | array<ControlCommandToday> | |
area必填 | null | object | |
limits必填 | object | The controller profile's run_zone bounds (minima since #371): installation facts, never an irrigation amount. |
truncated必填 | boolean |
ControlControllerToday
object
#363. One controller of an area's day.
| 名称 | 类型 | 说明 |
|---|---|---|
device_id必填 | string | |
name必填 | string | null | |
link必填 | ControlLink | |
hold_until必填 | 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必填 | ControlProgramToday | |
zones必填 | array<ControlZoneToday> | |
steps必填 | array<ControlStepToday> | |
commands必填 | array<ControlCommandToday> |
ControlDay
object
#363. The farm-local day an answer describes (the backend owns the day).
| 名称 | 类型 | 说明 |
|---|---|---|
date必填 | string (date) | The farm-local date (Asia/Ho_Chi_Minh). |
starts_at必填 | string (date-time) | Its local midnight, in UTC (17:00:00Z of the day before). |
time_zone必填 | "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.
| 名称 | 类型 | 说明 |
|---|---|---|
device_id必填 | string | The weather station. |
local_date必填 | string | The local day (Asia/Ho_Chi_Minh, midnight to midnight). |
seq必填 | integer | The version of the station day (1, 2, ...): the latest is listed. |
wind_height_m必填 | number | The anemometer's height the zone gives (eq. 47). |
elevation_m必填 | number | The station's elevation the zone gives (eqs. 7 and 37). |
status必填 | "ok" | "needs_krs" | "refused" |
|
reason必填 | string | null | Why not |
et0_mm必填 | number | null | mm/day; null unless ok. |
inputs必填 | 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 |
trace必填 | 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). |
computed_at必填 | number | |
estimated必填 | 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).
| 名称 | 类型 | 说明 |
|---|---|---|
from必填 | string | |
to必填 | string | |
items必填 | array<ControlEt0Day> | |
truncated必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
code必填 | string | |
name必填 | string | null | |
controllers必填 | object | |
zones必填 | object | |
water_today必填 | object | |
sensors必填 | object | |
alarms必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
tenant必填 | string | |
generated_at必填 | string (date-time) | When the answer was computed (the server serves it for up to |
max_age_s必填 | integer | |
poll_hint_s必填 | 15 | 60 | 15 while a run is open, a step is scheduled now or a command waits for its controller, else 60. |
day必填 | ControlDay | |
view必填 | string | |
attention必填 | ControlFleetAttention | |
areas必填 | ControlFleetAreas | |
controllers必填 | ControlFleetControllers |
ControlGateDecision
object
| 名称 | 类型 | 说明 |
|---|---|---|
zone必填 | integer | |
rule_id必填 | integer | |
decided_at必填 | number | |
verdict必填 | "healthy" | "fallback" | "blocked" | |
reason必填 | string | null | |
detail必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
generated_at必填 | number | |
controllers必填 | integer | The company's controllers with a control zone in scope. |
programs_waiting必填 | object | The programs still |
rules必填 | object | The company's rules in scope by what they need. |
salinity必填 | object | The open alerts of a controller in scope whose zone's water or soil EC (mS/cm) passed its signed sheet's limit: |
et0必填 | 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. |
ControlLink
object
#363. How a controller is reached, as its gateway reported it.
| 名称 | 类型 | 说明 |
|---|---|---|
state必填 | "online" | "stale" | "offline" | "unknown" | Through a gateway: |
via必填 | "gateway" | "direct" | |
gateway必填 | string | null | The gateway of the freshest heartbeat. |
heard_at必填 | string (date-time) | null (date-time) | When the server received that heartbeat. |
expected_s必填 | integer | null | The gateway's heartbeat interval; null for a direct link. |
ready必填 | boolean | null | Whether the heartbeat lists the controller ready (null when not measured). |
ControlPreview
object
#352: a dry run of a rule's controller as if the rule were enabled; nothing written or sent.
| 名称 | 类型 | 说明 |
|---|---|---|
generated_at必填 | number | |
rule_id必填 | integer | |
device_id必填 | string | |
provenance必填 | object | As a program's provenance. A zone's record may carry |
gate必填 | array<object> | |
params必填 | 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必填 | array<integer> |
ControlProbeHealth
object
#365: one probe of the area at one depth.
| 名称 | 类型 | 说明 |
|---|---|---|
device_id必填 | string | |
profile必填 | string | |
depth_cm必填 | number | null | |
capability必填 | 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必填 | 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必填 | 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必填 | object | |
used_by必填 | array<object> |
ControlProgram
object
#352: a program the engine composed (control/programs.py), with the #242 command it became.
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
device_id必填 | string | |
local_date必填 | string | |
status必填 | "proposed" | "approved" | "rejected" | "dispatched" | "superseded" | "failed" | "blocked" | "expired" | "withdrawn" | |
cause必填 | "daily" | "threshold" | "recompose" | |
proposed_at必填 | number | |
expires_at必填 | number | |
decided_by必填 | string | null | |
decided_at必填 | number | null | |
dispatched_at必填 | number | null | |
command_id必填 | string | null | |
program_version必填 | integer | null | |
error必填 | string | null | |
steps必填 | integer | |
litres必填 | number | |
rules必填 | array<object> | |
sheets必填 | array<object> | Every sheet the program cites: its id, version, series and SHA-256. |
withdrew必填 | boolean | The controller's earlier program was withdrawn with this row. |
params必填 | object | null | The set_program params: as sent once dispatched (with the program_version CropPath assigned), else as they would be sent now. |
provenance必填 | 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 ( |
decision_note必填 | string | null | |
withdrawal必填 | object | null | #367: who withdrew the program from the controller (null to an agronomist), when (RFC 3339 UTC) and why ( |
gate_decisions必填 | array<ControlGateDecision> | |
command必填 | object | null |
ControlProgramPage
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<ControlProgramSummary> | |
next_before必填 | integer | null |
ControlProgramReject
object
| 名称 | 类型 | 说明 |
|---|---|---|
reason可选 | string |
ControlProgramStep
object
| 名称 | 类型 | 说明 |
|---|---|---|
zone必填 | integer | |
start_s必填 | integer | |
duration_s必填 | integer | |
max_volume_l必填 | number |
ControlProgramSummary
object
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
device_id必填 | string | |
local_date必填 | string | |
status必填 | "proposed" | "approved" | "rejected" | "dispatched" | "superseded" | "failed" | "blocked" | "expired" | "withdrawn" | |
cause必填 | "daily" | "threshold" | "recompose" | |
proposed_at必填 | number | |
expires_at必填 | number | |
decided_by必填 | string | null | |
decided_at必填 | number | null | |
dispatched_at必填 | number | null | |
command_id必填 | string | null | |
program_version必填 | integer | null | |
error必填 | string | null | |
steps必填 | integer | |
litres必填 | number | |
rules必填 | array<object> | |
sheets必填 | array<object> | Every sheet the program cites: its id, version, series and SHA-256. |
withdrew必填 | boolean | The controller's earlier program was withdrawn with this row. |
ControlProgramToday
object
#363. Today's program of a controller.
| 名称 | 类型 | 说明 |
|---|---|---|
state必填 | "none" | "sending" | "installed" | "refused" | "not_installed" | "ended" | The day's newest set_program as the controller reported it. |
command_id必填 | string | null | |
program_version必填 | integer | null | |
control_program_id必填 | integer | null | The #352 program row that sent it (null: not the rules'). |
valid_until必填 | string (date-time) | null (date-time) | The end of its lease. |
withdrawable必填 | 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必填 | "stop_installed" | "stop_sending" | "hold" | "already_held" | null | #371: what a withdrawal would do now: |
lease_version必填 | 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必填 | string | null | #371: the set_program command of that program; null when none is installed. |
lease_control_program_id必填 | integer | null | #371: the #352 program row that sent that program (null: none installed, or not the rules'). |
withdrawal必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
kind必填 | "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必填 | string | |
name必填 | string | |
zones必填 | array<integer> | |
sheet_id必填 | integer | null | A signed agronomic input sheet of the company. |
windows必填 | array<object> | |
fallback_rule_id必填 | 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必填 | integer | |
min_interval_s必填 | integer | |
peer_tolerance_pct必填 | 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必填 | 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必填 | "required" | "auto" | |
enabled必填 | boolean | |
state必填 | "disabled" | "ok" | "blocked" | "fallback" | |
state_reason必填 | string | null | Why blocked or on fallback, e.g. |
state_at必填 | number | null | |
next_run_at必填 | number | null | |
last_run_at必填 | number | null | |
created_by必填 | string | |
created_at必填 | number | |
updated_by必填 | string | null | |
updated_at必填 | number | |
enabled_by必填 | string | null | |
enabled_at必填 | number | null | |
auto_approval_by必填 | string | null | |
auto_approval_at必填 | number | null | |
hold_until必填 | 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必填 | object | null | |
sheet_gate必填 | 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): |
resumed_command_id必填 | string | null | The person's own set_program an admin resumed the controller's rules over (POST .../resume), or null. |
ControlRuleApproval
object
| 名称 | 类型 | 说明 |
|---|---|---|
approval必填 | "required" | "auto" |
ControlRuleCreate
object
| 名称 | 类型 | 说明 |
|---|---|---|
kind必填 | "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必填 | string | |
name必填 | string | |
zones必填 | array<integer> | |
sheet_id可选 | integer | null | A signed agronomic input sheet of the company. |
windows必填 | array<object> | |
fallback_rule_id可选 | 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可选 | integer | |
min_interval_s可选 | integer | |
peer_tolerance_pct可选 | 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可选 | 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
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<ControlRule> | |
next_before必填 | integer | null |
ControlRuleUpdate
object
| 名称 | 类型 | 说明 |
|---|---|---|
name可选 | string | |
zones可选 | array<integer> | |
sheet_id可选 | integer | null | A signed agronomic input sheet of the company. |
windows可选 | array<object> | |
fallback_rule_id可选 | 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可选 | integer | |
min_interval_s可选 | integer | |
peer_tolerance_pct可选 | 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可选 | 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).
| 名称 | 类型 | 说明 |
|---|---|---|
generated_at必填 | string (date-time) | When the answer was computed (the server serves it from its cache for |
max_age_s必填 | integer | How long the server serves this answer from its cache. |
poll_hint_s必填 | integer | How often a screen may ask again. |
day必填 | CockpitDay | |
area必填 | string | |
probes必填 | array<ControlProbeHealth> | |
gate_decisions_today必填 | array<object> | Newest first. |
truncated必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
zone必填 | integer | |
start_s必填 | integer | Seconds after local midnight. |
duration_s必填 | integer | |
max_volume_l必填 | number | null | |
planned_l必填 | number | null | |
actual必填 | object |
ControlZone
object
#352: an irrigation zone of a controller, with its installation facts (control/zones.py).
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
device_id必填 | string | |
zone必填 | integer | |
growing_area必填 | string | |
name必填 | string | |
irrigated_area_m2必填 | number | |
nominal_flow_lpm必填 | number | |
efficiency必填 | number | |
max_daily_l必填 | number | |
probes必填 | array<object> | The soil moisture probes that watch the zone: devices of the company whose profile produces soil.moisture (#365). |
weather_station必填 | object | null | |
controller_utc_offset必填 | string | |
field_capacity_pct必填 | 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必填 | 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必填 | boolean | Whether the controller is on Viet Nam time (+07:00): a zone that is not blocks the rules watering it. |
created_by必填 | string | |
created_at必填 | number | |
updated_by必填 | string | null | |
updated_at必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
from必填 | string | |
to必填 | string | |
lower_pct必填 | number | |
upper_pct必填 | number | |
depth_cm必填 | number | The band's basis depth. |
probe_profile必填 | string | null | The probe profile the band was set for. |
stage必填 | string | null | The stage's code. |
stage_name必填 | AgronomyLocalizedText | null | #372: the stage's name as the sheet words it (vi, en, zh-Hans); null when the stage has none. |
sheet必填 | object |
ControlZoneCreate
object
| 名称 | 类型 | 说明 |
|---|---|---|
device_id必填 | string | |
zone必填 | integer | |
name必填 | string | |
irrigated_area_m2必填 | number | |
nominal_flow_lpm必填 | number | |
efficiency必填 | number | |
max_daily_l必填 | number | |
probes可选 | array<object> | |
weather_station可选 | object | null | |
controller_utc_offset必填 | string | |
field_capacity_pct可选 | 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可选 | 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).
| 名称 | 类型 | 说明 |
|---|---|---|
generated_at必填 | string (date-time) | When the answer was computed (the server serves it from its cache for |
max_age_s必填 | integer | How long the server serves this answer from its cache. |
poll_hint_s必填 | integer | How often a screen may ask again. |
day必填 | CockpitDay | |
from必填 | string | |
to必填 | string | |
zone必填 | object | |
days必填 | array<ControlZoneHistoryDay> | |
runs必填 | array<ControlZoneRun> | Newest first. |
moisture_series必填 | 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必填 | object | null | #372: the soil moisture of the zone's own probes (its |
bands必填 | array<ControlZoneBand> | |
truncated必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
date必填 | string | |
planned_l必填 | 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 |
applied_l必填 | 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必填 | number | null |
|
applied_mm必填 | number | null |
|
et0_mm必填 | 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 |
et0_status必填 | "ok" | "needs_krs" | "refused" | null | That station day's status: |
kc_stage必填 | 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必填 | 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必填 | object | null | How the newest program row of the day decided the zone; null without one. |
program必填 | object | null | The newest program row of the day for the controller. |
ControlZonePage
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<ControlZone> |
ControlZoneRun
object
#365: one delivery the controller reported for the zone (it reports a run's water when the run ends).
| 名称 | 类型 | 说明 |
|---|---|---|
started_at必填 | string (date-time) | null (date-time) | When the controller's |
ended_at必填 | string (date-time) | The delivered-volume reading's time. |
litres必填 | number | |
source必填 | "manual" | "program_step" |
|
command_id必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
zone必填 | integer | |
name必填 | string | null | |
state必填 | "idle" | "requested" | "running" | "scheduled_now" | "ended" | "refused" | "fault" | From the reports only: a request waiting for the controller is |
source必填 | "run_zone_reply" | "step_water" | "program_reply" | null | |
since必填 | string (date-time) | null (date-time) | |
expected_end必填 | string (date-time) | null (date-time) | |
reason必填 | string | null | The refusal or fault reason token. |
today必填 | object | |
moisture必填 | object | |
sheet可选 | 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. |
nominal_flow_lpm可选 | number | null | Controller today only: the installation's nominal flow (#352 control_zones). |
max_daily_l可选 | number | null | Controller today only: the zone's daily cap (#352 control_zones). |
ControlZoneUpdate
object
| 名称 | 类型 | 说明 |
|---|---|---|
name可选 | string | |
irrigated_area_m2可选 | number | |
nominal_flow_lpm可选 | number | |
efficiency可选 | number | |
max_daily_l可选 | number | |
probes可选 | array<object> | |
weather_station可选 | object | null | |
controller_utc_offset可选 | string | |
field_capacity_pct可选 | 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可选 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
code必填 | string | The crop code that lots ( |
names必填 | CropNames | |
ripeness_scale必填 | "levels_1_to_4" | null | The crop's ripeness scale: |
created_at必填 | number | Unix seconds (0 for the crop the platform started with). |
updated_at必填 | number | Unix seconds of the last change. |
CropCreate
object
| 名称 | 类型 | 说明 |
|---|---|---|
code必填 | string | The crop code that lots ( |
names必填 | CropNames | |
ripeness_scale可选 | "levels_1_to_4" | null | The crop's ripeness scale: |
CropDetail
object
A crop of the registry with its rules per destination market and its grading rules.
| 名称 | 类型 | 说明 |
|---|---|---|
code必填 | string | The crop code that lots ( |
names必填 | CropNames | |
ripeness_scale必填 | "levels_1_to_4" | null | The crop's ripeness scale: |
created_at必填 | number | Unix seconds (0 for the crop the platform started with). |
updated_at必填 | number | Unix seconds of the last change. |
markets必填 | array<CropMarketRule> | |
grading_rules必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
crop必填 | string | |
variety必填 | string | null | |
rules必填 | GradingRules | |
created_at必填 | number | |
updated_at必填 | number |
CropGradingRulePut
object
| 名称 | 类型 | 说明 |
|---|---|---|
variety必填 | string | null | A variety of the crop; null for every variety of it. |
rules必填 | GradingRules |
CropList
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<Crop> | Every crop of the registry, by code (at most 200). |
configured必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
crop必填 | string | |
market必填 | string | ISO 3166-1 alpha-2. |
registration_protocol必填 | 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必填 | 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必填 | number | |
updated_at必填 | number |
CropMarketRulePut
object
| 名称 | 类型 | 说明 |
|---|---|---|
registration_protocol必填 | boolean | |
sampling必填 | CropSampling | null |
CropNames
object
The crop's name in Vietnamese, English and Simplified Chinese (each 1 to 100 characters).
| 名称 | 类型 | 说明 |
|---|---|---|
vi必填 | string | |
en必填 | string | |
zh-Hans必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
rule必填 | string | The rule's id, unique across crops and markets; every sampling records it. |
rule_source必填 | string | The http(s) address of the published rule. |
base_rate必填 | number | 0.02 is 2%. |
clean_rate必填 | number | |
clean_days必填 | integer | |
analytes必填 | array<string> | |
analytes_source可选 | string | null | The http(s) address that requires these tests; optional. |
CropUpdate
object
| 名称 | 类型 | 说明 |
|---|---|---|
names可选 | CropNames | |
ripeness_scale可选 | "levels_1_to_4" | null | The crop's 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.
| 名称 | 类型 | 说明 |
|---|---|---|
device_id必填 | string | |
tenant必填 | string | |
site必填 | string | The site segment of the device's ingest route and MQTT topics. |
facility必填 | string | null | Facility code; null for a device registered before facilities, whose site then stands in for the facility in operator scope. |
profile必填 | string | Device profile id (without version). |
status必填 | string | Only |
display_name必填 | string | null | |
vendor_model必填 | string | null | |
serial必填 | string | null | |
created_at必填 | number | Unix seconds. |
commands必填 | array<string> | The downlink commands the device's profile declares, sorted by name: the only names |
last_seen必填 | number | null | Unix seconds (server time of the last message). |
max_seq必填 | integer | null | |
last_model必填 | string | null | |
firmware必填 | string | null | |
battery_pct必填 | number | null | |
battery_v必填 | number | null | |
last_calibrated_at必填 | number | null | Unix seconds. |
ready必填 | boolean | |
approval必填 | "pending" | "approved" | "rejected" | Platform approval (#201): |
approval_reason必填 | string | null | The reason of a rejection; null otherwise. |
approval_at必填 | number | null | Unix seconds of the last approval decision. |
DeviceApproval
object
| 名称 | 类型 | 说明 |
|---|---|---|
keys必填 | array<string> | The kids of the identity's waiting keys the platform admin saw in the queue ( |
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.
| 名称 | 类型 | 说明 |
|---|---|---|
kind必填 | "device" | "gateway" | |
id必填 | string | The device or gateway id (one namespace). |
tenant必填 | string | The company that registered it. |
tenant_name必填 | string | null | |
site必填 | string | |
facility必填 | string | null | |
profile必填 | string | null | The device profile; null for a gateway. |
display_name必填 | string | null | |
registered_by必填 | string | null | Who registered it (null before #201, or when the platform provisioned it). |
registered_at必填 | number | null | Unix seconds; null for an older gateway. |
approval必填 | "pending" | "approved" | "rejected" | |
approval_reason必填 | string | null | |
approval_at必填 | number | null | Unix seconds of the last decision. |
approval_by必填 | string | null | Who decided last: a platform admin, |
keys必填 | 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
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<DeviceApprovalItem> | |
next_cursor必填 | string | null | Pass as |
DeviceCreate
object
| 名称 | 类型 | 说明 |
|---|---|---|
device_id必填 | string | Unique across every tenant's devices and gateways. An id starting with |
profile必填 | string | The id of a device profile the server knows; any other id is refused. The profiles, each served as a file: |
site必填 | string | |
facility必填 | string | A facility code of the caller's tenant. |
display_name可选 | string | null | |
vendor_model可选 | string | null | |
serial可选 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
device_id必填 | string | |
placement必填 | DevicePlacement | null | The placement version in force at |
calibrations必填 | array<Calibration> | The calibrations not superseded, newest first, at most 1000. |
as_of必填 | number | The server time the placement in force was read at. |
DevicePage
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<Device> | |
next_cursor必填 | string | null | Pass as |
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).
| 名称 | 类型 | 说明 |
|---|---|---|
device_id必填 | string | |
version必填 | integer | 1 for the first placement, then 2, 3, ... |
mobility必填 | "fixed" | "mobile" | |
key_protection必填 | "hardware" | "software" | |
gnss必填 | boolean | |
growing_area必填 | string | null | |
lat必填 | number | null | |
lon必填 | number | null | |
accuracy_m必填 | number | null | |
fix_at必填 | number | null | |
installed_at必填 | number | null | |
installer必填 | string | null | |
photo_sha256必填 | string | null | |
depth_cm必填 | number | null | |
sensor_serial必填 | string | null | |
note必填 | string | null | |
removed_at必填 | number | null | Set on a removal version: when the device was taken out. |
recorded_by可选 | string | The CropPath platform admin who recorded it; present for platform admins only. |
recorded_at必填 | number | |
valid_until必填 | 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).
| 名称 | 类型 | 说明 |
|---|---|---|
mobility必填 | "fixed" | "mobile" |
|
key_protection必填 | "hardware" | "software" | The platform admin's statement of where the device keeps its signing key: |
gnss可选 | boolean | The device has its own GNSS receiver. Default false. |
growing_area可选 | string | Code of a growing area of the device's company; required for |
lat可选 | number | Install point latitude, WGS84. |
lon可选 | number | Install point longitude, WGS84. |
accuracy_m可选 | number | Accuracy of the install point fix in metres. |
fix_at可选 | number | When the GPS fix of the install point was taken: at most 7 days before |
installed_at可选 | 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可选 | string | Who installed it. |
photo_sha256可选 | string | SHA-256 of the installer's photo of the installed device (JPEG or PNG). |
depth_cm可选 | number | Probe depth in centimetres. |
sensor_serial可选 | string | Probe serial number. |
note可选 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
removed_at必填 | 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可选 | string | Why it was taken out. |
DevicePlacements
object
SENS-A2 (#225): a device's placement versions, newest first (at most 1000).
| 名称 | 类型 | 说明 |
|---|---|---|
device_id必填 | string | |
registered_before_placements必填 | 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必填 | array<DevicePlacement> |
DeviceRejection
object
| 名称 | 类型 | 说明 |
|---|---|---|
reason必填 | string | Shown to the company. |
DeviceUpdate
object
| 名称 | 类型 | 说明 |
|---|---|---|
status可选 | "active" | "inactive" | |
display_name可选 | string | null | |
vendor_model可选 | string | null | |
serial可选 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
@context必填 | array<string> | |
id必填 | string | |
verificationMethod必填 | array<object> | |
assertionMethod必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
start_days必填 | integer | |
end_days必填 | integer | |
from_date必填 | string (date) | |
to_date必填 | string (date) | |
band必填 | "ambient" | "10-13C" | "14-18C" | Storage temperature band of the lot. |
warning必填 | "immature" | "eat_soon" | "overripe" | null |
EatingWindowRow
object
| 名称 | 类型 | 说明 |
|---|---|---|
level必填 | integer | |
min_days必填 | integer | |
max_days必填 | integer | |
band必填 | "ambient" | "10-13C" | "14-18C" | |
start_days必填 | integer | |
end_days必填 | integer | |
warning必填 | "immature" | "eat_soon" | "overripe" | null |
EmailSettings
object
| 名称 | 类型 | 说明 |
|---|---|---|
notifications必填 | 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必填 | "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必填 | 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
| 名称 | 类型 | 说明 |
|---|---|---|
notifications必填 | boolean | |
language可选 | "vi" | "en" | "zh-Hans" | null | Omitted or null: not known. |
EmailUnsubscribe
object
| 名称 | 类型 | 说明 |
|---|---|---|
token必填 | string | The token of the email's link ( |
EmailUnsubscribed
object
| 名称 | 类型 | 说明 |
|---|---|---|
notifications必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | string | Envelope id. |
device_id必填 | string | |
site必填 | string | Site of the ingest route. |
facility必填 | string | null | The envelope context's facility, null when it names none. |
seq必填 | integer | The device's sequence number. |
kind必填 | "telemetry" | "event" | "status" | |
event_type必填 | string | null | Event type; null for telemetry and status. |
event_time必填 | string | The device's time, as sent. |
received_at必填 | number | Server receive time, epoch seconds. |
status必填 | "accepted" | "quarantined" | "rejected_after_review" | |
reasons必填 | array<string> | Why ingest quarantined it; empty when accepted on arrival. |
lot必填 | string | null | The envelope context's lot. |
growing_area必填 | string | null | The envelope context's growing area. |
payload必填 | object | The signed envelope exactly as stored (spec envelope v1). |
signature必填 | object |
|
EnvelopePage
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<EnvelopeSummary> | |
next_cursor必填 | string | null | Pass as |
EnvelopeSummary
object
One stored envelope of the device message log (#117): routing and outcome columns only.
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | string | Envelope id. |
device_id必填 | string | |
site必填 | string | Site of the ingest route. |
facility必填 | string | null | The envelope context's facility, null when it names none. |
seq必填 | integer | The device's sequence number. |
kind必填 | "telemetry" | "event" | "status" | |
event_type必填 | string | null | Event type; null for telemetry and status. |
event_time必填 | string | The device's time, as sent. |
received_at必填 | number | Server receive time, epoch seconds. |
status必填 | "accepted" | "quarantined" | "rejected_after_review" | |
reasons必填 | array<string> | Why ingest quarantined it; empty when accepted on arrival. |
lot必填 | string | null | The envelope context's lot. |
EpcisCaptureReport
object
The outcome of one capture, one result per event in document order.
| 名称 | 类型 | 说明 |
|---|---|---|
capture_id必填 | integer | The capture's id (the audit row's entity id). |
events必填 | integer | Events in the document. |
accepted必填 | integer | Events stored by this capture. |
duplicates必填 | integer | Events already held with the same content. |
rejected必填 | integer | Events refused (nothing written for them). |
source必填 | "partner_capture" | Provenance of captured events. |
tier必填 | "self_declared" | Trust tier of captured events (ADR 0001): always Self-declared. |
results必填 | array<EpcisCaptureResult> |
EpcisCaptureResult
object
One event's outcome. step and references only when accepted; code (and usually detail) only when rejected.
| 名称 | 类型 | 说明 |
|---|---|---|
index必填 | integer | The event's position in eventList. |
event_id必填 | string | null | The event's eventID; null when it sent none usable. |
status必填 | "accepted" | "duplicate" | "rejected" | |
step可选 | "harvest" | "receive" | "pack" | "ship" | "observe" | The journey step the event records: commissioning is the harvest, receiving, packing, shipping; sensor_reporting (#238) is an observation ( |
references可选 | array<object> | The tenant's records the event names. |
code可选 | "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可选 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
error必填 | string | |
code必填 | string | |
items可选 | array<BatchItemError> | A batch request (#170) only: the items that failed, by index. Every invalid item on a 400 |
details可选 | array<AddressToCode> | A seal refused with |
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).
| 名称 | 类型 | 说明 |
|---|---|---|
lot必填 | string | |
market必填 | string | |
lot_status必填 | string | |
template_version必填 | integer | |
template必填 | ExportLabelTemplate | |
fields必填 | object | |
pallet必填 | object | The selected cartons' totals (the pallet label) and the lot's public URL. |
cartons必填 | array<ExportLabelCarton> | |
problems必填 | 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必填 | boolean | |
next_cursor必填 | string | null |
ExportLabelCarton
object
| 名称 | 类型 | 说明 |
|---|---|---|
code必填 | string | |
carton_no必填 | integer | |
net_mass_kg必填 | number | null | |
fruit_count必填 | integer | |
qr_url必填 | string (uri) | The carton's public URL: a GS1 Digital Link with the lot's GTIN, else |
label_code可选 | string | #288, with |
ExportLabelCodeField
object
The orchard (growing area, PUC code) or the packing house (facility, PHC code).
| 名称 | 类型 | 说明 |
|---|---|---|
name必填 | string | null | |
code必填 | string | null | The registration code, only when cross-checked; null otherwise (never printed unchecked). |
check必填 | "matched" | "no_code" | "no_list" | "not_found" | "mismatch" | "suspended" | "revoked" | "expired" | The code against the published code lists (#150): |
cross_checked必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
zh必填 | string | |
en必填 | string | |
required必填 | boolean |
ExportLabelPrint
object
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
lot必填 | string | |
market必填 | string | |
kind必填 | "carton" | "pallet" | |
from必填 | integer | |
to必填 | integer | |
cartons必填 | integer | |
template_version必填 | integer | |
printed_by必填 | string | |
printed_at必填 | number |
ExportLabelPrintCreate
object
| 名称 | 类型 | 说明 |
|---|---|---|
market必填 | string | |
kind必填 | "carton" | "pallet" | |
from可选 | integer | |
to可选 | integer | |
template_version必填 | 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必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
mark必填 | ExportLabelText | |
export_country必填 | ExportLabelText | |
products必填 | map<string, ExportLabelText> | The fruit name per lot product ( |
fields必填 | object | |
require_cross_checked_codes必填 | 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必填 | string |
ExportLabelTemplateList
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<ExportLabelTemplateView> |
ExportLabelTemplateView
object
A market's template in force: version 0 is the built-in default (no edit yet).
| 名称 | 类型 | 说明 |
|---|---|---|
market必填 | string | |
version必填 | integer | |
template必填 | ExportLabelTemplate | |
updated_at必填 | number | null | |
updated_by必填 | string | null |
ExportLabelText
object
A text of the label in Chinese (zh) and English (en).
| 名称 | 类型 | 说明 |
|---|---|---|
zh必填 | string | |
en必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
code必填 | string | |
tenant必填 | string | |
name必填 | string | |
address必填 | string | null | |
province必填 | string | null | |
district必填 | string | null | |
gacc_phc_code必填 | string | null | GACC registration of the packing house. |
lines必填 | array<string> | |
source必填 | "manual" | "backfill" | |
approved_at必填 | number | null | Unix seconds; null until approved. |
slug必填 | string | |
created_at必填 | number | Unix seconds. |
updated_at必填 | number | Unix seconds. |
proposed_at必填 | 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可选 | string | null | The commune's official name (xã, phường or đặc khu) when the record is coded; else null. Only with |
province_code可选 | string | null | The province's official 2-digit code, in the list |
commune_code可选 | string | null | The commune's official 5-digit code, in the list |
admin_units_version可选 | string | null | The version of the official list the codes were taken from (for example |
address_before_reform可选 | 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 |
address_status可选 | "coded" | "choose_commune" | "needs_commune" | "outside_vietnam" | null |
|
address_candidates可选 | array<string> | null | For |
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).
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
facility必填 | string | |
scheme必填 | "ISO 22000" | "FSSC 22000" | "BRCGS" | "IFS" | The packing-house certification scheme, compared exactly. |
number必填 | string | The certificate number. |
issuer必填 | string | The certifier (certification body) that issued the certificate. |
valid_from必填 | string (date) | The first valid day. |
valid_to必填 | string (date) | The last valid day, not before valid_from. |
evidence_sha256必填 | string | The SHA-256 of the certificate document, a company upload (GET /v1/attachments/{sha256} for the facility's readers; never public). |
created_at必填 | number | When it was recorded (Unix seconds). |
ended_on必填 | 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必填 | string | null | Why it was ended; null while not. |
ended_at必填 | number | null | When it was ended (Unix seconds); null while not. |
status必填 | "valid" | "expired" | "not_yet_valid" | "ended" | On today's date in Viet Nam: |
FacilityCertificationCreate
object
#269: a packing-house certification to record on a facility.
| 名称 | 类型 | 说明 |
|---|---|---|
scheme必填 | "ISO 22000" | "FSSC 22000" | "BRCGS" | "IFS" | The packing-house certification scheme, compared exactly. |
number必填 | string | The certificate number. |
issuer必填 | string | The certifier. |
valid_from必填 | string (date) | |
valid_to必填 | string (date) | Not before valid_from. |
evidence_sha256必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
ended_on必填 | string (date) | The day it stopped being in force, from valid_from to valid_to. |
reason必填 | string | Why it was ended. |
FacilityCertificationList
object
#269: every certification of a facility (at most 100), newest valid_from first.
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<FacilityCertification> |
FacilityCreate
object
| 名称 | 类型 | 说明 |
|---|---|---|
code必填 | string | |
name必填 | string | |
address可选 | string | null | |
province可选 | string | null | Deprecated (#273), sunset 1 May 2027: the province as free text. Send |
district可选 | string | null | Deprecated (#273), sunset 1 May 2027: Viet Nam has had no district level since 1 July 2025. Send |
province_code可选 | 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 ( |
commune_code可选 | string | null | #273: the commune (xã, phường or đặc khu) by its official 5-digit code in the administrative units list in force ( |
gacc_phc_code可选 | string | null | |
lines可选 | array<string> | |
slug可选 | string |
FacilityGln
object
#161: a facility's GLN (EPCIS read point and business location of its events).
| 名称 | 类型 | 说明 |
|---|---|---|
facility必填 | string | |
gln必填 | string | null | GS1 Global Location Number: 13 digits, the last the GS1 mod-10 check digit; null when none. |
FacilityPage
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<Facility> | |
next_cursor必填 | string | null | Pass as |
FacilityProposal
object
SELF-2-8 (#197): a company's facility proposal waiting for CropPath, in the platform's queue.
| 名称 | 类型 | 说明 |
|---|---|---|
code必填 | string | |
tenant必填 | string | |
tenant_name必填 | string | The proposing company's name. |
name必填 | string | |
address必填 | string | null | |
province必填 | string | null | |
district必填 | string | null | |
lines必填 | array<string> | |
slug必填 | string | The default slug of the code; the approval may set another. |
proposed_at必填 | number | Unix seconds. |
proposed_by必填 | 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).
| 名称 | 类型 | 说明 |
|---|---|---|
slug可选 | string | |
gacc_phc_code可选 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
code必填 | string | |
name必填 | string | |
address可选 | string | null | |
province可选 | string | null | Deprecated (#273), sunset 1 May 2027: the province as free text. Send |
district可选 | string | null | Deprecated (#273), sunset 1 May 2027: Viet Nam has had no district level since 1 July 2025. Send |
province_code可选 | 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 ( |
commune_code可选 | string | null | #273: the commune (xã, phường or đặc khu) by its official 5-digit code in the administrative units list in force ( |
lines可选 | array<string> |
FacilityProposalPage
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<FacilityProposal> | |
next_cursor必填 | string | null |
FacilityProposalRejected
object
SELF-2-8 (#197): the proposal CropPath rejected (it is deleted, so its code is free again).
| 名称 | 类型 | 说明 |
|---|---|---|
code必填 | string | |
tenant必填 | string | |
name必填 | string | |
reason必填 | string |
FacilityProposalRejection
object
| 名称 | 类型 | 说明 |
|---|---|---|
reason必填 | string | Shown to the company in its activity log. |
FacilityUpdate
object
gacc_phc_code and slug: platform_admin only.
| 名称 | 类型 | 说明 |
|---|---|---|
name可选 | string | |
address可选 | string | null | |
province可选 | string | null | Deprecated (#273), sunset 1 May 2027: the province as free text. Send |
district可选 | string | null | Deprecated (#273), sunset 1 May 2027: Viet Nam has had no district level since 1 July 2025. Send |
province_code可选 | 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 ( |
commune_code可选 | string | null | #273: the commune (xã, phường or đặc khu) by its official 5-digit code in the administrative units list in force ( |
gacc_phc_code可选 | string | null | |
lines可选 | array<string> | |
slug可选 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
require_second_admin必填 | boolean | |
admins必填 | integer | Active company admins (active membership and account). |
pending必填 | integer | Requests waiting for a decision (not expired). |
expires_after_s必填 | integer | Seconds a request may wait (72 hours). |
FourEyesUpdate
object
| 名称 | 类型 | 说明 |
|---|---|---|
require_second_admin必填 | boolean |
Fruit
object
A fruit record: identity, label fields and the measurements bound to it (L3).
| 名称 | 类型 | 说明 |
|---|---|---|
tenant必填 | string | |
code必填 | string | Fruit code |
n必填 | integer | Position of the fruit in its lot: 1, 2, ... without gaps. |
public_id必填 | string | 128 random bits (hex); the public handle of the fruit, never derived from code or n. |
lot必填 | string | Lot code. |
session必填 | string | Measurement session id. |
line必填 | string | The session's line. |
operator必填 | string | null | Opaque operator id |
status必填 | "awaiting_device" | "recorded" | "overridden" | "rejected" | "remeasured" | Fruit record state; allocation starts at awaiting_device. |
labels_printed_at必填 | number | null | Unix seconds the label was printed (allocation). |
created_at必填 | number | Unix seconds. |
updated_at必填 | number | Unix seconds. |
qr_url必填 | string (uri) | The QR content: a GS1 Digital Link |
level必填 | 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必填 | integer | null | The level the knocker sent ( |
maturity_class必填 | "immature" | "mature" | "overripe" | "defect" | "unknown" | null | The knocker's |
confidence必填 | number | null | Model confidence 0-1. |
model必填 | string | null | Model version that made the prediction. |
measured_at必填 | number | null | Unix seconds of the knock (device event time). |
weight_kg必填 | number | null | Net mass from the bound scale reading. |
level_sensory必填 | integer | null | The operator's sensory override (keys 1-4), if bound. |
override必填 | boolean | A sensory override is bound. |
pending_review必填 | boolean | Overlay: a bound envelope is quarantined and waits for review. |
grade必填 | "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必填 | EatingWindow | null | |
record_tier必填 | "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必填 | string | null | The bound knock envelope. |
scale_envelope_id必填 | string | null | The bound scale envelope. |
override_envelope_id必填 | 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).
| 名称 | 类型 | 说明 |
|---|---|---|
device_id必填 | string | |
command_id必填 | string | null | |
status必填 | "pending" | "sent" | "failed" | "refused" | "skipped" | |
reason必填 | "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).
| 名称 | 类型 | 说明 |
|---|---|---|
type必填 | "accept" | "remeasure" | "reject" | "override" | |
level可选 | integer | The sensory ripeness level (keys 1-4); required for override, refused otherwise. |
reason可选 | 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 ( |
idempotency_key必填 | string | Client-chosen key, unique per tenant (a UUID fits). |
client_ts必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
action必填 | object | |
fruit必填 | Fruit | |
accepted_at必填 | number | null | Unix seconds the fruit was first accepted into the lot (this round); null again once the bound measurement changes. |
measurement_round必填 | integer | Re-measures so far: 0 for the first measurement. |
commands必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
tenant必填 | string | |
code必填 | string | Fruit code |
n必填 | integer | Position of the fruit in its lot: 1, 2, ... without gaps. |
public_id必填 | string | 128 random bits (hex); the public handle of the fruit, never derived from code or n. |
lot必填 | string | Lot code. |
session必填 | string | Measurement session id. |
line必填 | string | The session's line. |
operator必填 | string | null | Opaque operator id |
status必填 | "awaiting_device" | "recorded" | "overridden" | "rejected" | "remeasured" | Fruit record state; allocation starts at awaiting_device. |
labels_printed_at必填 | number | null | Unix seconds the label was printed (allocation). |
created_at必填 | number | Unix seconds. |
updated_at必填 | number | Unix seconds. |
qr_url必填 | string (uri) | The QR content: a GS1 Digital Link |
label必填 | FruitLabel | |
commands必填 | array<SessionCommand> | The set_session outcome per device of the session. |
level必填 | 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必填 | integer | null | The level the knocker sent ( |
maturity_class必填 | "immature" | "mature" | "overripe" | "defect" | "unknown" | null | The knocker's |
confidence必填 | number | null | Model confidence 0-1. |
model必填 | string | null | Model version that made the prediction. |
measured_at必填 | number | null | Unix seconds of the knock (device event time). |
weight_kg必填 | number | null | Net mass from the bound scale reading. |
level_sensory必填 | integer | null | The operator's sensory override (keys 1-4), if bound. |
override必填 | boolean | A sensory override is bound. |
pending_review必填 | boolean | Overlay: a bound envelope is quarantined and waits for review. |
grade必填 | "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必填 | EatingWindow | null | |
record_tier必填 | "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必填 | string | null | The bound knock envelope. |
scale_envelope_id必填 | string | null | The bound scale envelope. |
override_envelope_id必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
tenant必填 | string | |
code必填 | string | Fruit code |
n必填 | integer | Position of the fruit in its lot: 1, 2, ... without gaps. |
public_id必填 | string | 128 random bits (hex); the public handle of the fruit, never derived from code or n. |
lot必填 | string | Lot code. |
session必填 | string | Measurement session id. |
line必填 | string | The session's line. |
operator必填 | string | null | Opaque operator id |
status必填 | "awaiting_device" | "recorded" | "overridden" | "rejected" | "remeasured" | Fruit record state; allocation starts at awaiting_device. |
labels_printed_at必填 | number | null | Unix seconds the label was printed (allocation). |
created_at必填 | number | Unix seconds. |
updated_at必填 | number | Unix seconds. |
qr_url必填 | string (uri) | The QR content: a GS1 Digital Link |
label必填 | FruitLabel | |
level必填 | 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必填 | integer | null | The level the knocker sent ( |
maturity_class必填 | "immature" | "mature" | "overripe" | "defect" | "unknown" | null | The knocker's |
confidence必填 | number | null | Model confidence 0-1. |
model必填 | string | null | Model version that made the prediction. |
measured_at必填 | number | null | Unix seconds of the knock (device event time). |
weight_kg必填 | number | null | Net mass from the bound scale reading. |
level_sensory必填 | integer | null | The operator's sensory override (keys 1-4), if bound. |
override必填 | boolean | A sensory override is bound. |
pending_review必填 | boolean | Overlay: a bound envelope is quarantined and waits for review. |
grade必填 | "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必填 | EatingWindow | null | |
record_tier必填 | "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必填 | string | null | The bound knock envelope. |
scale_envelope_id必填 | string | null | The bound scale envelope. |
override_envelope_id必填 | string | null | The bound sensory-override envelope. |
FruitBatchResult
object
The fruits a batch allocated, by n.
| 名称 | 类型 | 说明 |
|---|---|---|
batch_id必填 | integer | The stored batch request's id. |
count必填 | integer | |
items必填 | array<FruitBatchItem> | In request order. |
FruitLabel
object
What the label printer prints for the fruit.
| 名称 | 类型 | 说明 |
|---|---|---|
code必填 | string | |
lot必填 | string | |
n必填 | integer | |
line必填 | string | |
operator必填 | string | null | |
printed_at必填 | number | null | Unix seconds. |
qr_url必填 | string (uri) | |
label_code可选 | string | #326, in the fruit batch's answer with |
FruitPage
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<Fruit> | |
next_cursor必填 | string | null | Pass as |
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.
| 名称 | 类型 | 说明 |
|---|---|---|
traceability_lot_code必填 | 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必填 | "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必填 | 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必填 | string | The event's time with its offset, whole seconds, hh:mm:ss+hh:mm (the same offset as event_date). |
location必填 | 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必填 | 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必填 | 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必填 | string | The growing area code: the device event's, or the lot's for a departure or a merge; empty without one. |
parcel必填 | string | The parcel the device event names; empty otherwise. |
producer必填 | string | The producer the device event names; empty otherwise. |
device_id必填 | string | The id of the device that signed the event; empty on a row the platform recorded (a departure, a merge). |
event_id必填 | 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必填 | string | The lot's product (for example durian); empty when the lot code is not one of the company's lots. |
variety必填 | string | The lot's variety (for example Ri6); empty without one. |
field_name必填 | 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必填 | 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必填 | 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必填 | 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必填 | 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必填 | string | That location's GS1 GLN (#161); empty without one. |
recipient_location_name必填 | 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必填 | 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必填 | string | That location's GS1 GLN: the consignee's (#153) or the facility's (#161); empty without one. |
reference_document_type必填 | 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必填 | string | The numbers of those documents, in the same order, separated by "; ". |
container必填 | string | The ISO 6346 container number of the departed shipment; empty otherwise. |
input_traceability_lot_code必填 | string | Transformation row: the code of the lot the merge used (one row per lot used); empty on other rows. |
input_quantity必填 | number | "" | Transformation row: the kilograms the merge took from that lot (unit_of_measure kg); empty on other rows. |
Gateway
object
| 名称 | 类型 | 说明 |
|---|---|---|
gateway_id必填 | string | |
tenant必填 | string | |
site必填 | string | |
facility必填 | string | null | |
display_name必填 | string | null | |
status必填 | string | |
approval必填 | "pending" | "approved" | "rejected" | Platform approval (#201): |
approval_reason必填 | string | null | The reason of a rejection; null otherwise. |
approval_at必填 | number | null | Unix seconds of the last approval decision. |
GatewayCreate
object
| 名称 | 类型 | 说明 |
|---|---|---|
gateway_id必填 | string | Unique across every tenant's gateways and devices. An id starting with |
site必填 | string | |
facility可选 | string | null | A facility code of the caller's tenant. |
display_name可选 | string | null |
GatewayHeartbeat
object
| 名称 | 类型 | 说明 |
|---|---|---|
received_at必填 | number | Unix seconds when the server received it. |
time必填 | string | The gateway's own time of the heartbeat (ISO 8601 with its UTC offset). |
seq必填 | integer | The gateway's sequence number of the heartbeat. |
signed必填 | boolean | Signed with one of the gateway's own keys (false only where the server accepts unsigned envelopes). |
outbox_depth必填 | integer | null |
|
dead_letter_count必填 | integer | null |
|
link必填 | GatewayLink | null |
|
peripherals_ready必填 | array<GatewayPeripheral> | null |
|
GatewayHeartbeatStatus
object
| 名称 | 类型 | 说明 |
|---|---|---|
gateway_id必填 | string | |
heartbeat必填 | GatewayHeartbeat | null | The newest heartbeat; null until the gateway sent one. |
GatewayLink
object
| 名称 | 类型 | 说明 |
|---|---|---|
state必填 | "connected" | "disconnected" | "unknown" | |
last_error可选 | string | The text of the gateway's last uplink error. |
GatewayPage
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<Gateway> | |
next_cursor必填 | string | null | Pass as |
GatewayPeripheral
object
| 名称 | 类型 | 说明 |
|---|---|---|
device必填 | string | |
ready必填 | boolean |
GatewayStatusBucket
object
An hourly rollup, or a day's hourly rollups merged.
| 名称 | 类型 | 说明 |
|---|---|---|
bucket_start必填 | number | Start of the UTC hour or day, Unix seconds. |
samples必填 | integer | |
outbox_depth必填 | GatewayStatusStat | |
dead_letter_count必填 | GatewayStatusStat | |
peripherals_ready必填 | GatewayStatusStat | The devices the gateway listed as ready. |
peripherals_total必填 | GatewayStatusStat | The devices the gateway listed. |
link必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
minute必填 | number | Start of the UTC minute of reception, Unix seconds. |
received_at必填 | number | When the server received it, Unix seconds. |
time必填 | string | The gateway's own time of the heartbeat. |
seq必填 | integer | |
signed必填 | boolean | |
outbox_depth必填 | integer | null | |
dead_letter_count必填 | integer | null | |
link_state必填 | "connected" | "disconnected" | "unknown" | null | |
peripherals_ready必填 | integer | null | The devices listed as ready. |
peripherals_total必填 | integer | null | The devices listed. |
GatewayStatusSeries
object
#128: a gateway's status series: samples (grain minute) or rollups (hourly, daily), oldest first.
| 名称 | 类型 | 说明 |
|---|---|---|
gateway_id必填 | string | |
grain必填 | "minute" | "hourly" | "daily" | |
bucket_s必填 | number | Bucket width in seconds: 60, 3600 or 86400. |
from必填 | number | Start of the range read, Unix seconds: aligned down to the grain and clipped to what is kept. |
to必填 | number | End of the range (excluded), Unix seconds. |
items必填 | array<GatewayStatusSample | GatewayStatusBucket> | Samples for grain minute, rollups otherwise. |
GatewayStatusStat
object
One value over a bucket's samples that carried it.
| 名称 | 类型 | 说明 |
|---|---|---|
min必填 | integer | null | |
max必填 | integer | null | |
mean必填 | number | null | Null when no sample carried the value. |
count必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
type必填 | "Polygon" | "MultiPolygon" | |
coordinates必填 | 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
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | Server id (the audit entity id). |
tenant必填 | string | |
variety必填 | string | The lot variety these rules apply to. |
rules必填 | GradingRules | |
updated_at必填 | number | Unix seconds. |
updated_by必填 | string | The principal that last wrote them. |
GradingRuleHistory
object
| 名称 | 类型 | 说明 |
|---|---|---|
variety必填 | string | |
items必填 | array<GradingRuleVersion> | |
next_cursor必填 | string | null | The next page's |
GradingRulePage
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<GradingRule> | |
next_cursor必填 | string | null | Pass as |
platform_default必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
a_levels必填 | array<integer> | |
reject_levels必填 | array<integer> | |
a_weight_kg必填 | array<array<number>> | [min, max] kg bands, 0 < min < max <= 100, strictly non-overlapping. |
a_min_confidence必填 | number | |
eating_window必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
version必填 | integer | |
rules必填 | GradingRules | |
updated_at必填 | number | Unix seconds. |
updated_by必填 | string | Who wrote this version. |
Grower
object
A grower (personal data) of one tenant, as the caller may see it.
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
tenant必填 | string | |
name可选 | string | Present only for the owning tenant_admin and platform_admin, or for other readers when public_consent is on. |
display_name必填 | string | The name with public consent, otherwise |
cooperative必填 | string | null | |
public_consent必填 | boolean | Explicit consent to show the grower's name publicly. |
consent_at必填 | number | null | Unix seconds consent was given; null without consent. |
consent_date必填 | 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必填 | 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必填 | number | Unix seconds. |
updated_at必填 | number | Unix seconds. |
GrowerBatch
object
Up to 1,000 growers.
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<GrowerCreate> |
GrowerBatchResult
object
The growers a batch created, in request order.
| 名称 | 类型 | 说明 |
|---|---|---|
batch_id必填 | integer | The stored batch request's id. |
count必填 | integer | |
items必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
grower_id必填 | integer | |
purpose必填 | "public_name" | "orchard_position" |
|
market必填 | string | null | ISO 3166-1 alpha-2 market the decision is for; null: every market. |
decision必填 | "granted" | "withdrawn" | |
channel必填 | "paper" | "electronic" | "in_person" | "record_edit" | "migrated" | "data_request" | How the decision reached the company: a signed |
evidence_sha256必填 | string | null | SHA-256 of the evidence (the scanned form or the message), or null. |
consent_date必填 | string (date) | null (date) | The day on the form (YYYY-MM-DD), or null. |
scope必填 | string | null | What the decision covers (staff-only text), or null. |
request_id必填 | integer | null | The grower data request handled with this withdrawal ( |
recorded_at必填 | number | Seconds since 1970 (UTC). |
recorded_by必填 | string | Who recorded it: an opaque operator id ( |
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.
| 名称 | 类型 | 说明 |
|---|---|---|
purpose必填 | "public_name" | "orchard_position" |
|
market可选 | string | null | ISO 3166-1 alpha-2 market the decision is for; null: every market. |
decision必填 | "granted" | "withdrawn" | |
channel必填 | "paper" | "electronic" | "in_person" | |
evidence_sha256可选 | string | null | SHA-256 of the evidence (64 lowercase hex digits); required for a grant. |
consent_date可选 | string (date) | null (date) | The day on the form (YYYY-MM-DD), from 2000-01-01, not after today. |
scope可选 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
grower_id必填 | integer | |
in_force必填 | array<object> | Every (purpose, market) whose latest decision is a grant. The public fruit page names the grower with |
items必填 | array<GrowerConsent> | |
next_cursor必填 | string | null | The next page's |
GrowerCreate
object
| 名称 | 类型 | 说明 |
|---|---|---|
name必填 | string | |
cooperative可选 | string | null | |
public_consent可选 | boolean | |
consent_date可选 | 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可选 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
grower必填 | object | |
kind必填 | "access" | "rectification" | "erasure" | "objection" | |
channel必填 | "paper" | "electronic" | "in_person" | |
text必填 | string | The grower's request as received: plain text, never HTML or markdown. |
received_on必填 | string (date) | |
due_on必填 | string (date) | The day the answer is due: 30 days after |
overdue必填 | boolean | Open and past |
status必填 | "open" | "handled" | |
created_at必填 | number | Seconds since 1970 (UTC). |
created_by必填 | string | Who entered it: an opaque operator id, never an email. |
handled_at必填 | number | null | |
handled_by必填 | string | null | An opaque operator id, or null. |
answer必填 | string | null | The answer given to the grower (plain text), or null while open. |
withdrawn必填 | array<object> | null | The consents withdrawn when the request was handled (empty: none), or null while open. |
GrowerDataRequestCreate
object
| 名称 | 类型 | 说明 |
|---|---|---|
grower_id必填 | integer | |
kind必填 | "access" | "rectification" | "erasure" | "objection" | |
channel必填 | "paper" | "electronic" | "in_person" | |
received_on必填 | string (date) | The day the company received it (YYYY-MM-DD), from 2000-01-01, not after today. |
text必填 | string | 1 to 2000 characters after trimming; line breaks and tabs allowed, no other control characters. Stored and shown as plain text. |
GrowerDataRequestHandle
object
| 名称 | 类型 | 说明 |
|---|---|---|
answer必填 | string | The answer given to the grower, as plain text (1 to 2000 characters after trimming). |
withdraw_public可选 | boolean | Erasure or objection only: also withdraw every consent in force (each recorded as a |
GrowerDataRequestPage
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<GrowerDataRequest> | |
next_cursor必填 | string | null | The next page's |
GrowerPage
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<Grower> | |
next_cursor必填 | string | null | Pass as |
GrowerUpdate
object
| 名称 | 类型 | 说明 |
|---|---|---|
name可选 | string | |
cooperative可选 | string | null | |
public_consent可选 | boolean | |
consent_date可选 | 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可选 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
code必填 | string | |
tenant必填 | 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必填 | string | null | |
crop必填 | string | null | |
variety必填 | string | null | |
province必填 | string | null | |
district必填 | string | null | |
commune必填 | string | null | |
area_ha必填 | number | |
yield_kg_per_ha必填 | number | |
trees必填 | integer | null | |
planted_year必填 | integer | null | |
grower_id必填 | integer | null | |
gacc_puc_code必填 | string | null | GACC registration of the production unit. |
source必填 | "seed" | "manual" | |
approved_at必填 | number | null | Unix seconds; null until a platform admin approves. |
created_at必填 | number | null | Unix seconds; null for a seeded (legacy) area. |
updated_at必填 | number | null | Unix seconds; null for a seeded (legacy) area. |
registry_changed_at必填 | 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必填 | 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必填 | 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必填 | Grower | null | |
polygon可选 | GeoJsonPolygon | null | Present only for the owning tenant_admin and platform_admin. |
province_code可选 | string | null | The province's official 2-digit code, in the list |
commune_code可选 | string | null | The commune's official 5-digit code, in the list |
admin_units_version可选 | string | null | The version of the official list the codes were taken from (for example |
address_before_reform可选 | 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 |
address_status可选 | "coded" | "choose_commune" | "needs_commune" | "outside_vietnam" | null |
|
address_candidates可选 | array<string> | null | For |
GrowingAreaCreate
object
| 名称 | 类型 | 说明 |
|---|---|---|
code必填 | string | |
area_ha必填 | number | |
yield_kg_per_ha必填 | number | |
gacc_puc_code可选 | string | null | |
name可选 | string | null | |
crop可选 | string | null | |
variety可选 | string | null | |
province可选 | string | null | Deprecated (#273), sunset 1 May 2027: the province as free text. Send |
district可选 | string | null | Deprecated (#273), sunset 1 May 2027: Viet Nam has had no district level since 1 July 2025. Send |
commune可选 | string | null | Deprecated (#273), sunset 1 May 2027: the commune as free text. Send |
province_code可选 | 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 ( |
commune_code可选 | string | null | #273: the commune (xã, phường or đặc khu) by its official 5-digit code in the administrative units list in force ( |
polygon可选 | GeoJsonPolygon | null | |
trees可选 | integer | null | |
planted_year可选 | integer | null | |
grower_id可选 | 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).
| 名称 | 类型 | 说明 |
|---|---|---|
growing_area必填 | string | |
gln必填 | string | null | GS1 Global Location Number: 13 digits, the last the GS1 mod-10 check digit; null when none. |
GrowingAreaPage
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<GrowingArea> | |
next_cursor必填 | string | null | Pass as |
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.
| 名称 | 类型 | 说明 |
|---|---|---|
name可选 | string | null | |
crop可选 | string | null | |
variety可选 | string | null | |
province可选 | string | null | Deprecated (#273), sunset 1 May 2027: the province as free text. Send |
district可选 | string | null | Deprecated (#273), sunset 1 May 2027: Viet Nam has had no district level since 1 July 2025. Send |
commune可选 | string | null | Deprecated (#273), sunset 1 May 2027: the commune as free text. Send |
province_code可选 | 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 ( |
commune_code可选 | string | null | #273: the commune (xã, phường or đặc khu) by its official 5-digit code in the administrative units list in force ( |
polygon可选 | GeoJsonPolygon | null | |
trees可选 | integer | null | |
planted_year可选 | integer | null | |
grower_id可选 | integer | null | A grower of the area's owning tenant. |
area_ha可选 | number | |
yield_kg_per_ha可选 | number | |
gacc_puc_code可选 | string | null | |
tenant可选 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
growing_area必填 | string | |
season必填 | string | |
declared_kg必填 | number | |
cap_kg必填 | 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必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<HarvestBatchItem> |
HarvestBatchItem
object
One declaration; an area and date at most once per batch.
| 名称 | 类型 | 说明 |
|---|---|---|
growing_area必填 | string | Code of a growing area the caller may write. |
harvest_date必填 | string (date) | The harvest date; not later than today. |
kg必填 | number | Mass harvested on that date. |
HarvestBatchResult
object
The declarations a batch stored, in request order.
| 名称 | 类型 | 说明 |
|---|---|---|
batch_id必填 | integer | The stored batch request's id. |
count必填 | integer | |
items必填 | array<HarvestDeclaration> | In request order. |
HarvestDeclaration
object
A tenant-entered harvest of a growing area on one date (Self-declared).
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
growing_area必填 | string | |
harvest_date必填 | string (date) | |
season必填 | string | The ingest policy's season of the harvest date. |
kg必填 | number | |
source必填 | "self_declared" | |
declared_by必填 | string | The user who declared it. |
declared_at必填 | number | Unix time of the declaration. |
HarvestDeclarationCreate
object
| 名称 | 类型 | 说明 |
|---|---|---|
harvest_date必填 | string (date) | The harvest date; not later than today. |
kg必填 | number | Mass harvested on that date. |
HarvestDeclarationPage
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<HarvestDeclaration> | |
next_cursor必填 | string | null | Pass as |
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.
| 名称 | 类型 | 说明 |
|---|---|---|
kid必填 | string | |
device_id必填 | string | |
tenant必填 | string | |
facility必填 | string | The collection point the install records for. |
label必填 | string | A name people recognise the install by. |
status必填 | "pending" | "approved" | "rejected" | "revoked" |
|
fingerprint_sha256必填 | string | |
fingerprint必填 | string | First four and last four hex characters. |
requested_by必填 | string | |
requested_at必填 | number | Unix seconds. |
decided_by必填 | string | null | |
decided_at必填 | number | null | Unix seconds. |
revoked_at必填 | number | null | Unix seconds; set only when |
revoke_reason必填 | "rotation" | "compromise" | null |
HarvestKeyPage
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<HarvestKey> | |
next_cursor必填 | string | null | Pass as |
HarvestKeyRegister
object
| 名称 | 类型 | 说明 |
|---|---|---|
public_key_pem必填 | string | The install's EC P-256 public key as one PEM SubjectPublicKeyInfo block. |
facility必填 | string | A facility of the caller's tenant (within an operator's facilities). |
label必填 | string |
Health
object
| 名称 | 类型 | 说明 |
|---|---|---|
ok必填 | true | |
outbound_backlog必填 | map<string, integer> | Undelivered outbound items per target. |
certificates必填 | array<CertificateStatus> | |
read_only可选 | 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 |
mqtt可选 | object | Present when the MQTT bridge runs. |
warnings可选 | 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
| 名称 | 类型 | 说明 |
|---|---|---|
status_page_url必填 | string (uri) | null (uri) | CropPath's status page (an https address), or null: hide the link. |
announcements必填 | array<LiveAnnouncement> | The announcements showing now, newest first. |
IdentityProvider
object
#87. The company's identity provider; never its client secret.
| 名称 | 类型 | 说明 |
|---|---|---|
issuer必填 | string (uri) | |
client_id必填 | string | |
enabled必填 | boolean | Whether the company's people can sign in with it now. |
created_at必填 | number | Unix seconds. |
updated_at必填 | number | Unix seconds. |
linked_accounts必填 | 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).
| 名称 | 类型 | 说明 |
|---|---|---|
available必填 | boolean | |
redirect_uri必填 | string | null | Null when the server has no public origin. |
provider必填 | IdentityProvider | null |
IdentityProviderUpdate
object
#87. The company's identity provider as registered there.
| 名称 | 类型 | 说明 |
|---|---|---|
issuer必填 | string | The provider's issuer: an https:// URL without query or fragment, on a host this deployment allows; |
client_id必填 | string | |
client_secret可选 | string | Required to set a provider up, and whenever the issuer or the client id changes (400 |
enabled可选 | boolean |
IngestResult
object
| 名称 | 类型 | 说明 |
|---|---|---|
status必填 | "accepted" | "quarantined" | "duplicate" | "rejected" | |
id必填 | string | null | Envelope id; null when the body could not be parsed far enough to read it. |
reasons必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
day必填 | string | The UTC day the records were written (YYYY-MM-DD). |
seq必填 | integer | Position in the chain: 0 for the first anchored day, then one per day without gaps. |
version必填 | 1 | The encoding version. |
prev_anchor必填 | string | The previous day's |
audit_root必填 | string | Root of the day's activity log rows. |
evidence_root必填 | string | Root of the evidence envelopes received that day (accepted, quarantined or rejected after review). |
seal_root必填 | string | Root of the lot seals made that day. |
review_root必填 | 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 |
held_root必填 | 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必填 | string | |
audit_count必填 | integer | |
evidence_count必填 | integer | |
seal_count必填 | integer | |
review_count必填 | integer | |
held_count必填 | integer | |
anchor必填 | string | |
created_at必填 | string (date-time) | When the job computed the anchor (UTC). |
timestamp必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
version必填 | 1 | |
genesis必填 | string | The |
items必填 | array<IntegrityAnchor> | |
next_after必填 | string | null | Pass as |
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.
| 名称 | 类型 | 说明 |
|---|---|---|
status必填 | "pending" | "verified" | |
gen_time必填 | string (date-time) | null (date-time) | The token's genTime (UTC); null while pending. |
token必填 | string | null | Base64 of the TimeStampToken's DER (a CMS SignedData of a TSTInfo); null while pending. Check it with |
Invitation
object
SELF-1-4 (#185). An invitation link or a password link of the company; never the link or its token.
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
purpose必填 | "invite" | "reset" | invite: an invitation to join the company; reset: a password link for a member ( |
email必填 | string | |
role必填 | "tenant_admin" | "operator" | "auditor" | "agronomist" | |
facilities必填 | array<string> | null | An operator's facility codes; null = every facility of the company (always null for another role). |
display_name必填 | string | null | |
status必填 | "pending" | "used" | "expired" | "revoked" | pending: works until |
created_by必填 | string | Who created it (an email, or |
created_at必填 | number | |
expires_at必填 | number | |
used_at必填 | number | null | |
used_by必填 | string | null | |
revoked_at必填 | number | null | |
revoked_by必填 | string | null |
InvitationCreate
object
| 名称 | 类型 | 说明 |
|---|---|---|
email必填 | string | The email the person will sign in with. |
role必填 | "tenant_admin" | "operator" | "auditor" | "agronomist" | |
facilities可选 | array<string> | null | Operators only: codes of the company's facilities; null or an empty list = every facility. |
display_name可选 | string | null |
InvitationList
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<Invitation> | |
next_cursor必填 | string | null | Pass as |
InvitationRevoked
object
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
status必填 | "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>).
| 名称 | 类型 | 说明 |
|---|---|---|
facility必填 | string | |
n必填 | integer | The key's number within the facility, never reused. |
name必填 | string | |
did必填 | string |
|
key_id必填 | string | |
alg必填 | "ES256" | |
public_jwk必填 | PublicJwk | |
status必填 | "active" | "retired" | "revoked" | active: signs. retired: replaced by a rotation, still in the DID document. revoked: compromised, removed from the DID document. |
created_by必填 | string | |
created_at必填 | number | Unix seconds. |
retired_at必填 | number | null | Unix seconds. |
revoked_at必填 | number | null | Unix seconds. |
revoke_reason必填 | "compromise" | null | |
revoked_by必填 | string | null |
IssuerKeyList
object
Every key of the facility by number (at most 100 per facility).
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<IssuerKey> |
IssuerKeyRevoke
object
| 名称 | 类型 | 说明 |
|---|---|---|
reason必填 | "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.
| 名称 | 类型 | 说明 |
|---|---|---|
lat必填 | number | |
lon必填 | number | |
acc_m必填 | number | null | The accuracy the device reported; null when it reported none. |
verdict必填 | GeofenceVerdict | |
checked_at必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
kid必填 | string | |
owner_type必填 | "device" | "gateway" | |
owner_id必填 | string | |
status必填 | string |
|
created_at必填 | number | Unix seconds. |
revoked_at必填 | number | null | Unix seconds. |
revoke_reason必填 | "rotation" | "compromise" | null | |
revoked_by必填 | string | null | |
fingerprint_sha256必填 | string | |
fingerprint必填 | string | First four and last four hex characters, e.g. |
approval必填 | "pending" | "approved" | #201: |
KeyCreate
object
| 名称 | 类型 | 说明 |
|---|---|---|
kid必填 | string | Unique across every tenant. |
owner_type必填 | "device" | "gateway" | |
owner_id必填 | string | A device or gateway of the caller's tenant. |
public_key_pem必填 | string | One |
KeyPage
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<Key> | |
next_cursor必填 | string | null | Pass as |
KeyRevoke
object
| 名称 | 类型 | 说明 |
|---|---|---|
reason必填 | "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.
| 名称 | 类型 | 说明 |
|---|---|---|
code必填 | string | |
name必填 | string | |
accreditation必填 | string | |
valid_to必填 | string (date) | Last day the accreditation is valid. |
status必填 | "active" | "suspended" | |
created_at必填 | number | Unix seconds. |
updated_at必填 | number | Unix seconds. |
in_force必填 | boolean | |
accreditation_body必填 | string | null | Accreditation body, e.g. |
accreditation_number必填 | string | null | Accreditation certificate number (#73); null when not recorded. |
accreditation_scope必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
lab必填 | string | Lab code. |
market必填 | string | Destination market, ISO 3166-1 alpha-2. |
approving_body必填 | string | |
reference必填 | string | The approval's reference as published (decision or list number). |
analytes必填 | array<string> | Analyte codes the approval covers, sorted. |
valid_from必填 | string (date) | First valid day, inclusive. |
valid_to必填 | string (date) | Last valid day, inclusive. |
source_url必填 | string | null | Where the list is published (http or https); stored and shown, never fetched. |
evidence_sha256必填 | string | null | SHA-256 of the list document kept as evidence. |
status必填 | "active" | "withdrawn" |
|
in_force必填 | boolean | Active and valid today (Asia/Ho_Chi_Minh). |
created_at必填 | number | |
created_by必填 | string | |
updated_at必填 | number | |
updated_by必填 | string |
LabApprovalCreate
object
A new approval (status active). valid_to is on or after valid_from; source_url and evidence_sha256 are optional.
| 名称 | 类型 | 说明 |
|---|---|---|
market必填 | string | Destination market, ISO 3166-1 alpha-2. |
approving_body必填 | string | |
reference必填 | string | The approval's reference as published (decision or list number). |
analytes必填 | array<string> | Analyte codes the approval covers, sorted. |
valid_from必填 | string (date) | First valid day, inclusive. |
valid_to必填 | string (date) | Last valid day, inclusive. |
source_url可选 | string | null | Where the list is published (http or https); stored and shown, never fetched. |
evidence_sha256可选 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | 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).
| 名称 | 类型 | 说明 |
|---|---|---|
approving_body可选 | string | |
reference可选 | string | The approval's reference as published (decision or list number). |
analytes可选 | array<string> | Analyte codes the approval covers, sorted. |
valid_from可选 | string (date) | First valid day, inclusive. |
valid_to可选 | string (date) | Last valid day, inclusive. |
source_url可选 | string | null | Where the list is published (http or https); stored and shown, never fetched. |
evidence_sha256可选 | string | null | SHA-256 of the list document kept as evidence. |
status可选 | "active" | "withdrawn" |
|
LabAssignment
object
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
exporter必填 | string | Name of the tenant that owns the lot. |
lot必填 | object | |
facility必填 | object | |
analytes必填 | array<SampleAnalyte> | |
sample_count必填 | integer | |
selected_at必填 | number | Unix seconds. |
samples必填 | array<SampleItem> | |
report必填 | 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).
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
exporter必填 | string | Name of the tenant that owns the lot. |
lot必填 | object | |
facility必填 | object | |
analytes必填 | array<SampleAnalyte> | |
sample_count必填 | integer | |
selected_at必填 | number | Unix seconds. |
samples必填 | array<SampleItem> | |
report必填 | LabReport | null | |
portal_key必填 | object | null |
LabAssignmentPage
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<LabAssignment> | |
next_cursor必填 | string | null | Pass as |
LabCompany
object
#278: a company a lab serves.
| 名称 | 类型 | 说明 |
|---|---|---|
lab必填 | string | The lab's code. |
tenant必填 | string | The company's id. |
name必填 | string | The company's name. |
linked_at必填 | 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).
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<LabCompany> |
LabCreate
object
| 名称 | 类型 | 说明 |
|---|---|---|
code必填 | string | |
name必填 | string | |
accreditation必填 | string | Accreditation scheme and number, e.g. |
valid_to必填 | string (date) | |
accreditation_body可选 | string | null | |
accreditation_number可选 | string | null | |
accreditation_scope可选 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
lab必填 | object | The caller's lab. |
generated_at必填 | string (date-time) | When the answer was computed (the server serves it for up to |
max_age_s必填 | integer | Seconds the server serves one answer. |
window必填 | object | |
target_hours必填 | integer | The time from the draw to the results the lab aims for; |
sections必填 | 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
| 名称 | 类型 | 说明 |
|---|---|---|
email必填 | string | The lab analyst's email: their sign-in name, not checked by any email. |
display_name可选 | 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).
| 名称 | 类型 | 说明 |
|---|---|---|
kid必填 | string | |
lab必填 | string | |
status必填 | "active" | "revoked" | |
created_at必填 | number | Unix seconds. |
revoked_at必填 | number | null | Unix seconds. |
revoke_reason必填 | "rotation" | "compromise" | null | |
revoked_by必填 | string | null | |
fingerprint_sha256必填 | string | |
fingerprint必填 | string | |
custody必填 | "lab" | "server" |
LabKeyCreate
object
| 名称 | 类型 | 说明 |
|---|---|---|
kid必填 | string | Key id; one namespace with device and gateway keys. |
public_key_pem必填 | string | EC P-256 public key, PEM SubjectPublicKeyInfo. |
LabKeyPage
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<LabKey> | |
next_cursor必填 | string | null | Pass as |
LabLogins
object
Who signs in for a lab, and its pending invitations. Never a link or its token.
| 名称 | 类型 | 说明 |
|---|---|---|
members必填 | array<object> | Each person with a lab membership for this lab, in any company record, by email (at most 500). |
invitations必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
sample必填 | integer | |
outcome必填 | "match" | "mismatch" | |
region必填 | string | |
method必填 | string | |
passed必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
sample必填 | integer | The sample number k of the sampling. |
analyte必填 | "origin_isotopes" | |
outcome必填 | "match" | "mismatch" | |
region必填 | string | The region the sample was compared with, e.g. |
method必填 | string |
LabPage
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<Lab> | |
next_cursor必填 | string | null | Pass as |
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.
| 名称 | 类型 | 说明 |
|---|---|---|
report_no必填 | string | The lab's report number, once per lab. |
report_sha256必填 | string | SHA-256 of the report's PDF original. |
results必填 | array<LabReportResultSubmission | LabOriginResultSubmission> |
LabPortalKeyCreate
object
| 名称 | 类型 | 说明 |
|---|---|---|
kid必填 | 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).
| 名称 | 类型 | 说明 |
|---|---|---|
report_no必填 | string | |
lab必填 | string | |
kid必填 | string | The lab key that signed it. |
key_custody必填 | "lab" | "server" | Who holds the key that signed the report (#73): |
market必填 | string | ISO 3166-1 alpha-2 of the market whose limits judged it. |
signed_at必填 | number | Unix seconds. |
report_sha256必填 | string | |
passed必填 | boolean | |
analytes必填 | array<object> | |
results必填 | array<LabReportResult> | |
origin必填 | array<LabOriginResult> | |
submitted_by必填 | string | |
received_at必填 | number | Unix seconds. |
report_pdf可选 | AttachmentStored | null | #73: the report's PDF original once the lab sent it ( |
LabReportResult
object
One stored result with the market limit that judged it (null when the market sets none).
| 名称 | 类型 | 说明 |
|---|---|---|
sample必填 | integer | |
analyte必填 | LabResultAnalyte | |
outcome必填 | "measured" | "not_detected" | |
value必填 | number | null | |
unit必填 | string | |
lod必填 | number | |
method必填 | string | |
limit必填 | object | null | |
passed必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
sample必填 | integer | The sample number k of the sampling. |
analyte必填 | LabResultAnalyte | |
outcome必填 | "measured" | "not_detected" | |
value可选 | number | |
unit必填 | "mg/kg" | |
lod必填 | number | Detection limit. |
method必填 | 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).
| 名称 | 类型 | 说明 |
|---|---|---|
v必填 | 1 | |
lab必填 | string | The assigned lab's code; it must be the caller's lab. |
sampling必填 | integer | The sampling id of the URL. |
report_no必填 | string | The lab's report number, once per lab. |
signed_at必填 | 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必填 | string | SHA-256 of the report's PDF original. |
results必填 | array<LabReportResultSubmission | LabOriginResultSubmission> | |
sig必填 | object |
LabResultAnalyte
"cadmium" | "auramine_o"
LabUpdate
object
| 名称 | 类型 | 说明 |
|---|---|---|
name可选 | string | |
accreditation可选 | string | |
valid_to可选 | string (date) | |
status可选 | "active" | "suspended" | |
accreditation_body可选 | string | null | null clears it. |
accreditation_number可选 | string | null | null clears it. |
accreditation_scope可选 | string | null | null clears it. |
LandCertificate
object
#250: one land certificate with the corners as typed and the converted outline (WGS 84).
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | The certificate's id. |
growing_area必填 | string | |
submitted_at必填 | number | Unix seconds when the certificate was received. |
central_meridian_min必填 | 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必填 | integer | The number of corners. |
plane_area_m2必填 | 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必填 | string | SHA-256 of the photo of the certificate page, an image the company uploaded ( |
polygon_sha256必填 | 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必填 | 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必填 | number | null | The growing area's registered |
area_difference_ratio必填 | 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必填 | LandCertificateWalkComparison | null | The certificate against the area's latest boundary walk; null when the area has none. |
superseded必填 | boolean | Whether the certificate replaced a boundary proposal that was waiting. |
corners必填 | array<array<number>> | The corners [X, Y] (VN-2000, metres) as typed, without a repeated first corner. |
polygon必填 | GeoJsonPolygon |
LandCertificateCheck
object
#250: the parcel corners of a land-use right certificate to check before its photo is uploaded: LandCertificateCreate without photo_sha256.
| 名称 | 类型 | 说明 |
|---|---|---|
central_meridian_min必填 | 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必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
corners_total必填 | integer | The number of corners. |
plane_area_m2必填 | 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必填 | 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必填 | 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必填 | number | null | The growing area's registered |
area_difference_ratio必填 | 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必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
central_meridian_min必填 | 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必填 | 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必填 | string | SHA-256 of the photo of the certificate page, an image the company uploaded ( |
LandCertificatePage
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<LandCertificateSummary> | Newest first. |
next_cursor必填 | 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".
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | The certificate's id. |
growing_area必填 | string | |
submitted_at必填 | number | Unix seconds when the certificate was received. |
central_meridian_min必填 | 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必填 | integer | The number of corners. |
plane_area_m2必填 | 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必填 | string | SHA-256 of the photo of the certificate page, an image the company uploaded ( |
polygon_sha256必填 | 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必填 | 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必填 | number | null | The growing area's registered |
area_difference_ratio必填 | 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必填 | LandCertificateWalkComparison | null | The certificate against the area's latest boundary walk; null when the area has none. |
superseded必填 | boolean | Whether the certificate replaced a boundary proposal that was waiting. |
LandCertificateWalkComparison
object
#250: a certificate against the area's latest boundary walk (#248).
| 名称 | 类型 | 说明 |
|---|---|---|
walk_id必填 | integer | The walk's id. |
area_ha必填 | number | The walked area in hectares. |
area_difference_ratio必填 | number | null | (certificate area - walked area) / walked area. |
centre_offset_m必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
text必填 | string | Plain text, one line. |
level必填 | "info" | "warning" | |
starts_at必填 | number | Shown from this time (seconds since 1970, UTC). |
ends_at必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
applies必填 | "plot_boundary" | "commune" | "none" | The check ingest makes now for a position of the area. |
registered_commune必填 | string | null | The commune registered on the area; null: none. |
dataset必填 | string | null | The key of the commune boundary dataset in force (the one imported last); null: none imported. |
name必填 | "matched" | "unmatched" | "missing" | null | Whether a unit of the dataset in force is named like the registered commune ( |
commune_verdict_counts必填 | CommuneVerdictCounts | |
position_communes必填 | 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必填 | string | null | "© OpenStreetMap contributors", to show with any commune named here (ODbL); null without a dataset. |
copyright必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
status必填 | "missing" | "incomplete" | "out_of_range" | "matched" | |
readings必填 | integer | |
considered必填 | integer | Readings from the seal time on. |
first_at必填 | number | null | |
last_at必填 | number | null | |
min_c必填 | number | null | |
max_c必填 | number | null | |
seal_at必填 | number | null | |
until必填 | number | null | The departure; null while the shipment is open. |
gap_count必填 | integer | |
gaps必填 | array<object> | |
out_of_range_count必填 | integer | |
out_of_range必填 | array<object> | |
complete必填 | boolean | |
within_setpoint必填 | 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).
| 名称 | 类型 | 说明 |
|---|---|---|
logger必填 | string | The shipment's logger device id. |
shipment必填 | string | The shipment code. |
capability必填 | "air.temperature" | |
unit必填 | "Cel" | |
readings必填 | array<object> | |
sig必填 | object |
LoginRequest
object
| 名称 | 类型 | 说明 |
|---|---|---|
email必填 | string | |
password必填 | 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).
| 名称 | 类型 | 说明 |
|---|---|---|
tenant必填 | string | |
code必填 | string | |
seq必填 | integer | |
public_id必填 | string | |
facility必填 | string | |
product必填 | string | |
variety必填 | string | null | |
growing_area必填 | string | null | |
harvest_date必填 | string (date) | null (date) | |
harvest_event_id必填 | string | null | Id of the tenant's harvest envelope. |
destination必填 | string | null | |
gtin必填 | string | null | |
status必填 | "draft" | "open" | "paused" | "closed" | "packed" | "shipped" | "recalled" | "withdrawn" | |
created_at必填 | number | Unix seconds. |
updated_at必填 | number | Unix seconds. |
closed_at必填 | number | null | Unix seconds; null until closed. |
LotApplication
object
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | string | The application record's envelope id. |
applied_at必填 | string (date-time) | When the application started (the event's time), UTC. |
input必填 | string | null |
|
product必填 | object | null |
|
product_mass_kg必填 | number | null |
|
product_volume_l必填 | number | null |
|
duration_s必填 | number | null |
|
phi_days必填 | number | null |
|
interval_ends_at必填 | 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必填 | "accepted" | "quarantined" | quarantined: held for review. |
reasons必填 | array<string> | Why the record is held (empty when accepted). |
device_id必填 | string | The device or harvest app install that signed it. |
operator必填 | string | null |
|
harvest_app必填 | boolean | Entered by hand in the harvest app: Self-declared. |
LotApplications
object
| 名称 | 类型 | 说明 |
|---|---|---|
lot必填 | string | Lot code. |
growing_area必填 | string | null | The lot's growing area; null: none, and no records. |
from必填 | string (date-time) | null (date-time) | Start of the period listed (included), UTC; null without a growing area. |
until必填 | 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必填 | array<LotApplication> | |
more必填 | boolean | More records than |
sprays必填 | array<object> | #322: the spray records of the lot's growing area (its spray log, |
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.
| 名称 | 类型 | 说明 |
|---|---|---|
exportable_fruits必填 | integer | Fruits recorded or overridden with grade A or B. |
exportable_kg必填 | number | Their measured weights (unweighed fruits add none). |
uncartoned_fruits必填 | integer | Exportable fruits in no carton. |
uncartoned_kg必填 | number | Their measured weights. |
violation必填 | "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.
| 名称 | 类型 | 说明 |
|---|---|---|
lot必填 | string | Lot code. |
status必填 | "draft" | "open" | "paused" | "closed" | "packed" | "shipped" | "recalled" | "withdrawn" | |
sealed必填 | boolean | Whether the lot has its seal. |
counts必填 | object | The lot's final counts. |
sessions必填 | object | Measurement sessions of the lot not closed yet; the close closes a paused one. |
issuer_key必填 | string | null | The DID URL of the facility's active issuer key, the one the close signs with; null without one. |
timestamping必填 | boolean | Whether an external timestamp authority (RFC 3161) is configured: the seal's manifest hash is then timestamped by the periodic job. |
blockers必填 | 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. |
seal必填 | null | object |
LotCloseRequest
object
What the operator confirms before signing: the lot's fruit records as the console showed them.
| 名称 | 类型 | 说明 |
|---|---|---|
confirm_counts必填 | object |
LotCodeSuggestion
object
| 名称 | 类型 | 说明 |
|---|---|---|
code必填 | string | A code |
LotCreate
object
The owner is the tenant the caller acts for; seq, public_id and status are set by the server.
| 名称 | 类型 | 说明 |
|---|---|---|
code必填 | string | |
facility必填 | string | A facility of the caller's tenant (within an operator's facilities). |
product可选 | string | |
variety可选 | string | null | |
growing_area可选 | string | null | A growing-area code the tenant may read (its own or an unowned one). |
harvest_date可选 | string (date) | null (date) | YYYY-MM-DD, at most one day after today (UTC). |
harvest_event_id可选 | string | null | Id of a stored harvest envelope of the tenant. |
destination可选 | string | null | |
gtin可选 | string | null | GTIN-14 with a valid GS1 check digit. |
LotGs1Carton
object
| 名称 | 类型 | 说明 |
|---|---|---|
code必填 | string | |
carton_no必填 | integer | |
epc必填 | string | |
element_string必填 | string | null | (01)<gtin>(10)<lot>(21)<serial>; null without a GTIN. |
digital_link必填 | 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).
| 名称 | 类型 | 说明 |
|---|---|---|
lot必填 | string | |
gtin必填 | string | null | |
sealed必填 | boolean | |
element_string必填 | string | null | (01)<gtin>(10)<lot> |
digital_link必填 | string | null | <resolver base>/01/<gtin>/10/<lot> |
cartons必填 | array<LotGs1Carton> | |
pallets必填 | array<LotGs1Pallet> | |
next_cursor必填 | string | null |
LotGs1Pallet
object
| 名称 | 类型 | 说明 |
|---|---|---|
sscc必填 | string | GS1 Serial Shipping Container Code: 18 digits, the last the GS1 mod-10 check digit. |
element_string必填 | string | |
lot_cartons必填 | integer | |
first_carton必填 | integer | The lowest number of the lot's cartons on the pallet. |
last_carton必填 | integer | The highest number of the lot's cartons on the pallet. |
cartons必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
lot必填 | 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必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
inputs必填 | array<LotMergeInput> | 2 to 50 distinct lots, never the output lot itself. |
output_kg必填 | 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).
| 名称 | 类型 | 说明 |
|---|---|---|
lot必填 | string | |
status必填 | "draft" | "open" | "paused" | "closed" | "packed" | "shipped" | "recalled" | "withdrawn" | |
packed_at必填 | number | null | Unix seconds of the pack event (the first seal). |
cartons必填 | integer | |
fruits必填 | integer | |
net_mass_kg必填 | number | Sum of the cartons' net masses. |
fruit_mass_kg必填 | number | Sum of the packed fruits' measured weights. |
seal_numbers必填 | array<object> | |
mass_balance必填 | object |
LotPage
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<Lot> | |
next_cursor必填 | string | null | Pass as |
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.
| 名称 | 类型 | 说明 |
|---|---|---|
kind必填 | "recall" | "withdrawal" | |
status必填 | "recalled" | "withdrawn" | |
reason必填 | RecallReason | |
scope必填 | "consumer" | "retail" | "wholesale" | |
note必填 | string | |
prior_status必填 | "draft" | "open" | "paused" | "closed" | "packed" | "shipped" | |
recalled_by必填 | string | |
recalled_at必填 | number | Unix seconds. |
cartons必填 | integer | |
shipments必填 | integer | |
notice必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
kind必填 | "recall" | "withdrawal" | |
reason必填 | RecallReason | |
scope必填 | "consumer" | "retail" | "wholesale" | |
note可选 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
lot必填 | string | |
lab必填 | object | |
rule必填 | object | |
population必填 | integer | |
sample_count必填 | integer | |
analytes必填 | array<SampleAnalyte> | |
selected_by必填 | string | |
selected_at必填 | number | Unix seconds. |
samples必填 | array<SampleItem> | |
report必填 | LabReport | null | The lab's signed report (P4, #40), null until the lab submits it. |
LotSamplingRead
object
| 名称 | 类型 | 说明 |
|---|---|---|
sampling必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
lot必填 | string | Lot code. |
status必填 | "closed" | "packed" | "shipped" | "recalled" | "withdrawn" | The lot's status now. |
sealed_at必填 | number | |
sealed_by必填 | string | |
key_id必填 | string | The signing key's DID URL ( |
manifest_sha256必填 | string | |
fruit_count必填 | integer | |
event_count必填 | integer | |
credential必填 | string |
LotSummary
object
Lot summary (L6, #31).
| 名称 | 类型 | 说明 |
|---|---|---|
lot必填 | string | Lot code. |
status必填 | "draft" | "open" | "paused" | "closed" | "packed" | "shipped" | "recalled" | "withdrawn" | |
count必填 | 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必填 | integer | Fruits labelled but without a device record yet. |
rejected_unmeasured必填 | integer | Fruits rejected before any device envelope was bound (no device record); not in |
kg必填 | number | Sum of the scale weights of the counted fruits, rounded to 3 decimals. |
weighed必填 | integer | Counted fruits that have a scale weight. |
levels必填 | object | Counted fruits per effective ripeness level (the sensory level when overridden, else the device level); |
grades必填 | object | Counted fruits per grade; a fruit with status rejected counts as reject. |
overrides必填 | integer | Counted fruits with a sensory override. |
avg_confidence必填 | number | null | Mean device confidence of the counted fruits that have one, 4 decimals; null when none has one. |
pending_review必填 | integer | Fruits of the lot with a bound envelope still in quarantine. |
export必填 | object | Counted fruits graded A or B and not rejected, and their weight. |
volume必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
lot必填 | object | |
recall必填 | LotRecall | null | |
backward必填 | object | |
forward必填 | object | |
related_lots必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
event_id必填 | 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必填 | string | The output lot's code. |
facility必填 | string | The facility the merge happened at: the output lot's. |
inputs必填 | array<LotMergeInput> | The lots the merge consumed, by code. |
input_kg必填 | number | The sum of the inputs' quantity_kg. |
output_kg必填 | number | The output lot's kilograms. |
mass_tolerance必填 | number | The share of input_kg by which output_kg may differ (0.05). |
recorded_at必填 | number | When the merge was recorded (Unix seconds). |
LotTransformations
object
The lot merges a lot took part in (#91).
| 名称 | 类型 | 说明 |
|---|---|---|
produced_by必填 | LotTransformation | null | The merge that produced the lot; null when no merge did. |
consumed_by必填 | LotTransformation | null | The merge that consumed the lot; null when no merge did. |
LotTrust
object
| 名称 | 类型 | 说明 |
|---|---|---|
lot必填 | string | Lot code. |
snapshot必填 | null | object | |
queued必填 | boolean | The lot waits for a recompute. |
holds必填 | array<object> | The latest recorded holds, newest first. |
history必填 | array<object> | |
next_cursor必填 | string | null |
LotUpdate
object
Descriptive fields only; code, facility, seq, public_id, tenant and status are immutable here.
| 名称 | 类型 | 说明 |
|---|---|---|
product可选 | string | |
variety可选 | string | null | |
growing_area可选 | string | null | A growing-area code the tenant may read (its own or an unowned one). |
harvest_date可选 | string (date) | null (date) | YYYY-MM-DD, at most one day after today (UTC). |
harvest_event_id可选 | string | null | Id of a stored harvest envelope of the tenant. |
destination可选 | string | null | |
gtin可选 | string | null | GTIN-14 with a valid GS1 check digit. |
MapPoint
object
SENS-B1e (#235): a placement's surveyed install point (WGS84).
| 名称 | 类型 | 说明 |
|---|---|---|
lat必填 | number | |
lon必填 | number | |
accuracy_m必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
market必填 | string | ISO 3166-1 alpha-2. |
product必填 | string | As lots.product. |
analyte必填 | string | |
kind必填 | "max" | "banned" | |
value必填 | number | null | The maximum; null for a ban. |
unit必填 | "mg/kg" | |
valid_from必填 | string (date) | |
source必填 | string | The regulation it cites. |
created_at必填 | number | Unix seconds. |
created_by必填 | string | Who recorded it ( |
status必填 | "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.
| 名称 | 类型 | 说明 |
|---|---|---|
market必填 | string | |
product必填 | string | |
analyte必填 | string | |
kind必填 | "max" | "banned" | |
value可选 | number | null | |
valid_from必填 | string (date) | |
source必填 | string |
MarketLimitPage
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<MarketLimit> | |
today必填 | string (date) | The date |
next_cursor必填 | string | null | The next page's |
Me
object
| 名称 | 类型 | 说明 |
|---|---|---|
user必填 | User | |
memberships必填 | array<Membership> | |
csrf_token必填 | string | |
tenant必填 | string | null | Tenant the request acts for; null when the user has no membership. |
roles必填 | array<string> | |
tenant_name可选 | string | null | #282 (always present in this answer): the name of the tenant the request acts for ( |
lab_name可选 | string | null | #282 (always present in this answer): for a lab user ( |
two_factor可选 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | string | |
tenant必填 | string | |
lot必填 | string | Lot code. |
facility必填 | string | The lot's facility. |
line必填 | string | |
status必填 | "open" | "paused" | "closed" | |
opened_by必填 | string | The principal that opened the session. |
opened_at必填 | number | Unix seconds. |
paused_at必填 | number | null | Unix seconds of the last pause. |
closed_at必填 | number | null | Unix seconds. |
updated_at必填 | number | Unix seconds. |
devices必填 | array<string> | Devices chosen when the session opened. |
MeasurementSessionList
object
Every measurement session of one lot, newest first.
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<MeasurementSession> |
MeasurementSessionOpen
object
| 名称 | 类型 | 说明 |
|---|---|---|
line必填 | string | |
devices可选 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | string | |
tenant必填 | string | |
lot必填 | string | Lot code. |
facility必填 | string | The lot's facility. |
line必填 | string | |
status必填 | "open" | "paused" | "closed" | |
opened_by必填 | string | The principal that opened the session. |
opened_at必填 | number | Unix seconds. |
paused_at必填 | number | null | Unix seconds of the last pause. |
closed_at必填 | number | null | Unix seconds. |
updated_at必填 | number | Unix seconds. |
devices必填 | array<string> | Devices chosen when the session opened. |
commands必填 | array<SessionCommand> |
Member
object
SELF-1-4 (#185). Someone who belongs to the company. Never a password, a token or a session.
| 名称 | 类型 | 说明 |
|---|---|---|
user_id必填 | integer | |
email必填 | string | The email the person signs in with. |
display_name必填 | string | null | |
role必填 | "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必填 | array<string> | null | An operator's facility codes; null = every facility of the company (always null for another role). |
other_roles必填 | array<"lab" | "platform_admin"> | Platform-managed roles held in this company: shown, never changed here. |
lab_id必填 | string | null | The lab of a lab membership. |
status必填 | "active" | "disabled" |
|
account_status必填 | "active" | "disabled" | The account itself, managed by CropPath only. |
last_sign_in_at必填 | 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必填 | number | null | Unix seconds; null for a membership older than #184. |
two_factor必填 | boolean | SELF-1-6 (#187): the member's two-step sign-in is on. |
locked必填 | 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
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<Member> | |
active_admins必填 | integer | How many company admins are active, with an active account (the last-admin rule). |
MemberSessionsRevoke
object
| 名称 | 类型 | 说明 |
|---|---|---|
reason可选 | string | Required from a platform admin (CropPath support): one line, kept in the company's activity log. Ignored for a company admin. |
MemberSessionsRevoked
object
| 名称 | 类型 | 说明 |
|---|---|---|
user_id必填 | integer | |
sessions_revoked必填 | integer | How many live sessions of the member were ended. |
Membership
object
| 名称 | 类型 | 说明 |
|---|---|---|
tenant必填 | string | |
role必填 | string | e.g. tenant_admin, platform_admin, operator, lab, auditor. |
facilities必填 | array<string> | null | null means every facility of the tenant. |
lab_id必填 | string | null |
MemberUnlockResult
object
SELF-2-10 (#199). The member's sign-in lockout was cleared.
| 名称 | 类型 | 说明 |
|---|---|---|
user_id必填 | integer | |
locked必填 | false | |
was_locked必填 | 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
| 名称 | 类型 | 说明 |
|---|---|---|
role必填 | "tenant_admin" | "operator" | "auditor" | "agronomist" | |
facilities可选 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
rows必填 | integer | |
delivered必填 | integer | |
pending必填 | integer | |
failing必填 | integer | |
filed必填 | boolean |
Notification
object
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
kind必填 | NotificationKind | |
params必填 | NotificationParams | |
created_at必填 | number | Unix seconds. |
read_at必填 | 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
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<Notification> | |
unread必填 | integer | The caller's unread notifications in this company. |
next_cursor必填 | string | null | The next page's |
NotificationParams
object
The kind's parameters (see NotificationKind): identifiers, names and times only, never rendered text.
| 名称 | 类型 | 说明 |
|---|---|---|
email可选 | string | The invited person's sign-in email. |
role可选 | "tenant_admin" | "operator" | "auditor" | "agronomist" | The invited role. |
expires_at可选 | number | When the invitation or token expires (Unix seconds). |
subscription_id可选 | integer | The webhook subscription turned off. |
description可选 | string | The webhook's own description (may be empty). |
failures可选 | integer | Failed delivery attempts in a row. |
token_id可选 | integer | |
name可选 | string | null | The token's, facility's or growing area's name. |
code可选 | string | The facility or growing area code. |
reason可选 | string | Why CropPath refused the facility proposal. |
report_id可选 | integer | |
lot可选 | string | The lot code a public report names. |
category可选 | "label_peeled" | "scanned_many" | "ripeness_off" | "other" | |
facility可选 | string | The facility code missing a signing key. |
open_lots可选 | integer | Its lots not closed yet (draft, open or paused). |
alarm_id可选 | integer | #361: the alarm raised (GET /v1/alarms/{id}). |
alarm_kind可选 | string | #361: the alarm's catalog kind. |
priority可选 | "urgent" | "warning" | "notice" | #361: the alarm's priority. |
device可选 | string | null | #361: the alarm's device. |
zone可选 | integer | null | #361: the alarm's controller zone. |
area可选 | string | null | #361: the alarm's growing area code. |
NotificationsMarkedRead
object
| 名称 | 类型 | 说明 |
|---|---|---|
marked必填 | integer | |
unread必填 | integer |
NotificationUnreadCount
object
| 名称 | 类型 | 说明 |
|---|---|---|
unread必填 | integer |
OAuthClient
object
An OAuth2 API client of the tenant as the admin console lists it: never the secret, never its hash. Unix seconds.
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
client_id必填 | string | The public client identifier the integration authenticates with. |
name必填 | string | The operator's label (not unique). |
role必填 | "tenant_admin" | "operator" | "auditor" | |
scopes必填 | 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必填 | array<string> | null | An operator client's facility codes; null: every facility. |
created_by必填 | string | |
created_at必填 | number | |
last_token_at必填 | number | null | When it last got a token; null: never. |
revoked_at必填 | number | null | |
revoke_reason必填 | string | null | |
revoked_by必填 | string | null | |
status必填 | "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.
| 名称 | 类型 | 说明 |
|---|---|---|
allowed_ips必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
name必填 | string | |
role必填 | "tenant_admin" | "operator" | "auditor" | |
scopes必填 | 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可选 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
client必填 | OAuthClient | |
client_secret必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
client_id必填 | string | The public client identifier the integration authenticates with. |
name必填 | string | The operator's label (not unique). |
role必填 | "tenant_admin" | "operator" | "auditor" | |
scopes必填 | 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必填 | array<string> | null | An operator client's facility codes; null: every facility. |
created_by必填 | string | |
created_at必填 | number | |
last_token_at必填 | number | null | When it last got a token; null: never. |
revoked_at必填 | number | null | |
revoke_reason必填 | string | null | |
revoked_by必填 | string | null | |
status必填 | "active" | "revoked" | |
expires_at必填 | 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必填 | boolean | True from |
allowed_ips必填 | array<string> | null | The networks (CIDR form, IPv4 or IPv6) the client may call from; null: any source. |
last_used_at必填 | 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必填 | 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必填 | 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必填 | boolean | True when |
OAuthClientDetailPage
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<OAuthClientDetail> | |
next_cursor必填 | string | null | The next page's |
OAuthClientPage
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<OAuthClient> | |
next_cursor必填 | string | null | The next page's |
OAuthClientRenew
object
#205: the new lifetime, counted from now. Absent: 365 days.
| 名称 | 类型 | 说明 |
|---|---|---|
expires_in_days可选 | integer |
OAuthClientRevoke
object
| 名称 | 类型 | 说明 |
|---|---|---|
reason必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
error必填 | string | |
error_description可选 | string | |
code必填 | string |
OAuthRevokeRequest
object
RFC 7009 §2.1. client_id and client_secret only when the client does not use HTTP Basic.
| 名称 | 类型 | 说明 |
|---|---|---|
token必填 | string | |
token_type_hint可选 | string | |
client_id可选 | string | |
client_secret可选 | string |
OAuthToken
object
RFC 6749 §5.1.
| 名称 | 类型 | 说明 |
|---|---|---|
access_token必填 | string | |
token_type必填 | "Bearer" | |
expires_in必填 | integer | Seconds. |
scope必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
grant_type必填 | "client_credentials" | |
scope可选 | string | |
client_id可选 | string | |
client_secret可选 | string |
OidcCallback
object
#87. What the identity provider sent back to the company's redirect URI, and that company.
| 名称 | 类型 | 说明 |
|---|---|---|
state必填 | string | |
code必填 | string | |
company必填 | string | The company of the redirect URI the provider sent the browser back to ( |
iss可选 | string | The |
OidcStart
object
#87. The company whose identity provider the person signs in with.
| 名称 | 类型 | 说明 |
|---|---|---|
company必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
authorization_url必填 | string (uri) | |
expires_at必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
tenant必填 | string | |
complete必填 | boolean | Every required step is done. |
hidden必填 | boolean | A company admin hid the checklist (the console then stops showing it on /admin). |
hidden_at必填 | number | null | Unix seconds when it was hidden; null while shown. |
steps必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | "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必填 | boolean | false for an optional step (integrations): the checklist is complete without it. |
status必填 | "done" | "to_do" | "waiting_for_platform" | waiting_for_platform: the company did its part and waits for CropPath (an approval). |
count必填 | integer | null | The number the step is judged by, where one helps. |
total必填 | integer | null | What |
link必填 | string | The console screen (path and hash) where the step is done. |
OnboardingUpdate
object
| 名称 | 类型 | 说明 |
|---|---|---|
hidden必填 | boolean | true hides the checklist, false shows it again. |
OutboundBacklog
object
| 名称 | 类型 | 说明 |
|---|---|---|
targets必填 | 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).
| 名称 | 类型 | 说明 |
|---|---|---|
target必填 | string | The target's name, as the deployment configures it. |
pending必填 | integer | Accepted events waiting to be delivered. |
held必填 | 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必填 | integer | Pending events whose delivery failed at least once. |
next_attempt_at必填 | number | null | Unix seconds: the earliest next delivery attempt of a pending event; null when none is pending. |
max_attempts必填 | integer | The most failed attempts of one waiting event. |
last_error必填 | 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: |
Pallet
object
#161: a pallet of a facility, identified by its SSCC, with the cartons on it.
| 名称 | 类型 | 说明 |
|---|---|---|
sscc必填 | string | GS1 Serial Shipping Container Code: 18 digits, the last the GS1 mod-10 check digit. |
facility必填 | string | |
epc必填 | string | https://id.gs1.org/00/<sscc> |
element_string必填 | string | GS1-128 element string, (00)<sscc>. |
cartons必填 | array<PalletCarton> | |
created_by必填 | string | |
created_at必填 | number | Unix seconds. |
updated_at必填 | number | Unix seconds. |
PalletCarton
object
| 名称 | 类型 | 说明 |
|---|---|---|
code必填 | string | |
lot必填 | string | |
epc必填 | string | The carton's EPC: its SGTIN Digital Link when its lot has a GTIN, else urn:agritrace:carton:<code>. |
PalletCartons
object
| 名称 | 类型 | 说明 |
|---|---|---|
cartons必填 | array<string> | |
expected_cartons可选 | 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 |
PalletCreate
object
Without sscc, the next SSCC of the platform's GS1 company prefix is allocated.
| 名称 | 类型 | 说明 |
|---|---|---|
facility必填 | string | |
sscc可选 | string | An SSCC of the company's own GS1 membership. |
PalletPage
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<PalletSummary> | |
next_cursor必填 | string | null |
PalletSummary
object
| 名称 | 类型 | 说明 |
|---|---|---|
sscc必填 | string | GS1 Serial Shipping Container Code: 18 digits, the last the GS1 mod-10 check digit. |
facility必填 | string | |
epc必填 | string | |
element_string必填 | string | |
carton_count必填 | integer | |
created_by必填 | string | |
created_at必填 | number | |
updated_at必填 | number |
Passkey
object
#87. One of the signed-in user's passkeys: never its credential id, public key or user handle.
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
nickname必填 | string | The owner's name for it; empty when none was given. |
algorithm必填 | "ES256" | "RS256" | "EdDSA" | |
transports必填 | array<"ble" | "hybrid" | "internal" | "nfc" | "smart-card" | "usb"> | How the browser said the authenticator connects (hints). |
attestation_format必填 | string | |
created_at必填 | number | Unix seconds. |
last_used_at必填 | number | null | Unix seconds of the last sign-in with it. |
clone_warning_at必填 | 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).
| 名称 | 类型 | 说明 |
|---|---|---|
public_key必填 | object |
PasskeyList
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | 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).
| 名称 | 类型 | 说明 |
|---|---|---|
credential_id必填 | string | |
client_data_json必填 | string | |
authenticator_data必填 | string | |
signature必填 | string | |
user_handle必填 | string |
PasskeyRegistration
object
#87. The answer of navigator.credentials.create(): response.clientDataJSON and response.attestationObject, base64url (padding optional), and response.getTransports().
| 名称 | 类型 | 说明 |
|---|---|---|
client_data_json必填 | string | |
attestation_object必填 | string | |
transports可选 | array<string> | Unknown names are dropped. |
nickname可选 | string |
PasskeyRename
object
| 名称 | 类型 | 说明 |
|---|---|---|
nickname必填 | 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).
| 名称 | 类型 | 说明 |
|---|---|---|
public_key必填 | object |
PasswordChanged
object
| 名称 | 类型 | 说明 |
|---|---|---|
csrf_token必填 | string |
PasswordChangeRequest
object
| 名称 | 类型 | 说明 |
|---|---|---|
current_password必填 | string | |
new_password必填 | string | |
code可选 | string | #187: the 6-digit code from the authenticator app; required (or |
backup_code可选 | string | #187: one unused backup code, instead of |
PasswordRecovered
object
| 名称 | 类型 | 说明 |
|---|---|---|
backup_codes_left必填 | integer | The account's unused backup codes after this one. |
second_factor必填 | "required" | The next sign-in asks for the second step after the password. |
PasswordRecoveryRequest
object
| 名称 | 类型 | 说明 |
|---|---|---|
email必填 | string | The email used to sign in. |
backup_code必填 | string | One unused backup code of the account (SELF-1-6, #187), as printed: any case, spaces and hyphens allowed. |
new_password必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
user_id必填 | integer | |
email必填 | string | |
display_name必填 | string | null | |
company必填 | object | |
roles必填 | array<"tenant_admin" | "operator" | "auditor" | "agronomist" | "lab" | "platform_admin"> | The member's roles in this company, the company-managed ones first. |
facilities必填 | array<string> | null | An operator's facility codes; null for every facility or for another role. |
lab_id必填 | string | null | The lab of a lab membership, or null. |
membership_status必填 | "active" | "disabled" | |
account_status必填 | "active" | "disabled" | |
account_created_at必填 | number | Seconds since 1970 (UTC). |
joined_at必填 | number | null | When the member joined this company, or null when not recorded. |
notice_accepted_at必填 | number | null | When the member accepted the staff privacy notice (at the invitation), or null. |
two_factor必填 | boolean | Whether two-step sign-in is on (never its secret). |
recent_sign_ins必填 | 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可选 | Agronomist | null | #351: with |
PersonalDataRequest
object
SELF-2-9 (#198). A member's request about their personal data, as the member sees it (never who handled it).
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
kind必填 | "access" | "correction" |
|
text必填 | string | Plain text, as typed (trimmed): never HTML or markdown; line breaks are kept. |
status必填 | "open" | "handled" |
|
created_at必填 | number | Seconds since 1970 (UTC). |
handled_at必填 | number | null | When a company admin marked it handled, or null. |
PersonalDataRequestCreate
object
| 名称 | 类型 | 说明 |
|---|---|---|
kind必填 | "access" | "correction" | |
text必填 | string | 1 to 2000 characters after trimming; line breaks and tabs allowed, no other control characters. Stored and shown as plain text. |
PersonalDataRequestPage
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<PersonalDataRequest> | |
next_cursor必填 | string | null | The next page's |
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.
| 名称 | 类型 | 说明 |
|---|---|---|
generated_at必填 | string (date-time) | When the answer was computed (the server serves it for up to |
max_age_s必填 | integer | Seconds the server serves one answer. |
process必填 | object | |
sections必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | string | |
name必填 | string | |
sandbox必填 | boolean | A hosted sandbox company. |
offboarding必填 | "leaving" | "left" | null | Whether the company is leaving or has left CropPath; null otherwise. |
members_active必填 | integer | |
admins_active必填 | integer | Active company admins. |
devices_registered必填 | integer | Devices of every status. |
messages_last_hour必填 | integer | null | Device messages stored in the last hour; null until the server has measured an hour. |
api_calls_today必填 | integer | API calls this UTC day. |
api_day_percent必填 | integer |
|
open_high_alerts必填 | integer | Open alerts of severity high. |
support_open必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
tenant必填 | string | The company the request came from. |
user必填 | SupportRequestUser | |
subject必填 | string | Plain text, as typed (trimmed). |
body必填 | string | Plain text, as typed (trimmed): never HTML or markdown; line breaks are kept. |
record_id必填 | string | null | The record the request is about (a lot code, device id, public id, ...), or null. |
status必填 | "open" | "in_progress" | "answered" | "closed" |
|
reply必填 | string | null | CropPath's reply (plain text), or null. |
created_at必填 | number | Seconds since 1970 (UTC). |
updated_at必填 | number | When the request was sent or CropPath last changed it. |
updated_by必填 | string | null | The platform admin who last changed it; null until then. |
PlatformSupportRequestPage
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<PlatformSupportRequest> | |
next_cursor必填 | string | null | The next page's |
PolygonHistory
object
| 名称 | 类型 | 说明 |
|---|---|---|
pending必填 | PolygonProposal | null | |
items必填 | array<PolygonVersion> | The approved versions, newest first. |
next_cursor必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
polygon_sha256必填 | string | null | SHA-256 of the proposed boundary; null proposes removing it. |
proposed_at必填 | number | |
polygon可选 | GeoJsonPolygon | null | |
proposed_by可选 | string | null |
PolygonProposalApproval
object
| 名称 | 类型 | 说明 |
|---|---|---|
polygon_sha256必填 | string | null | The SHA-256 of the proposal reviewed (null for a proposed removal): a proposal replaced meanwhile is refused (409). |
PolygonProposalPage
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<PolygonProposalQueueItem> | |
next_cursor必填 | string | null |
PolygonProposalQueueItem
object
SENS-A1 (#224): a company's boundary proposal in the platform's queue, with the boundary in force.
| 名称 | 类型 | 说明 |
|---|---|---|
code必填 | string | |
tenant必填 | string | |
tenant_name必填 | string | |
name必填 | string | null | |
polygon必填 | GeoJsonPolygon | null | The proposed boundary; null proposes removing it. |
polygon_sha256必填 | string | null | Name it when approving (POST /v1/polygon-proposals/{code}/approve). |
proposed_at必填 | number | |
proposed_by必填 | string | null | |
current_version必填 | integer | null | The latest approved version, null when none. |
current_polygon_sha256必填 | string | null | SHA-256 of the boundary in force; null when none. |
current_polygon必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
code必填 | string | |
tenant必填 | string | |
polygon_sha256必填 | string | null | |
proposed_at必填 | number | |
proposed_by必填 | string | null | |
reason必填 | string |
PolygonProposalRejection
object
| 名称 | 类型 | 说明 |
|---|---|---|
reason必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
growing_area必填 | string | |
version必填 | integer | 1, 2, ... per growing area. |
polygon_sha256必填 | 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必填 | number | Unix seconds from which this version is in force. |
origin必填 | "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可选 | GeoJsonPolygon | null | Present only for the owning tenant_admin and platform_admin; null: no boundary. |
proposed_at可选 | number | null | Present only for the owning tenant_admin and platform_admin. |
proposed_by可选 | string | null | Present only for the owning tenant_admin and platform_admin. |
approved_by可选 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
name必填 | string | The unit's name in OpenStreetMap. |
osm_relation必填 | integer | The unit's OpenStreetMap relation id. |
positions必填 | 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).
| 名称 | 类型 | 说明 |
|---|---|---|
product必填 | string | |
variety必填 | string | null | |
grade必填 | string | null | |
gtin必填 | string | 14 digits with the GS1 check digit. |
allocated必填 | boolean | Allocated from the platform's GS1 company prefix. |
created_by必填 | string | |
created_at必填 | number | Unix seconds. |
ProductGtinCreate
object
Without gtin, the next GTIN of the platform's GS1 company prefix is allocated.
| 名称 | 类型 | 说明 |
|---|---|---|
product必填 | string | |
variety可选 | string | null | |
grade可选 | string | null | |
gtin可选 | string | A GTIN of the company's own GS1 membership (14 digits, check digit). |
ProductGtinList
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | 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).
| 名称 | 类型 | 说明 |
|---|---|---|
released必填 | object | |
rules_due必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
withdrawal必填 | object | |
control_program必填 | 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必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
reason必填 | 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可选 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
url必填 | PublicSameOriginPath | The image's same-origin path, |
osm_relation必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
sealed必填 | 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必填 | PublicIsoDate | null | The local date the lot was first public (its first measurement session opened); null when it has none. |
steps必填 | 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).
| 名称 | 类型 | 说明 |
|---|---|---|
status必填 | PublicStatus | |
status_since必填 | PublicIsoDateTime | null | |
status_reason必填 | RecallReason | null | |
tier必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
format必填 | "agritrace-customs-dossier/1" | "agritrace-customs-dossier/2" | The format of the document, that of its sealed record: |
lang必填 | "vi" | "zh-Hans" | "en" | |
status必填 | PublicStatus | |
trust_tier必填 | PublicTrustTier | |
public_id必填 | PublicCode | |
origin_country必填 | PublicText | |
sealed必填 | 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必填 | object | The seal digest recorded when the lot was packed: the SHA-256 (hex) of the JCS form of |
registry_entry必填 | object | null | The trust tier and source of the growing-area and packing-house codes: those of the lot's registration step (PublicLotJourneyStep |
lab_report必填 | object | null | |
shipment必填 | object | |
protocol必填 | PublicText | null | The Durian Protocol's name in |
producer必填 | 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 |
digest必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
approved必填 | boolean | |
approved_on必填 | PublicIsoDate | null |
PublicDownloads
object
| 名称 | 类型 | 说明 |
|---|---|---|
epcis_url必填 | PublicSameOriginPath | null | |
credential_url必填 | PublicSameOriginPath | null | X3 (#44): the fruit's UNTP credential ( |
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.
| 名称 | 类型 | 说明 |
|---|---|---|
@context必填 | array<any> | |
type必填 | "EPCISDocument" | |
schemaVersion必填 | "2.0" | |
creationDate必填 | string | The seal time, UTC. |
epcisBody必填 | object |
PublicEvidenceSource
"manual" | "registered_app" | "device" | "lab" | "registry" | "logger"
PublicFruit
object
| 名称 | 类型 | 说明 |
|---|---|---|
status必填 | PublicStatus | |
status_since必填 | PublicIsoDateTime | null | |
status_reason必填 | 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必填 | PublicCode | |
code必填 | PublicCode | |
crop必填 | "durian" | |
variety必填 | PublicText | |
harvested_on必填 | PublicIsoDate | |
harvest_place必填 | PublicText | null | |
carton_no必填 | integer | null | |
lot必填 | object | |
trust必填 | object | |
scan必填 | object | null | |
measurement必填 | object | |
origin必填 | object | |
journey必填 | array<PublicFruitJourneyStep> | |
downloads必填 | PublicDownloads | |
report必填 | object |
PublicFruitJourneyStep
object | object | object | object | object
PublicIsoDate
string (date)
PublicIsoDateTime
string (date-time)
PublicIssuer
object
| 名称 | 类型 | 说明 |
|---|---|---|
did必填 | string | |
key_id必填 | string |
PublicJwk
object
A P-256 public key as a JWK (RFC 7518 §6.2.1).
| 名称 | 类型 | 说明 |
|---|---|---|
kty必填 | "EC" | |
crv必填 | "P-256" | |
x必填 | string | |
y必填 | string |
PublicLabLimit
object | object
PublicLabMarketApproval
object
| 名称 | 类型 | 说明 |
|---|---|---|
market必填 | PublicMarket | |
approved必填 | 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 |
reference必填 | 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).
| 名称 | 类型 | 说明 |
|---|---|---|
linkset必填 | array<object> |
PublicLinkTarget
object
#162: a link target (RFC 9264).
| 名称 | 类型 | 说明 |
|---|---|---|
href必填 | string | The target URL. |
title必填 | string | What the target is. |
type可选 | string | The target's media type. |
hreflang可选 | array<string> | The target's language, for a public page. |
PublicLot
object
| 名称 | 类型 | 说明 |
|---|---|---|
status必填 | PublicStatus | |
status_since必填 | PublicIsoDateTime | null | |
status_reason必填 | 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必填 | PublicCode | |
code必填 | PublicCode | |
crop必填 | string | |
crop_name可选 | string | #156: the registry's name of the lot's crop ( |
ripeness_scale可选 | "levels_1_to_4" | null | #156: the crop's ripeness scale; null for a crop graded on none, whose lot has no ripeness section ( |
variety必填 | PublicText | |
origin_country必填 | PublicText | |
fruit_count必填 | integer | |
net_mass_kg必填 | number | |
carton_count必填 | integer | null | |
packed_on必填 | PublicIsoDate | null | |
harvested_on必填 | PublicIsoDate | |
facility必填 | object | |
growing_area必填 | object | null | |
export必填 | object | null | |
trust必填 | object | |
verification必填 | object | |
journey必填 | array<PublicLotJourneyStep> | |
ripeness必填 | object | null | |
lab必填 | object | null | |
downloads必填 | PublicLotDownloads | |
issuer必填 | PublicIssuer | null |
PublicLotDownloads
object
| 名称 | 类型 | 说明 |
|---|---|---|
epcis_url必填 | PublicSameOriginPath | null | X3 (#44): the lot's EPCIS 2.0 document ( |
credential_url必填 | PublicSameOriginPath | null | X3 (#44): the lot's UNTP credential ( |
customs_dossier_url必填 | PublicSameOriginPath | null | X4 (#45): the HTML print view of the lot's code file for China customs (its customs dossier, |
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.
| 名称 | 类型 | 说明 |
|---|---|---|
public_id必填 | PublicCode | The fruit's public id (its record: /{locale}/q/{public_id}). |
code必填 | PublicCode | The fruit code printed on its label. |
ripeness_level必填 | integer | The effective level (L3): the operator's sensory level when overridden, else the device's. |
model_confidence必填 | number | The device model's confidence, 0..1. |
weight_kg必填 | number | The bound scale reading, kg. |
grade必填 | "A" | "B" | "reject" | The grade (L3). |
tier必填 | PublicTrustTier | As the fruit record's |
sensory_override必填 | boolean | An operator replaced the device's level (always true in group |
recording_url必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
lot必填 | object | |
group必填 | "measured" | "overridden" | |
total必填 | integer | Public fruits of the lot in this group. |
items必填 | array<PublicLotFruit> | |
next_cursor必填 | string | null | Pass as |
PublicLotJourneyStep
object | object | object | object | object | object
PublicMarket
object
| 名称 | 类型 | 说明 |
|---|---|---|
country_code必填 | string | |
short_name必填 | PublicText | |
authority必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
kind必填 | "lot" | "fruit" | |
public_id必填 | string | |
locale_hint必填 | "vi" | "zh" | "en" | null |
PublicSameOriginPath
string
PublicSatelliteCheck
object
| 名称 | 类型 | 说明 |
|---|---|---|
source必填 | PublicText | |
image_date必填 | PublicIsoDate | |
area_matches_registration必填 | boolean | |
deforestation_detected必填 | boolean |
PublicStatus
"normal" | "recalled" | "withdrawn" | "on_hold" | "under_review"
PublicText
string
PublicTrustTier
"self_declared" | "device_recorded" | "cross_checked" | "lab_verified"
QuarantinedEnvelope
object
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | string | |
device_id必填 | string | |
seq必填 | integer | |
kind必填 | string | |
event_type必填 | string | null | |
event_time必填 | string | |
lot必填 | string | null | |
growing_area必填 | string | null | |
reasons必填 | array<string> |
ReauthRequest
object
| 名称 | 类型 | 说明 |
|---|---|---|
password必填 | string | |
code可选 | string | SELF-1-6 (#187): the 6-digit code from the authenticator app; required (or |
backup_code可选 | string | SELF-1-6 (#187): one unused backup code, instead of |
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.
| 名称 | 类型 | 说明 |
|---|---|---|
format必填 | "agritrace-recall-export/1" | |
lot必填 | string | |
generated_at必填 | string (date-time) | |
recall必填 | object | null | |
columns必填 | 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必填 | array<object> |
RecallList
object
#322: the company's recalls and withdrawals, newest first, with their counts.
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<object> | |
total必填 | integer | Every recall and withdrawal of the company ( |
notices_pending必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
format必填 | "agritrace-records-export/1" | |
lot必填 | string | |
status必填 | "draft" | "open" | "paused" | "closed" | "packed" | "shipped" | "recalled" | "withdrawn" | The lot's status when the export was taken. |
generated_at必填 | string (date-time) | |
truncated必填 | 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必填 | 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必填 | 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必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
format必填 | "agritrace-records-export-range/1" | |
start必填 | string (date-time) | |
end必填 | string (date-time) | |
generated_at必填 | string (date-time) | |
lots必填 | array<string> | The lot codes of this page, in creation order. |
next_cursor必填 | string | null | The |
truncated必填 | boolean | True when a lot of the page had more than 1,000 signed device events (receiving, cooling, packing, shipping). |
columns必填 | 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必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
record_type必填 | "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必填 | string | The lot code (the traceability lot code of every row). |
critical_tracking_event必填 | "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必填 | 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必填 | 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必填 | "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必填 | 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必填 | 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必填 | 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必填 | 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必填 | 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必填 | string | The lot's product and variety, space-separated (e.g. |
quantity必填 | 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必填 | "kg" | "" |
|
area_declared_kg必填 | 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必填 | string | The carton code (initial_packing, shipping); empty otherwise. |
fruit_count必填 | integer | "" | The fruits in the carton (initial_packing, shipping) or in the sealed lot (sealed_record); empty otherwise. |
supplier_name必填 | 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 ( |
supplier_organisation必填 | string | The grower's cooperative; empty when none. |
supplier_code必填 | string | The growing area code (the sealed record's frozen code on its row); empty without an area. |
supplier_address必填 | 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必填 | string | The growing area's GACC growing-area (PUC) code; empty when none. |
harvest_date必填 | string | The lot's harvest date, YYYY-MM-DD; empty when not recorded. |
shipment必填 | string | One step forward: the shipment code (shipping); empty otherwise. |
container必填 | string | The ISO 6346 container number (shipping); empty otherwise. |
seal_number必填 | string | The lot's seal number on the shipment (shipping); empty otherwise. |
destination必填 | string | The destination market, ISO 3166-1 alpha-2 (shipping); empty otherwise. |
border_gate必填 | string | The border gate the shipment heads for (shipping); empty otherwise. |
consignee_name必填 | string | The shipment's consignee (immediate subsequent recipient); empty until the shipment records one (#153). |
consignee_address必填 | string | The consignee's address; empty until recorded (#153). |
consignee_country必填 | string | The consignee's country, ISO 3166-1 alpha-2; empty until recorded (#153). |
consignee_gln必填 | string | The consignee's GS1 GLN; empty until recorded (#153). |
consignee_gacc_record必填 | string | The importer's GACC registration number; empty until recorded (#153). |
reference_document_type必填 | "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必填 | string | The reference document's number: the lab's report number on a lab_result row; empty otherwise. |
lab_key_custody必填 | "lab" | "server" | "" | Who holds the key that signed the lab report: lab (uploaded) or server (portal entry); empty on other rows. |
lab_market必填 | string | The market whose limits judged the report, ISO 3166-1 alpha-2; empty on other rows. |
sample必填 | integer | "" | The sample number k (lab_result); empty otherwise. |
analyte必填 | string | The analyte (lab_result), e.g. cadmium, auramine_o; empty otherwise. |
result_outcome必填 | "measured" | "not_detected" | "" | measured or not_detected (lab_result); empty otherwise. |
result_value必填 | number | "" | The measured value in result_unit (lab_result, measured); empty otherwise. |
result_unit必填 | string | The unit the lab signed (lab_result), e.g. mg/kg; empty otherwise. |
limit_kind必填 | "max" | "banned" | "" | The market limit that judged the result: max or banned; empty when the market sets none or on other rows. |
limit_value必填 | number | "" | The maximum in result_unit (limit_kind max); empty otherwise. |
limit_source必填 | string | The source of the limit as it stood when the report was judged; empty when none. |
verdict必填 | "pass" | "fail" | "" | pass or fail (lab_result); empty otherwise. |
sealed_digest必填 | string | The SHA-256 (lower-case hex) of the sealed record (sealed_record); empty otherwise. |
sealed_basis必填 | "transition" | "migration" | "" | How the sealed record was taken: transition (inside the pack transaction) or migration; empty otherwise. |
recall_kind必填 | "recall" | "withdrawal" | "" | recall or withdrawal (recall row); empty otherwise. |
recall_reason必填 | RecallReason | "" | The recall's reason category (recall row); empty otherwise. |
recall_scope必填 | "consumer" | "retail" | "wholesale" | "" | The recall depth: consumer, retail or wholesale (recall row); empty otherwise. |
hold_kind必填 | "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必填 | "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必填 | "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 |
RecoveryLinkCreate
object
| 名称 | 类型 | 说明 |
|---|---|---|
reason必填 | 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).
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
kind必填 | "puc" | "phc" | puc: growing-area codes; phc: packing-house codes. |
market必填 | string | The destination market whose protocol the codes are registered for (ISO 3166-1 alpha-2). |
crop必填 | string | One of the platform's crops (AGRITRACE_REGISTRY_CROPS; by default coconut, dragon_fruit, durian, jackfruit, mango). |
source_url必填 | string | The page the list was downloaded from. |
source_sha256必填 | 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必填 | "application/pdf" | "application/vnd.ms-excel" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "text/csv" | null | The media type of the authority's original file |
published_on必填 | string (date) | null (date) | The date the authority published the list, when known. |
file_name必填 | string | |
file_sha256必填 | string | SHA-256 of the stored file. |
file_size必填 | integer | |
entry_count必填 | integer | |
imported_at必填 | number | Unix seconds. |
imported_by必填 | string | |
superseded_by必填 | integer | null | |
superseded_at必填 | number | null | When a later import superseded the list, or when it was retired (then |
retired_by必填 | string | null | Who retired the list (POST /v1/registry-lists/{id}/retire); null unless retired. |
retire_reason必填 | string | null | Why the list was retired; null unless retired. |
current必填 | boolean | Neither superseded by a later import nor retired. |
stale必填 | boolean | Current and older than the configured age. |
superseded可选 | integer | null | Only on the import's answer: the id of the list this import superseded. |
RegistryListDetail
object
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
kind必填 | "puc" | "phc" | puc: growing-area codes; phc: packing-house codes. |
market必填 | string | The destination market whose protocol the codes are registered for (ISO 3166-1 alpha-2). |
crop必填 | string | One of the platform's crops (AGRITRACE_REGISTRY_CROPS; by default coconut, dragon_fruit, durian, jackfruit, mango). |
source_url必填 | string | The page the list was downloaded from. |
source_sha256必填 | 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必填 | "application/pdf" | "application/vnd.ms-excel" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "text/csv" | null | The media type of the authority's original file |
published_on必填 | string (date) | null (date) | The date the authority published the list, when known. |
file_name必填 | string | |
file_sha256必填 | string | SHA-256 of the stored file. |
file_size必填 | integer | |
entry_count必填 | integer | |
imported_at必填 | number | Unix seconds. |
imported_by必填 | string | |
superseded_by必填 | integer | null | |
superseded_at必填 | number | null | When a later import superseded the list, or when it was retired (then |
retired_by必填 | string | null | Who retired the list (POST /v1/registry-lists/{id}/retire); null unless retired. |
retire_reason必填 | string | null | Why the list was retired; null unless retired. |
current必填 | boolean | Neither superseded by a later import nor retired. |
stale必填 | boolean | Current and older than the configured age. |
status_counts必填 | object | |
max_age_days必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
code必填 | string | |
code_raw必填 | string | |
status必填 | "active" | "suspended" | "revoked" | |
holder必填 | string | null | |
province必填 | string | null | |
district必填 | string | null | |
commune必填 | string | null | |
area_ha必填 | number | null | |
valid_from必填 | string (date) | null (date) | |
valid_to必填 | string (date) | null (date) |
RegistryListEntryPage
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<RegistryListEntry> | |
next_cursor必填 | string | null |
RegistryListImport
object
| 名称 | 类型 | 说明 |
|---|---|---|
kind必填 | "puc" | "phc" | |
market必填 | "CN" | A destination market the platform ships to (ISO 3166-1 alpha-2). |
crop必填 | 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 |
source_url必填 | string | |
source_sha256必填 | 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可选 | string (date) | null (date) | |
file_name必填 | string | |
file_base64必填 | string | The CSV file, base64-encoded. |
RegistryListPage
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<RegistryList> | |
max_age_days必填 | integer | |
crops必填 | array<string> | The crops an import may name, sorted (AGRITRACE_REGISTRY_CROPS; by default the D7 crops). |
next_cursor必填 | string | null | The next page's |
RegistryListRetire
object
| 名称 | 类型 | 说明 |
|---|---|---|
reason必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
code必填 | string | The growing area's or facility's own code. |
tenant必填 | string | null | |
name必填 | string | null | |
crop必填 | string | null | The growing area's crop; null for a facility. |
registered_code必填 | string | The PUC or PHC as entered. |
normalized_code必填 | string | null | |
result必填 | "matched" | "no_code" | "no_list" | "not_found" | "mismatch" | "suspended" | "revoked" | "expired" | |
stale必填 | boolean | |
list_id必填 | integer | null | The list that decided (null for mismatch, no_list, no_code). |
list_crop必填 | string | null |
RegistryMatchPage
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<RegistryMatch> | |
max_age_days必填 | integer | |
next_cursor必填 | string | null |
RegistrySourceStored
object
The authority's original file of a code list as the server stored it: sha256 is computed from the bytes.
| 名称 | 类型 | 说明 |
|---|---|---|
sha256必填 | string | |
media_type必填 | "application/pdf" | "application/vnd.ms-excel" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "text/csv" | |
size必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
route必填 | string | null | The ingest route the message came on, |
envelope_id必填 | string | null | The envelope id, when one could be read. |
reason必填 | string | Why it was refused, for example |
received_at必填 | number | Unix seconds. |
payload_bytes必填 | integer | Size of the stored payload (at most 65,536 bytes are kept). |
RejectionPage
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<Rejection> | |
next_cursor必填 | string | null | The next page's |
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.
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
fruit必填 | object | |
lot必填 | object | |
category必填 | ReportCategory | |
note必填 | string | |
contact必填 | string | null | |
status必填 | "open" | "resolved" | |
outcome必填 | "confirmed" | "unfounded" | "duplicate" | null | |
created_at必填 | number | |
resolved_at必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
challenge必填 | string | |
difficulty必填 | integer | |
expires_in必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
fruit必填 | object | |
lot必填 | object | |
category必填 | ReportCategory | |
note必填 | string | |
contact必填 | string | null | |
status必填 | "open" | "resolved" | |
outcome必填 | "confirmed" | "unfounded" | "duplicate" | null | |
created_at必填 | number | |
resolved_at必填 | number | null | |
scans必填 | object |
ReportPage
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<Report> | |
next_cursor必填 | string | null | The next page's |
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.
| 名称 | 类型 | 说明 |
|---|---|---|
status必填 | "received" | |
fruit必填 | PublicCurrentStatus | null | |
lot必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
outcome必填 | "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.
| 名称 | 类型 | 说明 |
|---|---|---|
publicId必填 | string | The public id of the fruit (its page's). |
category必填 | ReportCategory | |
note可选 | string | |
contact可选 | string | null | |
challenge必填 | string | A ReportChallenge's |
solution必填 | string |
ResidueCertificate
object
#157: a lot's lab results judged against its destination market (see getLotResidueCertificate).
| 名称 | 类型 | 说明 |
|---|---|---|
lot必填 | string | |
product必填 | string | |
report必填 | object | null | The lab report; null while the lab has not reported. |
market必填 | string | null | The destination market the results are judged against. |
market_from必填 | "shipment" | "lot" | "report" | null | Where the market comes from: the lot's shipment, the lot's own destination, or the lab report. |
limits_on必填 | string (date) | null (date) | The report's signed date (Asia/Ho_Chi_Minh), the day the limits are read for. |
verdict必填 | "pass" | "fail" | "incomplete" | null | |
analytes必填 | array<ResidueCertificateAnalyte> | |
required_analytes必填 | array<string> | |
missing_analytes必填 | array<string> |
ResidueCertificateAnalyte
object
| 名称 | 类型 | 说明 |
|---|---|---|
analyte必填 | string | |
samples必填 | integer | The number of results (one per drawn sample). |
outcome必填 | "measured" | "not_detected" | measured when a sample measured it, else not_detected. |
value必填 | number | null | The highest measured value; null when not detected. |
lod必填 | number | null | The highest detection limit of the results; null when measured. |
unit必填 | "mg/kg" | |
limit必填 | object | null | The limit the analyte was judged with; null when the market sets none. |
verdict必填 | "pass" | "fail" | "no_limit" |
ReviewRequest
object
| 名称 | 类型 | 说明 |
|---|---|---|
decision必填 | "approve" | "reject" | |
note可选 | string | Optional; recorded with the review. |
ReviewResult
object
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | string | |
status必填 | "accepted" | "rejected_after_review" |
SampleAnalyte
"cadmium" | "auramine_o"
SampleItem
object
| 名称 | 类型 | 说明 |
|---|---|---|
k必填 | integer | Sample number within the lot's sampling. |
fruit必填 | string | Fruit code as printed on the label. |
status必填 | "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.
| 名称 | 类型 | 说明 |
|---|---|---|
tenant_id必填 | string | The new company's id, the tenant every record of the token belongs to. |
api_token必填 | string | An API token of the company, role tenant_admin, sent as |
expires_at必填 | number | When the token stops working: 24 hours after the creation, Unix seconds. |
base_url必填 | string (uri) | The sandbox API's address: the requests go to |
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.
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
growing_area必填 | string | |
image_date必填 | string (date) | |
provider必填 | string | |
result必填 | "match" | "mismatch" | "inconclusive" | Whether the image matches the registered area. |
cultivated_ha必填 | number | null | |
deforestation必填 | boolean | |
confidence必填 | number | null | |
image_sha256必填 | string | null | SHA-256 of the image attachment; the blob itself is stored elsewhere. |
source必填 | "manual" | "automatic" | manual for every check recorded through this API. |
created_at必填 | number | Unix seconds. |
SatelliteCheckCreate
object
| 名称 | 类型 | 说明 |
|---|---|---|
image_date必填 | string (date) | |
provider必填 | string | |
result必填 | "match" | "mismatch" | "inconclusive" | |
cultivated_ha可选 | number | null | |
deforestation必填 | boolean | |
confidence可选 | number | null | |
image_sha256可选 | string | null |
SatelliteCheckPage
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<SatelliteCheck> | |
next_cursor必填 | string | null | Pass as |
SealRequest
object
| 名称 | 类型 | 说明 |
|---|---|---|
seal_no必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
second_factor必填 | "required" | |
ticket必填 | 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必填 | number | Unix seconds. |
SecondFactorLogin
object
| 名称 | 类型 | 说明 |
|---|---|---|
ticket必填 | string | |
code可选 | string | The 6-digit code from the authenticator app (spaces allowed). |
backup_code可选 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
user必填 | User | |
memberships必填 | array<Membership> | |
csrf_token必填 | string | |
two_factor可选 | TwoFactorState | |
second_factor必填 | "code" | "backup_code" | What proved the second factor. |
backup_codes_left必填 | 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).
| 名称 | 类型 | 说明 |
|---|---|---|
growing_area必填 | string | |
capability必填 | string | |
unit必填 | string | null | The vocabulary's UCUM unit of the capability. |
grain必填 | "hourly" | "daily" | "local_daily" | |
bucket_s必填 | number | Bucket width in seconds: 3600 or 86400. |
from必填 | number | Start of the range, Unix seconds. |
to必填 | number | End of the range (excluded), Unix seconds. |
truncated必填 | boolean | True when the answer reached the bucket cap (5000 buckets in all): the later depths or buckets were left out. |
series必填 | array<SensorSeriesDepth> | |
time_zone可选 | "Asia/Ho_Chi_Minh" |
|
day_starts_at可选 | number |
|
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).
| 名称 | 类型 | 说明 |
|---|---|---|
bucket_start必填 | number | Start of the UTC hour or day, or ( |
min必填 | number | null | Null when |
max必填 | number | null | Null when |
mean必填 | number | null | The sum of the values over |
count必填 | integer | Values in the statistics. |
n_total必填 | integer | Every reading of the bucket. |
n_pass必填 | integer | Readings flagged 1 (pass). |
n_not_evaluated必填 | integer | Readings flagged 2 (not evaluated). |
n_suspect必填 | integer | Readings flagged 3 (suspect). |
n_fail必填 | integer | Readings flagged 4 (fail). |
n_missing必填 | integer | Readings flagged 9 (missing value). |
SensorSeriesDepth
object
SENS-B1e (#235): the buckets of one depth, oldest first.
| 名称 | 类型 | 说明 |
|---|---|---|
depth_cm必填 | number | null | The readings' depth in cm; null for readings without a depth. |
buckets必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
device_id必填 | string | |
start_seq必填 | integer | First missing sequence number. |
end_seq必填 | integer | Last missing sequence number. |
missing必填 | integer | How many numbers are missing: end_seq - start_seq + 1. |
opened_at必填 | number | Unix seconds: when the server first saw the gap. |
alerted必填 | boolean | Whether the gap has been open long enough to raise a |
SeqGapPage
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<SeqGap> | |
next_cursor必填 | string | null | The next page's |
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.
| 名称 | 类型 | 说明 |
|---|---|---|
epoch必填 | string | The value a device cites in |
issuedAt必填 | string (date-time) | When the server issued it (UTC, milliseconds). |
kid必填 | string | The epoch key's id: |
sig必填 | object | |
publicKeyJwk必填 | 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).
| 名称 | 类型 | 说明 |
|---|---|---|
device_id必填 | string | |
command_id必填 | string | null | |
status必填 | "pending" | "sent" | "failed" | "refused" | "skipped" | |
reason必填 | "not_declared" | "dispatch_failed" | "device_not_found" | "device_not_approved" | "invalid_command" | null |
SessionFeed
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<SessionFeedItem> | |
next_after必填 | integer | The rx_seq of the last item, or the given |
session_status必填 | "open" | "paused" | "closed" | |
devices必填 | array<Device> | The devices stored on the session, by id. |
scale必填 | null | object | Scale live weight: the newest |
pending必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
rx_seq必填 | integer | |
fruit必填 | Fruit |
SessionsRevoked
object
| 名称 | 类型 | 说明 |
|---|---|---|
sessions_revoked必填 | integer | How many live sessions were ended. |
Shipment
object
| 名称 | 类型 | 说明 |
|---|---|---|
code必填 | string | |
facility必填 | string | |
container必填 | string | |
border_gate必填 | string | |
destination必填 | string | |
setpoint_c必填 | number | |
tolerance_c必填 | number | |
logger_interval_minutes必填 | integer | |
logger必填 | object | |
status必填 | "open" | "departed" | |
created_by必填 | string | |
created_at必填 | number | |
departed_by必填 | string | null | |
departed_at必填 | number | null | |
lots必填 | array<ShipmentLot> | |
logger_check必填 | LoggerCheck | |
national_portal必填 | NationalPortalFiling | |
upload可选 | object | Only in the answer of an upload: the stored upload, its readings and how many were new. |
consignee必填 | Consignee | null | |
documents必填 | array<ShipmentDocument> | |
paperwork必填 | ShipmentPaperwork | |
amendments必填 | array<ShipmentAmendment> |
ShipmentAmendment
object
A change made after the departure: the consignee or the document list before and after it.
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
kind必填 | "consignee" | "documents" | |
reason必填 | string | |
before必填 | object | The consignee (or null) or the document list before the change. |
after必填 | object | The consignee or the document list after the change. |
amended_by必填 | string | |
amended_at必填 | number |
ShipmentConsigneeSet
object
| 名称 | 类型 | 说明 |
|---|---|---|
consignee必填 | ConsigneeInput | |
reason可选 | string | Required once the shipment departed (the change is kept as an amendment); accepted and not kept before. |
ShipmentCreate
object
| 名称 | 类型 | 说明 |
|---|---|---|
code必填 | string | Unique within the tenant (a lot code's pattern). |
facility必填 | string | The departure facility: one of the tenant's, within the caller's facilities. |
container必填 | string | ISO 6346 container number; its check digit must be valid. |
border_gate必填 | string | The border gate the shipment heads for (a display string). |
destination必填 | "CN" | Destination market, ISO 3166-1 alpha-2. |
setpoint_c必填 | number | Reefer setpoint, Cel. |
tolerance_c可选 | number | Deviation from the setpoint a logger reading may show, Cel. |
logger_interval_minutes可选 | integer | The longest interval the logger may leave between readings. |
logger必填 | 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
| 名称 | 类型 | 说明 |
|---|---|---|
type必填 | "phytosanitary_certificate" | "certificate_of_origin" | "commercial_invoice" | "packing_list" | "customs_declaration" | "bill_of_lading" | "air_waybill" | "test_report" | "other" | |
number必填 | string | |
issued_on必填 | string (date) | |
attachment_sha256必填 | string | null | |
added_by必填 | string | |
added_at必填 | number |
ShipmentDocumentInput
object
| 名称 | 类型 | 说明 |
|---|---|---|
type必填 | "phytosanitary_certificate" | "certificate_of_origin" | "commercial_invoice" | "packing_list" | "customs_declaration" | "bill_of_lading" | "air_waybill" | "test_report" | "other" | |
number必填 | string | |
issued_on必填 | string (date) | YYYY-MM-DD, from 2000-01-01 to tomorrow (Asia/Ho_Chi_Minh). |
attachment_sha256可选 | string | null | A PDF the tenant uploaded (PUT /v1/attachments/{sha256}); staff-only. |
ShipmentDocumentsSet
object
| 名称 | 类型 | 说明 |
|---|---|---|
documents必填 | array<ShipmentDocumentInput> | The whole list, each (type, number) once; it replaces the stored one. |
reason可选 | string | Required once the shipment departed (the change is kept as an amendment); accepted and not kept before. |
ShipmentLot
object
| 名称 | 类型 | 说明 |
|---|---|---|
lot必填 | string | |
status必填 | string | |
cartons必填 | integer | |
seal_no必填 | string | The lot's seal number when it was linked. |
sealed_at必填 | number | |
current_seal_no必填 | string | null | The lot's seal number now. |
seal_matches必填 | boolean | |
added_by必填 | string | |
added_at必填 | number |
ShipmentLotLink
object
| 名称 | 类型 | 说明 |
|---|---|---|
lot必填 | string | A packed lot of the shipment's facility. |
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.
| 名称 | 类型 | 说明 |
|---|---|---|
required必填 | array<string> | |
missing必填 | array<string> | |
complete必填 | boolean |
ShipmentSscc
object
#161: the SSCC of a shipment's container load; null until set.
| 名称 | 类型 | 说明 |
|---|---|---|
shipment必填 | string | |
sscc必填 | string | null | GS1 Serial Shipping Container Code: 18 digits, the last the GS1 mod-10 check digit. |
epc必填 | string | null | |
element_string必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | The session's id: pass it to revokeMySession. |
browser必填 | 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必填 | string | null | The operating system: Windows, macOS, iOS, Android, ChromeOS or Linux; null when it could not be told. |
mobile必填 | boolean | Whether the browser said it runs on a phone. |
created_at必填 | integer | When the session was opened (sign-in), Unix seconds rounded down to the minute. |
last_seen_at必填 | integer | When the session was last used, Unix seconds rounded down to the minute (recorded at most once a minute). |
current必填 | boolean | Whether this is the session making the request. |
SignedInSessionList
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<SignedInSession> | The live sessions, the current one first, then the most recently used. |
SignedInSessionRevoked
object
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
revoked必填 | true |
SprayRecord
object
A spray record with its withholding status.
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
growing_area必填 | string | |
sprayed_on必填 | string (date) | |
product必填 | string | |
active_ingredient必填 | string | null | |
withholding_days必填 | integer | |
evidence_sha256必填 | string | null | |
created_at必填 | number | Unix seconds. |
safe_from必填 | string (date) | sprayed_on plus withholding_days: the first day a harvest is allowed. |
evaluated_on必填 | string (date) | The harvest date the status was judged against (today's UTC date when none was given). |
withholding_status必填 | "ok" | "violated" | violated when sprayed_on <= evaluated_on < safe_from. |
SprayRecordCreate
object
| 名称 | 类型 | 说明 |
|---|---|---|
sprayed_on必填 | string (date) | |
product必填 | string | |
active_ingredient可选 | string | null | |
withholding_days必填 | integer | |
evidence_sha256可选 | string | null |
SprayRecordPage
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<SprayRecord> | |
next_cursor必填 | string | null | Pass as |
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.
| 名称 | 类型 | 说明 |
|---|---|---|
v必填 | 1 | |
id必填 | string (uuid) | |
type必填 | "accept" | "remeasure" | "print" | |
gateway必填 | string | |
seq必填 | integer | The station's action counter: replay order. |
delegation必填 | string | |
operator必填 | string | |
fruit必填 | string | |
round可选 | integer | A re-measure only: the round the station numbered. |
recorded_at必填 | string (date-time) | The station's time, ISO 8601 with a zone offset. |
time_source可选 | "gnss" | "ntp" | "unsynced" | The station's clock state. |
since_claim_s可选 | 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 |
after可选 | array<string (uuid)> | The fruit's envelopes the station recorded before the action. |
sig必填 | StationSignature |
StationActionResult
object
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | string | |
type必填 | "accept" | "remeasure" | "print" | |
outcome必填 | "applied" | |
seq必填 | integer | |
fruit必填 | object |
StationClaim
object
| 名称 | 类型 | 说明 |
|---|---|---|
delegation必填 | object | |
labels必填 | array<StationLabel> | |
last_seq必填 | integer | null | The highest |
time必填 | number | The cloud's time (Unix seconds): the station counts the delegation's end from it on its monotonic clock. |
StationClaimRequest
object
| 名称 | 类型 | 说明 |
|---|---|---|
gateway必填 | string | |
time必填 | string (date-time) | The station's time, ISO 8601 with a zone offset. |
code必填 | string | |
sig必填 | StationSignature |
StationDelegation
object
#85: a station sign-in (Unix times).
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | string | |
gateway必填 | string | |
operator必填 | string | The operator's opaque id ( |
state必填 | "pending" | "unclaimed" | "active" | "expired" | "revoked" | pending: the code not typed yet; unclaimed: the code expired unused; active: claimed by the station; expired: past |
issued_at必填 | number | |
code_expires_at必填 | number | |
expires_at必填 | number | |
claimed_at必填 | number | null | |
revoked_at必填 | number | null |
StationDelegationList
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<StationDelegation> |
StationLabel
object
What the station's printer queue prints a fruit's 40 x 30 mm label from (#66, #92).
| 名称 | 类型 | 说明 |
|---|---|---|
code必填 | string | |
lot必填 | string | |
n必填 | integer | |
round必填 | integer | The fruit's measurement round. |
status必填 | string | |
qr_url必填 | string (uri) | |
label_code可选 | string | #326, with |
StationSignature
object
ES256 over the canonical JSON of every member but sig (an envelope's signature).
| 名称 | 类型 | 说明 |
|---|---|---|
alg必填 | "ES256" | |
kid必填 | string | |
value必填 | string |
StationSignIn
object
#85: a new station sign-in with its one-time code (shown only in this answer).
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | string | |
gateway必填 | string | |
operator必填 | string | The operator's opaque id ( |
state必填 | "pending" | "unclaimed" | "active" | "expired" | "revoked" | pending: the code not typed yet; unclaimed: the code expired unused; active: claimed by the station; expired: past |
issued_at必填 | number | |
code_expires_at必填 | number | |
expires_at必填 | number | |
claimed_at必填 | number | null | |
revoked_at必填 | number | null | |
code必填 | 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).
| 名称 | 类型 | 说明 |
|---|---|---|
lifetime_s可选 | integer |
StationSync
object
| 名称 | 类型 | 说明 |
|---|---|---|
delegations必填 | map<string, "active" | "revoked" | "expired" | "unknown"> | |
labels必填 | array<StationLabel> | |
last_seq必填 | integer | null | The highest |
time必填 | number |
StationSyncRequest
object
| 名称 | 类型 | 说明 |
|---|---|---|
gateway必填 | string | |
time必填 | string (date-time) | The station's time, ISO 8601 with a zone offset. |
delegations可选 | array<string> | |
sig必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
_status必填 | string |
SupportRequest
object
A support request as its company sees it (never who at CropPath changed it).
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
tenant必填 | string | The company the request came from. |
user必填 | SupportRequestUser | |
subject必填 | string | Plain text, as typed (trimmed). |
body必填 | string | Plain text, as typed (trimmed): never HTML or markdown; line breaks are kept. |
record_id必填 | string | null | The record the request is about (a lot code, device id, public id, ...), or null. |
status必填 | "open" | "in_progress" | "answered" | "closed" |
|
reply必填 | string | null | CropPath's reply (plain text), or null. |
created_at必填 | number | Seconds since 1970 (UTC). |
updated_at必填 | number | When the request was sent or CropPath last changed it. |
SupportRequestCreate
object
| 名称 | 类型 | 说明 |
|---|---|---|
subject必填 | string | 1 to 200 characters after trimming; no line breaks or other control characters. |
body必填 | string | 1 to 5000 characters after trimming; line breaks and tabs allowed, no other control characters. Stored and shown as plain text. |
record_id可选 | string | null | Optional: at most 100 letters, digits and . _ : / # -, starting with a letter or digit; blank or null for none. |
SupportRequestPage
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<SupportRequest> | |
next_cursor必填 | string | null | The next page's |
SupportRequestUpdate
object
A status, a reply, or both.
| 名称 | 类型 | 说明 |
|---|---|---|
status可选 | "open" | "in_progress" | "answered" | "closed" |
|
reply可选 | string | null | Plain text; line breaks allowed; null or blank clears it. |
SupportRequestUser
object
The member who sent the request.
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
email必填 | string | |
display_name必填 | string | null |
Tenant
object
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | string | |
name必填 | string | |
source必填 | "manual" | "backfill" | |
created_at必填 | number | Unix seconds. |
members必填 | 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必填 | integer | SELF-1-3 (#184): how many of them are active company admins whose account is active (SELF-1-4, #185). |
offboarding必填 | CompanyOffboarding | SELF-2-4 (#193): whether the company is leaving CropPath. |
platform可选 | boolean | #282: present only with listTenants |
TenantAdmin
object
| 名称 | 类型 | 说明 |
|---|---|---|
user_id必填 | integer | |
email必填 | string | The email the admin signs in with. |
display_name必填 | string | null | |
status必填 | "active" | "disabled" |
TenantAdminList
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<TenantAdmin> |
TenantCreate
object
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | string | |
name必填 | string |
TenantPage
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<Tenant> | |
next_cursor必填 | string | null | Pass as |
TrustReason
object
A machine-readable explanation: a stable code and its parameters, no prose.
| 名称 | 类型 | 说明 |
|---|---|---|
code必填 | string | A stable reason code of the trust engine (trust.Code). |
params必填 | map<string, string | integer> |
TrustTier
"self_declared" | "device_recorded" | "cross_checked" | "lab_verified"
Trust tiers, lowest first.
TwoFactorCode
object
| 名称 | 类型 | 说明 |
|---|---|---|
code必填 | string | The 6-digit code the app shows now. |
TwoFactorDisable
object
| 名称 | 类型 | 说明 |
|---|---|---|
password必填 | string | |
code可选 | string | The 6-digit code from the app; or send |
backup_code可选 | string | |
set_up_again可选 | 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
| 名称 | 类型 | 说明 |
|---|---|---|
reason可选 | string | Required from a platform admin (CropPath support): one line, kept in the company's activity log. Ignored for a company admin. |
TwoFactorResetResult
object
| 名称 | 类型 | 说明 |
|---|---|---|
user_id必填 | integer | |
two_factor必填 | false | |
sessions_revoked必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
secret必填 | string | 160 random bits in base32 (RFC 4648, no padding). |
otpauth_uri必填 | string | otpauth://totp/CropPath:<email>?secret=...&issuer=CropPath |
issuer必填 | "CropPath" | |
account必填 | string | |
digits必填 | 6 | |
period必填 | 30 |
TwoFactorState
object
SELF-1-6 (#187). The signed-in user's own two-step sign-in. Never the secret or a code.
| 名称 | 类型 | 说明 |
|---|---|---|
enabled必填 | boolean | The authenticator app is on for this account. |
backup_codes_left必填 | integer | Unused backup codes (0 when the app is off). |
verified必填 | boolean | This session proved a second factor (a code at sign-in, at re-authentication or when the app was turned on). |
required必填 | 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 |
deadline必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
page必填 | "landing" | "lot" | "fruit" | "fruit_results" | "privacy" | "accessibility" | "staff" | "other" | The kind of page, never its URL. |
lcp_ms可选 | number | Largest Contentful Paint, milliseconds. |
cls可选 | number | Cumulative Layout Shift (largest session window). |
inp_ms可选 | number | Interaction to Next Paint, milliseconds. |
errors可选 | array<object> |
User
object
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
email必填 | string | |
display_name必填 | string | null |
VerdictCounts
object
SENS-B1e (#235): how many positions of the device got each geofence verdict in the range.
| 名称 | 类型 | 说明 |
|---|---|---|
inside必填 | integer | |
near必填 | integer | |
outside必填 | integer | |
ambiguous必填 | integer | |
unverifiable必填 | integer | |
no_position必填 | integer | |
no_polygon必填 | integer |
VerdictMap
object
SENS-B1e (#235): the growing area's devices with their geofence verdicts over a range of reception times.
| 名称 | 类型 | 说明 |
|---|---|---|
growing_area必填 | string | |
from必填 | number | Start of the range of reception times, Unix seconds. |
to必填 | number | End of the range (included), Unix seconds. |
coordinates_shown必填 | boolean | Whether the install points and judged positions are given to this caller. |
truncated必填 | boolean | True when more than 500 devices matched: the rest, by device id, were left out. |
devices必填 | array<VerdictMapDevice> | Ordered by device id. |
polygon可选 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
device_id必填 | string | |
profile必填 | string | |
placement必填 | VerdictMapPlacement | null | Null for a device without a placement. |
verdict_counts必填 | VerdictCounts | |
latest_verdict必填 | GeofenceVerdict | null | |
latest_verdict_at必填 | number | null | When ingest judged the latest position (its reception). |
latest_position可选 | JudgedPosition | null | Present only when |
VerdictMapPlacement
object
SENS-B1e (#235): the device's current placement version.
| 名称 | 类型 | 说明 |
|---|---|---|
version必填 | integer | |
mobility必填 | "fixed" | "mobile" | |
growing_area必填 | string | null | The area the version binds the device to. |
bound_here必填 | boolean | The version is an installation bound to this area. |
depth_cm必填 | number | null | |
installed_at必填 | number | null | |
removed_at必填 | number | null | Set when the current version is a removal. |
install_point可选 | MapPoint | null | Present only when |
Volume
object
| 名称 | 类型 | 说明 |
|---|---|---|
growing_area必填 | string | |
season必填 | string | |
declared_kg必填 | number | |
cap_kg必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
subscription_id必填 | integer | |
event_id必填 | string | The |
event_type必填 | WebhookEventType | |
status必填 | "pending" | "delivered" | "failed" | |
attempts必填 | integer | Since the delivery was queued or redelivered. |
next_attempt_at必填 | number | null | |
last_attempt_at必填 | number | null | |
last_status必填 | integer | null | The last attempt's HTTP status; null: none. |
last_error必填 | string | null | Why the last attempt failed: |
created_at必填 | number | |
delivered_at必填 | number | null |
WebhookDeliveryPage
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | array<WebhookDelivery> | |
next_cursor必填 | string | null | The next page's |
WebhookEventLabResultRecorded
object
The body of a lab_result.recorded delivery (compact JSON, UTF-8).
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | string | Equals |
type必填 | "lab_result.recorded" | |
created_at必填 | string (date-time) | UTC, ISO 8601 with milliseconds. |
tenant必填 | string | |
data必填 | WebhookLabResultRecordedData |
WebhookEventLotRecalled
object
The body of a lot.recalled delivery (compact JSON, UTF-8).
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | string | Equals |
type必填 | "lot.recalled" | |
created_at必填 | string (date-time) | UTC, ISO 8601 with milliseconds. |
tenant必填 | string | |
data必填 | WebhookLotRecalledData |
WebhookEventLotSealed
object
The body of a lot.sealed delivery (compact JSON, UTF-8).
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | string | Equals |
type必填 | "lot.sealed" | |
created_at必填 | string (date-time) | UTC, ISO 8601 with milliseconds. |
tenant必填 | string | |
data必填 | WebhookLotSealedData |
WebhookEventLotTrustTierChanged
object
The body of a lot.trust_tier_changed delivery (compact JSON, UTF-8).
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | string | Equals |
type必填 | "lot.trust_tier_changed" | |
created_at必填 | string (date-time) | UTC, ISO 8601 with milliseconds. |
tenant必填 | string | |
data必填 | WebhookTrustTierChangedData |
WebhookEventLotWithdrawn
object
The body of a lot.withdrawn delivery (compact JSON, UTF-8).
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | string | Equals |
type必填 | "lot.withdrawn" | |
created_at必填 | string (date-time) | UTC, ISO 8601 with milliseconds. |
tenant必填 | string | |
data必填 | WebhookLotRecalledData |
WebhookEventReportFiled
object
The body of a report.filed delivery (compact JSON, UTF-8).
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | string | Equals |
type必填 | "report.filed" | |
created_at必填 | string (date-time) | UTC, ISO 8601 with milliseconds. |
tenant必填 | string | |
data必填 | WebhookReportFiledData |
WebhookEventShipmentDeparted
object
The body of a shipment.departed delivery (compact JSON, UTF-8).
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | string | Equals |
type必填 | "shipment.departed" | |
created_at必填 | string (date-time) | UTC, ISO 8601 with milliseconds. |
tenant必填 | string | |
data必填 | 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).
| 名称 | 类型 | 说明 |
|---|---|---|
lot必填 | string | |
sampling_id必填 | integer | |
lab必填 | string | |
report_no必填 | string | |
market必填 | string | |
signed_at必填 | string (date-time) | UTC, ISO 8601 with milliseconds. |
passed必填 | boolean |
WebhookLotRecalledData
object
lot.recalled and lot.withdrawn: the lot's recall or withdrawal (P5). The staff note never appears.
| 名称 | 类型 | 说明 |
|---|---|---|
lot必填 | string | |
public_id必填 | string | The lot's public id (its QR record). |
kind必填 | "recall" | "withdrawal" | |
reason必填 | "contamination" | "pathogen" | "foreign_matter" | "labelling" | "quality" | "regulatory" | "traceability" | "other" | |
scope必填 | "consumer" | "retail" | "wholesale" | |
recalled_at必填 | string (date-time) | UTC, ISO 8601 with milliseconds. |
cartons必填 | integer | |
shipments必填 | integer |
WebhookLotSealedData
object
lot.sealed: the lot was closed and its manifest signed (L10).
| 名称 | 类型 | 说明 |
|---|---|---|
lot必填 | string | |
public_id必填 | string | The lot's public id (its QR record). |
facility必填 | string | |
sealed_at必填 | string (date-time) | UTC, ISO 8601 with milliseconds. |
manifest_sha256必填 | string | |
fruit_count必填 | integer | |
event_count必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
report_id必填 | integer | |
lot必填 | string | |
fruit必填 | string | |
category必填 | "label_peeled" | "scanned_many" | "ripeness_off" | "other" | |
filed_at必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
subscription必填 | WebhookSubscription | |
secret必填 | string |
WebhookShipmentDepartedData
object
shipment.departed: the shipment left its facility; its lots are shipped.
| 名称 | 类型 | 说明 |
|---|---|---|
shipment必填 | string | |
facility必填 | string | |
container必填 | string | |
border_gate必填 | string | |
destination必填 | string | |
departed_at必填 | string (date-time) | UTC, ISO 8601 with milliseconds. |
lots必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | integer | |
url必填 | 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必填 | string | |
event_types必填 | array<WebhookEventType> | |
status必填 | "active" | "disabled" | Only an active subscription takes new events and is delivered to. |
disabled_reason必填 | "manual" | "failures" | null |
|
disabled_at必填 | number | null | |
consecutive_failures必填 | integer | Failed delivery attempts since the last success. |
created_by必填 | string | |
created_at必填 | number | |
updated_at必填 | number |
WebhookSubscriptionCreate
object
A tenant holds at most 20 subscriptions. The secret is generated by the server.
| 名称 | 类型 | 说明 |
|---|---|---|
url必填 | string | |
event_types必填 | array<WebhookEventType> | |
description可选 | string | null | One line. |
WebhookSubscriptionList
object
| 名称 | 类型 | 说明 |
|---|---|---|
items必填 | 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.
| 名称 | 类型 | 说明 |
|---|---|---|
url可选 | string | |
event_types可选 | array<WebhookEventType> | |
description可选 | string | null | |
enabled可选 | 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.