CropPath for developers

All guides

Public reads and caching

Available

Reading public lot and fruit records without a credential, and how long a copy may be cached.

The /v1/public/… routes need no credential and answer only what the public pages show. An id that is unknown, hidden or not public answers the same 404, so a 404 says nothing about whether a record exists.

A shared cache between you and CropPath (CropPath's content delivery network) may keep the answers of public reads:

So a change of status (a recall, a hold, a seal) can take up to 360 seconds to reach a cached copy. When you need the status now, for example before you accept goods, read past the cache: add a query parameter of your own with a new random value (the web pages use fresh), which the API ignores. A company can also subscribe to webhooks for its own lots: lot.sealed, lot.recalled, lot.withdrawn and lot.trust_tier_changed (sent only when the displayed trust tier changes). Webhooks never report another company's lots, so everyone else reads past the cache.

/public-scan/<id> belongs to the fruit page of the web site: it counts a consumer's scan, is never cached and refuses requests from other sites (403). Integrations must not call it; read GET /v1/public/fruits/{publicId}, which counts nothing.

In the API reference