Welcome to the KisanHub developer space! You'll find comprehensive guides and documentation to help you start working with KisanHub as quickly as possible, as well as support if you get stuck.
KisanHub is a supply management platform that brings complex agricultural and procurement data together in one convenient platform so you can better predict supply and make the most of demand.
If you have any questions, please get in touch with our team support@kisanhub.com
KisanHub uses Bearer Authentication (also called token authentication).
You must include an Authorization
header when making requests to the API:
Authorization: Token <token>
Please contact support@kisanhub.com to obtain your API token.
All API calls should end with a trailing /
: you'll get 301 error codes if you forget this.
All date-times are UTC and in RFC3339 format, although most APIs also accept simple dates without the time component (in YYYY-MM-DD format).
We use metric units throughout e.g we use hectares for area.
Some APIs will return localised names where available, in response to the ACCEPT_LANGUAGE
header. Note that we only use the first (language) part of the header value: e.g en-US
will be converted to en
. The language may also be overridden via the language
query parameter for convenience. Note that at the moment the only available languages are:
GET APIs will be default return all information associated with the requested entity. You can retrict the fields returned by using the only
query parameter. For example:
The Agritech industry as a whole uses a lot of terms in often conflicting and ambiguous ways. At KisanHub we've tried to come up with a standardised set of terms that we use throughout our platform, which should mostly map onto the terms you're expecting.
Term | Our meaning |
---|---|
User | A user of the KisanHub platform. |
Team | A grouping of users, often mapped to an organisation |
Organisation | An organisation is a named legal entity. There is a 1-1 mapping between organisation and team |
Site | A deprecated grouped of teams. Generally the site was associated a single KisanHub enterprise customer |
Farm | A hub from which a collection of fields are managed. A team can have one or many farms, and controls access to the fields and related data |
Field | A geographical region of land owned by a Farm that can be used to grow crops. |
Plot | A subsection of a Field which is to be (or has already been) planted with a single crop. |
Observation | An observation on a plot e.g ground cover. Observation is also called 'Crop Monitoring' |
Product | A product that can be applied to a plot e.g pesticide, fertiliser |
Genus | The genus of the planted crop e.g "Potato". Note that historically this was known as a Crop , and is still referred to as such in some older APIs (e.g crop_id ) |
Variety | The variety of the planted crop e.g "Adora" |
PestDisease | A general term and encompasses all pests and diseases that can afflict a crop |
Primary Growth Stage | A broad stage in the lifecycle of a crop, for example germination. |
Secondary Growth Stage | Represents a more granular metric of where a given crop is in it's Primary Growth Stage development. |
Store | A physical building owned by an organisation that can be used to store crop. |
Store Lot | StoreLot is the fraction of the store that contains, or will contain, an amount from the crop. |
Customer | The customer is the organisation who is paying for the produce in a transaction |
Load | A load is a transaction with a supplier/seller, a customer/buyer, and a crop |
Trade Record | A record of a load transaction that is sent to the customer and verified at intake |
Trading Agreement | A sales or purchase contract between two organisations |
Load Ticket | Another (deprecated) name for trade record |
Off-platform | An "off-platform" field or plot is one that is recorded on the platform but is not actively managed by us. Off-platform fields and plots have no polygons and so do not appear on the geojson APIs, but can otherwise be used as normal |
Operation | An operation on a plot e.g planting, harvest. An operation may either be planned or applied |
Operation schedule | A schedule of planned operations that can be created automatically after a specified trigger |
The following permission levels determine the actions and data that is available to the user:
Permission | Description |
---|---|
REGISTRATION_ADMIN | Registration admins can access and edit teams/users/farms and fields under their Site |
CROP_QUALITY_ADMIN | Allows creation and edit of crop quality templates |
SITE_ADMIN | DEPRECATED. Site admins can access and edit teams/users/farms/fields/plots under their Site |
When an API accepts a PUT request the object is not replaced it is updated. Only the attributes present in the request will be altered: default values will not be set for attributes that are absent from the request. As such you should pass in the entire object in the payload unless you want the PUT to behave like a PATCH.
Returns details for all visible users. In practise this will return the details for all users in all visible teams, so the same visibility rules for teams apply here. To recap: all users will be able to see their own teammates plus the details of all users in teams which have shared one or more plots with their team.
Users with SITE_ADMIN or REGISTRATION_ADMIN permission will in additional see users for all teams associated with their Site.
Kisanhub staff members can see all users regardless.
page | integer >= 1 Default: 1 Example: page=2 Page number |
page_size | integer [ 1 .. 100 ] Default: 20 Page size |
team_id | |
team_ids | |
organisation_id | |
string or string (DateOrDateTime) Example: updated_since=2020-01-02T10:00:00Z Return items created or updated since the specified data/time (inclusive). Date times are always in UTC and are specified in RFC3339 format. Can also be specified as simple dates e.g 2020-01-01, in which case midnight is assumed for the time component. | |
string Only return users with this email address | |
phone | string Only return users with this phone number |
search | string Text search - checks |
user_type | string Enum: "grower" "agronomist" Filter on the user type |
include_collaborators | boolean Deprecated Default: false This used to force the inclusion of users from teams which have shared plots. However that is now the default behaviour, so this has no effect and is ignored. |
permission | string Enum: "staff" "crop_quality_admin" "registration_admin" Filter users with the specified permission |
sort_field | string Enum: "id" "name" "last_access" Determine the sort field of returned users. Note that |
sort_direction | string Default: "asc" Enum: "asc" "desc" Sort direction |
state | string Default: "active" Enum: "active" "inactive" Filter by active or inactive user state. We will default to only returning active users |
{- "total": 0,
- "results": [
- {
- "id": 1,
- "username": "me@you.com",
- "first_name": "Bob",
- "last_name": "Smith",
- "email": "me@you.com",
- "is_active": true,
- "team_id": 5,
- "organisation_id": 7,
- "organisation_name": "Big Corp",
- "contact_details": {
- "phone_number": "+447803122523",
- "alt_phone_number": "+91564564542"
}, - "demographics": {
- "gender": "Male",
- "education": "string",
- "date_of_birth": "2019-08-24"
}, - "grower_details": {
- "global_gap_id": "string",
- "facts_id": "string",
- "basis_id": "string"
}, - "address": {
- "street_name": "Cambrige Road",
- "village": "Oakington",
- "town_city": "Cambridge",
- "county": "Cambridgeshire",
- "state": "East Anglia",
- "post_code": "AB23 5FR",
- "plus_code": "string",
- "country": "GB",
- "address": "string",
- "locality": "string"
}, - "permissions": {
- "registration_admin": true,
- "is_staff": true,
- "crop_quality_admin": true
}, - "last_access": "2019-08-24T14:15:22Z"
}
]
}
Create a new user. A user with TEAM_ADMIN may create users for their own team. An Enterprise user with SITE_ADMIN permission may create users for any of their client teams. A Kisanhub staff user may create users for any teams.
username required | string Globally unique username. This should be the either the supplied phone number or the email address |
first_name required | string First (and middle) name |
last_name required | string Last name |
string | |
is_active | boolean Is this an active user? |
team_id | integer Primary team key |
organisation_id | integer Organisation ID |
object (ContactDetails) Contact details | |
object (UserDemographics) Demographical user information | |
object (GrowerDetails) | |
Address (object) or LegacyAddress (object) (schemas-Address) User address. Please use the newer | |
object (Permissions) | |
last_access | string <date-time> Date-time when this user last accessed the KisanHub platform via an API call |
password required | string <password> |
{- "username": "me@you.com",
- "first_name": "Bob",
- "last_name": "Smith",
- "email": "me@you.com",
- "is_active": true,
- "team_id": 5,
- "organisation_id": 7,
- "contact_details": {
- "phone_number": "+447803122523",
- "alt_phone_number": "+91564564542"
}, - "demographics": {
- "gender": "Male",
- "education": "string",
- "date_of_birth": "2019-08-24"
}, - "grower_details": {
- "global_gap_id": "string",
- "facts_id": "string",
- "basis_id": "string"
}, - "address": {
- "street_name": "Cambrige Road",
- "village": "Oakington",
- "town_city": "Cambridge",
- "county": "Cambridgeshire",
- "state": "East Anglia",
- "post_code": "AB23 5FR",
- "plus_code": "string",
- "country": "GB",
- "address": "string",
- "locality": "string"
}, - "permissions": {
- "registration_admin": true,
- "is_staff": true,
- "crop_quality_admin": true
}, - "last_access": "2019-08-24T14:15:22Z",
- "password": "pa$$word"
}
{- "id": 1,
- "username": "me@you.com",
- "first_name": "Bob",
- "last_name": "Smith",
- "email": "me@you.com",
- "is_active": true,
- "team_id": 5,
- "organisation_id": 7,
- "organisation_name": "Big Corp",
- "contact_details": {
- "phone_number": "+447803122523",
- "alt_phone_number": "+91564564542"
}, - "demographics": {
- "gender": "Male",
- "education": "string",
- "date_of_birth": "2019-08-24"
}, - "grower_details": {
- "global_gap_id": "string",
- "facts_id": "string",
- "basis_id": "string"
}, - "address": {
- "street_name": "Cambrige Road",
- "village": "Oakington",
- "town_city": "Cambridge",
- "county": "Cambridgeshire",
- "state": "East Anglia",
- "post_code": "AB23 5FR",
- "plus_code": "string",
- "country": "GB",
- "address": "string",
- "locality": "string"
}, - "permissions": {
- "registration_admin": true,
- "is_staff": true,
- "crop_quality_admin": true
}, - "last_access": "2019-08-24T14:15:22Z"
}
Return a single user. A user with TEAM_ADMIN permission may access any users within their team. An Enterprise user with SITE_ADMIN permission view users in any of their client teams. A Kisanhub staff user may view any user.
id required | integer (PrimaryKey) >= 1 Example: 1 User ID |
{- "id": 1,
- "username": "me@you.com",
- "first_name": "Bob",
- "last_name": "Smith",
- "email": "me@you.com",
- "is_active": true,
- "team_id": 5,
- "organisation_id": 7,
- "organisation_name": "Big Corp",
- "contact_details": {
- "phone_number": "+447803122523",
- "alt_phone_number": "+91564564542"
}, - "demographics": {
- "gender": "Male",
- "education": "string",
- "date_of_birth": "2019-08-24"
}, - "grower_details": {
- "global_gap_id": "string",
- "facts_id": "string",
- "basis_id": "string"
}, - "address": {
- "street_name": "Cambrige Road",
- "village": "Oakington",
- "town_city": "Cambridge",
- "county": "Cambridgeshire",
- "state": "East Anglia",
- "post_code": "AB23 5FR",
- "plus_code": "string",
- "country": "GB",
- "address": "string",
- "locality": "string"
}, - "permissions": {
- "registration_admin": true,
- "is_staff": true,
- "crop_quality_admin": true
}, - "last_access": "2019-08-24T14:15:22Z"
}
Update an existing user. A user should always be able to update their own details. A user with TEAM_ADMIN permission may update any user within their own team. An Enterprise user with SITE_ADMIN permission may update any user in any of their client teams. A Kisanhub staff user may update any user in any team.
id required | integer (PrimaryKey) >= 1 Example: 1 User ID |
username required | string Globally unique username. This should be the either the supplied phone number or the email address |
first_name required | string First (and middle) name |
last_name required | string Last name |
string | |
is_active | boolean Is this an active user? |
team_id | integer Primary team key |
organisation_id | integer Organisation ID |
object (ContactDetails) Contact details | |
object (UserDemographics) Demographical user information | |
object (GrowerDetails) | |
Address (object) or LegacyAddress (object) (schemas-Address) User address. Please use the newer | |
object (Permissions) | |
last_access | string <date-time> Date-time when this user last accessed the KisanHub platform via an API call |
{- "username": "me@you.com",
- "first_name": "Bob",
- "last_name": "Smith",
- "email": "me@you.com",
- "is_active": true,
- "team_id": 5,
- "organisation_id": 7,
- "contact_details": {
- "phone_number": "+447803122523",
- "alt_phone_number": "+91564564542"
}, - "demographics": {
- "gender": "Male",
- "education": "string",
- "date_of_birth": "2019-08-24"
}, - "grower_details": {
- "global_gap_id": "string",
- "facts_id": "string",
- "basis_id": "string"
}, - "address": {
- "street_name": "Cambrige Road",
- "village": "Oakington",
- "town_city": "Cambridge",
- "county": "Cambridgeshire",
- "state": "East Anglia",
- "post_code": "AB23 5FR",
- "plus_code": "string",
- "country": "GB",
- "address": "string",
- "locality": "string"
}, - "permissions": {
- "registration_admin": true,
- "is_staff": true,
- "crop_quality_admin": true
}, - "last_access": "2019-08-24T14:15:22Z"
}
{- "id": 1,
- "username": "me@you.com",
- "first_name": "Bob",
- "last_name": "Smith",
- "email": "me@you.com",
- "is_active": true,
- "team_id": 5,
- "organisation_id": 7,
- "organisation_name": "Big Corp",
- "contact_details": {
- "phone_number": "+447803122523",
- "alt_phone_number": "+91564564542"
}, - "demographics": {
- "gender": "Male",
- "education": "string",
- "date_of_birth": "2019-08-24"
}, - "grower_details": {
- "global_gap_id": "string",
- "facts_id": "string",
- "basis_id": "string"
}, - "address": {
- "street_name": "Cambrige Road",
- "village": "Oakington",
- "town_city": "Cambridge",
- "county": "Cambridgeshire",
- "state": "East Anglia",
- "post_code": "AB23 5FR",
- "plus_code": "string",
- "country": "GB",
- "address": "string",
- "locality": "string"
}, - "permissions": {
- "registration_admin": true,
- "is_staff": true,
- "crop_quality_admin": true
}, - "last_access": "2019-08-24T14:15:22Z"
}
Partially update an existing user
id required | integer (PrimaryKey) >= 1 Example: 1 User ID |
username required | string Globally unique username. This should be the either the supplied phone number or the email address |
first_name required | string First (and middle) name |
last_name required | string Last name |
string | |
is_active | boolean Is this an active user? |
team_id | integer Primary team key |
organisation_id | integer Organisation ID |
object (ContactDetails) Contact details | |
object (UserDemographics) Demographical user information | |
object (GrowerDetails) | |
Address (object) or LegacyAddress (object) (schemas-Address) User address. Please use the newer | |
object (Permissions) | |
last_access | string <date-time> Date-time when this user last accessed the KisanHub platform via an API call |
{- "username": "me@you.com",
- "first_name": "Bob",
- "last_name": "Smith",
- "email": "me@you.com",
- "is_active": true,
- "team_id": 5,
- "organisation_id": 7,
- "contact_details": {
- "phone_number": "+447803122523",
- "alt_phone_number": "+91564564542"
}, - "demographics": {
- "gender": "Male",
- "education": "string",
- "date_of_birth": "2019-08-24"
}, - "grower_details": {
- "global_gap_id": "string",
- "facts_id": "string",
- "basis_id": "string"
}, - "address": {
- "street_name": "Cambrige Road",
- "village": "Oakington",
- "town_city": "Cambridge",
- "county": "Cambridgeshire",
- "state": "East Anglia",
- "post_code": "AB23 5FR",
- "plus_code": "string",
- "country": "GB",
- "address": "string",
- "locality": "string"
}, - "permissions": {
- "registration_admin": true,
- "is_staff": true,
- "crop_quality_admin": true
}, - "last_access": "2019-08-24T14:15:22Z"
}
{- "id": 1,
- "username": "me@you.com",
- "first_name": "Bob",
- "last_name": "Smith",
- "email": "me@you.com",
- "is_active": true,
- "team_id": 5,
- "organisation_id": 7,
- "organisation_name": "Big Corp",
- "contact_details": {
- "phone_number": "+447803122523",
- "alt_phone_number": "+91564564542"
}, - "demographics": {
- "gender": "Male",
- "education": "string",
- "date_of_birth": "2019-08-24"
}, - "grower_details": {
- "global_gap_id": "string",
- "facts_id": "string",
- "basis_id": "string"
}, - "address": {
- "street_name": "Cambrige Road",
- "village": "Oakington",
- "town_city": "Cambridge",
- "county": "Cambridgeshire",
- "state": "East Anglia",
- "post_code": "AB23 5FR",
- "plus_code": "string",
- "country": "GB",
- "address": "string",
- "locality": "string"
}, - "permissions": {
- "registration_admin": true,
- "is_staff": true,
- "crop_quality_admin": true
}, - "last_access": "2019-08-24T14:15:22Z"
}
Reactivate a user. A non-staff user may only reactivate users in their own team or in teams that they manage
id required | integer (PrimaryKey) >= 1 Example: 1 User ID |
{- "id": 1,
- "username": "me@you.com",
- "first_name": "Bob",
- "last_name": "Smith",
- "email": "me@you.com",
- "is_active": true,
- "team_id": 5,
- "organisation_id": 7,
- "organisation_name": "Big Corp",
- "contact_details": {
- "phone_number": "+447803122523",
- "alt_phone_number": "+91564564542"
}, - "demographics": {
- "gender": "Male",
- "education": "string",
- "date_of_birth": "2019-08-24"
}, - "grower_details": {
- "global_gap_id": "string",
- "facts_id": "string",
- "basis_id": "string"
}, - "address": {
- "street_name": "Cambrige Road",
- "village": "Oakington",
- "town_city": "Cambridge",
- "county": "Cambridgeshire",
- "state": "East Anglia",
- "post_code": "AB23 5FR",
- "plus_code": "string",
- "country": "GB",
- "address": "string",
- "locality": "string"
}, - "permissions": {
- "registration_admin": true,
- "is_staff": true,
- "crop_quality_admin": true
}, - "last_access": "2019-08-24T14:15:22Z"
}
Deactivate the user. A non-staff user may only deactivate users in their own team or in teams that they manage. You cannot deactivate your own user.
id required | integer (PrimaryKey) >= 1 Example: 1 User ID |
{- "id": 1,
- "username": "me@you.com",
- "first_name": "Bob",
- "last_name": "Smith",
- "email": "me@you.com",
- "is_active": true,
- "team_id": 5,
- "organisation_id": 7,
- "organisation_name": "Big Corp",
- "contact_details": {
- "phone_number": "+447803122523",
- "alt_phone_number": "+91564564542"
}, - "demographics": {
- "gender": "Male",
- "education": "string",
- "date_of_birth": "2019-08-24"
}, - "grower_details": {
- "global_gap_id": "string",
- "facts_id": "string",
- "basis_id": "string"
}, - "address": {
- "street_name": "Cambrige Road",
- "village": "Oakington",
- "town_city": "Cambridge",
- "county": "Cambridgeshire",
- "state": "East Anglia",
- "post_code": "AB23 5FR",
- "plus_code": "string",
- "country": "GB",
- "address": "string",
- "locality": "string"
}, - "permissions": {
- "registration_admin": true,
- "is_staff": true,
- "crop_quality_admin": true
}, - "last_access": "2019-08-24T14:15:22Z"
}
Invite one or more users by email to an organisation.
While any user may invite a user to their own organisation, permission to invite to another organisation is restricted by the following rules:
registration_admin
access may invite users to organisations that they are managingOnly KisanHub staff may set the is_staff
or registration_admin
permission, and only registration
admins may set the crop_quality_admin
flag.
organisation_id | integer Organisation ID. If not specified then assume the user's own organisation. |
Array of objects |
{- "organisation_id": 7,
- "users": [
- {
- "email": "me@you.com",
- "registration_admin": true,
- "is_staff": true,
- "crop_quality_admin": true
}
]
}
Verify a user invite token and return details about the inviter
token required | string Token generated as a result of the user invite |
{- "inviter_user_name": "string",
- "inviter_organisation_name": 0,
- "target_organisation_name": 0
}
Create a new user using an invite token
token required | string Token generated as a result of the user invite |
first_name required | string First name |
last_name required | string Last name |
phone_number | string Phone number (preferably mobile) |
password required | string The desired password |
{- "first_name": "string",
- "last_name": "string",
- "phone_number": "string",
- "password": "string"
}
{- "user_id": 0,
- "username": "string",
- "email": "string",
- "organisation_id": 0,
- "team_id": 0,
- "first_name": "string",
- "last_name": "string",
- "features": [
- "crop_quality_module"
], - "permissions": [
- "FIELD_OFFICER"
], - "is_staff": true
}
Set a new account password.
uid required | integer User ID of the account. |
password required | string The desired password for the account. |
token required | string The generated token used to verify the password reset. |
{- "uid": 0,
- "password": "string",
- "token": "string"
}
Returns a list of training events attended by the given user
user_id required | integer >= 1 id of the user whose training data should be fetched |
page | integer >= 1 Default: 1 Example: page=2 Page number |
page_size | integer [ 1 .. 100 ] Default: 20 Page size |
year | integer Year of the training when it was conducted |
status | string Default: "attended" Enum: "attended" "absent" "registered" Status of the user registration for a training |
{- "total": 0,
- "results": [
- {
- "id": 0,
- "title": "string",
- "description": "string",
- "start_datetime": "2019-08-24",
- "end_datetime": "2019-08-24",
- "location": "string",
- "organizer_name": "string",
- "category_name": "string"
}
]
}
Returns user profile information which includes team, organisation, name and all available features and permission levels for the requesting user
{- "user_id": 0,
- "username": "string",
- "email": "string",
- "organisation_id": 0,
- "team_id": 0,
- "first_name": "string",
- "last_name": "string",
- "features": [
- "crop_quality_module"
], - "permissions": [
- "FIELD_OFFICER"
], - "is_staff": true
}
A list of selected team IDs, mainly used so we can deliver relevant notifications.
selected_team_ids required | Array of integers A list of selected team IDs. |
{- "selected_team_ids": [
- 0
]
}
{- "selected_team_ids": [
- 0
]
}
Submit feedback on app functionality for our team to review
comment | string Comment to include with the user feedback (max 500 characters) |
image | string Screenshot of the associated page user is giving feedback for |
star_rating | integer Rating of the page, from 1 to 5 |
url | string URL of the page the user is giving feedback for |
submitted_by | integer ID of the user submitting the feedback |
submitted_at | string <date-time> Datetime of submission - defaults to now |
permission_to_contact | boolean Whether the user is happy to be contacted about this feedback |
{- "comment": "string",
- "image": "string",
- "star_rating": 0,
- "url": "string",
- "submitted_by": 0,
- "submitted_at": "2019-08-24T14:15:22Z",
- "permission_to_contact": true
}
{- "comment": "string",
- "image": "string",
- "star_rating": 0,
- "url": "string",
- "submitted_by": 0,
- "submitted_at": "2019-08-24T14:15:22Z",
- "permission_to_contact": true
}
Returns a list of all teams for which the user is currently able to view any Plots or Storelots. A Team is added to the list if any of the following conditions are met:
page | integer >= 1 Default: 1 Example: page=2 Page number |
string or string (DateOrDateTime) Example: updated_since=2020-01-02T10:00:00Z Return items created or updated since the specified data/time (inclusive). Date times are always in UTC and are specified in RFC3339 format. Can also be specified as simple dates e.g 2020-01-01, in which case midnight is assumed for the time component. | |
page_size | integer [ 0 .. 100 ] Default: 20 Page size. Use "0" for all results in a single page |
search | string Search for team by name |
exclude_plot_shares | boolean Default: false Returns the team to which the user belongs. |
only_plot_shares | boolean Default: false If true then only include teams that own Plots which are open & visible to the user; either because they belong to the user's team, or because they have been shared with the user's team. |
only_storelot_shares | boolean Default: false If true then only include teams that own Storelots which are open & visible to the user; either because they belong to the user's team, or because they have been shared with the user's team. |
only_shares | boolean Default: false If true then only include teams that own either Plots or Storelots which are open & visible to the user. This is already the default response for most users. This option is relevant to users with admin permissions and allows them to ignore their admin permissions and see only the teams from which data has been shared with them. |
site_id | integer Filters by Site ID |
integration | string Get all the teams who have subscribed to this integration |
exclude_shared_with_plot | integer Exclude any teams that this specific plot has been shared with. |
{- "total": 0,
- "results": [
- {
- "id": 1,
- "name": "string",
- "slug": "string",
- "lead": 1,
- "site_id": 0,
- "global_gap_id": "string",
- "organisation_id": 1
}
]
}
Create a new Team. Only Kisanhub staff and enterprise users with SITE_ADMIN permission will be allowed to create teams.
name | string Team name |
slug | string Deprecated Legacy identifier |
site_id | integer Deprecated Teams are associated with a parent "Site". This is a legacy concept which will be replaced with a full organisational structure shortly. |
global_gap_id | string Global gap id of the lead user. |
{- "name": "string",
- "slug": "string",
- "site_id": 0,
- "global_gap_id": "string"
}
{- "id": 1,
- "name": "string",
- "slug": "string",
- "lead": 1,
- "site_id": 0,
- "global_gap_id": "string",
- "organisation_id": 1
}
Accessible teams will depend on the access rights of the requesting user. A user will always be able to view their own team, and teams that have shared plots with them. A user with the SITE_ADMIN permission in an Enterprise team will be able to view users of client teams. A Kisanhub staff member will be able to view all teams.
id required | integer (PrimaryKey) >= 1 Example: 1 Team ID |
{- "id": 1,
- "name": "string",
- "slug": "string",
- "lead": 1,
- "site_id": 0,
- "global_gap_id": "string",
- "organisation_id": 1
}
Note that the team name must be globally unique
id required | integer (PrimaryKey) >= 1 Example: 1 Team ID |
name | string Team name |
slug | string Deprecated Legacy identifier |
site_id | integer Deprecated Teams are associated with a parent "Site". This is a legacy concept which will be replaced with a full organisational structure shortly. |
global_gap_id | string Global gap id of the lead user. |
{- "name": "string",
- "slug": "string",
- "site_id": 0,
- "global_gap_id": "string"
}
{- "id": 1,
- "name": "string",
- "slug": "string",
- "lead": 1,
- "site_id": 0,
- "global_gap_id": "string",
- "organisation_id": 1
}
A farm in KisanHub owns a set of fields. It has a geographic location and an address, and is owned by a single team.
The following rules determine whether a particular user can edit or delete a farm:
A user can view a farm if any of the above rules are satisfied, or if one or more plots from fields in the farm have been shared with the user or their team.
Return a list of farms. A farm is included in the list if any of the following conditions are met:
exclude_plot_shares
query parameter is set to "true"page | integer >= 1 Default: 1 Example: page=2 Page number |
page_size | integer [ 1 .. 100 ] Default: 20 Page size |
team_id | |
team_ids | |
search | string Example: search=my-plot Text search |
string or string (DateOrDateTime) Example: updated_since=2020-01-02T10:00:00Z Return items created or updated since the specified data/time (inclusive). Date times are always in UTC and are specified in RFC3339 format. Can also be specified as simple dates e.g 2020-01-01, in which case midnight is assumed for the time component. | |
created_by_id | |
exclude_no_plots | boolean Default: false If true then exclude farms which have shared plots |
exclude_plot_shares | boolean Default: false If true then exclude farms that are only visible due to Plot sharing |
{- "total": 0,
- "results": [
- {
- "id": 1,
- "slug": "string",
- "name": "string",
- "team_id": 1,
- "address": {
- "address1": "string",
- "address2": "string",
- "address3": "string",
- "address4": "string",
- "address_code": "string",
- "country_code": "st",
- "street_name": "string",
- "village": "string",
- "town_city": "string",
- "county": "string",
- "state": "string",
- "post_code": "string",
- "plus_code": "string"
}, - "location": [
- -1.30329,
- 51.17687
], - "access": "read-edit",
- "notes": "string",
- "created_by_id": 1,
- "created_by_name": "Billy bob",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_by_id": 1,
- "updated_by_name": "Billy bob",
- "updated_at": "2019-08-24T14:15:22Z"
}
]
}
Create a new farm. A team user with TEAM_ADMIN permission will be able to create a farm for their team. An enterprise user with SITE_ADMIN permission will be able to create a farm for a client team. A Kisanhub staff member can create farms for any team.
name required | string Farm name |
object (components-schemas-Address) | |
location required | Array of numbers <float> (Point) = 2 items [ items <float > ] Point location as a [lng, lat] pair |
notes | string Any notes related to the farm |
{- "name": "string",
- "address": {
- "address1": "string",
- "address2": "string",
- "address3": "string",
- "address4": "string",
- "address_code": "string",
- "country_code": "st",
- "street_name": "string",
- "village": "string",
- "town_city": "string",
- "county": "string",
- "state": "string",
- "post_code": "string",
- "plus_code": "string"
}, - "location": [
- -1.30329,
- 51.17687
], - "notes": "string"
}
{- "id": 1,
- "slug": "string",
- "name": "string",
- "team_id": 1,
- "address": {
- "address1": "string",
- "address2": "string",
- "address3": "string",
- "address4": "string",
- "address_code": "string",
- "country_code": "st",
- "street_name": "string",
- "village": "string",
- "town_city": "string",
- "county": "string",
- "state": "string",
- "post_code": "string",
- "plus_code": "string"
}, - "location": [
- -1.30329,
- 51.17687
], - "access": "read-edit",
- "notes": "string",
- "created_by_id": 1,
- "created_by_name": "Billy bob",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_by_id": 1,
- "updated_by_name": "Billy bob",
- "updated_at": "2019-08-24T14:15:22Z"
}
Farm summaries in GeoJSON format
team_id | |
season | string Deprecated Example: season=2019/20 Growing season |
{- "type": "FeatureCollection",
- "features": [
- {
- "type": "Feature",
- "geometry": {
- "type": "Point",
- "coordinates": [
- -1.30329,
- 51.17687
]
}, - "properties": {
- "id": 0,
- "name": "string"
}
}
]
}
Return a single farm by ID
id required | integer (PrimaryKey) >= 1 Example: 1 ID |
{- "id": 1,
- "slug": "string",
- "name": "string",
- "team_id": 1,
- "address": {
- "address1": "string",
- "address2": "string",
- "address3": "string",
- "address4": "string",
- "address_code": "string",
- "country_code": "st",
- "street_name": "string",
- "village": "string",
- "town_city": "string",
- "county": "string",
- "state": "string",
- "post_code": "string",
- "plus_code": "string"
}, - "location": [
- -1.30329,
- 51.17687
], - "access": "read-edit",
- "notes": "string",
- "created_by_id": 1,
- "created_by_name": "Billy bob",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_by_id": 1,
- "updated_by_name": "Billy bob",
- "updated_at": "2019-08-24T14:15:22Z"
}
Update an existing farm. A team user with TEAM_ADMIN permission will be able to update a farm if it is owned by their team. An enterprise user with SITE_ADMIN permission will be able to update a farm for a client team. A Kisanhub staff member can update any farm.
id required | integer (PrimaryKey) >= 1 Example: 1 Farm ID |
name required | string Farm name |
object (components-schemas-Address) | |
location required | Array of numbers <float> (Point) = 2 items [ items <float > ] Point location as a [lng, lat] pair |
notes | string Any notes related to the farm |
{- "name": "string",
- "address": {
- "address1": "string",
- "address2": "string",
- "address3": "string",
- "address4": "string",
- "address_code": "string",
- "country_code": "st",
- "street_name": "string",
- "village": "string",
- "town_city": "string",
- "county": "string",
- "state": "string",
- "post_code": "string",
- "plus_code": "string"
}, - "location": [
- -1.30329,
- 51.17687
], - "notes": "string"
}
{- "id": 1,
- "slug": "string",
- "name": "string",
- "team_id": 1,
- "address": {
- "address1": "string",
- "address2": "string",
- "address3": "string",
- "address4": "string",
- "address_code": "string",
- "country_code": "st",
- "street_name": "string",
- "village": "string",
- "town_city": "string",
- "county": "string",
- "state": "string",
- "post_code": "string",
- "plus_code": "string"
}, - "location": [
- -1.30329,
- 51.17687
], - "access": "read-edit",
- "notes": "string",
- "created_by_id": 1,
- "created_by_name": "Billy bob",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_by_id": 1,
- "updated_by_name": "Billy bob",
- "updated_at": "2019-08-24T14:15:22Z"
}
Returns the permission level for this farm. A user has read/write access to a farm if any of the following conditions are met:
The user has read-only access to a farm only if they have access to any of the plots contained by any fields owned by this farm, and none of the above conditions apply.
id required | integer (PrimaryKey) >= 1 Example: 1 ID |
{- "access": "read-edit",
- "noDeleteReason": "string"
}
A field corresponds to a bounded area of land that will be used to grow crops. In general fields are unchanged over time, since they represent real physical boundaries. A field will contain one or more plots.
Return a list of fields. The accessible fields depends on the request user permissions:
page | integer >= 1 Default: 1 Example: page=2 Page number |
page_size | integer [ 1 .. 100 ] Default: 20 Page size |
farm_id | |
team_id | |
organisation_id | |
team_ids | |
search | string Example: search=my-plot Text search |
string or string (DateOrDateTime) Example: updated_since=2020-01-02T10:00:00Z Return items created or updated since the specified data/time (inclusive). Date times are always in UTC and are specified in RFC3339 format. Can also be specified as simple dates e.g 2020-01-01, in which case midnight is assumed for the time component. | |
created_by_id | |
off_platform | string Enum: "only" "exclude" If only then only returns "off-platform" fields· If exclude then exclude "off-platform" fields. If not specified then fields of both types are returned. |
has_active_plots | boolean Example: has_active_plots=true If set then only include fields which have any active plots |
genus_id |
{- "total": 0,
- "results": [
- {
- "created_at": "2019-08-24T14:15:22Z",
- "created_by_id": 1,
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_by_id": 1,
- "id": 1,
- "slug": "string",
- "access": "read-edit",
- "farm_id": 1,
- "organisation_id": 1,
- "team_id": 0,
- "name": "string",
- "government_id": "string",
- "soil_type_id": 1,
- "region": "string",
- "country_code": "st",
- "boundary": {
- "bounds": [
- [
- -1.30329,
- 51.17687
], - [
- -1.29829,
- 51.17687
], - [
- -1.29829,
- 51.17287
]
], - "area": 2.4
}, - "weather_station_slug": "string",
- "location_slug": "string",
- "centroid": [
- -1.30329,
- 51.17687
], - "notes": "string",
- "noDeleteReason": "string"
}
]
}
Create a new field. If a team user with TEAM_ADMIN can create fields for their own farm. An enterprise user with SITE_ADMIN permission may create fields for a farms owned by any of their client teams. A Kisanhub staff member may create a field for any farm.
farm_id required | integer >= 1 Farm ID if owned by a farm (i.e is "on-platform") |
organisation_id | integer >= 1 Organisation ID if this is an off-platform field owned by an organisation |
name required | string Field name |
government_id | string Governmental field identifier |
soil_type_id required | integer >= 1 Primary key |
object (Boundary) Bounding polygon | |
centroid | Array of numbers <float> (Point) = 2 items [ items <float > ] Point location as a [lng, lat] pair |
notes | string Any notes related to the field |
noDeleteReason | string Describes why the entity cannot be deleted (usually because it contains other entities) |
{- "farm_id": 1,
- "organisation_id": 1,
- "name": "string",
- "government_id": "string",
- "soil_type_id": 1,
- "boundary": {
- "bounds": [
- [
- -1.30329,
- 51.17687
], - [
- -1.29829,
- 51.17687
], - [
- -1.29829,
- 51.17287
]
], - "area": 2.4
}, - "centroid": [
- -1.30329,
- 51.17687
], - "notes": "string",
- "noDeleteReason": "string"
}
{- "created_at": "2019-08-24T14:15:22Z",
- "created_by_id": 1,
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_by_id": 1,
- "id": 1,
- "slug": "string",
- "access": "read-edit",
- "farm_id": 1,
- "organisation_id": 1,
- "team_id": 0,
- "name": "string",
- "government_id": "string",
- "soil_type_id": 1,
- "region": "string",
- "country_code": "st",
- "boundary": {
- "bounds": [
- [
- -1.30329,
- 51.17687
], - [
- -1.29829,
- 51.17687
], - [
- -1.29829,
- 51.17287
]
], - "area": 2.4
}, - "weather_station_slug": "string",
- "location_slug": "string",
- "centroid": [
- -1.30329,
- 51.17687
], - "notes": "string",
- "noDeleteReason": "string"
}
{- "created_at": "2019-08-24T14:15:22Z",
- "created_by_id": 1,
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_by_id": 1,
- "id": 1,
- "slug": "string",
- "access": "read-edit",
- "farm_id": 1,
- "organisation_id": 1,
- "team_id": 0,
- "name": "string",
- "government_id": "string",
- "soil_type_id": 1,
- "region": "string",
- "country_code": "st",
- "boundary": {
- "bounds": [
- [
- -1.30329,
- 51.17687
], - [
- -1.29829,
- 51.17687
], - [
- -1.29829,
- 51.17287
]
], - "area": 2.4
}, - "weather_station_slug": "string",
- "location_slug": "string",
- "centroid": [
- -1.30329,
- 51.17687
], - "notes": "string",
- "noDeleteReason": "string"
}
Update an existing field. If a team user with TEAM_ADMIN can update fields for their own farm. An enterprise user with SITE_ADMIN permission may update fields for a farms owned by any of their client teams. A Kisanhub staff member may update any field in any farm.
id required | integer (PrimaryKey) >= 1 Example: 1 ID |
farm_id required | integer >= 1 Farm ID if owned by a farm (i.e is "on-platform") |
organisation_id | integer >= 1 Organisation ID if this is an off-platform field owned by an organisation |
name required | string Field name |
government_id | string Governmental field identifier |
soil_type_id required | integer >= 1 Primary key |
object (Boundary) Bounding polygon | |
centroid | Array of numbers <float> (Point) = 2 items [ items <float > ] Point location as a [lng, lat] pair |
notes | string Any notes related to the field |
noDeleteReason | string Describes why the entity cannot be deleted (usually because it contains other entities) |
{- "farm_id": 1,
- "organisation_id": 1,
- "name": "string",
- "government_id": "string",
- "soil_type_id": 1,
- "boundary": {
- "bounds": [
- [
- -1.30329,
- 51.17687
], - [
- -1.29829,
- 51.17687
], - [
- -1.29829,
- 51.17287
]
], - "area": 2.4
}, - "centroid": [
- -1.30329,
- 51.17687
], - "notes": "string",
- "noDeleteReason": "string"
}
{- "created_at": "2019-08-24T14:15:22Z",
- "created_by_id": 1,
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_by_id": 1,
- "id": 1,
- "slug": "string",
- "access": "read-edit",
- "farm_id": 1,
- "organisation_id": 1,
- "team_id": 0,
- "name": "string",
- "government_id": "string",
- "soil_type_id": 1,
- "region": "string",
- "country_code": "st",
- "boundary": {
- "bounds": [
- [
- -1.30329,
- 51.17687
], - [
- -1.29829,
- 51.17687
], - [
- -1.29829,
- 51.17287
]
], - "area": 2.4
}, - "weather_station_slug": "string",
- "location_slug": "string",
- "centroid": [
- -1.30329,
- 51.17687
], - "notes": "string",
- "noDeleteReason": "string"
}
Returns the permission level for this field. A user has read/write access to a field if any of the following conditions are met:
The user has read-only access to a field only if they have access to any of the plots contained by the field, but none of the above conditions.
id required | integer (PrimaryKey) >= 1 Example: 1 ID |
{- "access": "read-edit",
- "noDeleteReason": "string"
}
Field summaries in GeoJSON format
team_id | |
team_ids | |
season | string Deprecated Example: season=2019/20 Growing season |
bounds | Array of integers[ items = 4 characters ] Example: bounds=-0.6287,53.8621,-0.5636,53.8830 Only return features that are contained within the bounding box (including intersects) Format is |
{- "type": "FeatureCollection",
- "features": [
- {
- "type": "Feature",
- "geometry": {
- "type": "Polygon",
- "coordinates": [
- [
- [
- -1.30329,
- 51.17687
], - [
- -1.29829,
- 51.17687
], - [
- -1.29829,
- 51.17287
], - [
- -1.30329,
- 51.17287
], - [
- -1.30329,
- 51.17687
]
]
]
}, - "properties": {
- "id": 1,
- "name": "Pretty poly"
}
}
]
}
Creates fields for each polygon found in the ESRI zipped shapefile previously uploaded using the /api/field/shapefile/upload endpoint. Fields are added to a single Farm. This is an asynchronous operation: the caller can use /api/field/shapefile/import/{upload_id}/status to poll for status.
farm_id required | integer >= 1 Farm primary key |
upload_id required | integer >= 1 ID of previously uploaded shapefile (returned from /api/field/shapefile/upload) |
name_property | string Default: "Name" Use this property as the field name |
upload_id required | integer >= 1 ID of previously uploaded shapefile (returned from /api/field/shapefile/upload) |
{- "status": "completed",
- "total": 0,
- "completed": 0,
- "errors": [
- "string"
]
}
A plot describes a subdivision of a field that is planted with a particular crop variety.
While this is modelled
independently to operations the lifecycle of a plot is intimately connected with it's sowing and harvest operations.
As such this API doesn't quite follow the same design pattern as elsewhere, since it allows the modification
of sowing and harvest information: adding a planned or actual planting date will result in a new sowing
operation
being created, and similarly adding the planned or actual harvest date or yield will result in a new harvest
operation
being created (see operations). Editing existing dates and yields will edit the
existing operation.
A planned sowing operation will be created by default for a new plot with the specified
genus, variety and planting area.
Todays date (with 00:00 time component) is taken as the start_date
unless
planned_planting_date
is provided.
Plot operations can also be created and updated via operation API.
Plots can be shared/unshared with collaborating teams via the team-shares API. Only the team which own the plot, or the team of the owning plot (where they have allow_edit: true on their team-share) have the ability to share plots, no onward sharing past this is possible.
Return a paginated list of plots. By default we only return active plots i.e plots that have not been closed - use the "state" parameter to override this behaviour.
The plots that are accessible by the caller depends on a number of factors. Specifically a plot is visible for a user if any of the following conditions are met:
page | integer >= 1 Default: 1 Example: page=2 Page number |
page_size | integer [ 1 .. 100 ] Default: 20 Page size |
farm_id | |
field_id | |
team_id | |
team_ids | |
group_id | |
genus_id | |
genus_ids | integer Example: genus_ids=2,3 Comma-separated list of genus IDs. Includes plots that have planted any variety of any of these genera |
string or string (DateOrDateTime) Example: updated_since=2020-01-02T10:00:00Z Return items created or updated since the specified data/time (inclusive). Date times are always in UTC and are specified in RFC3339 format. Can also be specified as simple dates e.g 2020-01-01, in which case midnight is assumed for the time component. | |
variety_id | |
variety_ids | Array of integers Comma-separated list of variety variety IDs. Include plots that have planted any of these varieties. |
tag_id | integer >= 1 Filter by crop tag ID. Include objects that have been tagged with this tag. |
tag_ids | Array of integers Example: tag_ids=2,3 Comma-separated list of crop tag IDs. Includes objects that have been tagged with any of these tags |
crop_variety_id | integer >= 1 Deprecated Example: crop_variety_id=1 Filter by the variety ID. Deprecated: use |
growing_season | string Example: growing_season=2020/21 Filter by growing season |
created_by_id | |
slug | string Deprecated Search by the legacy "slug" identifier |
search | string Search for plot name |
field_name | string Return the plots associated with these fields. |
is_active | boolean Deprecated If true then return the plots that are currently active i.e that have not been marked as harvested and closed. If false then only return the plots that have been harvested and closed i.e are not currently considered "active". If not specified then return plots disregarding the active state. |
state | string Enum: "all" "open" "closed" If |
status | string (PlotStatusValues) Enum: "Ready to sample" "Awaiting results" "Resample" "Results received" "Resample results received" "Ready for harvest" "NOC" "Crop unsuitable" "Scheduled for harvest" "Harvested" Filter by current plot status |
sowing_from | string <date> Example: sowing_from=2020-01-01 Filter results by sowing operation after a given date |
sowing_to | string <date> Example: sowing_to=2020-01-02 Filter results by sowing operation up to a given date |
harvest_from | string <date> Example: harvest_from=2020-01-01 Filter results by harvest operation after a given date |
harvest_to | string <date> Example: harvest_to=2020-01-02 Filter results by harvest operation up to a given date |
off_platform | string Enum: "only" "exclude" If only then only returns "off-platform" plots· If exclude then exclude "off-platform" plots. If not specified that all plots are returned. |
{- "total": 0,
- "results": [
- {
- "id": 1,
- "field_id": 1,
- "boundary": {
- "bounds": [
- [
- -1.30329,
- 51.17687
], - [
- -1.29829,
- 51.17687
], - [
- -1.29829,
- 51.17287
]
], - "area": 2.4
}, - "crop_id": 1,
- "farm_id": 2,
- "team_id": 1,
- "organisation_id": 1,
- "access": "read-edit",
- "name": "string",
- "slug": "string",
- "notes": "string",
- "variety_id": 1,
- "soil_type_id": 1,
- "open": true,
- "planned_planting_date": "2020-04-01T11:00:00Z",
- "actual_planting_date": "2020-04-07T10:00:00Z",
- "planting_area": 0,
- "planned_harvest_date": "2020-07-01T09:00:00Z",
- "planned_yield": 10,
- "planned_quantity": 10,
- "actual_harvest_date": "2020-07-02T09:00:00Z",
- "actual_yield": 12.5,
- "actual_quantity": 12.5,
- "planting": {
- "date": "2019-08-24",
- "complete": true,
- "area": 0
}, - "harvest": {
- "date": "2019-08-24",
- "complete": true,
- "yield": 0
}, - "registration_code": "string",
- "governmental_code": "string",
- "agronomist_ids": [
- 0
], - "owner_id": 1,
- "created_at": "2019-08-24T14:15:22Z",
- "growing_season": [
- "string"
], - "is_seed": false,
- "weather_station_slug": "string",
- "location_slug": "string",
- "centroid": [
- -1.30329,
- 51.17687
], - "tag_ids": [
- 0
], - "created_by_id": 1,
- "created_by_name": "Billy bob",
- "updated_by_id": 1,
- "updated_by_name": "Billy bob",
- "updated_at": "2019-08-24T14:15:22Z"
}
]
}
Create a new plot within a field. A user with TEAM_ADMIN will be able to create a new plot for their farm. An Enterprise user with SITE_ADMIN permission will be able to create a plot for any fields owned by any of their client teams. A Kisanhub staff user may create a plot for any field.
field_id required | integer (FieldId) >= 1 Field ID. |
object (Boundary) Bounding polygon | |
crop_id required | integer (CropId) >= 1 Crop ("genus") ID. Note that value is taken from the most recent sowing operation. |
name | string (PlotName) Name. If this field is left blank while creating the plot, a name will be auto-generated in the format YYYY-0 |
slug | string Deprecated Legacy identifier |
notes | string Notes |
variety_id | integer >= 1 Variety ID - see /api/variety for more detail |
soil_type_id | integer >= 1 Soil type ID. If not specified then we assume the soil type of the field. |
open | boolean A plot is open when it is actively growing produce i.e it has not undergone a final harvest or been abandoned. |
planned_planting_date | string <date-time> Planned planting date. Editing this property will result in the creation of a new sowing operation |
actual_planting_date | string <date-time> Actual planting date. Editing this property will result in the creation of a new sowing operation |
planting_area | number The planting (i.e sown) area in ha. If not specified then we assume the working area
is the full plot area as specified in |
planned_harvest_date | string <date-time> Planned harvest date. Editing this property will result in the creation of a new
harvest operation, along with any |
planned_yield | number or null Planned harvest yield, in t/ha. If a |
planned_quantity | number or null Planned harvest quantity, in tonnes. If a |
actual_harvest_date | string <date-time> Actual date of harvest. Editing this property will result in the creation of a new
harvest operation, along with any |
actual_yield | number Actual harvest yield, in t/ha. Editing this property will result in the creation of a new
harvest operation, along with any |
actual_quantity | number Actual harvest quantity, in tonnes. Editing this property will result in the creation of a new
harvest operation, along with any |
object Deprecated Deprecated planting information. Please use | |
object Deprecated Deprecated harvest information. Please use | |
registration_code | string A code that uniquely and globally identifies this plot |
governmental_code | string A country-specific code that uniquely identifies this plot |
agronomist_ids | Array of integers user ids list who are agronomists |
owner_id | integer >= 1 The designated plot owner |
growing_season | Array of strings The growing season for this plot, like 2019/20. A plot can have more than one season |
is_seed | boolean Default: false Is what's growing here for seed? |
centroid | Array of numbers <float> (Point) = 2 items [ items <float > ] Point location as a [lng, lat] pair |
tag_ids | Array of integers List of associated crop tags ids |
{- "field_id": 1,
- "boundary": {
- "bounds": [
- [
- -1.30329,
- 51.17687
], - [
- -1.29829,
- 51.17687
], - [
- -1.29829,
- 51.17287
]
], - "area": 2.4
}, - "crop_id": 1,
- "name": "string",
- "slug": "string",
- "notes": "string",
- "variety_id": 1,
- "soil_type_id": 1,
- "open": true,
- "planned_planting_date": "2020-04-01T11:00:00Z",
- "actual_planting_date": "2020-04-07T10:00:00Z",
- "planting_area": 0,
- "planned_harvest_date": "2020-07-01T09:00:00Z",
- "planned_yield": 10,
- "planned_quantity": 10,
- "actual_harvest_date": "2020-07-02T09:00:00Z",
- "actual_yield": 12.5,
- "actual_quantity": 12.5,
- "planting": {
- "date": "2019-08-24",
- "complete": true,
- "area": 0
}, - "harvest": {
- "date": "2019-08-24",
- "complete": true,
- "yield": 0
}, - "registration_code": "string",
- "governmental_code": "string",
- "agronomist_ids": [
- 0
], - "owner_id": 1,
- "created_at": "2019-08-24T14:15:22Z",
- "growing_season": [
- "string"
], - "is_seed": false,
- "centroid": [
- -1.30329,
- 51.17687
], - "tag_ids": [
- 0
]
}
{- "id": 1,
- "field_id": 1,
- "boundary": {
- "bounds": [
- [
- -1.30329,
- 51.17687
], - [
- -1.29829,
- 51.17687
], - [
- -1.29829,
- 51.17287
]
], - "area": 2.4
}, - "crop_id": 1,
- "farm_id": 2,
- "team_id": 1,
- "organisation_id": 1,
- "access": "read-edit",
- "name": "string",
- "slug": "string",
- "notes": "string",
- "variety_id": 1,
- "soil_type_id": 1,
- "open": true,
- "planned_planting_date": "2020-04-01T11:00:00Z",
- "actual_planting_date": "2020-04-07T10:00:00Z",
- "planting_area": 0,
- "planned_harvest_date": "2020-07-01T09:00:00Z",
- "planned_yield": 10,
- "planned_quantity": 10,
- "actual_harvest_date": "2020-07-02T09:00:00Z",
- "actual_yield": 12.5,
- "actual_quantity": 12.5,
- "planting": {
- "date": "2019-08-24",
- "complete": true,
- "area": 0
}, - "harvest": {
- "date": "2019-08-24",
- "complete": true,
- "yield": 0
}, - "registration_code": "string",
- "governmental_code": "string",
- "agronomist_ids": [
- 0
], - "owner_id": 1,
- "created_at": "2019-08-24T14:15:22Z",
- "growing_season": [
- "string"
], - "is_seed": false,
- "weather_station_slug": "string",
- "location_slug": "string",
- "centroid": [
- -1.30329,
- 51.17687
], - "tag_ids": [
- 0
], - "created_by_id": 1,
- "created_by_name": "Billy bob",
- "updated_by_id": 1,
- "updated_by_name": "Billy bob",
- "updated_at": "2019-08-24T14:15:22Z"
}
get the plot identified by the ID in the URL
id required | integer (PrimaryKey) >= 1 Example: 1 ID |
{- "id": 1,
- "field_id": 1,
- "boundary": {
- "bounds": [
- [
- -1.30329,
- 51.17687
], - [
- -1.29829,
- 51.17687
], - [
- -1.29829,
- 51.17287
]
], - "area": 2.4
}, - "crop_id": 1,
- "farm_id": 2,
- "team_id": 1,
- "organisation_id": 1,
- "access": "read-edit",
- "name": "string",
- "slug": "string",
- "notes": "string",
- "variety_id": 1,
- "soil_type_id": 1,
- "open": true,
- "planned_planting_date": "2020-04-01T11:00:00Z",
- "actual_planting_date": "2020-04-07T10:00:00Z",
- "planting_area": 0,
- "planned_harvest_date": "2020-07-01T09:00:00Z",
- "planned_yield": 10,
- "planned_quantity": 10,
- "actual_harvest_date": "2020-07-02T09:00:00Z",
- "actual_yield": 12.5,
- "actual_quantity": 12.5,
- "planting": {
- "date": "2019-08-24",
- "complete": true,
- "area": 0
}, - "harvest": {
- "date": "2019-08-24",
- "complete": true,
- "yield": 0
}, - "registration_code": "string",
- "governmental_code": "string",
- "agronomist_ids": [
- 0
], - "owner_id": 1,
- "created_at": "2019-08-24T14:15:22Z",
- "growing_season": [
- "string"
], - "is_seed": false,
- "weather_station_slug": "string",
- "location_slug": "string",
- "centroid": [
- -1.30329,
- 51.17687
], - "tag_ids": [
- 0
], - "created_by_id": 1,
- "created_by_name": "Billy bob",
- "updated_by_id": 1,
- "updated_by_name": "Billy bob",
- "updated_at": "2019-08-24T14:15:22Z",
- "status": "Ready to sample"
}
Delete the plot. Note that only plots which satisfy the following constraints may be deleted:
id required | integer (PrimaryKey) >= 1 Example: 1 ID |
Update an existing plot within a field. A user with TEAM_ADMIN will be able to update any plot for their farm. A user with SITE_ADMIN permission will be able to update a plot for any fields owned by any of their client teams. A Kisanhub staff user may update any plot.
id required | integer (PrimaryKey) >= 1 Example: 1 ID |
field_id required | integer (FieldId) >= 1 Field ID. |
object (Boundary) Bounding polygon | |
crop_id required | integer (CropId) >= 1 Crop ("genus") ID. Note that value is taken from the most recent sowing operation. |
name | string (PlotName) Name. If this field is left blank while creating the plot, a name will be auto-generated in the format YYYY-0 |
slug | string Deprecated Legacy identifier |
notes | string Notes |
variety_id | integer >= 1 Variety ID - see /api/variety for more detail |
soil_type_id | integer >= 1 Soil type ID. If not specified then we assume the soil type of the field. |
open | boolean A plot is open when it is actively growing produce i.e it has not undergone a final harvest or been abandoned. |
planned_planting_date | string <date-time> Planned planting date. Editing this property will result in the creation of a new sowing operation |
actual_planting_date | string <date-time> Actual planting date. Editing this property will result in the creation of a new sowing operation |
planting_area | number The planting (i.e sown) area in ha. If not specified then we assume the working area
is the full plot area as specified in |
planned_harvest_date | string <date-time> Planned harvest date. Editing this property will result in the creation of a new
harvest operation, along with any |
planned_yield | number or null Planned harvest yield, in t/ha. If a |
planned_quantity | number or null Planned harvest quantity, in tonnes. If a |
actual_harvest_date | string <date-time> Actual date of harvest. Editing this property will result in the creation of a new
harvest operation, along with any |
actual_yield | number Actual harvest yield, in t/ha. Editing this property will result in the creation of a new
harvest operation, along with any |
actual_quantity | number Actual harvest quantity, in tonnes. Editing this property will result in the creation of a new
harvest operation, along with any |
object Deprecated Deprecated planting information. Please use | |
object Deprecated Deprecated harvest information. Please use | |
registration_code | string A code that uniquely and globally identifies this plot |
governmental_code | string A country-specific code that uniquely identifies this plot |
agronomist_ids | Array of integers user ids list who are agronomists |
owner_id | integer >= 1 The designated plot owner |
growing_season | Array of strings The growing season for this plot, like 2019/20. A plot can have more than one season |
is_seed | boolean Default: false Is what's growing here for seed? |
centroid | Array of numbers <float> (Point) = 2 items [ items <float > ] Point location as a [lng, lat] pair |
tag_ids | Array of integers List of associated crop tags ids |
{- "field_id": 1,
- "boundary": {
- "bounds": [
- [
- -1.30329,
- 51.17687
], - [
- -1.29829,
- 51.17687
], - [
- -1.29829,
- 51.17287
]
], - "area": 2.4
}, - "crop_id": 1,
- "name": "string",
- "slug": "string",
- "notes": "string",
- "variety_id": 1,
- "soil_type_id": 1,
- "open": true,
- "planned_planting_date": "2020-04-01T11:00:00Z",
- "actual_planting_date": "2020-04-07T10:00:00Z",
- "planting_area": 0,
- "planned_harvest_date": "2020-07-01T09:00:00Z",
- "planned_yield": 10,
- "planned_quantity": 10,
- "actual_harvest_date": "2020-07-02T09:00:00Z",
- "actual_yield": 12.5,
- "actual_quantity": 12.5,
- "planting": {
- "date": "2019-08-24",
- "complete": true,
- "area": 0
}, - "harvest": {
- "date": "2019-08-24",
- "complete": true,
- "yield": 0
}, - "registration_code": "string",
- "governmental_code": "string",
- "agronomist_ids": [
- 0
], - "owner_id": 1,
- "created_at": "2019-08-24T14:15:22Z",
- "growing_season": [
- "string"
], - "is_seed": false,
- "centroid": [
- -1.30329,
- 51.17687
], - "tag_ids": [
- 0
]
}
{- "id": 1,
- "field_id": 1,
- "boundary": {
- "bounds": [
- [
- -1.30329,
- 51.17687
], - [
- -1.29829,
- 51.17687
], - [
- -1.29829,
- 51.17287
]
], - "area": 2.4
}, - "crop_id": 1,
- "farm_id": 2,
- "team_id": 1,
- "organisation_id": 1,
- "access": "read-edit",
- "name": "string",
- "slug": "string",
- "notes": "string",
- "variety_id": 1,
- "soil_type_id": 1,
- "open": true,
- "planned_planting_date": "2020-04-01T11:00:00Z",
- "actual_planting_date": "2020-04-07T10:00:00Z",
- "planting_area": 0,
- "planned_harvest_date": "2020-07-01T09:00:00Z",
- "planned_yield": 10,
- "planned_quantity": 10,
- "actual_harvest_date": "2020-07-02T09:00:00Z",
- "actual_yield": 12.5,
- "actual_quantity": 12.5,
- "planting": {
- "date": "2019-08-24",
- "complete": true,
- "area": 0
}, - "harvest": {
- "date": "2019-08-24",
- "complete": true,
- "yield": 0
}, - "registration_code": "string",
- "governmental_code": "string",
- "agronomist_ids": [
- 0
], - "owner_id": 1,
- "created_at": "2019-08-24T14:15:22Z",
- "growing_season": [
- "string"
], - "is_seed": false,
- "weather_station_slug": "string",
- "location_slug": "string",
- "centroid": [
- -1.30329,
- 51.17687
], - "tag_ids": [
- 0
], - "created_by_id": 1,
- "created_by_name": "Billy bob",
- "updated_by_id": 1,
- "updated_by_name": "Billy bob",
- "updated_at": "2019-08-24T14:15:22Z"
}
Partially update an existing plot within a field. Only those properties supplied will be updated.
id required | integer (PrimaryKey) >= 1 Example: 1 ID |
name | string Name. If this field is left blank while creating the plot, a name will be auto-generated in the format YYYY-0 |
field_id | integer (FieldId) >= 1 Field ID. |
object (Boundary) Bounding polygon | |
crop_id | integer (CropId) >= 1 Crop ("genus") ID. Note that value is taken from the most recent sowing operation. |
slug | string Deprecated Legacy identifier |
notes | string Notes |
variety_id | integer >= 1 Variety ID - see /api/variety for more detail |
soil_type_id | integer >= 1 Soil type ID. If not specified then we assume the soil type of the field. |
open | boolean A plot is open when it is actively growing produce i.e it has not undergone a final harvest or been abandoned. |
planned_planting_date | string <date-time> Planned planting date. Editing this property will result in the creation of a new sowing operation |
actual_planting_date | string <date-time> Actual planting date. Editing this property will result in the creation of a new sowing operation |
planting_area | number The planting (i.e sown) area in ha. If not specified then we assume the working area
is the full plot area as specified in |
planned_harvest_date | string <date-time> Planned harvest date. Editing this property will result in the creation of a new
harvest operation, along with any |
planned_yield | number or null Planned harvest yield, in t/ha. If a |
planned_quantity | number or null Planned harvest quantity, in tonnes. If a |
actual_harvest_date | string <date-time> Actual date of harvest. Editing this property will result in the creation of a new
harvest operation, along with any |
actual_yield | number Actual harvest yield, in t/ha. Editing this property will result in the creation of a new
harvest operation, along with any |
actual_quantity | number Actual harvest quantity, in tonnes. Editing this property will result in the creation of a new
harvest operation, along with any |
object Deprecated Deprecated planting information. Please use | |
object Deprecated Deprecated harvest information. Please use | |
registration_code | string A code that uniquely and globally identifies this plot |
governmental_code | string A country-specific code that uniquely identifies this plot |
agronomist_ids | Array of integers user ids list who are agronomists |
owner_id | integer >= 1 The designated plot owner |
created_at | string <date-time> Date this plot was created |
growing_season | Array of strings The growing season for this plot, like 2019/20. A plot can have more than one season |
is_seed | boolean Default: false Is what's growing here for seed? |
centroid | Array of numbers <float> (Point) = 2 items [ items <float > ] Point location as a [lng, lat] pair |
tag_ids | Array of integers List of associated crop tags ids |
{- "name": "string",
- "field_id": 1,
- "boundary": {
- "bounds": [
- [
- -1.30329,
- 51.17687
], - [
- -1.29829,
- 51.17687
], - [
- -1.29829,
- 51.17287
]
], - "area": 2.4
}, - "crop_id": 1,
- "slug": "string",
- "notes": "string",
- "variety_id": 1,
- "soil_type_id": 1,
- "open": true,
- "planned_planting_date": "2020-04-01T11:00:00Z",
- "actual_planting_date": "2020-04-07T10:00:00Z",
- "planting_area": 0,
- "planned_harvest_date": "2020-07-01T09:00:00Z",
- "planned_yield": 10,
- "planned_quantity": 10,
- "actual_harvest_date": "2020-07-02T09:00:00Z",
- "actual_yield": 12.5,
- "actual_quantity": 12.5,
- "planting": {
- "date": "2019-08-24",
- "complete": true,
- "area": 0
}, - "harvest": {
- "date": "2019-08-24",
- "complete": true,
- "yield": 0
}, - "registration_code": "string",
- "governmental_code": "string",
- "agronomist_ids": [
- 0
], - "owner_id": 1,
- "created_at": "2019-08-24T14:15:22Z",
- "growing_season": [
- "string"
], - "is_seed": false,
- "centroid": [
- -1.30329,
- 51.17687
], - "tag_ids": [
- 0
]
}
{- "id": 1,
- "field_id": 1,
- "boundary": {
- "bounds": [
- [
- -1.30329,
- 51.17687
], - [
- -1.29829,
- 51.17687
], - [
- -1.29829,
- 51.17287
]
], - "area": 2.4
}, - "crop_id": 1,
- "farm_id": 2,
- "team_id": 1,
- "organisation_id": 1,
- "access": "read-edit",
- "name": "string",
- "slug": "string",
- "notes": "string",
- "variety_id": 1,
- "soil_type_id": 1,
- "open": true,
- "planned_planting_date": "2020-04-01T11:00:00Z",
- "actual_planting_date": "2020-04-07T10:00:00Z",
- "planting_area": 0,
- "planned_harvest_date": "2020-07-01T09:00:00Z",
- "planned_yield": 10,
- "planned_quantity": 10,
- "actual_harvest_date": "2020-07-02T09:00:00Z",
- "actual_yield": 12.5,
- "actual_quantity": 12.5,
- "planting": {
- "date": "2019-08-24",
- "complete": true,
- "area": 0
}, - "harvest": {
- "date": "2019-08-24",
- "complete": true,
- "yield": 0
}, - "registration_code": "string",
- "governmental_code": "string",
- "agronomist_ids": [
- 0
], - "owner_id": 1,
- "created_at": "2019-08-24T14:15:22Z",
- "growing_season": [
- "string"
], - "is_seed": false,
- "weather_station_slug": "string",
- "location_slug": "string",
- "centroid": [
- -1.30329,
- 51.17687
], - "tag_ids": [
- 0
], - "created_by_id": 1,
- "created_by_name": "Billy bob",
- "updated_by_id": 1,
- "updated_by_name": "Billy bob",
- "updated_at": "2019-08-24T14:15:22Z"
}
Returns the permission level for this plot. A user has read access to a plot if any of the following conditions are met:
A user has read-only access only if the user has only read-only access to the associated plot via a team share.
id required | integer (PrimaryKey) >= 1 Example: 1 ID |
{- "access": "read-edit",
- "noDeleteReason": "string"
}
Update the status for a specific plot
id required | integer (PrimaryKey) >= 1 Example: 1 Plot ID |
status | string (PlotStatusValues) Enum: "Ready to sample" "Awaiting results" "Resample" "Results received" "Resample results received" "Ready for harvest" "NOC" "Crop unsuitable" "Scheduled for harvest" "Harvested" Plot status string |
{- "status": "Ready to sample"
}
{- "property1": [
- "string"
], - "property2": [
- "string"
]
}
Add a tag to a plot
id required | integer (PrimaryKey) >= 1 Example: 1 Plot ID |
tag_id | integer >= 1 ID of the crop tag added to this plot |
{- "tag_id": 1
}
{- "tag_id": "string",
- "plot_id": 1
}
id required | integer (PrimaryKey) >= 1 Example: 1 Plot ID |
tag_id required | integer >= 1 Crop tag ID. |
Plot summaries in GeoJSON format
team_id | |
team_ids | |
season | string Deprecated Example: season=2019/20 Growing season |
bounds | Array of integers[ items = 4 characters ] Example: bounds=-0.6287,53.8621,-0.5636,53.8830 Only return features that are contained within the bounding box (including intersects) Format is |
state | string Enum: "all" "open" "closed" If |
{- "type": "FeatureCollection",
- "features": [
- {
- "type": "Feature",
- "geometry": {
- "type": "Polygon",
- "coordinates": [
- [
- [
- -1.30329,
- 51.17687
], - [
- -1.29829,
- 51.17687
], - [
- -1.29829,
- 51.17287
], - [
- -1.30329,
- 51.17287
], - [
- -1.30329,
- 51.17687
]
]
]
}, - "properties": {
- "id": 1,
- "name": "Pretty poly"
}
}
]
}
Returns the set of varieties planted, grouped by genus
farm_id | |
team_id | |
field_id | |
growing_season | string Example: growing_season=2020/21 Filter by growing season |
[- {
- "id": 1,
- "name": "Potato",
- "varieties": [
- {
- "id": 1,
- "name": "Accord",
- "slug": "string"
}
]
}
]
Returns a list of farm regions in which we have active plots.
from_date | string <date> Example: from_date=2020-01-02T10:00:00Z From date |
to_date | string <date> Example: to_date=2020-01-23T15:00:00Z To date |
[- "string"
]
Returns a list of team-group associated with active plots teams.
from_date | string <date> Example: from_date=2020-01-02T10:00:00Z From date |
to_date | string <date> Example: to_date=2020-01-23T15:00:00Z To date |
[- "string"
]
Returns the set of crops (i.e genus) and varieties planted
from_date | string <date> Exclude plots harvested before this date |
to_date | string <date> Exclude plots planted after this date |
region_name | string Name of the region |
team_group | string Label of Team group |
[- {
- "id": 0,
- "name": "string"
}
]
Return a human-readable report of the entire plot inventory.
page | integer >= 1 Default: 1 Example: page=2 Page number |
page_size | integer [ 1 .. 100 ] Default: 20 Page size |
farm_id | |
field_id | |
team_id | |
team_ids | |
organisation_id | |
organisation_ids | |
group_id | |
genus_id | |
string or string (DateOrDateTime) Example: updated_since=2020-01-02T10:00:00Z Return items created or updated since the specified data/time (inclusive). Date times are always in UTC and are specified in RFC3339 format. Can also be specified as simple dates e.g 2020-01-01, in which case midnight is assumed for the time component. | |
variety_id | |
variety_ids | Array of integers Comma-separated list of variety variety IDs. Include plots that have planted any of these varieties. |
tag_id | integer >= 1 Filter by crop tag ID. Include objects that have been tagged with this tag. |
tag_ids | Array of integers Example: tag_ids=2,3 Comma-separated list of crop tag IDs. Includes objects that have been tagged with any of these tags |
crop_variety_id | integer >= 1 Deprecated Example: crop_variety_id=1 Filter by the variety ID. Deprecated: use |
growing_season | string Example: growing_season=2020/21 Filter by growing season |
slug | string Deprecated Search by the legacy "slug" identifier |
search | string Search for plot name |
field_name | string Return the plots associated with these fields. |
is_active | boolean Deprecated If true then return the plots that are currently active i.e that have not been marked as harvested and closed. If false then only return the plots that have been harvested and closed i.e are not currently considered "active". If not specified then return plots disregarding the active state. |
status | string (PlotStatusValues) Enum: "Ready to sample" "Awaiting results" "Resample" "Results received" "Resample results received" "Ready for harvest" "NOC" "Crop unsuitable" "Scheduled for harvest" "Harvested" Filter by current plot status |
state | string Enum: "all" "open" "closed" If |
sowing_from | string <date> Example: sowing_from=2020-01-01 Filter results by sowing operation after a given date |
sowing_to | string <date> Example: sowing_to=2020-01-02 Filter results by sowing operation up to a given date |
harvest_from | string <date> Example: harvest_from=2020-01-01 Filter results by harvest operation after a given date |
harvest_to | string <date> Example: harvest_to=2020-01-02 Filter results by harvest operation up to a given date |
off_platform | string Enum: "only" "exclude" If only then only returns "off-platform" plots· If exclude then exclude "off-platform" plots. If not specified that all plots are returned. |
format | string Default: "json" Enum: "csv" "json" Example: format=csv Change the output format. Defaults to JSON |
{- "total": 0,
- "crop_type_count": 0,
- "results": [
- {
- "access": "read-edit",
- "plot_slug": "string",
- "team_id": 1,
- "team_name": "FarmCo",
- "is_off_platform": true,
- "farm_id": 12,
- "farm_name": "North farm",
- "field_id": 12,
- "field_name": "North field",
- "field_area": 10.5,
- "plot_id": 15,
- "plot_name": "plot-01",
- "genus_id": 4,
- "genus_name": "Potato",
- "variety_id": 6,
- "variety_name": "Accord",
- "tags": [
- {
- "id": 1,
- "organisation_id": 1,
- "organisation_name": "my organisation",
- "category_label": "string",
- "category_id": 1,
- "label": "string"
}
], - "area": 3.5,
- "planned_planting_date": "2020-04-03",
- "actual_planting_date": "2020-04-04",
- "planned_harvest_date": "2020-08-03",
- "actual_harvest_date": "2020-08-05",
- "estimated_yield": 10,
- "actual_yield": 10,
- "estimated_quantity": 10,
- "actual_quantity": 10,
- "total_production": 35,
- "is_closed": false,
- "assessment_count": 7,
- "observation_count": 10
}
]
}
Return aggregated totals for various metrics for the matching set of plots
page | integer >= 1 Default: 1 Example: page=2 Page number |
page_size | integer [ 1 .. 100 ] Default: 20 Page size |
farm_id | |
field_id | |
team_id | |
genus_id | |
string or string (DateOrDateTime) Example: updated_since=2020-01-02T10:00:00Z Return items created or updated since the specified data/time (inclusive). Date times are always in UTC and are specified in RFC3339 format. Can also be specified as simple dates e.g 2020-01-01, in which case midnight is assumed for the time component. | |
variety_id | |
crop_variety_id | integer >= 1 Deprecated Example: crop_variety_id=1 Filter by the variety ID. Deprecated: use |
growing_season | string Example: growing_season=2020/21 Filter by growing season |
slug | string Deprecated Search by the legacy "slug" identifier |
search | string Search for plot name |
field_name | string Return the plots associated with these fields. |
is_active | boolean Deprecated If true then return the plots that are currently active i.e that have not been marked as harvested and closed. If false then only return the plots that have been harvested and closed i.e are not currently considered "active". If not specified then return plots disregarding the active state. |
status | string (PlotStatusValues) Enum: "Ready to sample" "Awaiting results" "Resample" "Results received" "Resample results received" "Ready for harvest" "NOC" "Crop unsuitable" "Scheduled for harvest" "Harvested" Filter by current plot status |
state | string Enum: "all" "open" "closed" If |
sowing_from | string <date> Example: sowing_from=2020-01-01 Filter results by sowing operation after a given date |
sowing_to | string <date> Example: sowing_to=2020-01-02 Filter results by sowing operation up to a given date |
harvest_from | string <date> Example: harvest_from=2020-01-01 Filter results by harvest operation after a given date |
harvest_to | string <date> Example: harvest_to=2020-01-02 Filter results by harvest operation up to a given date |
off_platform | string Enum: "only" "exclude" If only then only returns "off-platform" plots· If exclude then exclude "off-platform" plots. If not specified that all plots are returned. |
{- "farms": 4,
- "plots": 23,
- "cropped_area": 11.52,
- "planted_plots": 22,
- "harvested_plots": 20,
- "expected_production": 55.5
}
Returns a list of available genera (often called "crop"). Names are translated according to the Accept-Language header, defaulting to English.
crop_name | |
string or string (DateOrDateTime) Example: updated_since=2020-01-02T10:00:00Z Return items created or updated since the specified data/time (inclusive). Date times are always in UTC and are specified in RFC3339 format. Can also be specified as simple dates e.g 2020-01-01, in which case midnight is assumed for the time component. |
Accept-Language | string (Language) Default: en Enum: "en" "hi" "mr" "es" Example: en Return localised data for the given language |
[- {
- "id": 0,
- "name": "string",
- "colour_code": "string",
- "is_perennial": true
}
]
Returns a single genus (often called "crop"). Names are translated according to the Accept-Language header, defaulting to English.
id required | integer (PrimaryKey) >= 1 Example: 1 ID |
Accept-Language | string (Language) Default: en Enum: "en" "hi" "mr" "es" Example: en Return localised data for the given language |
{- "id": 0,
- "name": "string",
- "colour_code": "string",
- "is_perennial": true
}
Returns lists of primary and secondary growth stages associated with each genus
Accept-Language | string (Language) Default: en Enum: "en" "hi" "mr" "es" Example: en Return localised data for the given language |
[- {
- "id": 0,
- "name": "string",
- "primary_growth_stages": [
- {
- "id": 1,
- "code": "PGS 01",
- "name": "Vegetative growth",
- "local_name": "Vegetative growth",
- "secondary_growth_stages": [
- {
- "id": 1,
- "code": "SGS 10",
- "name": "First leaves begin to extend",
- "local_name": "First leaves begin to extend",
- "has_field_coverage": false
}
]
}
]
}
]
Returns a list of primary and secondary growth stages associated with a given genus
genus_id required | integer (PrimaryKey) >= 1 Example: 1 ID |
Accept-Language | string (Language) Default: en Enum: "en" "hi" "mr" "es" Example: en Return localised data for the given language |
{- "id": 0,
- "name": "string",
- "primary_growth_stages": [
- {
- "id": 1,
- "code": "PGS 01",
- "name": "Vegetative growth",
- "local_name": "Vegetative growth",
- "secondary_growth_stages": [
- {
- "id": 1,
- "code": "SGS 10",
- "name": "First leaves begin to extend",
- "local_name": "First leaves begin to extend",
- "has_field_coverage": false
}
]
}
]
}
Return an unpaginated list of available crop varieties. Names are translated according to the Accept-Language header, defaulting to English.
genus_id | |
string or string (DateOrDateTime) Example: updated_since=2020-01-02T10:00:00Z Return items created or updated since the specified data/time (inclusive). Date times are always in UTC and are specified in RFC3339 format. Can also be specified as simple dates e.g 2020-01-01, in which case midnight is assumed for the time component. |
Accept-Language | string (Language) Default: en Enum: "en" "hi" "mr" "es" Example: en Return localised data for the given language |
[- {
- "id": 1,
- "name": "string",
- "crop_id": 1
}
]
Create a new crop variety. Uniqness is enforced for the name (for the given genus). Only available to users with VARIETY_ADMIN permission or KisanHub staff.
name | string Name |
crop_id | integer >= 1 Genus ID - see /api/genus for more detail |
{- "name": "string",
- "crop_id": 1
}
{- "id": 1,
- "name": "string",
- "crop_id": 1
}
Return an paginated list of available crop varieties. Names are translated according to the Accept-Language header, defaulting to English.
genus_id | |
string or string (DateOrDateTime) Example: updated_since=2020-01-02T10:00:00Z Return items created or updated since the specified data/time (inclusive). Date times are always in UTC and are specified in RFC3339 format. Can also be specified as simple dates e.g 2020-01-01, in which case midnight is assumed for the time component. |
Accept-Language | string (Language) Default: en Enum: "en" "hi" "mr" "es" Example: en Return localised data for the given language |
{- "total": 0,
- "results": [
- {
- "id": 1,
- "name": "string",
- "crop_id": 1
}
]
}
Return a single variety. Names are translated according to the Accept-Language header, defaulting to English.
id required | integer (PrimaryKey) >= 1 Example: 1 ID |
Accept-Language | string (Language) Default: en Enum: "en" "hi" "mr" "es" Example: en Return localised data for the given language |
{- "id": 1,
- "name": "string",
- "crop_id": 1
}
Return all primary growth stages for all visible genera. Names are translated according to the Accept-Language header, defaulting to English.
genus_id | |
string or string (DateOrDateTime) Example: updated_since=2020-01-02T10:00:00Z Return items created or updated since the specified data/time (inclusive). Date times are always in UTC and are specified in RFC3339 format. Can also be specified as simple dates e.g 2020-01-01, in which case midnight is assumed for the time component. |
[- {
- "id": 1,
- "code": "PGS 01",
- "name": "Vegetative growth",
- "local_name": "Vegetative growth",
- "genus_id": 2
}
]
Return a primary growth stage. The name is translated according to the Accept-Language header, defaulting to English.
id required | integer (PrimaryKey) >= 1 Example: 1 ID |
{- "id": 1,
- "code": "PGS 01",
- "name": "Vegetative growth",
- "local_name": "Vegetative growth",
- "genus_id": 2
}
Return all primary growth stages for all visible genera. Names are supplied in all available languages
genus_id | |
string or string (DateOrDateTime) Example: updated_since=2020-01-02T10:00:00Z Return items created or updated since the specified data/time (inclusive). Date times are always in UTC and are specified in RFC3339 format. Can also be specified as simple dates e.g 2020-01-01, in which case midnight is assumed for the time component. |
[- {
- "id": 1,
- "code": "PGS 01",
- "name": {
- "en": "Hello",
- "es": "Hola",
- "hi": "नमस्ते",
- "mr": "नमस्कार"
}, - "genus_id": 2
}
]
id required | integer (PrimaryKey) >= 1 Example: 1 ID |
code | string Shortcode |
required | object (Translations) Translations for a single text string |
genus_id required | integer (GenusId) >= 1 Genus ID |
{- "code": "PGS 01",
- "name": {
- "en": "Hello",
- "es": "Hola",
- "hi": "नमस्ते",
- "mr": "नमस्कार"
}, - "genus_id": 2
}
{- "id": 1,
- "code": "PGS 01",
- "name": {
- "en": "Hello",
- "es": "Hola",
- "hi": "नमस्ते",
- "mr": "नमस्कार"
}, - "genus_id": 2
}
Return all secondary growth stages for all visible primary growth stages. Names are translated according to the Accept-Language header, defaulting to English.
primary_growth_stage_id | |
string or string (DateOrDateTime) Example: updated_since=2020-01-02T10:00:00Z Return items created or updated since the specified data/time (inclusive). Date times are always in UTC and are specified in RFC3339 format. Can also be specified as simple dates e.g 2020-01-01, in which case midnight is assumed for the time component. |
[- {
- "id": 1,
- "code": "SGS 10",
- "name": "First leaves begin to extend",
- "local_name": "First leaves begin to extend",
- "has_field_coverage": false,
- "primary_growth_stage_id": 0
}
]
Return a secondary growth stage. The name is translated according to the Accept-Language header, defaulting to English.
id required | integer (PrimaryKey) >= 1 Example: 1 ID |
{- "id": 1,
- "code": "SGS 10",
- "name": "First leaves begin to extend",
- "local_name": "First leaves begin to extend",
- "has_field_coverage": false
}
Return all secondary growth stages. Names are supplied in all available languages
string or string (DateOrDateTime) Example: updated_since=2020-01-02T10:00:00Z Return items created or updated since the specified data/time (inclusive). Date times are always in UTC and are specified in RFC3339 format. Can also be specified as simple dates e.g 2020-01-01, in which case midnight is assumed for the time component. |
[- {
- "id": 1,
- "code": "SGS 01",
- "name": {
- "en": "Hello",
- "es": "Hola",
- "hi": "नमस्ते",
- "mr": "नमस्कार"
}, - "genus_id": 2,
- "has_field_coverage": false
}
]
id required | integer (PrimaryKey) >= 1 Example: 1 ID |
code | string Shortcode |
required | object (Translations) Translations for a single text string |
genus_id | integer (GenusId) >= 1 Genus ID |
has_field_coverage | boolean (HasFieldCoverage) If true then field coverage is applicable |
{- "code": "SGS 01",
- "name": {
- "en": "Hello",
- "es": "Hola",
- "hi": "नमस्ते",
- "mr": "नमस्कार"
}, - "genus_id": 2,
- "has_field_coverage": false
}
{- "id": 1,
- "code": "SGS 01",
- "name": {
- "en": "Hello",
- "es": "Hola",
- "hi": "नमस्ते",
- "mr": "नमस्कार"
}, - "genus_id": 2,
- "has_field_coverage": false
}
Returns lists of primary and secondary growth stages associated with each genus
Accept-Language | string (Language) Default: en Enum: "en" "hi" "mr" "es" Example: en Return localised data for the given language |
[- {
- "id": 0,
- "name": "string",
- "primary_growth_stages": [
- {
- "id": 1,
- "code": "PGS 01",
- "name": "Vegetative growth",
- "local_name": "Vegetative growth",
- "secondary_growth_stages": [
- {
- "id": 1,
- "code": "SGS 10",
- "name": "First leaves begin to extend",
- "local_name": "First leaves begin to extend",
- "has_field_coverage": false
}
]
}
]
}
]
Returns a list of primary and secondary growth stages associated with a given genus
genus_id required | integer (PrimaryKey) >= 1 Example: 1 ID |
Accept-Language | string (Language) Default: en Enum: "en" "hi" "mr" "es" Example: en Return localised data for the given language |
{- "id": 0,
- "name": "string",
- "primary_growth_stages": [
- {
- "id": 1,
- "code": "PGS 01",
- "name": "Vegetative growth",
- "local_name": "Vegetative growth",
- "secondary_growth_stages": [
- {
- "id": 1,
- "code": "SGS 10",
- "name": "First leaves begin to extend",
- "local_name": "First leaves begin to extend",
- "has_field_coverage": false
}
]
}
]
}
Return a paginated list of operations of all types, in ascending order of when the operation was last
updated (we set the creation date as the initial update date for convenience).
Only observations from open plots are listed by default: to override this set the include_closed_plots
parameter to "true".
page | integer >= 1 Default: 1 Example: page=2 Page number |
page_size | integer [ 1 .. 1000 ] Default: 20 Page size |
string or string (DateOrDateTime) Example: updated_since=2020-01-02T10:00:00Z Return items created or updated since the specified data/time (inclusive). Date times are always in UTC and are specified in RFC3339 format. Can also be specified as simple dates e.g 2020-01-01, in which case midnight is assumed for the time component. | |
plot_id | integer >= 1 Only return operations for this Plot |
field_id | integer >= 1 Only return operations for this Field |
farm_id | integer >= 1 Only return operations for this Farm |
team_id | |
team_ids | |
exclude_linked_planned | boolean If true then don't return planned operations which have associated applied operations |
include_closed_plots | boolean If True, then returns operations of closed/inactive plots also. Defaults to False |
status | string (OperationStatus) Enum: "upcoming" "overdue" "completed" Operation status |
type | Array of strings (OperationCategory) Items Enum: "fertiliser" "pesticide" "sowing" "harvest" "irrigation" "intercultural" "land_preparation" Example: type=sowing,harvest Filter by operation type. Multiple values can be specified - operations matching any of the types specified will be returned |
applied | boolean If true then filter for applied operations only. If false then filter for planned operations only. The default is to return all operations, irrespective of planning status. |
ordering | string Enum: "created_at" "updated_at" "start_date" Example: ordering=-created_at,updated_at Comma separated field names to order by. Prefix with - for descending. |
search | string Example: search=growercorp Search for operations by team or plot name |
product_subtype | string Enum: "organic" "inorganic" "herbicide" "insecticide" "nematicide" "fungicide" "adjuvant" "seed treatment" "growth regulator" "molluscicide" Filter all product-based operations by the specified subtype |
is_burndown | boolean If true then only return pesticide burndown operations |
from_date | string <date> Example: from_date=2020-01-02 Only include operations completed at or after this date |
to_date | string <date> Example: to_date=2020-01-06 Only include operations completed at or before this date |
{- "total": 0,
- "results": [
- {
- "id": 1,
- "type": "pesticide",
- "notes": "string",
- "start_date": "2020-01-02",
- "end_date": "2020-01-02",
- "plot_id": 1,
- "plot_name": "My plot",
- "field_id": 1,
- "field_name": "North field",
- "farm_id": 1,
- "farm_name": "Sunny Farm",
- "team_id": 6,
- "team_name": "My Team",
- "is_applied": true,
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "created_by_id": 1,
- "created_by_name": "string",
- "updated_by_id": 1,
- "updated_by_name": "string",
- "attachments": [
- {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}
], - "planned_operation_id": 0,
- "status": "upcoming",
- "slug": "string",
- "method": "broadcasting",
- "products": [
- {
- "quantity": 0,
- "application_rate": 0,
- "application_rate_unit": "kg/ha",
- "product_id": 1,
- "product_name": "string",
- "subtype": "herbicide"
}
], - "primary_growth_stage_id": 1,
- "primary_growth_stage_name": 1,
- "secondary_growth_stage_id": 1,
- "secondary_growth_stage_name": 1,
- "percent_field_cover": 100
}
]
}
Create a new operation
type required | string (OperationCategory) Operation type |
notes | string Supplemental notes |
start_date required | string <date> Operation started on this date. If not specified then this date will be set to the |
end_date | string <date> Operation ended on this datetime. If not specified then this date will be set with the |
plot_id required | integer >= 1 Plot ID |
team_id | integer (TeamId) >= 1 Team ID |
is_applied required | boolean Default: true If false then this is a planned operation i.e an operation that is scheduled to happen. If true then the operation actually happened |
created_at | string <date-time> When this operation was created |
updated_at | string <date-time> When this operation was updated. This will be equal to the created_at date initially |
Array of objects (Attachments) Media attachments (uploaded using upload-media-file) | |
planned_operation_id | integer For applied operations this may optionally link to a related planned operation of the same type and plot. |
slug | string Deprecated Legacy operation slug |
method | string Enum: "broadcasting" "placement" "fertigation" "foliar-spray" "injection" "drenching" Method of application |
Array of objects (AppliedProduct) List of applied fertiliser products | |
primary_growth_stage_id | number >= 1 The primary growth stage of the plot. |
primary_growth_stage_name | number (PrimaryGrowthStageId) >= 1 The primary growth stage of the plot. |
secondary_growth_stage_id | number >= 1 The secondary growth stage of the plot, which is dependent on the primary growth stage. |
secondary_growth_stage_name | number (SecondaryGrowthStageId) >= 1 The secondary growth stage of the plot, which is dependent on the primary growth stage. |
percent_field_cover | number <float> [ 0 .. 100 ] Percentage area of plot that has reached the above primary and secondary growth stages |
{- "type": "fertiliser",
- "notes": "string",
- "start_date": "2020-01-02",
- "end_date": "2020-01-02",
- "plot_id": 1,
- "team_id": 6,
- "is_applied": true,
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "attachments": [
- {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}
], - "planned_operation_id": 0,
- "slug": "string",
- "method": "broadcasting",
- "products": [
- {
- "quantity": 0,
- "application_rate": 0,
- "product_id": 1,
- "subtype": "herbicide"
}
], - "primary_growth_stage_id": 1,
- "primary_growth_stage_name": 1,
- "secondary_growth_stage_id": 1,
- "secondary_growth_stage_name": 1,
- "percent_field_cover": 100
}
{- "id": 1,
- "type": "fertiliser",
- "notes": "string",
- "start_date": "2020-01-02",
- "end_date": "2020-01-02",
- "plot_id": 1,
- "plot_name": "My plot",
- "field_id": 1,
- "field_name": "North field",
- "farm_id": 1,
- "farm_name": "Sunny Farm",
- "team_id": 6,
- "team_name": "My Team",
- "is_applied": true,
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "created_by_id": 1,
- "created_by_name": "string",
- "updated_by_id": 1,
- "updated_by_name": "string",
- "attachments": [
- {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}
], - "planned_operation_id": 0,
- "status": "upcoming",
- "slug": "string",
- "method": "broadcasting",
- "products": [
- {
- "quantity": 0,
- "application_rate": 0,
- "application_rate_unit": "kg/ha",
- "product_id": 1,
- "product_name": "string",
- "subtype": "herbicide"
}
], - "primary_growth_stage_id": 1,
- "primary_growth_stage_name": 1,
- "secondary_growth_stage_id": 1,
- "secondary_growth_stage_name": 1,
- "percent_field_cover": 100
}
Return a single operation
id required | integer (PrimaryKey) >= 1 Example: 1 ID |
{- "id": 1,
- "type": "fertiliser",
- "notes": "string",
- "start_date": "2020-01-02",
- "end_date": "2020-01-02",
- "plot_id": 1,
- "plot_name": "My plot",
- "field_id": 1,
- "field_name": "North field",
- "farm_id": 1,
- "farm_name": "Sunny Farm",
- "team_id": 6,
- "team_name": "My Team",
- "is_applied": true,
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "created_by_id": 1,
- "created_by_name": "string",
- "updated_by_id": 1,
- "updated_by_name": "string",
- "attachments": [
- {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}
], - "planned_operation_id": 0,
- "status": "upcoming",
- "slug": "string",
- "method": "broadcasting",
- "products": [
- {
- "quantity": 0,
- "application_rate": 0,
- "application_rate_unit": "kg/ha",
- "product_id": 1,
- "product_name": "string",
- "subtype": "herbicide"
}
], - "primary_growth_stage_id": 1,
- "primary_growth_stage_name": 1,
- "secondary_growth_stage_id": 1,
- "secondary_growth_stage_name": 1,
- "percent_field_cover": 100
}
Update an existing operation
id required | integer (PrimaryKey) >= 1 Example: 1 ID |
type required | string (OperationCategory) Operation type |
notes | string Supplemental notes |
start_date required | string <date> Operation started on this date. If not specified then this date will be set to the |
end_date | string <date> Operation ended on this datetime. If not specified then this date will be set with the |
plot_id required | integer >= 1 Plot ID |
team_id | integer (TeamId) >= 1 Team ID |
is_applied required | boolean Default: true If false then this is a planned operation i.e an operation that is scheduled to happen. If true then the operation actually happened |
created_at | string <date-time> When this operation was created |
updated_at | string <date-time> When this operation was updated. This will be equal to the created_at date initially |
Array of objects (Attachments) Media attachments (uploaded using upload-media-file) | |
planned_operation_id | integer For applied operations this may optionally link to a related planned operation of the same type and plot. |
slug | string Deprecated Legacy operation slug |
method | string Enum: "broadcasting" "placement" "fertigation" "foliar-spray" "injection" "drenching" Method of application |
Array of objects (AppliedProduct) List of applied fertiliser products | |
primary_growth_stage_id | number >= 1 The primary growth stage of the plot. |
primary_growth_stage_name | number (PrimaryGrowthStageId) >= 1 The primary growth stage of the plot. |
secondary_growth_stage_id | number >= 1 The secondary growth stage of the plot, which is dependent on the primary growth stage. |
secondary_growth_stage_name | number (SecondaryGrowthStageId) >= 1 The secondary growth stage of the plot, which is dependent on the primary growth stage. |
percent_field_cover | number <float> [ 0 .. 100 ] Percentage area of plot that has reached the above primary and secondary growth stages |
{- "type": "fertiliser",
- "notes": "string",
- "start_date": "2020-01-02",
- "end_date": "2020-01-02",
- "plot_id": 1,
- "team_id": 6,
- "is_applied": true,
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "attachments": [
- {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}
], - "planned_operation_id": 0,
- "slug": "string",
- "method": "broadcasting",
- "products": [
- {
- "quantity": 0,
- "application_rate": 0,
- "product_id": 1,
- "subtype": "herbicide"
}
], - "primary_growth_stage_id": 1,
- "primary_growth_stage_name": 1,
- "secondary_growth_stage_id": 1,
- "secondary_growth_stage_name": 1,
- "percent_field_cover": 100
}
{- "id": 1,
- "type": "fertiliser",
- "notes": "string",
- "start_date": "2020-01-02",
- "end_date": "2020-01-02",
- "plot_id": 1,
- "plot_name": "My plot",
- "field_id": 1,
- "field_name": "North field",
- "farm_id": 1,
- "farm_name": "Sunny Farm",
- "team_id": 6,
- "team_name": "My Team",
- "is_applied": true,
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "created_by_id": 1,
- "created_by_name": "string",
- "updated_by_id": 1,
- "updated_by_name": "string",
- "attachments": [
- {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}
], - "planned_operation_id": 0,
- "status": "upcoming",
- "slug": "string",
- "method": "broadcasting",
- "products": [
- {
- "quantity": 0,
- "application_rate": 0,
- "application_rate_unit": "kg/ha",
- "product_id": 1,
- "product_name": "string",
- "subtype": "herbicide"
}
], - "primary_growth_stage_id": 1,
- "primary_growth_stage_name": 1,
- "secondary_growth_stage_id": 1,
- "secondary_growth_stage_name": 1,
- "percent_field_cover": 100
}
Returns the permission level for this operation. A user has read/write access to an operation if any of the following conditions are met:
A user has only read-only access if the user has only read-only access to the associated plot.
id required | integer (PrimaryKey) >= 1 Example: 1 ID |
{- "access": "read-edit",
- "noDeleteReason": "string"
}
Create an operation report. This is an asynchronous operation since reports may be large: the URL containing the created report will be found using get-report-status. Note that this API takes all the same query parameters as the list operations API, but as body data.
{- "token": "string"
}
token required | string Token returned in create-operation-report-async |
{- "url": "string"
}
An operation schedule defines a set of planned operations that will be automatically created after a specified trigger operation. A trigger is a combination of genus/variety and organisation group, and the only trigger operation currently supported is a sowing operation i.e the scheduled operations will be added to a plot if it matches the trigger criteria immediately after an actually sowing operation is created for that plot.
Create a crop schedule. Only availble to KisanHub staff and users with the REGISTRATION_ADMIN permission
name required | string Name |
owner_id | integer Owning organisation ID. Only allowed for staff users |
is_active | boolean True if active |
{- "name": "string",
- "owner_id": 0,
- "is_active": true
}
{- "id": 1,
- "name": "string",
- "owner_id": 0,
- "is_active": true
}
List crop schedule operations
qualifier_id | integer Filter by parent schedule qualifier ID |
[- {
- "id": 1,
- "qualifier_id": 0,
- "days_after_sowing": 0,
- "type": "pesticide",
- "method": "fertigation",
- "primary_growth_stage_id": 1,
- "primary_growth_stage_name": "Germination",
- "secondary_growth_stage_id": 1,
- "secondary_growth_stage_name": "Seed imbibition complete",
- "projects": [
- {
- "id": 0,
- "rate": 0.1,
- "state": "liquid",
- "name": "string"
}
]
}
]
List crop schedule operations
qualifier_id required | integer Parent schedule qualifier ID |
days_after_sowing | integer >= 0 qualifier is fired N days after an actual sowing operation |
type | string (OperationCategory) Enum: "fertiliser" "pesticide" "sowing" "harvest" "irrigation" "intercultural" "land_preparation" Operation type |
method | string Operation method |
primary_growth_stage_id | number (PrimaryGrowthStageId) >= 1 The primary growth stage of the plot. |
secondary_growth_stage_id | number (SecondaryGrowthStageId) >= 1 The secondary growth stage of the plot, which is dependent on the primary growth stage. |
Array of objects |
{- "qualifier_id": 0,
- "days_after_sowing": 0,
- "type": "pesticide",
- "method": "fertigation",
- "primary_growth_stage_id": 1,
- "secondary_growth_stage_id": 1,
- "projects": [
- {
- "id": 0,
- "rate": 0.1,
- "name": "string"
}
]
}
{- "id": 1,
- "qualifier_id": 0,
- "days_after_sowing": 0,
- "type": "pesticide",
- "method": "fertigation",
- "primary_growth_stage_id": 1,
- "primary_growth_stage_name": "Germination",
- "secondary_growth_stage_id": 1,
- "secondary_growth_stage_name": "Seed imbibition complete",
- "projects": [
- {
- "id": 0,
- "rate": 0.1,
- "state": "liquid",
- "name": "string"
}
]
}
Get crop schedule operation
id required | integer (PrimaryKey) >= 1 Example: 1 ID |
[- {
- "id": 1,
- "qualifier_id": 0,
- "days_after_sowing": 0,
- "type": "pesticide",
- "method": "fertigation",
- "primary_growth_stage_id": 1,
- "primary_growth_stage_name": "Germination",
- "secondary_growth_stage_id": 1,
- "secondary_growth_stage_name": "Seed imbibition complete",
- "projects": [
- {
- "id": 0,
- "rate": 0.1,
- "state": "liquid",
- "name": "string"
}
]
}
]
List active ingredients used by pesticides
string or string (DateOrDateTime) Example: updated_since=2020-01-02T10:00:00Z Return items created or updated since the specified data/time (inclusive). Date times are always in UTC and are specified in RFC3339 format. Can also be specified as simple dates e.g 2020-01-01, in which case midnight is assumed for the time component. | |
page | integer >= 1 Default: 1 Example: page=2 Page number |
page_size | integer [ 1 .. 100 ] Default: 20 Page size |
search | string Search for ingredient by name |
product_id | integer Filter for ingredients used by this product |
{- "total": 0,
- "results": [
- {
- "id": 1,
- "name": "string"
}
]
}
Note that curation of the list of active ingredients is managed by KisanHub. As such this operation is only accessible for KisanHub staff.
name | string Name |
{- "name": "string"
}
{- "id": 1,
- "name": "string"
}
Return a list of fertiliser and pesticide products
page | integer >= 1 Default: 1 Example: page=2 Page number |
page_size | integer [ 1 .. 100 ] Default: 20 Page size |
search | string Search by product or active ingredient name |
type | any Enum: "pesticide" "fertiliser" Product type |
subtype | string (ProductSubTypes) Enum: "herbicide" "insecticide" "nematicide" "fungicide" "adjuvant" "seed treatment" "growth regulator" "molluscicide" "organic" "inorganic" Product subtype |
{- "total": 0,
- "results": [
- {
- "id": 1,
- "name": "string",
- "manufacturer": "string",
- "type": "pesticide",
- "state": "liquid",
- "is_public": true,
- "created_at": "2019-08-24T14:15:22Z",
- "created_by_id": 1,
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_by_id": 1,
- "subtype": "organic",
- "nitrogen": 100,
- "phosphorus": 100,
- "potassium": 100,
- "magnesium": 100,
- "calcium": 100,
- "sulphur": 100,
- "zinc": 100
}
]
}
Note that curation of the list of pesticide products is managed by KisanHub. As such this operation is only accessible for KisanHub staff.
name required | string Name |
manufacturer | string Manufacturer name |
type required | string type |
state | string Enum: "liquid" "solid" "unknown" Product state. If |
is_public | boolean Default: true If false then this product is only visible to the Team that created it |
subtype | string (FertiliserSubTypes) Enum: "organic" "inorganic" |
nitrogen | number [ 0 .. 100 ] Nitrogen percentage |
phosphorus | number [ 0 .. 100 ] Phosphorus percentage |
potassium | number [ 0 .. 100 ] Potassium percentage |
magnesium | number [ 0 .. 100 ] Magnesium percentage |
calcium | number [ 0 .. 100 ] Calcium percentage |
sulphur | number [ 0 .. 100 ] Sulphur percentage |
zinc | number [ 0 .. 100 ] Zinc percentage |
{- "name": "string",
- "manufacturer": "string",
- "type": "fertiliser",
- "state": "liquid",
- "is_public": true,
- "subtype": "organic",
- "nitrogen": 100,
- "phosphorus": 100,
- "potassium": 100,
- "magnesium": 100,
- "calcium": 100,
- "sulphur": 100,
- "zinc": 100
}
{- "id": 1,
- "name": "string",
- "manufacturer": "string",
- "type": "fertiliser",
- "state": "liquid",
- "is_public": true,
- "created_at": "2019-08-24T14:15:22Z",
- "created_by_id": 1,
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_by_id": 1,
- "subtype": "organic",
- "nitrogen": 100,
- "phosphorus": 100,
- "potassium": 100,
- "magnesium": 100,
- "calcium": 100,
- "sulphur": 100,
- "zinc": 100
}
{- "id": 1,
- "name": "string",
- "manufacturer": "string",
- "type": "fertiliser",
- "state": "liquid",
- "is_public": true,
- "created_at": "2019-08-24T14:15:22Z",
- "created_by_id": 1,
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_by_id": 1,
- "subtype": "organic",
- "nitrogen": 100,
- "phosphorus": 100,
- "potassium": 100,
- "magnesium": 100,
- "calcium": 100,
- "sulphur": 100,
- "zinc": 100
}
Note that curation of the list of pesticide products is managed by KisanHub. As such this operation is only accessible for KisanHub staff.
id required | integer (PrimaryKey) >= 1 Example: 1 ID |
name required | string Name |
manufacturer | string Manufacturer name |
type required | string type |
state | string Enum: "liquid" "solid" "unknown" Product state. If |
is_public | boolean Default: true If false then this product is only visible to the Team that created it |
subtype | string (FertiliserSubTypes) Enum: "organic" "inorganic" |
nitrogen | number [ 0 .. 100 ] Nitrogen percentage |
phosphorus | number [ 0 .. 100 ] Phosphorus percentage |
potassium | number [ 0 .. 100 ] Potassium percentage |
magnesium | number [ 0 .. 100 ] Magnesium percentage |
calcium | number [ 0 .. 100 ] Calcium percentage |
sulphur | number [ 0 .. 100 ] Sulphur percentage |
zinc | number [ 0 .. 100 ] Zinc percentage |
{- "name": "string",
- "manufacturer": "string",
- "type": "fertiliser",
- "state": "liquid",
- "is_public": true,
- "subtype": "organic",
- "nitrogen": 100,
- "phosphorus": 100,
- "potassium": 100,
- "magnesium": 100,
- "calcium": 100,
- "sulphur": 100,
- "zinc": 100
}
{- "id": 1,
- "name": "string",
- "manufacturer": "string",
- "type": "fertiliser",
- "state": "liquid",
- "is_public": true,
- "created_at": "2019-08-24T14:15:22Z",
- "created_by_id": 1,
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_by_id": 1,
- "subtype": "organic",
- "nitrogen": 100,
- "phosphorus": 100,
- "potassium": 100,
- "magnesium": 100,
- "calcium": 100,
- "sulphur": 100,
- "zinc": 100
}
Return a list of fertiliser and pesticide products with pesticide ingredients expanded
page | integer >= 1 Default: 1 Example: page=2 Page number |
page_size | integer [ 1 .. 100 ] Default: 20 Page size |
search | string Search by product and active ingredient name |
type | any Enum: "pesticide" "fertiliser" Product type |
subtype | string (ProductSubTypes) Enum: "herbicide" "insecticide" "nematicide" "fungicide" "adjuvant" "seed treatment" "growth regulator" "molluscicide" "organic" "inorganic" Product subtype |
{- "total": 0,
- "results": [
- {
- "id": 1,
- "name": "string",
- "manufacturer": "string",
- "type": "pesticide",
- "state": "liquid",
- "is_public": true,
- "created_at": "2019-08-24T14:15:22Z",
- "created_by_id": 1,
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_by_id": 1,
- "subtype": "organic",
- "nitrogen": 100,
- "phosphorus": 100,
- "potassium": 100,
- "magnesium": 100,
- "calcium": 100,
- "sulphur": 100,
- "zinc": 100
}
]
}
Return a list of soil samples
page | integer >= 1 Default: 1 Example: page=2 Page number |
page_size | integer [ 1 .. 100 ] Default: 20 Page size |
string or string (DateOrDateTime) Example: updated_since=2020-01-02T10:00:00Z Return items created or updated since the specified data/time (inclusive). Date times are always in UTC and are specified in RFC3339 format. Can also be specified as simple dates e.g 2020-01-01, in which case midnight is assumed for the time component. | |
search | string Search for sample name |
exclude_with_reports | boolean If true then exclude samples which already have reports |
field_id |
{- "total": 0,
- "results": [
- {
- "id": 1,
- "name": "string",
- "field_id": 1,
- "date": "2019-08-24T14:15:22Z",
- "location": [
- -1.30329,
- 51.17687
], - "depth": 0,
- "notes": "string"
}
]
}
name | string Name |
field_id | integer >= 1 Field ID |
date | string <date-time> |
location | Array of numbers <float> (Point) = 2 items [ items <float > ] Point location as a [lng, lat] pair |
depth | number Depth in mm |
notes | string Associated notes |
{- "name": "string",
- "field_id": 1,
- "date": "2019-08-24T14:15:22Z",
- "location": [
- -1.30329,
- 51.17687
], - "depth": 0,
- "notes": "string"
}
{- "id": 1,
- "name": "string",
- "field_id": 1,
- "date": "2019-08-24T14:15:22Z",
- "location": [
- -1.30329,
- 51.17687
], - "depth": 0,
- "notes": "string"
}
Soil sample summaries in GeoJSON format
team_id | |
season | string Deprecated Example: season=2019/20 Growing season |
field_id |
{- "type": "FeatureCollection",
- "features": [
- {
- "type": "Feature",
- "geometry": {
- "type": "Point",
- "coordinates": [
- -1.30329,
- 51.17687
]
}, - "properties": {
- "id": 0,
- "name": "string"
}
}
]
}
Return a paginated list of soil test reports.
page | integer >= 1 Default: 1 Example: page=2 Page number |
page_size | integer [ 1 .. 100 ] Default: 20 Page size |
sample_id | integer >= 1 Filter by sample id |
field_id | |
team_id | |
string or string (DateOrDateTime) Example: updated_since=2020-01-02T10:00:00Z Return items created or updated since the specified data/time (inclusive). Date times are always in UTC and are specified in RFC3339 format. Can also be specified as simple dates e.g 2020-01-01, in which case midnight is assumed for the time component. |
{- "total": 0,
- "results": [
- {
- "id": 1,
- "date": "2019-08-24T14:15:22Z",
- "notes": "string",
- "attachments": [
- {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}
], - "physical_properties": {
- "bulk_density": 0,
- "sand": 100,
- "silt": 100,
- "clay": 100,
- "moisture_content": 100,
- "plastic_limit": 100,
- "field_capacity": 100,
- "permanent_wilting_point": 100,
- "percolation_rate": 0,
- "hydraulic_conductivity": 0,
- "texture": "string",
- "structure": "string",
- "colour": "string"
}, - "chemical_properties": {
- "pH": 14,
- "organic_matter": 100,
- "organic_carbon": 100,
- "electrical_conductivity": 100,
- "cation_exchange_capacity": 100,
- "sodium_adsorption_ratio": 100
}, - "micro_nutrients": {
- "iron": 0,
- "molybdenum": 0,
- "boron": 0,
- "copper": 0,
- "manganese": 0,
- "sodium": 0,
- "zinc": 0,
- "nickel": 0,
- "chlorine": 0,
- "cobalt": 0,
- "aluminium": 0,
- "silicon": 0
}, - "macro_nutrients": {
- "available_nitrogen": 0,
- "available_phosphorus": 0,
- "available_potassium": 0,
- "magnesium": 0,
- "calcium": 0,
- "sulphur": 0
}, - "laboratory_id": 1,
- "field_id": 0,
- "sample_id": 1
}
]
}
id | integer >= 1 Soil report ID |
date | string <date-time> Test report creation or most recent update |
notes | string Associated notes |
Array of objects (Attachments) Media attachments (uploaded using upload-media-file) | |
object Physical soil properties | |
object Chemical properties | |
object Micronutrients | |
object Macronutrients | |
laboratory_id required | integer >= 1 Laboratory ID |
sample_id required | integer >= 1 Soil sample ID |
{- "id": 1,
- "date": "2019-08-24T14:15:22Z",
- "notes": "string",
- "attachments": [
- {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}
], - "physical_properties": {
- "bulk_density": 0,
- "sand": 100,
- "silt": 100,
- "clay": 100,
- "moisture_content": 100,
- "plastic_limit": 100,
- "field_capacity": 100,
- "permanent_wilting_point": 100,
- "percolation_rate": 0,
- "hydraulic_conductivity": 0,
- "texture": "string",
- "structure": "string",
- "colour": "string"
}, - "chemical_properties": {
- "pH": 14,
- "organic_matter": 100,
- "organic_carbon": 100,
- "electrical_conductivity": 100,
- "cation_exchange_capacity": 100,
- "sodium_adsorption_ratio": 100
}, - "micro_nutrients": {
- "iron": 0,
- "molybdenum": 0,
- "boron": 0,
- "copper": 0,
- "manganese": 0,
- "sodium": 0,
- "zinc": 0,
- "nickel": 0,
- "chlorine": 0,
- "cobalt": 0,
- "aluminium": 0,
- "silicon": 0
}, - "macro_nutrients": {
- "available_nitrogen": 0,
- "available_phosphorus": 0,
- "available_potassium": 0,
- "magnesium": 0,
- "calcium": 0,
- "sulphur": 0
}, - "laboratory_id": 1,
- "sample_id": 1
}
{- "id": 1,
- "date": "2019-08-24T14:15:22Z",
- "notes": "string",
- "attachments": [
- {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}
], - "physical_properties": {
- "bulk_density": 0,
- "sand": 100,
- "silt": 100,
- "clay": 100,
- "moisture_content": 100,
- "plastic_limit": 100,
- "field_capacity": 100,
- "permanent_wilting_point": 100,
- "percolation_rate": 0,
- "hydraulic_conductivity": 0,
- "texture": "string",
- "structure": "string",
- "colour": "string"
}, - "chemical_properties": {
- "pH": 14,
- "organic_matter": 100,
- "organic_carbon": 100,
- "electrical_conductivity": 100,
- "cation_exchange_capacity": 100,
- "sodium_adsorption_ratio": 100
}, - "micro_nutrients": {
- "iron": 0,
- "molybdenum": 0,
- "boron": 0,
- "copper": 0,
- "manganese": 0,
- "sodium": 0,
- "zinc": 0,
- "nickel": 0,
- "chlorine": 0,
- "cobalt": 0,
- "aluminium": 0,
- "silicon": 0
}, - "macro_nutrients": {
- "available_nitrogen": 0,
- "available_phosphorus": 0,
- "available_potassium": 0,
- "magnesium": 0,
- "calcium": 0,
- "sulphur": 0
}, - "laboratory_id": 1,
- "field_id": 0,
- "sample_id": 1
}
{- "id": 1,
- "date": "2019-08-24T14:15:22Z",
- "notes": "string",
- "attachments": [
- {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}
], - "physical_properties": {
- "bulk_density": 0,
- "sand": 100,
- "silt": 100,
- "clay": 100,
- "moisture_content": 100,
- "plastic_limit": 100,
- "field_capacity": 100,
- "permanent_wilting_point": 100,
- "percolation_rate": 0,
- "hydraulic_conductivity": 0,
- "texture": "string",
- "structure": "string",
- "colour": "string"
}, - "chemical_properties": {
- "pH": 14,
- "organic_matter": 100,
- "organic_carbon": 100,
- "electrical_conductivity": 100,
- "cation_exchange_capacity": 100,
- "sodium_adsorption_ratio": 100
}, - "micro_nutrients": {
- "iron": 0,
- "molybdenum": 0,
- "boron": 0,
- "copper": 0,
- "manganese": 0,
- "sodium": 0,
- "zinc": 0,
- "nickel": 0,
- "chlorine": 0,
- "cobalt": 0,
- "aluminium": 0,
- "silicon": 0
}, - "macro_nutrients": {
- "available_nitrogen": 0,
- "available_phosphorus": 0,
- "available_potassium": 0,
- "magnesium": 0,
- "calcium": 0,
- "sulphur": 0
}, - "laboratory_id": 1,
- "field_id": 0,
- "sample_id": 1
}
id required | integer >= 1 Soil report ID |
id required | integer >= 1 Soil report ID |
date | string <date-time> Test report creation or most recent update |
notes | string Associated notes |
Array of objects (Attachments) Media attachments (uploaded using upload-media-file) | |
object Physical soil properties | |
object Chemical properties | |
object Micronutrients | |
object Macronutrients | |
laboratory_id required | integer >= 1 Laboratory ID |
sample_id required | integer >= 1 Soil sample ID |
{- "id": 1,
- "date": "2019-08-24T14:15:22Z",
- "notes": "string",
- "attachments": [
- {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}
], - "physical_properties": {
- "bulk_density": 0,
- "sand": 100,
- "silt": 100,
- "clay": 100,
- "moisture_content": 100,
- "plastic_limit": 100,
- "field_capacity": 100,
- "permanent_wilting_point": 100,
- "percolation_rate": 0,
- "hydraulic_conductivity": 0,
- "texture": "string",
- "structure": "string",
- "colour": "string"
}, - "chemical_properties": {
- "pH": 14,
- "organic_matter": 100,
- "organic_carbon": 100,
- "electrical_conductivity": 100,
- "cation_exchange_capacity": 100,
- "sodium_adsorption_ratio": 100
}, - "micro_nutrients": {
- "iron": 0,
- "molybdenum": 0,
- "boron": 0,
- "copper": 0,
- "manganese": 0,
- "sodium": 0,
- "zinc": 0,
- "nickel": 0,
- "chlorine": 0,
- "cobalt": 0,
- "aluminium": 0,
- "silicon": 0
}, - "macro_nutrients": {
- "available_nitrogen": 0,
- "available_phosphorus": 0,
- "available_potassium": 0,
- "magnesium": 0,
- "calcium": 0,
- "sulphur": 0
}, - "laboratory_id": 1,
- "sample_id": 1
}
{- "id": 1,
- "date": "2019-08-24T14:15:22Z",
- "notes": "string",
- "attachments": [
- {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}
], - "physical_properties": {
- "bulk_density": 0,
- "sand": 100,
- "silt": 100,
- "clay": 100,
- "moisture_content": 100,
- "plastic_limit": 100,
- "field_capacity": 100,
- "permanent_wilting_point": 100,
- "percolation_rate": 0,
- "hydraulic_conductivity": 0,
- "texture": "string",
- "structure": "string",
- "colour": "string"
}, - "chemical_properties": {
- "pH": 14,
- "organic_matter": 100,
- "organic_carbon": 100,
- "electrical_conductivity": 100,
- "cation_exchange_capacity": 100,
- "sodium_adsorption_ratio": 100
}, - "micro_nutrients": {
- "iron": 0,
- "molybdenum": 0,
- "boron": 0,
- "copper": 0,
- "manganese": 0,
- "sodium": 0,
- "zinc": 0,
- "nickel": 0,
- "chlorine": 0,
- "cobalt": 0,
- "aluminium": 0,
- "silicon": 0
}, - "macro_nutrients": {
- "available_nitrogen": 0,
- "available_phosphorus": 0,
- "available_potassium": 0,
- "magnesium": 0,
- "calcium": 0,
- "sulphur": 0
}, - "laboratory_id": 1,
- "field_id": 0,
- "sample_id": 1
}
Return a paginated list of soil test report summaries.
page | integer >= 1 Default: 1 Example: page=2 Page number |
page_size | integer [ 1 .. 100 ] Default: 20 Page size |
sample_id | integer >= 1 Filter by sample id |
field_id | |
team_id | |
string or string (DateOrDateTime) Example: updated_since=2020-01-02T10:00:00Z Return items created or updated since the specified data/time (inclusive). Date times are always in UTC and are specified in RFC3339 format. Can also be specified as simple dates e.g 2020-01-01, in which case midnight is assumed for the time component. |
{- "total": 0,
- "results": [
- {
- "laboratory": {
- "id": 1,
- "name": "string"
}, - "sample": {
- "id": 1,
- "name": "string"
}, - "team": {
- "id": 1,
- "name": "string"
}, - "field": {
- "id": 1,
- "name": "string"
}
}
]
}
A system to allow users to define the different parameters they wish to test on their crops and then record results to them. Threshold levels can be set for individual markets for each test parameter, with market suitability automatically being calculated when results are submitted.
Paginated list of crop quality assessments
page | integer >= 1 Default: 1 Example: page=2 Page number |
page_size | integer [ 1 .. 100 ] Default: 20 Page size |
string or string (DateOrDateTime) Example: updated_since=2020-01-02T10:00:00Z Return items created or updated since the specified data/time (inclusive). Date times are always in UTC and are specified in RFC3339 format. Can also be specified as simple dates e.g 2020-01-01, in which case midnight is assumed for the time component. | |
team_ids | |
plot_id | |
lot_id | |
template_id |
{- "total": 0,
- "results": [
- {
- "id": 0,
- "template_id": 2,
- "suitability": [
- {
- "specification": "UK",
- "parameter_id": 0,
- "sub_sample_index": 0,
- "is_suitable": "true"
}
], - "sample_reference": "Sample 101",
- "sample_date": "2019-02-25",
- "custom_field_values": [
- {
- "id": 1,
- "name": "string",
- "value": 91987654321
}
], - "test_results": [
- {
- "template_parameter_id": 5,
- "template_parameter_name": "Bruising",
- "value": 1.1,
- "sub_sample_index": 0
}
], - "attachments": [
- {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}
], - "sub_samples": [
- {
- "name": "S23",
- "sample_weight": 13.53
}
], - "lot_id": 1,
- "created_by_id": 1,
- "created_by_name": "Billy bob",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_by_id": 1,
- "updated_by_name": "Billy bob",
- "updated_at": "2019-08-24T14:15:22Z"
}
]
}
Create a crop quality assessment for an existing or an off platform field or lot.
You can create an "off-platform" crop by providing a new_field_name
(for an off-platform field),
and/or a new_lot_name
(for an off-platform store lot). When creating an off-platform field the caller must
create an off-platform lot: however an on-platform field may be paired with an off-platform lot. Off-platform
fields must specify both region
and country
of origin
The returned assessment will contain information on specification suitability.
If associated with a plot the plot status will be changed to RESULTS_RECEIVED if test results have been supplied and AWAITING_RESULT if no results have been applied, but only if the status is currently none of the following:
lot_id required | integer >= 1 Store lot ID |
template_id required | integer (TemplateId) Template API |
sample_reference | string (SampleReference) Sample reference |
sample_date required | string or null <date> (SampleDate) Sample date of Assessment |
Array of objects (CustomFieldValues) List of Custom Field values | |
required | Array of objects (TestResultsV2) Values collected |
Array of objects (Attachments) Media attachments (uploaded using upload-media-file) | |
Array of objects (SubSample) List of potential subsamples. Each test result may be associated with a specific subsample, referred to by index into this list |
{- "template_id": 2,
- "sample_reference": "Sample 101",
- "sample_date": "2019-02-25",
- "custom_field_values": [
- {
- "id": 1,
- "value": 91987654321
}
], - "test_results": [
- {
- "template_parameter_id": 5,
- "value": 1.1,
- "sub_sample_index": 0
}
], - "attachments": [
- {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}
], - "sub_samples": [
- {
- "name": "S23",
- "sample_weight": 13.53
}
], - "plot_id": 1
}
{- "id": 0,
- "template_id": 2,
- "suitability": [
- {
- "specification": "UK",
- "parameter_id": 0,
- "sub_sample_index": 0,
- "is_suitable": "true"
}
], - "sample_reference": "Sample 101",
- "sample_date": "2019-02-25",
- "custom_field_values": [
- {
- "id": 1,
- "name": "string",
- "value": 91987654321
}
], - "test_results": [
- {
- "template_parameter_id": 5,
- "template_parameter_name": "Bruising",
- "value": 1.1,
- "sub_sample_index": 0
}
], - "attachments": [
- {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}
], - "sub_samples": [
- {
- "name": "S23",
- "sample_weight": 13.53
}
], - "plot_id": 1,
- "created_by_id": 1,
- "created_by_name": "Billy bob",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_by_id": 1,
- "updated_by_name": "Billy bob",
- "updated_at": "2019-08-24T14:15:22Z"
}
Get shared assessment reports
page | integer >= 1 Default: 1 Example: page=2 Page number |
page_size | integer [ 1 .. 100 ] Default: 20 Page size |
string or string (DateOrDateTime) Example: updated_since=2020-01-02T10:00:00Z Return items created or updated since the specified data/time (inclusive). Date times are always in UTC and are specified in RFC3339 format. Can also be specified as simple dates e.g 2020-01-01, in which case midnight is assumed for the time component. | |
team_ids | |
plot_id | |
lot_id | |
template_id |
{- "id": 0,
- "template": {
- "id": 0,
- "old_template_id": 0,
- "version": 0,
- "name": "Potato main crop",
- "team_id": 6,
- "team_name": "Bobs Farm",
- "crop_id": 2,
- "genus_id": 2,
- "genus_name": "string",
- "specifications": "UK,ES",
- "description": "Used in ARRA 51",
- "custom_fields": [
- {
- "name": "Abzine",
- "required": true
}
], - "sections": [
- {
- "name": "string",
- "is_weighted": true,
- "deduct_from_tonnage": false,
- "min_y": 0,
- "max_y": 0,
- "chart_type": "spline",
- "parameters": [
- {
- "id": 0,
- "name": "string",
- "min_y": 0,
- "max_y": 0,
- "specifications": [
- {
- "name": "GB",
- "gte": 0.6,
- "lte": 1.2
}
]
}
]
}
], - "latest_id": 0,
- "created_by_id": 1,
- "created_by_name": "Billy bob",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_by_id": 1,
- "updated_by_name": "Billy bob",
- "updated_at": "2019-08-24T14:15:22Z"
}, - "crop_name": "string",
- "owner_organisation_name": "string",
- "field_name": "North field",
- "variety_name": "Accord",
- "suitability": [
- {
- "specification": "UK",
- "parameter_id": 0,
- "sub_sample_index": 0,
- "is_suitable": "true"
}
], - "sample_reference": "Sample 101",
- "sample_date": "2019-02-25",
- "custom_field_values": [
- {
- "id": 1,
- "name": "string",
- "value": 91987654321
}
], - "test_results": [
- {
- "template_parameter_id": 5,
- "template_parameter_name": "Bruising",
- "value": 1.1,
- "sub_sample_index": 0
}
], - "attachments": [
- {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}
], - "crop_store_lot": {
- "id": 0,
- "name": "string",
- "store_id": 0,
- "store_name": "string"
}, - "created_by_id": 1,
- "created_by_name": "Billy bob",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_by_id": 1,
- "updated_by_name": "Billy bob",
- "updated_at": "2019-08-24T14:15:22Z",
- "stats": {
- "by_parameter": [
- {
- "property_id": 0,
- "is_percentage": true,
- "min": 0,
- "max": 0,
- "average": 0,
- "tonnage": 0
}
], - "by_section": [
- {
- "section_id": 0,
- "subsample_totals": [
- 0
], - "min": 0,
- "max": 0,
- "average": 0,
- "tonnage": 0
}
], - "tonnage": {
- "available": 0,
- "is_estimated": true,
- "deducted": 0,
- "adjusted": 0
}
}
}
Get this assessment
id required | integer (PrimaryKey) >= 1 Example: 1 ID |
{- "id": 0,
- "template_id": 2,
- "suitability": [
- {
- "specification": "UK",
- "parameter_id": 0,
- "sub_sample_index": 0,
- "is_suitable": "true"
}
], - "sample_reference": "Sample 101",
- "sample_date": "2019-02-25",
- "custom_field_values": [
- {
- "id": 1,
- "name": "string",
- "value": 91987654321
}
], - "test_results": [
- {
- "template_parameter_id": 5,
- "template_parameter_name": "Bruising",
- "value": 1.1,
- "sub_sample_index": 0
}
], - "attachments": [
- {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}
], - "sub_samples": [
- {
- "name": "S23",
- "sample_weight": 13.53
}
], - "plot_id": 1,
- "created_by_id": 1,
- "created_by_name": "Billy bob",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_by_id": 1,
- "updated_by_name": "Billy bob",
- "updated_at": "2019-08-24T14:15:22Z"
}
Update an existing assessment
id required | integer (PrimaryKey) >= 1 Example: 1 ID |
{- "id": 0,
- "template_id": 2,
- "suitability": [
- {
- "specification": "UK",
- "parameter_id": 0,
- "sub_sample_index": 0,
- "is_suitable": "true"
}
], - "sample_reference": "Sample 101",
- "sample_date": "2019-02-25",
- "custom_field_values": [
- {
- "id": 1,
- "name": "string",
- "value": 91987654321
}
], - "test_results": [
- {
- "template_parameter_id": 5,
- "template_parameter_name": "Bruising",
- "value": 1.1,
- "sub_sample_index": 0
}
], - "attachments": [
- {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}
], - "sub_samples": [
- {
- "name": "S23",
- "sample_weight": 13.53
}
], - "plot_id": 1,
- "created_by_id": 1,
- "created_by_name": "Billy bob",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_by_id": 1,
- "updated_by_name": "Billy bob",
- "updated_at": "2019-08-24T14:15:22Z"
}
Returns a paginated list of subsample names with their owner organisations. Defaults to returning the list
of subsamples owned by the requester's organisation, but can be used to return names for any connected
organisation via the team_ids
parameter.
string or string (DateOrDateTime) Example: updated_since=2020-01-02T10:00:00Z Return items created or updated since the specified data/time (inclusive). Date times are always in UTC and are specified in RFC3339 format. Can also be specified as simple dates e.g 2020-01-01, in which case midnight is assumed for the time component. | |
team_ids | |
search | string Example: search=my-plot Text search |
[- {
- "name": "string",
- "owner_id": 0
}
]
Returns a paginated list of assessment templates
string or string (DateOrDateTime) Example: updated_since=2020-01-02T10:00:00Z Return items created or updated since the specified data/time (inclusive). Date times are always in UTC and are specified in RFC3339 format. Can also be specified as simple dates e.g 2020-01-01, in which case midnight is assumed for the time component. | |
team_id | |
team_ids | |
search | string Example: search=my-plot Text search |
is_active | boolean Default: true Returns all templates by default - supply false for this to show inactive templates |
include_archived | boolean Default: false Returns only the latest versions of templates by default - supply true for this to show all templates |
{- "total": 0,
- "results": [
- {
- "id": 0,
- "old_template_id": 0,
- "version": 0,
- "name": "Potato main crop",
- "team_id": 6,
- "team_name": "Bobs Farm",
- "crop_id": 2,
- "genus_id": 2,
- "genus_name": "string",
- "specifications": "UK,ES",
- "description": "Used in ARRA 51",
- "custom_fields": [
- {
- "name": "Abzine",
- "required": true
}
], - "sections": [
- {
- "name": "string",
- "is_weighted": true,
- "deduct_from_tonnage": false,
- "min_y": 0,
- "max_y": 0,
- "chart_type": "spline",
- "parameters": [
- {
- "id": 0,
- "name": "string",
- "min_y": 0,
- "max_y": 0,
- "specifications": [
- {
- "name": "GB",
- "gte": 0.6,
- "lte": 1.2
}
]
}
]
}
], - "latest_id": 0,
- "created_by_id": 1,
- "created_by_name": "Billy bob",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_by_id": 1,
- "updated_by_name": "Billy bob",
- "updated_at": "2019-08-24T14:15:22Z"
}
]
}
Create an assessment template or create a new version of an existing template
if old_template_id
is provided
old_template_id | integer should be provided in case of creating a new version of an existing template |
name required | string Template name |
team_id required | integer (TeamId) >= 1 Team ID |
crop_id required | integer (GenusId) >= 1 Genus ID |
genus_id | integer (GenusId) >= 1 Genus ID |
description | string Description |
Array of objects Custom fields for Template | |
required | Array of objects (AssessmentTemplateSection) non-empty |
{- "old_template_id": 0,
- "name": "Potato main crop",
- "team_id": 6,
- "crop_id": 2,
- "genus_id": 2,
- "description": "Used in ARRA 51",
- "custom_fields": [
- {
- "name": "Abzine",
- "required": true
}
], - "sections": [
- {
- "name": "string",
- "is_weighted": true,
- "deduct_from_tonnage": false,
- "min_y": 0,
- "max_y": 0,
- "chart_type": "spline",
- "parameters": [
- {
- "name": "string",
- "min_y": 0,
- "max_y": 0,
- "specifications": [
- {
- "name": "GB",
- "gte": 0.6,
- "lte": 1.2
}
]
}
]
}
]
}
{- "id": 0,
- "old_template_id": 0,
- "version": 0,
- "name": "Potato main crop",
- "team_id": 6,
- "team_name": "Bobs Farm",
- "crop_id": 2,
- "genus_id": 2,
- "genus_name": "string",
- "specifications": "UK,ES",
- "description": "Used in ARRA 51",
- "custom_fields": [
- {
- "name": "Abzine",
- "required": true
}
], - "sections": [
- {
- "name": "string",
- "is_weighted": true,
- "deduct_from_tonnage": false,
- "min_y": 0,
- "max_y": 0,
- "chart_type": "spline",
- "parameters": [
- {
- "id": 0,
- "name": "string",
- "min_y": 0,
- "max_y": 0,
- "specifications": [
- {
- "name": "GB",
- "gte": 0.6,
- "lte": 1.2
}
]
}
]
}
], - "latest_id": 0,
- "created_by_id": 1,
- "created_by_name": "Billy bob",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_by_id": 1,
- "updated_by_name": "Billy bob",
- "updated_at": "2019-08-24T14:15:22Z"
}
Returns a paginated list of assessment template id and names
page | integer >= 1 Default: 1 Example: page=2 Page number |
page_size | integer [ 1 .. 100 ] Default: 20 Page size |
search | string Example: search=my-plot Text search |
{- "total": 0,
- "results": [
- {
- "id": 0,
- "name": "string"
}
]
}
Retrieves template and related objects
id required | integer (PrimaryKey) >= 1 Example: 1 ID |
{- "id": 0,
- "old_template_id": 0,
- "version": 0,
- "name": "Potato main crop",
- "team_id": 6,
- "team_name": "Bobs Farm",
- "crop_id": 2,
- "genus_id": 2,
- "genus_name": "string",
- "specifications": "UK,ES",
- "description": "Used in ARRA 51",
- "custom_fields": [
- {
- "name": "Abzine",
- "required": true
}
], - "sections": [
- {
- "name": "string",
- "is_weighted": true,
- "deduct_from_tonnage": false,
- "min_y": 0,
- "max_y": 0,
- "chart_type": "spline",
- "parameters": [
- {
- "id": 0,
- "name": "string",
- "min_y": 0,
- "max_y": 0,
- "specifications": [
- {
- "name": "GB",
- "gte": 0.6,
- "lte": 1.2
}
]
}
]
}
], - "latest_id": 0,
- "created_by_id": 1,
- "created_by_name": "Billy bob",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_by_id": 1,
- "updated_by_name": "Billy bob",
- "updated_at": "2019-08-24T14:15:22Z"
}
id required | integer (PrimaryKey) >= 1 Example: 1 ID |
old_template_id | integer should be provided in case of creating a new version of an existing template |
name required | string Template name |
team_id required | integer (TeamId) >= 1 Team ID |
crop_id required | integer (GenusId) >= 1 Genus ID |
genus_id | integer (GenusId) >= 1 Genus ID |
description | string Description |
Array of objects Custom fields for Template | |
required | Array of objects (AssessmentTemplateSection) non-empty |
{- "old_template_id": 0,
- "name": "Potato main crop",
- "team_id": 6,
- "crop_id": 2,
- "genus_id": 2,
- "description": "Used in ARRA 51",
- "custom_fields": [
- {
- "name": "Abzine",
- "required": true
}
], - "sections": [
- {
- "name": "string",
- "is_weighted": true,
- "deduct_from_tonnage": false,
- "min_y": 0,
- "max_y": 0,
- "chart_type": "spline",
- "parameters": [
- {
- "name": "string",
- "min_y": 0,
- "max_y": 0,
- "specifications": [
- {
- "name": "GB",
- "gte": 0.6,
- "lte": 1.2
}
]
}
]
}
]
}
{- "id": 0,
- "old_template_id": 0,
- "version": 0,
- "name": "Potato main crop",
- "team_id": 6,
- "team_name": "Bobs Farm",
- "crop_id": 2,
- "genus_id": 2,
- "genus_name": "string",
- "specifications": "UK,ES",
- "description": "Used in ARRA 51",
- "custom_fields": [
- {
- "name": "Abzine",
- "required": true
}
], - "sections": [
- {
- "name": "string",
- "is_weighted": true,
- "deduct_from_tonnage": false,
- "min_y": 0,
- "max_y": 0,
- "chart_type": "spline",
- "parameters": [
- {
- "id": 0,
- "name": "string",
- "min_y": 0,
- "max_y": 0,
- "specifications": [
- {
- "name": "GB",
- "gte": 0.6,
- "lte": 1.2
}
]
}
]
}
], - "latest_id": 0,
- "created_by_id": 1,
- "created_by_name": "Billy bob",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_by_id": 1,
- "updated_by_name": "Billy bob",
- "updated_at": "2019-08-24T14:15:22Z"
}
Returns a page of crop quality summaries. This is effectively the union of visible plots and store lots augmented with the their most recent quality assessment result, sorted by the most recent assessments first.
template_id required | integer Restrict to plots and lots which have assessments for this template |
page_size | integer [ 1 .. 100 ] Default: 20 Page size |
source | string Enum: "plot" "lot" Filter to return only plots or lots (defaults to both combined) |
sample_date_gte | string Example: sample_date_gte=2021-01-01 Exclude assessments where the sample date is strictly less than this value |
sample_date_lte | string Example: sample_date_lte=2021-09-01 Exclude assessments where the sample date is strictly greater than this value |
team_id | |
field_id | |
store_id | |
organisation_id | |
team_ids | |
variety_id | |
plot_id | |
lot_id | |
specifications | string Example: specifications=UK,ES Comma separated list of quality specification names. Only include plots and plots where the most recent assessment passes any of the supplied specifications. |
search | string Example: search=north Search for crop owner, field name, plot name or lot name |
An crop monitoring diary is designed to capture all of the information recorded on a field visit. It groups multiple pieces of information so that they can be referenced to a certain field visit, and viewed in context of the other information collected. It may consist of a date, growth stages, notes, images and observations. Observations provide a structured and repeatable way of recording a regular or universal piece of information, like pest or disease presence or a crop milestone
Returns a paginated list of crop monitoring diaries. Diaries can be associated with either a plot or a store lot.
Diary visibility is determined by the following rules:
Note that all visible diaries are editable
page | integer >= 1 Default: 1 Example: page=2 Page number |
page_size | integer [ 1 .. 100 ] Default: 20 Page size |
date_gte | string <date> Example: date_gte=2019-01-01 Lower threshold for the date when observation is captured |
date_lte | string <date> Example: date_lte=2019-01-01 Upper threshold for the date when observation is captured |
user_id | |
critical | boolean Deprecated Whether to retrieve only critical observations |
parameter_id | integer Observation parameter ID |
parameter_name | string Name of the parameter to search by |
risk_level | string Enum: "low" "medium" "high" Filter on risk level |
team_id | |
team_ids | |
farm_id | |
field_id | |
plot_id | |
genus_id | |
variety_id | |
string or string (DateOrDateTime) Example: updated_since=2020-01-02T10:00:00Z Return items created or updated since the specified data/time (inclusive). Date times are always in UTC and are specified in RFC3339 format. Can also be specified as simple dates e.g 2020-01-01, in which case midnight is assumed for the time component. |
{- "total": 0,
- "results": [
- {
- "lot_id": 1,
- "id": 1,
- "field_id": 1,
- "field_name": "string",
- "farm_id": 1,
- "farm_name": "string",
- "team_id": 1,
- "team_name": "string",
- "organisation_id": 1,
- "organisation_name": "string",
- "genus_id": 0,
- "genus_name": "potato",
- "variety_id": 0,
- "variety_name": "voyager",
- "date": "2020-05-26",
- "location": [
- -1.30329,
- 51.17687
], - "access": "read-edit",
- "notes": "string",
- "uploaded_files": [
- {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}
], - "samples": [
- {
- "id": 1,
- "parameter_id": 1,
- "parameter_name": "string",
- "format": "date",
- "category_id": 1,
- "category_name": "string",
- "unit_name": "centimetre",
- "value": 0.1,
- "risk_level": "low"
}
], - "created_at": "2019-08-24T14:15:22Z",
- "created_by_id": 1,
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_by_id": 1,
- "created_by_name": "Bob Smith"
}
]
}
Create a new crop monitoring diary
lot_id required | integer >= 1 Store lot ID |
date required | string <date> |
location | Array of numbers or null <float> = 2 items Point location as a [lng, lat] pair |
notes | string |
Array of objects (Attachments) Media attachments (uploaded using upload-media-file) | |
Array of objects (ObservationSample) | |
created_by_name | string Full name of diary creator |
{- "lot_id": 1,
- "date": "2020-05-26",
- "location": [
- -1.30329,
- 51.17687
], - "notes": "string",
- "uploaded_files": [
- {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}
], - "samples": [
- {
- "parameter_id": 1,
- "format": "date",
- "category_id": 1,
- "value": 0.1
}
], - "created_by_name": "Bob Smith"
}
{- "lot_id": 1,
- "id": 1,
- "field_id": 1,
- "field_name": "string",
- "farm_id": 1,
- "farm_name": "string",
- "team_id": 1,
- "team_name": "string",
- "organisation_id": 1,
- "organisation_name": "string",
- "genus_id": 0,
- "genus_name": "potato",
- "variety_id": 0,
- "variety_name": "voyager",
- "date": "2020-05-26",
- "location": [
- -1.30329,
- 51.17687
], - "access": "read-edit",
- "notes": "string",
- "uploaded_files": [
- {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}
], - "samples": [
- {
- "id": 1,
- "parameter_id": 1,
- "parameter_name": "string",
- "format": "date",
- "category_id": 1,
- "category_name": "string",
- "unit_name": "centimetre",
- "value": 0.1,
- "risk_level": "low"
}
], - "created_at": "2019-08-24T14:15:22Z",
- "created_by_id": 1,
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_by_id": 1,
- "created_by_name": "Bob Smith"
}
Retrieve a diary. Contains more detail then the list-observation endpoint
id required | integer (PrimaryKey) >= 1 Example: 1 ID |
{- "lot_id": 1,
- "id": 1,
- "field_id": 1,
- "field_name": "string",
- "farm_id": 1,
- "farm_name": "string",
- "team_id": 1,
- "team_name": "string",
- "organisation_id": 1,
- "organisation_name": "string",
- "genus_id": 0,
- "genus_name": "potato",
- "variety_id": 0,
- "variety_name": "voyager",
- "date": "2020-05-26",
- "location": [
- -1.30329,
- 51.17687
], - "access": "read-edit",
- "notes": "string",
- "uploaded_files": [
- {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}
], - "samples": [
- {
- "id": 1,
- "parameter_id": 1,
- "parameter_name": "string",
- "format": "date",
- "category_id": 1,
- "category_name": "string",
- "unit_name": "centimetre",
- "value": 0.1,
- "risk_level": "low"
}
], - "created_at": "2019-08-24T14:15:22Z",
- "created_by_id": 1,
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_by_id": 1,
- "created_by_name": "Bob Smith",
- "plot_bounds": [
- [
- -1.30329,
- 51.17687
], - [
- -1.29829,
- 51.17687
], - [
- -1.29829,
- 51.17287
]
]
}
Edit a diary
id required | integer (PrimaryKey) >= 1 Example: 1 ID |
notify | string Deprecated Notify the owner of the plot about changes made. Deprecated if favour of a more user-driven notification scheme. |
lot_id required | integer >= 1 Store lot ID |
date required | string <date> |
location | Array of numbers or null <float> = 2 items Point location as a [lng, lat] pair |
notes | string |
Array of objects (Attachments) Media attachments (uploaded using upload-media-file) | |
Array of objects (ObservationSample) | |
created_by_name | string Full name of diary creator |
{- "lot_id": 1,
- "date": "2020-05-26",
- "location": [
- -1.30329,
- 51.17687
], - "notes": "string",
- "uploaded_files": [
- {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}
], - "samples": [
- {
- "parameter_id": 1,
- "format": "date",
- "category_id": 1,
- "value": 0.1
}
], - "created_by_name": "Bob Smith"
}
{- "name": [
- "This field is required."
]
}
DEPRECATED: use the standard list-observations API in preference.
Summarised list of crop monitoring diaries sorted by reverse date order. Diaries may be associated with either plots or store lots.
A user has read-write access to a field-sourced diary if any of the following conditions are met:
A user has read-only access to a diary if none of the previous conditions were met but the plot has been shared with their team as read-only and any of the following conditions are met:
The access rules for store lots are the same but apply to the plot associated with the store lot.
page | integer >= 1 Default: 1 Example: page=2 Page number |
page_size | integer [ 1 .. 100 ] Default: 20 Page size |
format | string Default: "json" Enum: "csv" "json" Example: format=csv Change the output format. Defaults to JSON |
source | string Enum: "field" "store" Set to "field" to restrict to field diaries (i.e from a plot), or "store" to restrict to store diaries (i.e from a store lot). If not specified returns both field and store monitoring diaries |
date_gte | string <date> Example: date_gte=2019-01-01 Lower threshold for the date when observation is captured |
date_lte | string <date> Example: date_lte=2019-01-01 Upper threshold for the date when observation is captured |
user_id | |
critical | boolean Deprecated Whether to retrieve only critical observations |
parameter_id | integer Observation parameter ID |
parameter_name | string Name of the parameter to search by |
team_id | |
team_ids | |
farm_id | |
field_id | |
plot_id | |
genus_id | |
variety_id | |
store_id | |
lot_id | |
crop_id | integer (PrimaryKey) >= 1 Deprecated Example: crop_id=1 ID of the crop. Deprecated - please use |
{- "total": 0,
- "results": [
- {
- "id": 0,
- "date": "2019-01-01",
- "reporter": {
- "id": 1,
- "first_name": "string",
- "last_name": "string"
}, - "team": {
- "id": 1,
- "name": "string"
}, - "farm": {
- "id": 1,
- "name": "string"
}, - "field": {
- "id": 1,
- "name": "string"
}, - "crop": {
- "id": 1,
- "name": "string"
}, - "variety": {
- "id": 1,
- "name": "string"
}, - "critical": true,
- "notes": "string",
- "plot": {
- "id": 1,
- "name": "string"
}, - "samples": [
- {
- "parameter_name": "string",
- "format": "date",
- "parameter_id": 1,
- "category_id": 1,
- "aggregation": "average",
- "value": 0.1,
- "raw_values": [
- 0.1
], - "unit_name": "centimetre"
}
]
}
]
}
Returns a detailed report for a particular observation
id required | integer (PrimaryKey) >= 1 Example: 1 Id of the observation |
{- "id": 0,
- "date": "2019-01-01",
- "reporter": {
- "id": 1,
- "first_name": "string",
- "last_name": "string"
}, - "team": {
- "id": 1,
- "name": "string"
}, - "farm": {
- "id": 1,
- "name": "string"
}, - "field": {
- "id": 1,
- "name": "string"
}, - "crop": {
- "id": 1,
- "name": "string"
}, - "variety": {
- "id": 1,
- "name": "string"
}, - "critical": true,
- "notes": "string",
- "plot": {
- "name": "string",
- "bounds": [
- [
- -1.30329,
- 51.17687
], - [
- -1.29829,
- 51.17687
], - [
- -1.29829,
- 51.17287
]
]
}, - "location": [
- 0
], - "primary_growth_stage": {
- "id": 1,
- "name": "string"
}, - "secondary_growth_stage": {
- "id": 1,
- "name": "string"
}, - "percent_field_cover": 0,
- "samples": [
- {
- "parameter_name": "string",
- "format": "date",
- "parameter_id": 1,
- "category_id": 1,
- "aggregation": "average",
- "value": 0.1,
- "raw_values": [
- 0.1
], - "unit_name": "centimetre"
}
], - "uploaded_files": [
- {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}
], - "attachments": [
- {
- "name": "string",
- "path": "string"
}
]
}
Return the list of observation parameters for crops
string or string (DateOrDateTime) Example: updated_since=2020-01-02T10:00:00Z Return items created or updated since the specified data/time (inclusive). Date times are always in UTC and are specified in RFC3339 format. Can also be specified as simple dates e.g 2020-01-01, in which case midnight is assumed for the time component. | |
crop_ids | integer Example: crop_ids=2,3 Comma seperated string of crop ids |
category | string Observation category name |
[- {
- "id": "string",
- "category_id": 1,
- "genus_ids": [
- 1
], - "minimum_sample_count": 1,
- "format": "date",
- "unit_type": "g",
- "type": "DATE_VARIABLE_TYPE",
- "category": {
- "id": 0,
- "name": "string"
}, - "name": "string"
}
]
Return a paginated and summarised list of observation parameters
string or string (DateOrDateTime) Example: updated_since=2020-01-02T10:00:00Z Return items created or updated since the specified data/time (inclusive). Date times are always in UTC and are specified in RFC3339 format. Can also be specified as simple dates e.g 2020-01-01, in which case midnight is assumed for the time component. | |
page | integer >= 1 Default: 1 Example: page=2 Page number |
page_size | integer [ 1 .. 100 ] Default: 20 Page size |
search | string Example: search=my-plot Text search |
crop_ids | integer Example: crop_ids=2,3 Comma seperated string of crop ids |
category | string Observation category name |
{- "total": 0,
- "results": [
- {
- "id": 0,
- "name": "string"
}
]
}
Admin staff-only endpoint that lists all parameters with their translations
{- "id": "string",
- "category_id": 1,
- "genus_ids": [
- 1
], - "minimum_sample_count": 1,
- "format": "date",
- "unit_type": "g",
- "type": "DATE_VARIABLE_TYPE",
- "category": {
- "id": 0,
- "name": "string"
}, - "name": {
- "en": "Hello",
- "es": "Hola",
- "hi": "नमस्ते",
- "mr": "नमस्कार"
}
}
Create an observation parameter with name translations. Only available to KisanHub staff
id | string Id of the observation parameter | ||||||||||||||||
category_id required | integer >= 1 Category ID | ||||||||||||||||
genus_ids | Array of integers[ items >= 1 ] List of applicable genus ids | ||||||||||||||||
minimum_sample_count required | integer Default: 1 Minimum number of samples that should be taken of this type | ||||||||||||||||
format required | string (ParameterFormat) Enum: "date" "float" "count" "percentage" "length" "weight" "risk_level" Value format. The following validation is performed for each type:
| ||||||||||||||||
unit_type | string Enum: "g" "kg" "mm" "cm" "m" "t" "t/ha" Unit for length/weight formats | ||||||||||||||||
type | string Deprecated Enum: "DATE_VARIABLE_TYPE" "FLOAT_VARIABLE_TYPE" Legacy type - use | ||||||||||||||||
required | object (Translations) Translations for a single text string |
{- "id": "string",
- "category_id": 1,
- "genus_ids": [
- 1
], - "minimum_sample_count": 1,
- "format": "date",
- "unit_type": "g",
- "type": "DATE_VARIABLE_TYPE",
- "name": {
- "en": "Hello",
- "es": "Hola",
- "hi": "नमस्ते",
- "mr": "नमस्कार"
}
}
{- "id": "string",
- "category_id": 1,
- "genus_ids": [
- 1
], - "minimum_sample_count": 1,
- "format": "date",
- "unit_type": "g",
- "type": "DATE_VARIABLE_TYPE",
- "category": {
- "id": 0,
- "name": "string"
}, - "name": {
- "en": "Hello",
- "es": "Hola",
- "hi": "नमस्ते",
- "mr": "नमस्कार"
}
}
Return the list of observation categories. The names are translated to the requested language
string or string (DateOrDateTime) Example: updated_since=2020-01-02T10:00:00Z Return items created or updated since the specified data/time (inclusive). Date times are always in UTC and are specified in RFC3339 format. Can also be specified as simple dates e.g 2020-01-01, in which case midnight is assumed for the time component. |
[- {
- "id": 1,
- "description": "string",
- "applies_to": "field",
- "name": "string"
}
]
Create an observation category. Only available to KisanHub staff
description | string Description |
applies_to | string Enum: "field" "store" Determine whether this category is only applicable to a particular source |
required | object (Translations) Translations for a single text string |
{- "description": "string",
- "applies_to": "field",
- "name": {
- "en": "Hello",
- "es": "Hola",
- "hi": "नमस्ते",
- "mr": "नमस्कार"
}
}
{- "id": 1,
- "description": "string",
- "applies_to": "field",
- "name": {
- "en": "Hello",
- "es": "Hola",
- "hi": "नमस्ते",
- "mr": "नमस्कार"
}
}
The activity feed represents a stream of activities relevant to interested parties, and is used to give an overview of farming activies and notes within a given timeframe. The feed is presented in reverse chronological order.
List events with regards to farming practices. 'Events' are any type of activity relevant to a crop or with regards to a given trade. Examples include a monitoring diary of a crop, an operation carried out on that crop, or a record of a trade involving the crop. The feed is listed in reverse chronologial order. The amount of results in a response from this endpoint will vary, as it will return at a minimum the number of objects set by the minimum_page_size parameter. If more events have taken place on the same day as the last events within this query, all events from that day will be returned.
plot_id | |
field_id | |
farm_id | |
organisation_id | |
genus_id | |
variety_id | |
search | string Example: search=my-plot Text search for any of plot, field, farm, organisation, crop or variety |
minimum_page_size | integer <= 20 Default: 10 Minimum number of results to return from the API. More results can be returned, as the API will include all results from the last day where results exist |
from_date | string <date> Example: from_date=2020-01-02T10:00:00Z From date |
to_date | string <date> Example: to_date=2020-01-23T15:00:00Z To date |
event_types | string Enum: "monitoring_diary" "sowing_operation" "harvest_operation" "fertiliser_operation" "intercultural_operation" "land_preparation_operation" "pesticide_operation" "irrigation_operation" "trading_agreement" "certificate" "plot_state" Example: event_types=pesticide_operation,fertiliser_operation Comma separated list of types of activities to filter for |
{- "results": [
- {
- "event_type": "monitoring_diary",
- "owner": {
- "id": 1,
- "name": "string"
}, - "certificate_type": {
- "id": 1,
- "name": "AP Number"
}, - "owner_type": "user",
- "classification": "Cereals",
- "issued_by": "string",
- "reference": "RR123456",
- "start_date": "2019-08-24",
- "renewal_date": "2019-08-24",
- "attachment": {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}, - "is_private": true,
- "created_at": "2019-08-24T14:15:22Z",
- "created_by": {
- "id": 0,
- "name": "string"
}, - "updated_at": "2019-08-24T14:15:22Z",
- "updated_by": {
- "id": 0,
- "name": "string"
}, - "event_date": "2019-08-24"
}
], - "total": 0
}
A store is place to keep farm produce. Different type of stores can be created for different crops.
Each store consists of multiple sections called store lots
in which different crops or crops with different varieties can be stored.
Return a paginated list of stores. The stores are visible to a user if any of the following conditions are met:
team_id | |
team_ids | |
string or string (DateOrDateTime) Example: updated_since=2020-01-02T10:00:00Z Return items created or updated since the specified data/time (inclusive). Date times are always in UTC and are specified in RFC3339 format. Can also be specified as simple dates e.g 2020-01-01, in which case midnight is assumed for the time component. | |
search | string Return stores that include this string in store name |
{- "total": 0,
- "results": [
- {
- "id": 1,
- "name": "string",
- "access": "read-edit",
- "store_type": "ambient",
- "storage_type": "box",
- "address": "string",
- "location": [
- -1.30329,
- 51.17687
], - "team_id": 1,
- "capacity_value": 0,
- "capacity_unit": "tonnes",
- "attachments": [
- {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}
], - "created_at": "2019-08-24T14:15:22Z",
- "created_by_id": 1,
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_by_id": 1
}
]
}
Create a new store. Staff users can create a store for any team, regular users can create stores for their own team and SITE & REG admins can create stores for any team under the same site.
name required | string Name of the crop store |
store_type required | string Enum: "ambient" "cold" "farm" "grain" Type of the store |
storage_type | string Enum: "box" "bulk" produce storage type |
address required | string Full text address of the store |
location required | Array of numbers <float> (Point) = 2 items [ items <float > ] Point location as a [lng, lat] pair |
team_id required | integer >= 1 Team ID that owns the store |
capacity_value | integer Store capacity in the specified unit |
capacity_unit | string Default: "tonnes" Enum: "tonnes" "bushels" "kilograms" "boxes" Store capacity unit |
Array of objects (Attachments) Media attachments (uploaded using upload-media-file) |
{- "name": "string",
- "store_type": "ambient",
- "storage_type": "box",
- "address": "string",
- "location": [
- -1.30329,
- 51.17687
], - "team_id": 1,
- "capacity_value": 0,
- "capacity_unit": "tonnes",
- "attachments": [
- {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}
]
}
{- "id": 1,
- "name": "string",
- "access": "read-edit",
- "store_type": "ambient",
- "storage_type": "box",
- "address": "string",
- "location": [
- -1.30329,
- 51.17687
], - "team_id": 1,
- "capacity_value": 0,
- "capacity_unit": "tonnes",
- "attachments": [
- {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}
], - "created_at": "2019-08-24T14:15:22Z",
- "created_by_id": 1,
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_by_id": 1
}
Get a single store. The store is visible to a user if any of the following conditions are met:
id required | integer Store ID |
{- "id": 1,
- "name": "string",
- "access": "read-edit",
- "store_type": "ambient",
- "storage_type": "box",
- "address": "string",
- "location": [
- -1.30329,
- 51.17687
], - "team_id": 1,
- "capacity_value": 0,
- "capacity_unit": "tonnes",
- "attachments": [
- {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}
], - "created_at": "2019-08-24T14:15:22Z",
- "created_by_id": 1,
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_by_id": 1
}
Update a store. Staff users can update a store for any team, regular users can update stores for their own team and SITE & REG admins can update stores for any team under the same site.
id required | integer Store ID |
name required | string Name of the crop store |
store_type required | string Enum: "ambient" "cold" "farm" "grain" Type of the store |
storage_type | string Enum: "box" "bulk" produce storage type |
address required | string Full text address of the store |
location required | Array of numbers <float> (Point) = 2 items [ items <float > ] Point location as a [lng, lat] pair |
team_id required | integer >= 1 Team ID that owns the store |
capacity_value | integer Store capacity in the specified unit |
capacity_unit | string Default: "tonnes" Enum: "tonnes" "bushels" "kilograms" "boxes" Store capacity unit |
Array of objects (Attachments) Media attachments (uploaded using upload-media-file) |
{- "name": "string",
- "store_type": "ambient",
- "storage_type": "box",
- "address": "string",
- "location": [
- -1.30329,
- 51.17687
], - "team_id": 1,
- "capacity_value": 0,
- "capacity_unit": "tonnes",
- "attachments": [
- {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}
]
}
{- "id": 1,
- "name": "string",
- "access": "read-edit",
- "store_type": "ambient",
- "storage_type": "box",
- "address": "string",
- "location": [
- -1.30329,
- 51.17687
], - "team_id": 1,
- "capacity_value": 0,
- "capacity_unit": "tonnes",
- "attachments": [
- {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}
], - "created_at": "2019-08-24T14:15:22Z",
- "created_by_id": 1,
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_by_id": 1
}
Returns the permission level for this store. A user has read/write access to a store if any of the following conditions are met:
Stores may be deleted if the user has r/w access and the store contains no lots. If the store does
contain lots then noDeleteMessage
will describe why delete isn't allowed.
Users that do not satify either of the above conditions may still see a store if their organisation is directly connected to the owner organisation, or if they can already see lots that are currently, or have been in the past, contained within the store
Returns 404 if the user has no access at all
id required | integer (PrimaryKey) >= 1 Example: 1 ID |
{- "access": "read-edit",
- "noDeleteReason": "string"
}
Store summaries in GeoJSON format. The same visibility rules as list-stores apply.
team_id | |
season | string Deprecated Example: season=2019/20 Growing season |
{- "type": "FeatureCollection",
- "features": [
- {
- "type": "Feature",
- "geometry": {
- "type": "Point",
- "coordinates": [
- -1.30329,
- 51.17687
]
}, - "properties": {
- "id": 0,
- "name": "string"
}
}
]
}
A store consists of a number of store-lots. Each store lot contains a single crop, either from a plot of from off-platform.
Create a new store lot. The set of required fields will differ depending on whether the lot is created for an on or off-platform plot.
If crop_store_id
is supplied, then tonnage_in
and loss_rate
are both required.
If new_field_name
is supplied then we will attempt to create a new off-platform field and
plot with this name.
In this case the following fields are all required:
grower_team_id
or grower_org_id
country
county
harvest_date
variety_id
name | string Lot name |
tonnage_in | number <float> >= 0 Gross tonnage |
loss_rate | number <float> [ 0 .. 100 ] Expected loss percentage |
adjustment | number Manual adjustment in tonnes. |
closed | boolean If the lot is closed. |
new_field_name | string If specified then create an off-platform crop with a plot and field with this name |
county | string District/County: required only when created off-platform lots |
country | string (CountryCode) = 2 characters ISO 3166-1 country code |
harvest_date | string <date> The harvest date of the produce: required only when created off-platform lots |
recommended_movement_date | string <date> (RecommendedMovementDate) Recommended movement date. This can be set directly or via a store monitoring diary |
plot_id | integer (PlotId) >= 1 Plot ID |
crop_store_id | integer (StoreId) >= 1 Store ID |
supplier_team_id | integer (TeamId) >= 1 Team ID |
grower_team_id | integer (TeamId) >= 1 Team ID |
grower_org_id | integer (GrowerOrgId) >= 1 Grower of the produce's organisation ID. |
genus_id | integer (GenusId) >= 1 Genus ID |
variety_id | integer (VarietyId) >= 1 Variety ID |
tag_ids | Array of integers (TagIds) List of associated crop tags ids |
{- "name": "20-2009",
- "tonnage_in": 0.1,
- "loss_rate": 100,
- "adjustment": 0,
- "closed": true,
- "new_field_name": "string",
- "county": "string",
- "country": "st",
- "harvest_date": "2019-08-24",
- "recommended_movement_date": "2019-08-24",
- "plot_id": 4,
- "crop_store_id": 1,
- "supplier_team_id": 6,
- "grower_team_id": 6,
- "grower_org_id": 1,
- "genus_id": 2,
- "variety_id": 43,
- "tag_ids": [
- 0
]
}
{- "id": 1,
- "name": "20-2009",
- "tonnage_in": 0.1,
- "loss_rate": 100,
- "adjustment": 0,
- "closed": true,
- "county": "string",
- "country": "st",
- "harvest_date": "2019-08-24",
- "recommended_movement_date": "2019-08-24",
- "available_tonnage": 0,
- "tonnage_out": 0,
- "created_at": "2019-08-24T14:15:22Z",
- "created_by_id": 1,
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_by_id": 1,
- "plot_id": 4,
- "crop_store_id": 1,
- "supplier_team_id": 6,
- "grower_team_id": 6,
- "grower_org_id": 1,
- "genus_id": 2,
- "variety_id": 43,
- "tag_ids": [
- 0
]
}
Return a paginated list of visible store lots. The following rules determine whether a lot is visible:
grower_team_id
or supplier_team_id
matches the users' team idSITE_ADMIN
permission and their team is in the Site of the team that created the lotpage | integer >= 1 Default: 1 Example: page=2 Page number |
page_size | integer [ 1 .. 100 ] Default: 20 Page size |
team_ids | integer Example: team_ids=1,2,3 Return the store lots associated with plots owned by these teams - matches either grower or supplier team |
tag_id | integer >= 1 Filter by crop tag ID. Include objects that have been tagged with this tag. |
tag_ids | Array of integers Example: tag_ids=2,3 Comma-separated list of crop tag IDs. Includes objects that have been tagged with any of these tags |
grower_ids | Array of integers[ items non-empty ] Return the store lots associated with plots owned by these teams. It will be serialized as comma separated ids. |
supplier_ids | Array of integers[ items non-empty ] Return the store lots which has grower as these teams. It will be serialized as comma separated ids. |
grower_organisation_ids | Array of integers[ items non-empty ] Return the store lots associated with plots owned by these organisations. It will be serialized as comma separated ids. |
supplier_organisation_ids | Array of integers[ items non-empty ] Return the store lots which has grower as these organisations. It will be serialized as comma separated ids. |
store_ids | Array of integers Return the store lots which has supplier as these teams. It will be serialized as comma separated ids. |
field_ids | Array of integers Deprecated Return the store lots associated with plots owned by these fields. It will be serialized as comma separated ids. |
group_id | |
field_name | string Return the store lots associated with these fields. |
genus_ids | Array of integers Return the store lots having these crops. It will be serialized as comma separated ids. |
variety_ids | Array of integers Return the store lots having these varieties. It will be serialized as comma separated ids. |
off_platform | string Enum: "only" "exclude" If only then only returns lots for "off-platform" plots· If exclude then exclude lots for "off-platform" plots. If not specified then all lots are returned. |
closed | boolean Return the store lots based on the “closed“ status of the store lot. open or close or all of them(if not given). |
string or string (DateOrDateTime) Example: updated_since=2020-01-02T10:00:00Z Return items created or updated since the specified data/time (inclusive). Date times are always in UTC and are specified in RFC3339 format. Can also be specified as simple dates e.g 2020-01-01, in which case midnight is assumed for the time component. | |
harvest_from | string <date> Example: harvest_from=2020-01-01 Filter store-lot by harvest after a given date |
harvest_to | string <date> Example: harvest_to=2020-01-02 Filter store-lot by harvest up to a given date |
{- "total": 0,
- "results": [
- {
- "id": 1,
- "name": "20-2009",
- "tonnage_in": 0.1,
- "loss_rate": 100,
- "adjustment": 0,
- "closed": true,
- "county": "string",
- "country": "st",
- "harvest_date": "2019-08-24",
- "recommended_movement_date": "2019-08-24",
- "available_tonnage": 0,
- "tonnage_out": 0,
- "created_at": "2019-08-24T14:15:22Z",
- "created_by_id": 1,
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_by_id": 1,
- "plot_id": 4,
- "crop_store_id": 1,
- "supplier_team_id": 6,
- "grower_team_id": 6,
- "grower_org_id": 1,
- "genus_id": 2,
- "variety_id": 43,
- "tag_ids": [
- 0
]
}
]
}
Return a paginated list of all store lots with foreign keys expanded i.e report that are either created by user's team or user's team is grower_team or supplier_team of the lot.
search | string Return store lots that include this string in the name |
page | integer >= 1 Default: 1 Example: page=2 Page number |
page_size | integer [ 1 .. 100 ] Default: 20 Page size |
team_ids | integer Example: team_ids=1,2,3 Return the store lots associated with plots owned by these teams - matches either grower or supplier team |
tag_id | integer >= 1 Filter by crop tag ID. Include objects that have been tagged with this tag. |
tag_ids | Array of integers Example: tag_ids=2,3 Comma-separated list of crop tag IDs. Includes objects that have been tagged with any of these tags |
grower_ids | Array of integers[ items non-empty ] Return the store lots associated with plots owned by these teams. It will be serialized as comma separated ids. |
supplier_ids | Array of integers[ items non-empty ] Return the store lots which has grower as these teams. It will be serialized as comma separated ids. |
grower_organisation_ids | Array of integers[ items non-empty ] Return the store lots associated with plots owned by these organisations. It will be serialized as comma separated ids. |
supplier_organisation_ids | Array of integers[ items non-empty ] Return the store lots which has grower as these organisations. It will be serialized as comma separated ids. |
store_ids | Array of integers Return the store lots which has supplier as these teams. It will be serialized as comma separated ids. |
field_ids | Array of integers Deprecated Return the store lots associated with plots owned by these fields. It will be serialized as comma separated ids. |
group_id | |
field_name | string Return the store lots associated with these fields. |
genus_ids | Array of integers Return the store lots having these crops. It will be serialized as comma separated ids. |
variety_ids | Array of integers Return the store lots having these varieties. It will be serialized as comma separated ids. |
off_platform | string Enum: "only" "exclude" If only then only returns lots for "off-platform" plots· If exclude then exclude lots for "off-platform" plots. If not specified then all lots are returned. |
closed | boolean Return the store lots based on the “closed“ status of the store lot. open or close or all of them(if not given). |
string or string (DateOrDateTime) Example: updated_since=2020-01-02T10:00:00Z Return items created or updated since the specified data/time (inclusive). Date times are always in UTC and are specified in RFC3339 format. Can also be specified as simple dates e.g 2020-01-01, in which case midnight is assumed for the time component. | |
format | string Default: "json" Enum: "csv" "json" Example: format=csv Change the output format. Defaults to JSON |
harvest_from | string <date> Example: harvest_from=2020-01-01 Filter store-lot by harvest after a given date |
harvest_to | string <date> Example: harvest_to=2020-01-02 Filter store-lot by harvest up to a given date |
recommended_movement_date_from | string <date> Example: recommended_movement_date_from=2022-01-02 Filter lots that have a |
recommended_movement_date_to | string <date> Example: recommended_movement_date_to=2022-02-05 Filter lots that have a |
{- "total_tonnage": 0,
- "total": 0,
- "results": [
- {
- "id": 1,
- "name": "20-2009",
- "tonnage_in": 0.1,
- "loss_rate": 100,
- "adjustment": 0,
- "closed": true,
- "county": "string",
- "country": "st",
- "harvest_date": "2019-08-24",
- "recommended_movement_date": "2019-08-24",
- "available_tonnage": 0,
- "tonnage_out": 0,
- "created_at": "2019-08-24T14:15:22Z",
- "created_by": {
- "id": 0,
- "name": "string"
}, - "updated_at": "2019-08-24T14:15:22Z",
- "updated_by": {
- "id": 0,
- "name": "string"
}, - "assessment_count": 0,
- "is_off_platform": true,
- "plot": {
- "id": 1,
- "name": "string"
}, - "store": {
- "id": 1,
- "name": "string"
}, - "supplier_team": {
- "id": 1,
- "name": "string"
}, - "grower_team": {
- "id": 1,
- "name": "string"
}, - "grower_organisation_id": 0,
- "genus": {
- "id": 1,
- "name": "string"
}, - "variety": {
- "id": 1,
- "name": "string"
}, - "tags": [
- {
- "id": 1,
- "organisation_id": 1,
- "organisation_name": "my organisation",
- "category_label": "string",
- "category_id": 1,
- "label": "string"
}
], - "field": {
- "id": 0,
- "name": "string"
}, - "actual_harvest_date": "2019-08-24",
- "team": {
- "id": 0,
- "name": "string"
}, - "crop": {
- "id": 0,
- "name": "string"
}, - "diary_count": 0
}
]
}
{- "id": 1,
- "name": "20-2009",
- "tonnage_in": 0.1,
- "loss_rate": 100,
- "adjustment": 0,
- "closed": true,
- "county": "string",
- "country": "st",
- "harvest_date": "2019-08-24",
- "recommended_movement_date": "2019-08-24",
- "available_tonnage": 0,
- "tonnage_out": 0,
- "created_at": "2019-08-24T14:15:22Z",
- "created_by_id": 1,
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_by_id": 1,
- "plot_id": 4,
- "crop_store_id": 1,
- "supplier_team_id": 6,
- "grower_team_id": 6,
- "grower_org_id": 1,
- "genus_id": 2,
- "variety_id": 43,
- "tag_ids": [
- 0
]
}
Add a tag to a lot
id required | integer Store lot id |
tag_id | integer >= 1 ID of the crop tag added to this lot |
{- "tag_id": 1
}
{- "tag_id": "string",
- "lot_id": 1
}
id required | integer Store lot id |
tag_id required | integer >= 1 Crop tag ID. |
Get a store lot report by id
id required | integer Store lot id |
{- "id": 1,
- "name": "20-2009",
- "tonnage_in": 0.1,
- "loss_rate": 100,
- "adjustment": 0,
- "closed": true,
- "county": "string",
- "country": "st",
- "harvest_date": "2019-08-24",
- "recommended_movement_date": "2019-08-24",
- "available_tonnage": 0,
- "tonnage_out": 0,
- "created_at": "2019-08-24T14:15:22Z",
- "created_by": {
- "id": 0,
- "name": "string"
}, - "updated_at": "2019-08-24T14:15:22Z",
- "updated_by": {
- "id": 0,
- "name": "string"
}, - "assessment_count": 0,
- "is_off_platform": true,
- "plot": {
- "id": 1,
- "name": "string"
}, - "store": {
- "id": 1,
- "name": "string"
}, - "supplier_team": {
- "id": 1,
- "name": "string"
}, - "grower_team": {
- "id": 1,
- "name": "string"
}, - "grower_organisation_id": 0,
- "genus": {
- "id": 1,
- "name": "string"
}, - "variety": {
- "id": 1,
- "name": "string"
}, - "tags": [
- {
- "id": 1,
- "organisation_id": 1,
- "organisation_name": "my organisation",
- "category_label": "string",
- "category_id": 1,
- "label": "string"
}
], - "field": {
- "id": 0,
- "name": "string"
}, - "actual_harvest_date": "2019-08-24",
- "team": {
- "id": 0,
- "name": "string"
}, - "crop": {
- "id": 0,
- "name": "string"
}, - "diary_count": 0
}
Partial update to a store lot. Enables adjustments to loss rate, wastage, closing a lot and adding a comment. Keys should not be sent for values that have not changed.
id required | integer (PrimaryKey) >= 1 Example: 1 ID |
loss_rate | number |
adjustment | number |
is_closed | boolean |
tag_ids | Array of integers (TagIds) List of associated crop tags ids |
{- "loss_rate": 0,
- "adjustment": 0,
- "is_closed": true,
- "tag_ids": [
- 0
]
}
Deprecated endpoint related to the legacy Labs module Return an unpaginated list of quality report metrics for the specified store lot
id required | integer Store lot id |
[- {
- "name": "Total defects",
- "value": 17,
- "unit": "%"
}, - {
- "name": "Tuber count",
- "value": 16,
- "unit": "avg"
}, - {
- "name": "Dry matter",
- "value": 16,
- "unit": "%"
}
]
Return a paginated list of lot events reverse ordered by date created. A user can view a CropStoreLot if it is shared with them or their team, or it is owned by their team.
id required | integer (PrimaryKey) >= 1 Example: 1 ID |
page | integer >= 1 Default: 1 Example: page=2 Page number |
page_size | integer [ 1 .. 100 ] Default: 20 Page size |
{- "total": 0,
- "results": [
- {
- "type_slug": "lot_created",
- "type_name": "string",
- "date": "2019-08-24",
- "author": {
- "id": 1,
- "email": "string",
- "first_name": "string",
- "last_name": "string"
}, - "properties": {
- "tonnage_in": 0,
- "loss_rate": 0,
- "field_name": "string",
- "plot_name": "string",
- "harvest_date": "2019-08-24"
}
}
]
}
A document that relates a load moved, or to be moved, from Source to Destination to fulfill a specific trade. Trade records are subject to certain restrictions on who can edit certain document fields. All of pay_weight, sales_weight, defects and grower_payment_amount are termed 'outcomes'. Outcomes are only editable by the buying organisation, and only buying organisations can mark tickets as completed. In summary:
Return a paginated list of trade records, in reverse chronological order. A user may see records if any of these conditions are met:
string or string (DateOrDateTime) Example: updated_since=2020-01-02T10:00:00Z Return items created or updated since the specified data/time (inclusive). Date times are always in UTC and are specified in RFC3339 format. Can also be specified as simple dates e.g 2020-01-01, in which case midnight is assumed for the time component. | |
team_ids |
{- "total": 0,
- "results": [
- {
- "supplier_org_id": 1,
- "grower_org_id": 1,
- "recipient_org_id": 1,
- "trading_agreement_id": 1,
- "genus_id": 0,
- "variety_id": 1,
- "lot_id": 1,
- "plot_id": 1,
- "field_id": 0,
- "template_id": 1,
- "is_sent": true,
- "supplier_org_name": "string",
- "recipient_org_name": "string",
- "general_tuber_count_10kg": 1000,
- "general_dry_matter": 100,
- "general_sprouts_stolons": 100,
- "general_starch_content": 100,
- "color_defects_green": 100,
- "color_defects_purple": 100,
- "external_rots_breakdown": 100,
- "external_slug_worm": 100,
- "chipping_fry_colour": 1,
- "chipping_colour_consistency": 1,
- "chipping_internal_discoloration": 1,
- "chipping_glucose_percent": 100,
- "washed": true,
- "defects": "string",
- "general_stored_temperature": 50,
- "general_foreign_matter": 100,
- "color_defects_other_discolouration": 100,
- "external_scab_lt_5pct": 100,
- "external_pest_damage": 100,
- "external_disease_infection": 100,
- "external_irregular_shape": 100,
- "external_other": 100,
- "internal_disease_infection": 100,
- "internal_major_bruise_percent": 100,
- "internal_minor_bruise_percent": 100,
- "internal_other": 100,
- "chemical_declaration_answers": [
- {
- "chemical_declaration_id": 1,
- "is_applied": true,
- "date": "2019-08-24"
}
], - "size_ranges": [
- 0
], - "due_time_on_site": "2019-08-24T14:15:22Z",
- "status": "transit",
- "load_number": "ABC123",
- "load_actual_arrival_time": "2019-08-24T14:15:22Z",
- "load_time_complete": "2019-08-24T14:15:22Z",
- "load_expected_delivery_time": "2019-08-24T14:15:22Z",
- "load_actual_delivery_time": "2019-08-24T14:15:22Z",
- "load_qty": 50,
- "pay_weight": 50,
- "grower_payment_amount": 0,
- "sales_weight": 50,
- "load_vehicle_reg": "AC118182",
- "load_haulier": "string",
- "load_trailer_no": "string",
- "load_seal_no": "string",
- "load_box_markings": "string",
- "origin": "string",
- "date_of_harvest": "2019-08-24",
- "comments": "string",
- "notes": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "created_by_id": 1,
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_by_id": 1
}
]
}
Creates a trade record validating against just mandatory fields and without validating against it’s
passport template. In the instance where grower_org_id
is missing, it will default to use supplier_org_id
.
Full validation against all fields required by the template will be performed in the send-trade-record endpoint.
A trade record must either refer to an existing plot or store lot.
However you can create an "off-platform" crop by providing a new_field_name
(for an off-platform field),
and/or a new_lot_name
(for an off-platform store lot). When creating an off-platform field the caller must
create an off-platform lot: however an on-platform field may be paired with an off-platform lot. Off-platform
fields must specify both region
and country
of origin.
general_tuber_count_10kg | integer [ 0 .. 1000 ] Tuber count |
general_dry_matter | integer [ 0 .. 100 ] The expected or actual dry matter percentage |
general_sprouts_stolons | integer [ 0 .. 100 ] The % of this load that contains/may contain sprouts |
general_starch_content | integer [ 0 .. 100 ] The expected or actual starch content expressed as a percentage |
color_defects_green | integer [ 0 .. 100 ] The % of this load that have green color defect |
color_defects_purple | integer [ 0 .. 100 ] The % of this load that have purple color defect |
external_rots_breakdown | integer [ 0 .. 100 ] The estimated proportion of the load with this defect |
external_slug_worm | integer [ 0 .. 100 ] The estimated proportion of the load with this defect |
chipping_fry_colour | integer [ 1 .. 7 ] Fry color indication on a scale from 1 to 7, where 1= very light, 7 = dark |
chipping_colour_consistency | number <= 1 Chipping color consistency |
chipping_internal_discoloration | integer [ 1 .. 9 ] Internal discoloration on a scale from 1 to 9 |
chipping_glucose_percent | integer [ 0 .. 100 ] The expected glucose level |
supplier_org_id required | integer >= 1 Seller ID |
recipient_org_id required | integer >= 1 Buyer ID |
trading_agreement_id required | integer >= 1 Trading agreement |
lot_id | integer >= 1 The store lot reference from where produce is being supplied |
plot_id | integer >= 1 The plot reference from where produce is being supplied |
template_id required | integer >= 1 The passport template that will be used to validate trade record |
grower_org_id | integer (GrowerOrgId) >= 1 Grower of the produce's organisation ID. |
new_field_name | string (NewFieldName) Create a new off-platform field with this name. The |
variety_id | integer (VarietyId) >= 1 Variety ID |
region | string (OffPlatformRegion) Region/county of off-platform field |
country_code | string (CountryCode) = 2 characters ISO 3166-1 country code |
new_lot_name | string Create a new off-platform lot with this name. Both |
date_of_harvest required | string <date> The date the crop was harvested, required when creating an off platform lot |
washed | boolean whether this crop is washed |
defects | string User comments about defects in the load. |
general_stored_temperature | number <= 50 The actual stored temperature in degrees Celcius |
general_foreign_matter | integer [ 0 .. 100 ] The % of this load that contains/may contain foreign matter |
color_defects_other_discolouration | integer [ 0 .. 100 ] The % of this load that have other defective colors defect |
external_scab_lt_5pct | integer [ 0 .. 100 ] The estimated proportion of the load with this defect |
external_pest_damage | integer [ 0 .. 100 ] The estimated proportion of the load with this defect |
external_disease_infection | integer [ 0 .. 100 ] The estimated proportion of the load with this defect |
external_irregular_shape | integer [ 0 .. 100 ] The estimated proportion of the load with this defect |
external_other | integer [ 0 .. 100 ] The estimated proportion of the load with this defect |
internal_disease_infection | integer [ 0 .. 100 ] The estimated proportion of the load with this defect |
internal_major_bruise_percent | integer [ 0 .. 100 ] The estimated proportion of the load with this defect |
internal_minor_bruise_percent | integer [ 0 .. 100 ] The estimated proportion of the load with this defect |
internal_other | integer [ 0 .. 100 ] The estimated proportion of the load with this defect |
Array of objects (ChemicalDeclarationAnswer) Answers to all the chemical declarations, if chemical is applied or not?. | |
Array of objects or null (TradeRecordAttachmentWrite) Associated documentation/images with the trade record | |
due_time_on_site required | string <date-time> The date & time by which the lorry is due to arrive to pick up the produce |
status | string Enum: "transit" "completed" "cancelled" "returned" Status of load transaction. Only buyer organisations are allowed to change the status to completed |
load_number required | string The reference for the load. |
load_actual_arrival_time | string <date-time> The actual date & time when the lorry actually arrived to pick up the produce |
load_time_complete | string <date-time> The date & time when the lorry is loaded |
load_expected_delivery_time | string <date-time> The expected date & time when the lorry is due to arrive at the destination to dropoff the produce |
load_actual_delivery_time | string <date-time> The actual date & time when the lorry arrived at the destination to dropoff the produce |
load_qty | number <= 50 Amount of crop on a single load. The load ticket will allow for boxes of different sizes as well as bulk transport |
pay_weight | number <= 50 Weight(in tons) to be paid to the grower. This field is only visible to the buyer |
grower_payment_amount | number >= 0 Total invoice amount of the load. This field is only visible to the buyer |
sales_weight | number <= 50 Weight(in tons) to be sold to the customer. This field is only visible to the buyer |
load_vehicle_reg | string The vehicle registration plate for the vehicle carrying this load |
load_haulier | string The name of the Haulage Company carrying this load |
load_trailer_no | string The reference for the specific trailer for this load |
load_seal_no | string The references for all seals on this load. |
load_box_markings | string The name of the owner of the boxes carrying the crop |
origin required | string County & Country where crop was grown |
comments | string These are comments that will be visible to everyone in the distribution list who receives the load ticket. |
notes | string These are comments that will only be visible to the Grower and anyone they have shared their crop with. |
{- "general_tuber_count_10kg": 1000,
- "general_dry_matter": 100,
- "general_sprouts_stolons": 100,
- "general_starch_content": 100,
- "color_defects_green": 100,
- "color_defects_purple": 100,
- "external_rots_breakdown": 100,
- "external_slug_worm": 100,
- "chipping_fry_colour": 1,
- "chipping_colour_consistency": 1,
- "chipping_internal_discoloration": 1,
- "chipping_glucose_percent": 100,
- "supplier_org_id": 1,
- "recipient_org_id": 1,
- "trading_agreement_id": 1,
- "lot_id": 1,
- "plot_id": 1,
- "template_id": 1,
- "grower_org_id": 1,
- "new_field_name": "string",
- "variety_id": 43,
- "region": "string",
- "country_code": "st",
- "new_lot_name": "string",
- "date_of_harvest": "2019-08-24",
- "washed": true,
- "defects": "string",
- "general_stored_temperature": 50,
- "general_foreign_matter": 100,
- "color_defects_other_discolouration": 100,
- "external_scab_lt_5pct": 100,
- "external_pest_damage": 100,
- "external_disease_infection": 100,
- "external_irregular_shape": 100,
- "external_other": 100,
- "internal_disease_infection": 100,
- "internal_major_bruise_percent": 100,
- "internal_minor_bruise_percent": 100,
- "internal_other": 100,
- "chemical_declaration_answers": [
- {
- "chemical_declaration_id": 1,
- "is_applied": true,
- "date": "2019-08-24"
}
], - "attachments": [
- {
- "url": "string",
- "file_name": "string",
- "private": true
}
], - "due_time_on_site": "2019-08-24T14:15:22Z",
- "status": "transit",
- "load_number": "ABC123",
- "load_actual_arrival_time": "2019-08-24T14:15:22Z",
- "load_time_complete": "2019-08-24T14:15:22Z",
- "load_expected_delivery_time": "2019-08-24T14:15:22Z",
- "load_actual_delivery_time": "2019-08-24T14:15:22Z",
- "load_qty": 50,
- "pay_weight": 50,
- "grower_payment_amount": 0,
- "sales_weight": 50,
- "load_vehicle_reg": "AC118182",
- "load_haulier": "string",
- "load_trailer_no": "string",
- "load_seal_no": "string",
- "load_box_markings": "string",
- "origin": "string",
- "comments": "string",
- "notes": "string"
}
{- "general_tuber_count_10kg": 1000,
- "general_dry_matter": 100,
- "general_sprouts_stolons": 100,
- "general_starch_content": 100,
- "color_defects_green": 100,
- "color_defects_purple": 100,
- "external_rots_breakdown": 100,
- "external_slug_worm": 100,
- "chipping_fry_colour": 1,
- "chipping_colour_consistency": 1,
- "chipping_internal_discoloration": 1,
- "chipping_glucose_percent": 100,
- "supplier_org_id": 1,
- "grower_org_id": 1,
- "recipient_org_id": 1,
- "trading_agreement_id": 1,
- "genus_id": 0,
- "variety_id": 1,
- "lot_id": 1,
- "plot_id": 1,
- "field_id": 0,
- "template_id": 1,
- "is_sent": true,
- "supplier_org_name": "string",
- "recipient_org_name": "string",
- "washed": true,
- "defects": "string",
- "general_stored_temperature": 50,
- "general_foreign_matter": 100,
- "color_defects_other_discolouration": 100,
- "external_scab_lt_5pct": 100,
- "external_pest_damage": 100,
- "external_disease_infection": 100,
- "external_irregular_shape": 100,
- "external_other": 100,
- "internal_disease_infection": 100,
- "internal_major_bruise_percent": 100,
- "internal_minor_bruise_percent": 100,
- "internal_other": 100,
- "chemical_declaration_answers": [
- {
- "chemical_declaration_id": 1,
- "is_applied": true,
- "date": "2019-08-24"
}
], - "size_ranges": [
- 0
], - "due_time_on_site": "2019-08-24T14:15:22Z",
- "status": "transit",
- "load_number": "ABC123",
- "load_actual_arrival_time": "2019-08-24T14:15:22Z",
- "load_time_complete": "2019-08-24T14:15:22Z",
- "load_expected_delivery_time": "2019-08-24T14:15:22Z",
- "load_actual_delivery_time": "2019-08-24T14:15:22Z",
- "load_qty": 50,
- "pay_weight": 50,
- "grower_payment_amount": 0,
- "sales_weight": 50,
- "load_vehicle_reg": "AC118182",
- "load_haulier": "string",
- "load_trailer_no": "string",
- "load_seal_no": "string",
- "load_box_markings": "string",
- "origin": "string",
- "date_of_harvest": "2019-08-24",
- "comments": "string",
- "notes": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "created_by_id": 1,
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_by_id": 1
}
Get a trade-record
id required | integer >= 1 Trade record id |
{- "general_tuber_count_10kg": 1000,
- "general_dry_matter": 100,
- "general_sprouts_stolons": 100,
- "general_starch_content": 100,
- "color_defects_green": 100,
- "color_defects_purple": 100,
- "external_rots_breakdown": 100,
- "external_slug_worm": 100,
- "chipping_fry_colour": 1,
- "chipping_colour_consistency": 1,
- "chipping_internal_discoloration": 1,
- "chipping_glucose_percent": 100,
- "supplier_org_id": 1,
- "grower_org_id": 1,
- "recipient_org_id": 1,
- "trading_agreement_id": 1,
- "genus_id": 0,
- "variety_id": 1,
- "lot_id": 1,
- "plot_id": 1,
- "field_id": 0,
- "template_id": 1,
- "is_sent": true,
- "supplier_org_name": "string",
- "recipient_org_name": "string",
- "washed": true,
- "defects": "string",
- "general_stored_temperature": 50,
- "general_foreign_matter": 100,
- "color_defects_other_discolouration": 100,
- "external_scab_lt_5pct": 100,
- "external_pest_damage": 100,
- "external_disease_infection": 100,
- "external_irregular_shape": 100,
- "external_other": 100,
- "internal_disease_infection": 100,
- "internal_major_bruise_percent": 100,
- "internal_minor_bruise_percent": 100,
- "internal_other": 100,
- "chemical_declaration_answers": [
- {
- "chemical_declaration_id": 1,
- "is_applied": true,
- "date": "2019-08-24"
}
], - "size_ranges": [
- 0
], - "due_time_on_site": "2019-08-24T14:15:22Z",
- "status": "transit",
- "load_number": "ABC123",
- "load_actual_arrival_time": "2019-08-24T14:15:22Z",
- "load_time_complete": "2019-08-24T14:15:22Z",
- "load_expected_delivery_time": "2019-08-24T14:15:22Z",
- "load_actual_delivery_time": "2019-08-24T14:15:22Z",
- "load_qty": 50,
- "pay_weight": 50,
- "grower_payment_amount": 0,
- "sales_weight": 50,
- "load_vehicle_reg": "AC118182",
- "load_haulier": "string",
- "load_trailer_no": "string",
- "load_seal_no": "string",
- "load_box_markings": "string",
- "origin": "string",
- "date_of_harvest": "2019-08-24",
- "comments": "string",
- "notes": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "created_by_id": 1,
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_by_id": 1
}
Update a trade record. See create-trade-record for more details.
id required | integer >= 1 Trade record id |
general_tuber_count_10kg | integer [ 0 .. 1000 ] Tuber count |
general_dry_matter | integer [ 0 .. 100 ] The expected or actual dry matter percentage |
general_sprouts_stolons | integer [ 0 .. 100 ] The % of this load that contains/may contain sprouts |
general_starch_content | integer [ 0 .. 100 ] The expected or actual starch content expressed as a percentage |
color_defects_green | integer [ 0 .. 100 ] The % of this load that have green color defect |
color_defects_purple | integer [ 0 .. 100 ] The % of this load that have purple color defect |
external_rots_breakdown | integer [ 0 .. 100 ] The estimated proportion of the load with this defect |
external_slug_worm | integer [ 0 .. 100 ] The estimated proportion of the load with this defect |
chipping_fry_colour | integer [ 1 .. 7 ] Fry color indication on a scale from 1 to 7, where 1= very light, 7 = dark |
chipping_colour_consistency | number <= 1 Chipping color consistency |
chipping_internal_discoloration | integer [ 1 .. 9 ] Internal discoloration on a scale from 1 to 9 |
chipping_glucose_percent | integer [ 0 .. 100 ] The expected glucose level |
supplier_org_id required | integer >= 1 Seller ID |
recipient_org_id required | integer >= 1 Buyer ID |
trading_agreement_id required | integer >= 1 Trading agreement |
lot_id | integer >= 1 The store lot reference from where produce is being supplied |
plot_id | integer >= 1 The plot reference from where produce is being supplied |
template_id required | integer >= 1 The passport template that will be used to validate trade record |
grower_org_id | integer (GrowerOrgId) >= 1 Grower of the produce's organisation ID. |
new_field_name | string (NewFieldName) Create a new off-platform field with this name. The |
variety_id | integer (VarietyId) >= 1 Variety ID |
region | string (OffPlatformRegion) Region/county of off-platform field |
country_code | string (CountryCode) = 2 characters ISO 3166-1 country code |
new_lot_name | string Create a new off-platform lot with this name. Both |
date_of_harvest required | string <date> The date the crop was harvested, required when creating an off platform lot |
washed | boolean whether this crop is washed |
defects | string User comments about defects in the load. |
general_stored_temperature | number <= 50 The actual stored temperature in degrees Celcius |
general_foreign_matter | integer [ 0 .. 100 ] The % of this load that contains/may contain foreign matter |
color_defects_other_discolouration | integer [ 0 .. 100 ] The % of this load that have other defective colors defect |
external_scab_lt_5pct | integer [ 0 .. 100 ] The estimated proportion of the load with this defect |
external_pest_damage | integer [ 0 .. 100 ] The estimated proportion of the load with this defect |
external_disease_infection | integer [ 0 .. 100 ] The estimated proportion of the load with this defect |
external_irregular_shape | integer [ 0 .. 100 ] The estimated proportion of the load with this defect |
external_other | integer [ 0 .. 100 ] The estimated proportion of the load with this defect |
internal_disease_infection | integer [ 0 .. 100 ] The estimated proportion of the load with this defect |
internal_major_bruise_percent | integer [ 0 .. 100 ] The estimated proportion of the load with this defect |
internal_minor_bruise_percent | integer [ 0 .. 100 ] The estimated proportion of the load with this defect |
internal_other | integer [ 0 .. 100 ] The estimated proportion of the load with this defect |
Array of objects (ChemicalDeclarationAnswer) Answers to all the chemical declarations, if chemical is applied or not?. | |
Array of objects or null (TradeRecordAttachmentWrite) Associated documentation/images with the trade record | |
due_time_on_site required | string <date-time> The date & time by which the lorry is due to arrive to pick up the produce |
status | string Enum: "transit" "completed" "cancelled" "returned" Status of load transaction. Only buyer organisations are allowed to change the status to completed |
load_number required | string The reference for the load. |
load_actual_arrival_time | string <date-time> The actual date & time when the lorry actually arrived to pick up the produce |
load_time_complete | string <date-time> The date & time when the lorry is loaded |
load_expected_delivery_time | string <date-time> The expected date & time when the lorry is due to arrive at the destination to dropoff the produce |
load_actual_delivery_time | string <date-time> The actual date & time when the lorry arrived at the destination to dropoff the produce |
load_qty | number <= 50 Amount of crop on a single load. The load ticket will allow for boxes of different sizes as well as bulk transport |
pay_weight | number <= 50 Weight(in tons) to be paid to the grower. This field is only visible to the buyer |
grower_payment_amount | number >= 0 Total invoice amount of the load. This field is only visible to the buyer |
sales_weight | number <= 50 Weight(in tons) to be sold to the customer. This field is only visible to the buyer |
load_vehicle_reg | string The vehicle registration plate for the vehicle carrying this load |
load_haulier | string The name of the Haulage Company carrying this load |
load_trailer_no | string The reference for the specific trailer for this load |
load_seal_no | string The references for all seals on this load. |
load_box_markings | string The name of the owner of the boxes carrying the crop |
origin required | string County & Country where crop was grown |
comments | string These are comments that will be visible to everyone in the distribution list who receives the load ticket. |
notes | string These are comments that will only be visible to the Grower and anyone they have shared their crop with. |
{- "general_tuber_count_10kg": 1000,
- "general_dry_matter": 100,
- "general_sprouts_stolons": 100,
- "general_starch_content": 100,
- "color_defects_green": 100,
- "color_defects_purple": 100,
- "external_rots_breakdown": 100,
- "external_slug_worm": 100,
- "chipping_fry_colour": 1,
- "chipping_colour_consistency": 1,
- "chipping_internal_discoloration": 1,
- "chipping_glucose_percent": 100,
- "supplier_org_id": 1,
- "recipient_org_id": 1,
- "trading_agreement_id": 1,
- "lot_id": 1,
- "plot_id": 1,
- "template_id": 1,
- "grower_org_id": 1,
- "new_field_name": "string",
- "variety_id": 43,
- "region": "string",
- "country_code": "st",
- "new_lot_name": "string",
- "date_of_harvest": "2019-08-24",
- "washed": true,
- "defects": "string",
- "general_stored_temperature": 50,
- "general_foreign_matter": 100,
- "color_defects_other_discolouration": 100,
- "external_scab_lt_5pct": 100,
- "external_pest_damage": 100,
- "external_disease_infection": 100,
- "external_irregular_shape": 100,
- "external_other": 100,
- "internal_disease_infection": 100,
- "internal_major_bruise_percent": 100,
- "internal_minor_bruise_percent": 100,
- "internal_other": 100,
- "chemical_declaration_answers": [
- {
- "chemical_declaration_id": 1,
- "is_applied": true,
- "date": "2019-08-24"
}
], - "attachments": [
- {
- "url": "string",
- "file_name": "string",
- "private": true
}
], - "due_time_on_site": "2019-08-24T14:15:22Z",
- "status": "transit",
- "load_number": "ABC123",
- "load_actual_arrival_time": "2019-08-24T14:15:22Z",
- "load_time_complete": "2019-08-24T14:15:22Z",
- "load_expected_delivery_time": "2019-08-24T14:15:22Z",
- "load_actual_delivery_time": "2019-08-24T14:15:22Z",
- "load_qty": 50,
- "pay_weight": 50,
- "grower_payment_amount": 0,
- "sales_weight": 50,
- "load_vehicle_reg": "AC118182",
- "load_haulier": "string",
- "load_trailer_no": "string",
- "load_seal_no": "string",
- "load_box_markings": "string",
- "origin": "string",
- "comments": "string",
- "notes": "string"
}
{- "general_tuber_count_10kg": 1000,
- "general_dry_matter": 100,
- "general_sprouts_stolons": 100,
- "general_starch_content": 100,
- "color_defects_green": 100,
- "color_defects_purple": 100,
- "external_rots_breakdown": 100,
- "external_slug_worm": 100,
- "chipping_fry_colour": 1,
- "chipping_colour_consistency": 1,
- "chipping_internal_discoloration": 1,
- "chipping_glucose_percent": 100,
- "supplier_org_id": 1,
- "grower_org_id": 1,
- "recipient_org_id": 1,
- "trading_agreement_id": 1,
- "genus_id": 0,
- "variety_id": 1,
- "lot_id": 1,
- "plot_id": 1,
- "field_id": 0,
- "template_id": 1,
- "is_sent": true,
- "supplier_org_name": "string",
- "recipient_org_name": "string",
- "washed": true,
- "defects": "string",
- "general_stored_temperature": 50,
- "general_foreign_matter": 100,
- "color_defects_other_discolouration": 100,
- "external_scab_lt_5pct": 100,
- "external_pest_damage": 100,
- "external_disease_infection": 100,
- "external_irregular_shape": 100,
- "external_other": 100,
- "internal_disease_infection": 100,
- "internal_major_bruise_percent": 100,
- "internal_minor_bruise_percent": 100,
- "internal_other": 100,
- "chemical_declaration_answers": [
- {
- "chemical_declaration_id": 1,
- "is_applied": true,
- "date": "2019-08-24"
}
], - "size_ranges": [
- 0
], - "due_time_on_site": "2019-08-24T14:15:22Z",
- "status": "transit",
- "load_number": "ABC123",
- "load_actual_arrival_time": "2019-08-24T14:15:22Z",
- "load_time_complete": "2019-08-24T14:15:22Z",
- "load_expected_delivery_time": "2019-08-24T14:15:22Z",
- "load_actual_delivery_time": "2019-08-24T14:15:22Z",
- "load_qty": 50,
- "pay_weight": 50,
- "grower_payment_amount": 0,
- "sales_weight": 50,
- "load_vehicle_reg": "AC118182",
- "load_haulier": "string",
- "load_trailer_no": "string",
- "load_seal_no": "string",
- "load_box_markings": "string",
- "origin": "string",
- "date_of_harvest": "2019-08-24",
- "comments": "string",
- "notes": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "created_by_id": 1,
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_by_id": 1
}
Partially update a trade record. Only those properties supplied will be updated. See create-trade-record for more details.
id required | integer >= 1 Trade record id |
general_tuber_count_10kg | integer [ 0 .. 1000 ] Tuber count |
general_dry_matter | integer [ 0 .. 100 ] The expected or actual dry matter percentage |
general_sprouts_stolons | integer [ 0 .. 100 ] The % of this load that contains/may contain sprouts |
general_starch_content | integer [ 0 .. 100 ] The expected or actual starch content expressed as a percentage |
color_defects_green | integer [ 0 .. 100 ] The % of this load that have green color defect |
color_defects_purple | integer [ 0 .. 100 ] The % of this load that have purple color defect |
external_rots_breakdown | integer [ 0 .. 100 ] The estimated proportion of the load with this defect |
external_slug_worm | integer [ 0 .. 100 ] The estimated proportion of the load with this defect |
chipping_fry_colour | integer [ 1 .. 7 ] Fry color indication on a scale from 1 to 7, where 1= very light, 7 = dark |
chipping_colour_consistency | number <= 1 Chipping color consistency |
chipping_internal_discoloration | integer [ 1 .. 9 ] Internal discoloration on a scale from 1 to 9 |
chipping_glucose_percent | integer [ 0 .. 100 ] The expected glucose level |
supplier_org_id required | integer >= 1 Seller ID |
recipient_org_id required | integer >= 1 Buyer ID |
trading_agreement_id required | integer >= 1 Trading agreement |
lot_id | integer >= 1 The store lot reference from where produce is being supplied |
plot_id | integer >= 1 The plot reference from where produce is being supplied |
template_id required | integer >= 1 The passport template that will be used to validate trade record |
grower_org_id | integer (GrowerOrgId) >= 1 Grower of the produce's organisation ID. |
new_field_name | string (NewFieldName) Create a new off-platform field with this name. The |
variety_id | integer (VarietyId) >= 1 Variety ID |
region | string (OffPlatformRegion) Region/county of off-platform field |
country_code | string (CountryCode) = 2 characters ISO 3166-1 country code |
new_lot_name | string Create a new off-platform lot with this name. Both |
date_of_harvest required | string <date> The date the crop was harvested, required when creating an off platform lot |
washed | boolean whether this crop is washed |
defects | string User comments about defects in the load. |
general_stored_temperature | number <= 50 The actual stored temperature in degrees Celcius |
general_foreign_matter | integer [ 0 .. 100 ] The % of this load that contains/may contain foreign matter |
color_defects_other_discolouration | integer [ 0 .. 100 ] The % of this load that have other defective colors defect |
external_scab_lt_5pct | integer [ 0 .. 100 ] The estimated proportion of the load with this defect |
external_pest_damage | integer [ 0 .. 100 ] The estimated proportion of the load with this defect |
external_disease_infection | integer [ 0 .. 100 ] The estimated proportion of the load with this defect |
external_irregular_shape | integer [ 0 .. 100 ] The estimated proportion of the load with this defect |
external_other | integer [ 0 .. 100 ] The estimated proportion of the load with this defect |
internal_disease_infection | integer [ 0 .. 100 ] The estimated proportion of the load with this defect |
internal_major_bruise_percent | integer [ 0 .. 100 ] The estimated proportion of the load with this defect |
internal_minor_bruise_percent | integer [ 0 .. 100 ] The estimated proportion of the load with this defect |
internal_other | integer [ 0 .. 100 ] The estimated proportion of the load with this defect |
Array of objects (ChemicalDeclarationAnswer) Answers to all the chemical declarations, if chemical is applied or not?. | |
Array of objects or null (TradeRecordAttachmentWrite) Associated documentation/images with the trade record | |
due_time_on_site required | string <date-time> The date & time by which the lorry is due to arrive to pick up the produce |
status | string Enum: "transit" "completed" "cancelled" "returned" Status of load transaction. Only buyer organisations are allowed to change the status to completed |
load_number required | string The reference for the load. |
load_actual_arrival_time | string <date-time> The actual date & time when the lorry actually arrived to pick up the produce |
load_time_complete | string <date-time> The date & time when the lorry is loaded |
load_expected_delivery_time | string <date-time> The expected date & time when the lorry is due to arrive at the destination to dropoff the produce |
load_actual_delivery_time | string <date-time> The actual date & time when the lorry arrived at the destination to dropoff the produce |
load_qty | number <= 50 Amount of crop on a single load. The load ticket will allow for boxes of different sizes as well as bulk transport |
pay_weight | number <= 50 Weight(in tons) to be paid to the grower. This field is only visible to the buyer |
grower_payment_amount | number >= 0 Total invoice amount of the load. This field is only visible to the buyer |
sales_weight | number <= 50 Weight(in tons) to be sold to the customer. This field is only visible to the buyer |
load_vehicle_reg | string The vehicle registration plate for the vehicle carrying this load |
load_haulier | string The name of the Haulage Company carrying this load |
load_trailer_no | string The reference for the specific trailer for this load |
load_seal_no | string The references for all seals on this load. |
load_box_markings | string The name of the owner of the boxes carrying the crop |
origin required | string County & Country where crop was grown |
comments | string These are comments that will be visible to everyone in the distribution list who receives the load ticket. |
notes | string These are comments that will only be visible to the Grower and anyone they have shared their crop with. |
{- "general_tuber_count_10kg": 1000,
- "general_dry_matter": 100,
- "general_sprouts_stolons": 100,
- "general_starch_content": 100,
- "color_defects_green": 100,
- "color_defects_purple": 100,
- "external_rots_breakdown": 100,
- "external_slug_worm": 100,
- "chipping_fry_colour": 1,
- "chipping_colour_consistency": 1,
- "chipping_internal_discoloration": 1,
- "chipping_glucose_percent": 100,
- "supplier_org_id": 1,
- "recipient_org_id": 1,
- "trading_agreement_id": 1,
- "lot_id": 1,
- "plot_id": 1,
- "template_id": 1,
- "grower_org_id": 1,
- "new_field_name": "string",
- "variety_id": 43,
- "region": "string",
- "country_code": "st",
- "new_lot_name": "string",
- "date_of_harvest": "2019-08-24",
- "washed": true,
- "defects": "string",
- "general_stored_temperature": 50,
- "general_foreign_matter": 100,
- "color_defects_other_discolouration": 100,
- "external_scab_lt_5pct": 100,
- "external_pest_damage": 100,
- "external_disease_infection": 100,
- "external_irregular_shape": 100,
- "external_other": 100,
- "internal_disease_infection": 100,
- "internal_major_bruise_percent": 100,
- "internal_minor_bruise_percent": 100,
- "internal_other": 100,
- "chemical_declaration_answers": [
- {
- "chemical_declaration_id": 1,
- "is_applied": true,
- "date": "2019-08-24"
}
], - "attachments": [
- {
- "url": "string",
- "file_name": "string",
- "private": true
}
], - "due_time_on_site": "2019-08-24T14:15:22Z",
- "status": "transit",
- "load_number": "ABC123",
- "load_actual_arrival_time": "2019-08-24T14:15:22Z",
- "load_time_complete": "2019-08-24T14:15:22Z",
- "load_expected_delivery_time": "2019-08-24T14:15:22Z",
- "load_actual_delivery_time": "2019-08-24T14:15:22Z",
- "load_qty": 50,
- "pay_weight": 50,
- "grower_payment_amount": 0,
- "sales_weight": 50,
- "load_vehicle_reg": "AC118182",
- "load_haulier": "string",
- "load_trailer_no": "string",
- "load_seal_no": "string",
- "load_box_markings": "string",
- "origin": "string",
- "comments": "string",
- "notes": "string"
}
{- "general_tuber_count_10kg": 1000,
- "general_dry_matter": 100,
- "general_sprouts_stolons": 100,
- "general_starch_content": 100,
- "color_defects_green": 100,
- "color_defects_purple": 100,
- "external_rots_breakdown": 100,
- "external_slug_worm": 100,
- "chipping_fry_colour": 1,
- "chipping_colour_consistency": 1,
- "chipping_internal_discoloration": 1,
- "chipping_glucose_percent": 100,
- "supplier_org_id": 1,
- "grower_org_id": 1,
- "recipient_org_id": 1,
- "trading_agreement_id": 1,
- "genus_id": 0,
- "variety_id": 1,
- "lot_id": 1,
- "plot_id": 1,
- "field_id": 0,
- "template_id": 1,
- "is_sent": true,
- "supplier_org_name": "string",
- "recipient_org_name": "string",
- "washed": true,
- "defects": "string",
- "general_stored_temperature": 50,
- "general_foreign_matter": 100,
- "color_defects_other_discolouration": 100,
- "external_scab_lt_5pct": 100,
- "external_pest_damage": 100,
- "external_disease_infection": 100,
- "external_irregular_shape": 100,
- "external_other": 100,
- "internal_disease_infection": 100,
- "internal_major_bruise_percent": 100,
- "internal_minor_bruise_percent": 100,
- "internal_other": 100,
- "chemical_declaration_answers": [
- {
- "chemical_declaration_id": 1,
- "is_applied": true,
- "date": "2019-08-24"
}
], - "size_ranges": [
- 0
], - "due_time_on_site": "2019-08-24T14:15:22Z",
- "status": "transit",
- "load_number": "ABC123",
- "load_actual_arrival_time": "2019-08-24T14:15:22Z",
- "load_time_complete": "2019-08-24T14:15:22Z",
- "load_expected_delivery_time": "2019-08-24T14:15:22Z",
- "load_actual_delivery_time": "2019-08-24T14:15:22Z",
- "load_qty": 50,
- "pay_weight": 50,
- "grower_payment_amount": 0,
- "sales_weight": 50,
- "load_vehicle_reg": "AC118182",
- "load_haulier": "string",
- "load_trailer_no": "string",
- "load_seal_no": "string",
- "load_box_markings": "string",
- "origin": "string",
- "date_of_harvest": "2019-08-24",
- "comments": "string",
- "notes": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "created_by_id": 1,
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_by_id": 1
}
Save a trade record and send it to the email addresses specified. The trade record must meet the requirements defined in its passport template.
id required | integer >= 1 Trade record id |
{- "general_tuber_count_10kg": 1000,
- "general_dry_matter": 100,
- "general_sprouts_stolons": 100,
- "general_starch_content": 100,
- "color_defects_green": 100,
- "color_defects_purple": 100,
- "external_rots_breakdown": 100,
- "external_slug_worm": 100,
- "chipping_fry_colour": 1,
- "chipping_colour_consistency": 1,
- "chipping_internal_discoloration": 1,
- "chipping_glucose_percent": 100,
- "supplier_org_id": 1,
- "grower_org_id": 1,
- "recipient_org_id": 1,
- "trading_agreement_id": 1,
- "genus_id": 0,
- "variety_id": 1,
- "lot_id": 1,
- "plot_id": 1,
- "field_id": 0,
- "template_id": 1,
- "is_sent": true,
- "supplier_org_name": "string",
- "recipient_org_name": "string",
- "washed": true,
- "defects": "string",
- "general_stored_temperature": 50,
- "general_foreign_matter": 100,
- "color_defects_other_discolouration": 100,
- "external_scab_lt_5pct": 100,
- "external_pest_damage": 100,
- "external_disease_infection": 100,
- "external_irregular_shape": 100,
- "external_other": 100,
- "internal_disease_infection": 100,
- "internal_major_bruise_percent": 100,
- "internal_minor_bruise_percent": 100,
- "internal_other": 100,
- "chemical_declaration_answers": [
- {
- "chemical_declaration_id": 1,
- "is_applied": true,
- "date": "2019-08-24"
}
], - "size_ranges": [
- 0
], - "due_time_on_site": "2019-08-24T14:15:22Z",
- "status": "transit",
- "load_number": "ABC123",
- "load_actual_arrival_time": "2019-08-24T14:15:22Z",
- "load_time_complete": "2019-08-24T14:15:22Z",
- "load_expected_delivery_time": "2019-08-24T14:15:22Z",
- "load_actual_delivery_time": "2019-08-24T14:15:22Z",
- "load_qty": 50,
- "pay_weight": 50,
- "grower_payment_amount": 0,
- "sales_weight": 50,
- "load_vehicle_reg": "AC118182",
- "load_haulier": "string",
- "load_trailer_no": "string",
- "load_seal_no": "string",
- "load_box_markings": "string",
- "origin": "string",
- "date_of_harvest": "2019-08-24",
- "comments": "string",
- "notes": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "created_by_id": 1,
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_by_id": 1
}
Returns a paginated list of trade records details sorted by latest load due time on site.
page | integer >= 1 Default: 1 Example: page=2 Page number |
page_size | integer [ 1 .. 100 ] Default: 20 Page size |
plot_id | |
lot_id | |
store_id | |
string or string (DateOrDateTime) Example: updated_since=2020-01-02T10:00:00Z Return items created or updated since the specified data/time (inclusive). Date times are always in UTC and are specified in RFC3339 format. Can also be specified as simple dates e.g 2020-01-01, in which case midnight is assumed for the time component. | |
team_ids | |
from_delivery_date | string <date> ISO date format. |
to_delivery_date | string <date> ISO date format. |
supplier_org_id | |
recipient_org_id | |
load_number | string Return trade records that include this string in load number. |
source | string Enum: "field" "store" Filter on whether the lot came directly from the field or from a store |
field_id | integer Only return tickets from this field |
field_name | string Name of field. Only return tickets from this field. |
delivery_date | string <date> Only return tickets that were delivered on this date (ISO date format) |
format | string Default: "json" Enum: "json" "csv" Determine which format to return: load tickets can be serialised as JSON or as CSV. When serialised as CSV only the names of the various entities will be returned i.e not the primary keys. |
draft | boolean draft status of the load ticket. |
status | string Status of load |
search | string Search load records for supplier/recipient addresses, phone numbers or load ticket numbers which match this string |
{- "total": 0,
- "results": [
- {
- "supplier_org": {
- "id": 1,
- "name": "ABC Inc.",
- "logo": {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}
}, - "supplier_group": "string",
- "recipient_org": {
- "id": 1,
- "name": "ABC Inc.",
- "logo": {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}
}, - "trading_agreement": {
- "id": 1,
- "reference": "string"
}, - "variety": {
- "id": 1,
- "name": "string"
}, - "lot": {
- "id": 1,
- "name": "string"
}, - "plot": {
- "id": 1,
- "name": "string"
}, - "template": {
- "id": 1,
- "name": "string",
- "prefix": "string"
}, - "created_by": {
- "id": 0,
- "name": "string"
}, - "updated_by": {
- "id": 0,
- "name": "string"
}, - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "is_sent": true,
- "genus": {
- "id": 1,
- "name": "string"
}, - "field_name": "string",
- "week": 0,
- "general_tuber_count_10kg": 1000,
- "general_dry_matter": 100,
- "general_sprouts_stolons": 100,
- "general_starch_content": 100,
- "color_defects_green": 100,
- "color_defects_purple": 100,
- "external_rots_breakdown": 100,
- "external_slug_worm": 100,
- "chipping_fry_colour": 1,
- "chipping_colour_consistency": 1,
- "chipping_internal_discoloration": 1,
- "chipping_glucose_percent": 100,
- "washed": true,
- "defects": "string",
- "general_stored_temperature": 50,
- "general_foreign_matter": 100,
- "color_defects_other_discolouration": 100,
- "external_scab_lt_5pct": 100,
- "external_pest_damage": 100,
- "external_disease_infection": 100,
- "external_irregular_shape": 100,
- "external_other": 100,
- "internal_disease_infection": 100,
- "internal_major_bruise_percent": 100,
- "internal_minor_bruise_percent": 100,
- "internal_other": 100,
- "chemical_declaration_answers": [
- {
- "chemical_declaration_id": 1,
- "is_applied": true,
- "date": "2019-08-24"
}
], - "size_ranges": [
- 0
], - "due_time_on_site": "2019-08-24T14:15:22Z",
- "status": "transit",
- "load_number": "ABC123",
- "load_actual_arrival_time": "2019-08-24T14:15:22Z",
- "load_time_complete": "2019-08-24T14:15:22Z",
- "load_expected_delivery_time": "2019-08-24T14:15:22Z",
- "load_actual_delivery_time": "2019-08-24T14:15:22Z",
- "load_qty": 50,
- "pay_weight": 50,
- "grower_payment_amount": 0,
- "sales_weight": 50,
- "load_vehicle_reg": "AC118182",
- "load_haulier": "string",
- "load_trailer_no": "string",
- "load_seal_no": "string",
- "load_box_markings": "string",
- "origin": "string",
- "date_of_harvest": "2019-08-24",
- "comments": "string",
- "notes": "string"
}
]
}
Get a trade-record report.
id required | integer >= 1 Trade record id |
format | string Enum: "pdf" "html" "json" Expected response format. |
{- "general_tuber_count_10kg": 1000,
- "general_dry_matter": 100,
- "general_sprouts_stolons": 100,
- "general_starch_content": 100,
- "color_defects_green": 100,
- "color_defects_purple": 100,
- "external_rots_breakdown": 100,
- "external_slug_worm": 100,
- "chipping_fry_colour": 1,
- "chipping_colour_consistency": 1,
- "chipping_internal_discoloration": 1,
- "chipping_glucose_percent": 100,
- "supplier_org": {
- "id": 1,
- "name": "ABC Inc.",
- "logo": {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}
}, - "supplier_group": "string",
- "recipient_org": {
- "id": 1,
- "name": "ABC Inc.",
- "logo": {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}
}, - "trading_agreement": {
- "id": 1,
- "reference": "string"
}, - "variety": {
- "id": 1,
- "name": "string"
}, - "lot": {
- "id": 1,
- "name": "string"
}, - "plot": {
- "id": 1,
- "name": "string"
}, - "template": {
- "id": 1,
- "name": "string",
- "prefix": "string"
}, - "created_by": {
- "id": 1,
- "name": "string"
}, - "updated_by": {
- "id": 1,
- "name": "string"
}, - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "is_sent": true,
- "genus": {
- "id": 1,
- "name": "string"
}, - "field_name": "string",
- "week": 0,
- "washed": true,
- "defects": "string",
- "general_stored_temperature": 50,
- "general_foreign_matter": 100,
- "color_defects_other_discolouration": 100,
- "external_scab_lt_5pct": 100,
- "external_pest_damage": 100,
- "external_disease_infection": 100,
- "external_irregular_shape": 100,
- "external_other": 100,
- "internal_disease_infection": 100,
- "internal_major_bruise_percent": 100,
- "internal_minor_bruise_percent": 100,
- "internal_other": 100,
- "chemical_declaration_answers": [
- {
- "chemical_declaration_id": 1,
- "is_applied": true,
- "date": "2019-08-24"
}
], - "size_ranges": [
- 0
], - "due_time_on_site": "2019-08-24T14:15:22Z",
- "status": "transit",
- "load_number": "ABC123",
- "load_actual_arrival_time": "2019-08-24T14:15:22Z",
- "load_time_complete": "2019-08-24T14:15:22Z",
- "load_expected_delivery_time": "2019-08-24T14:15:22Z",
- "load_actual_delivery_time": "2019-08-24T14:15:22Z",
- "load_qty": 50,
- "pay_weight": 50,
- "grower_payment_amount": 0,
- "sales_weight": 50,
- "load_vehicle_reg": "AC118182",
- "load_haulier": "string",
- "load_trailer_no": "string",
- "load_seal_no": "string",
- "load_box_markings": "string",
- "origin": "string",
- "date_of_harvest": "2019-08-24",
- "comments": "string",
- "notes": "string"
}
Verify a future load number within a trade record is available to the buyer.
load_number required | string Example: 5041092 A string to reference the load. |
buyer_org_id required | integer (OrganisationId) >= 1 Example: 1 The ID of the buyer organisation. |
exclude_trade_record_id | integer >= 1 Trade record to be excluded by ID. |
true
Returns a paginated and summarised list of active passport templates
page | integer >= 1 Default: 1 Example: page=2 Page number |
page_size | integer >= 0 Default: 0 Allow unbounded pages by default |
genus_id | |
search | string Example: search=my-plot Text search |
string or string (DateOrDateTime) Example: updated_since=2020-01-02T10:00:00Z Return items created or updated since the specified data/time (inclusive). Date times are always in UTC and are specified in RFC3339 format. Can also be specified as simple dates e.g 2020-01-01, in which case midnight is assumed for the time component. | |
source_organisation_id | integer >= 1 Source organisation against which templates are filtered. |
target_organisation_id | integer >= 1 Target organisation against which templates are filtered. |
exclude_archived | boolean If true then exclude archived templates. Ignored if false |
{- "total": 0,
- "results": [
- {
- "id": 0,
- "name": "string",
- "version": 0,
- "published_on": "2019-08-24T14:15:22Z",
- "published_by_user": {
- "id": 0,
- "name": "string"
}, - "genus": {
- "id": 0,
- "name": "string"
}, - "target_organisation": {
- "id": 1,
- "name": "ABC Inc.",
- "logo": {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}
}, - "organisation": {
- "id": 1,
- "name": "ABC Inc.",
- "logo": {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}
}
}
]
}
Return a paginated list of passport templates. Note that this will only return non-archived templates
by default i.e templates where latest_id
is null.
page | integer >= 1 Default: 1 Example: page=2 Page number |
page_size | integer >= 0 Default: 0 Allow unbounded pages by default |
genus_id | |
search | string Example: search=my-plot Text search |
string or string (DateOrDateTime) Example: updated_since=2020-01-02T10:00:00Z Return items created or updated since the specified data/time (inclusive). Date times are always in UTC and are specified in RFC3339 format. Can also be specified as simple dates e.g 2020-01-01, in which case midnight is assumed for the time component. | |
source_organisation_id | integer >= 1 Source organisation against which templates are filtered. |
target_organisation_id | integer >= 1 Target organisation against which templates are filtered. |
exclude_archived | boolean If true then exclude archived templates. Ignored if false |
{- "total": 0,
- "results": [
- {
- "id": 0,
- "latest_id": 0,
- "name": "string",
- "version": 0,
- "published_on": "2019-08-24T14:15:22Z",
- "published_by_user_id": 0,
- "genus_id": 0,
- "genus_name": "string",
- "organisation_id": 0,
- "target_organisation_id": 0,
- "declaration": "I agree to the terms of service.",
- "comments": "Added a new required field.",
- "prefix": "COL",
- "fields": [
- {
- "name": "string",
- "is_required": true,
- "is_visible": true
}
], - "chemical_declarations": [
- {
- "description": "string",
- "is_date_required": true
}
], - "size_ranges": "string"
}
]
}
Create a template for the given target organisation, genus and organisation of the logged user.
Note that passport templates may only be created by users in an organisation which is a direct (i.e paying) customer of KisanHub.
We never update existing templates (hence the lack of a PUT method). If an update is required then pass
in the ID of the previous version of this template using old_template_id
old_template_id | integer If updating an existing template then supply the ID of the previous version: this is null for new templates |
name required | string Name of versioned template given by user. |
genus_id required | integer Genus ID. |
target_organisation_id required | integer Organisation ID. |
declaration | string User entered notes that represent attestations to be confirmed in any load ticket. |
comments | string Deprecated Indicate changes included in a particular version of a template. |
prefix | string Prefix to be used on a load ticket number. |
required | Array of objects (TemplateField) fields present in a passport template. |
Array of objects (ChemicalDeclaration) list of question related to application of chemical on load. | |
size_ranges | string json array of upper limits for size ranges, -1 means infinity |
{- "old_template_id": 0,
- "name": "string",
- "genus_id": 0,
- "target_organisation_id": 0,
- "declaration": "I agree to the terms of service.",
- "comments": "Added a new required field.",
- "prefix": "COL",
- "fields": [
- {
- "name": "string",
- "is_required": true,
- "is_visible": true
}
], - "chemical_declarations": [
- {
- "description": "string",
- "is_date_required": true
}
], - "size_ranges": "string"
}
{- "id": 0,
- "latest_id": 0,
- "name": "string",
- "version": 0,
- "published_on": "2019-08-24T14:15:22Z",
- "published_by_user_id": 0,
- "genus_id": 0,
- "genus_name": "string",
- "organisation_id": 0,
- "target_organisation_id": 0,
- "declaration": "I agree to the terms of service.",
- "comments": "Added a new required field.",
- "prefix": "COL",
- "fields": [
- {
- "name": "string",
- "is_required": true,
- "is_visible": true
}
], - "chemical_declarations": [
- {
- "description": "string",
- "is_date_required": true
}
], - "size_ranges": "string"
}
Returns the template specified by the id. Note that this will return any template, including one that has been archived.
id required | integer (PrimaryKey) >= 1 Example: 1 ID |
{- "id": 0,
- "latest_id": 0,
- "name": "string",
- "version": 0,
- "published_on": "2019-08-24T14:15:22Z",
- "published_by_user_id": 0,
- "genus_id": 0,
- "genus_name": "string",
- "organisation_id": 0,
- "target_organisation_id": 0,
- "declaration": "I agree to the terms of service.",
- "comments": "Added a new required field.",
- "prefix": "COL",
- "fields": [
- {
- "name": "string",
- "is_required": true,
- "is_visible": true
}
], - "chemical_declarations": [
- {
- "description": "string",
- "is_date_required": true
}
], - "size_ranges": "string"
}
Publish the given template, making it available for load tickets creation.
Note that passport templates may only be published by users in an organisation which is a direct (i.e paying) customer of KisanHub
id required | integer >= 1 Passport template ID |
comments | string Comments about this template version, mainly to indicate changes included in it. |
{- "comments": "string"
}
{- "id": 0,
- "latest_id": 0,
- "name": "string",
- "version": 0,
- "published_on": "2019-08-24T14:15:22Z",
- "published_by_user_id": 0,
- "genus_id": 0,
- "genus_name": "string",
- "organisation_id": 0,
- "target_organisation_id": 0,
- "declaration": "I agree to the terms of service.",
- "comments": "Added a new required field.",
- "prefix": "COL",
- "fields": [
- {
- "name": "string",
- "is_required": true,
- "is_visible": true
}
], - "chemical_declarations": [
- {
- "description": "string",
- "is_date_required": true
}
], - "size_ranges": "string"
}
Paginated list of all certificates with full details.
page | integer >= 1 Default: 1 Example: page=2 Page number |
page_size | integer [ 1 .. 100 ] Default: 20 Page size |
owner_type | string Enum: "user" "organisation" Example: owner_type=organisation Certificate owned by either user/organisation. |
owner_id | integer >= 1 Example: owner_id=1 ID of the owner. |
certificate_type_id | |
format | string Value: "pdf" Expected response format. By default api returns JSON response but returns a PDF when provided this query param |
{- "owner": {
- "id": 1,
- "name": "string"
}, - "certificate_type": {
- "id": 1,
- "name": "AP Number"
}, - "owner_type": "user",
- "classification": "Cereals",
- "issued_by": "string",
- "reference": "RR123456",
- "start_date": "2019-08-24",
- "renewal_date": "2019-08-24",
- "attachment": {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}, - "is_private": true,
- "created_at": "2019-08-24T14:15:22Z",
- "created_by": {
- "id": 0,
- "name": "string"
}, - "updated_at": "2019-08-24T14:15:22Z",
- "updated_by": {
- "id": 0,
- "name": "string"
}
}
Paginated list of all certificates.
page | integer >= 1 Default: 1 Example: page=2 Page number |
page_size | integer [ 1 .. 100 ] Default: 20 Page size |
owner_type | string Enum: "user" "organisation" Example: owner_type=organisation Certificate owned by either user/organisation. |
owner_id | integer >= 1 Example: owner_id=1 ID of the owner. |
certificate_type_id |
{- "owner_id": 1,
- "certificate_type_id": 1,
- "owner_type": "user",
- "classification": "Cereals",
- "issued_by": "string",
- "reference": "RR123456",
- "start_date": "2019-08-24",
- "renewal_date": "2019-08-24",
- "attachment": {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}, - "is_private": true,
- "created_at": "2019-08-24T14:15:22Z",
- "created_by_id": 1,
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_by_id": 1
}
Creates a certificate for user/organisation.
owner_id required | integer >= 1 Owner ID either of user or organisation. |
certificate_type_id required | integer >= 1 Certificate type ID (Cert Type API). |
classification | string Scope/classification of this certificate. |
issued_by | string Issuer institute/org. of the certificate. |
reference required | string Reference number given to the certificate. |
start_date required | string <date> Start date of validation of the certificate. |
renewal_date required | string <date> Renewal date of validation of the certificate. |
object (Attachment) File upload object with file_name and url of attachment. | |
is_private required | boolean If the certificate is private or public. |
{- "owner_id": 1,
- "certificate_type_id": 1,
- "classification": "Cereals",
- "issued_by": "string",
- "reference": "RR123456",
- "start_date": "2019-08-24",
- "renewal_date": "2019-08-24",
- "attachment": {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}, - "is_private": true
}
{- "owner_id": 1,
- "certificate_type_id": 1,
- "owner_type": "user",
- "classification": "Cereals",
- "issued_by": "string",
- "reference": "RR123456",
- "start_date": "2019-08-24",
- "renewal_date": "2019-08-24",
- "attachment": {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}, - "is_private": true,
- "created_at": "2019-08-24T14:15:22Z",
- "created_by_id": 1,
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_by_id": 1
}
Gets a certificate for user/organisation.
id required | integer >= 1 Certificate ID |
{- "owner_id": 1,
- "certificate_type_id": 1,
- "owner_type": "user",
- "classification": "Cereals",
- "issued_by": "string",
- "reference": "RR123456",
- "start_date": "2019-08-24",
- "renewal_date": "2019-08-24",
- "attachment": {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}, - "is_private": true,
- "created_at": "2019-08-24T14:15:22Z",
- "created_by_id": 1,
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_by_id": 1
}
Updates a certificate for user/organisation.
id required | integer >= 1 Certificate ID |
owner_id required | integer >= 1 Owner ID either of user or organisation. |
certificate_type_id required | integer >= 1 Certificate type ID (Cert Type API). |
classification | string Scope/classification of this certificate. |
issued_by | string Issuer institute/org. of the certificate. |
reference required | string Reference number given to the certificate. |
start_date required | string <date> Start date of validation of the certificate. |
renewal_date required | string <date> Renewal date of validation of the certificate. |
object (Attachment) File upload object with file_name and url of attachment. | |
is_private required | boolean If the certificate is private or public. |
{- "owner_id": 1,
- "certificate_type_id": 1,
- "classification": "Cereals",
- "issued_by": "string",
- "reference": "RR123456",
- "start_date": "2019-08-24",
- "renewal_date": "2019-08-24",
- "attachment": {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}, - "is_private": true
}
{- "owner_id": 1,
- "certificate_type_id": 1,
- "owner_type": "user",
- "classification": "Cereals",
- "issued_by": "string",
- "reference": "RR123456",
- "start_date": "2019-08-24",
- "renewal_date": "2019-08-24",
- "attachment": {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}, - "is_private": true,
- "created_at": "2019-08-24T14:15:22Z",
- "created_by_id": 1,
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_by_id": 1
}
Gets a list of certificate types for user/organisation.
is_personal | boolean Certificate Type is of type personal(i.e user). |
search | string Example: search=AP Text search by name of certificate. |
{- "id": 1,
- "name": "AP Number"
}
Register a device for Firebase notifications
token required | string Default: "Firebase token" |
device_type required | string Default: "Device type" Enum: "ios" "android" |
device_id | string Default: "Unique device identifier" |
{- "token": "Firebase token",
- "device_type": "ios",
- "device_id": "Unique device identifier"
}
Delete a device that was saved for Firebase notifications
token | string Firebase token. If this is not present in request body, all the tokens gets deleted that were stored for the requesting user |
{- "token": "string"
}
Update the user's notification preferences.
crop_monitoring_diaries required | boolean Whether the user will recieve crop monitoring diary notifications. |
{- "crop_monitoring_diaries": true
}
Media files are public and shareable, but not searchable. The filename is replaced with a 16-digit generated UUID but with the same suffix. Geolocation data can be supplied as a latitude and longitude (if supplied then both are required). If not supplied then we will look for geolocation data inside the EXIF tags. If both are supplied then EXIF data takes precendence.
file required | string <binary> Binary file |
file_name required | string File name |
longitude | number <float> Longitude |
latitude | number <float> Latitude |
{- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}
List of paginated organisations with search and sort by name
page | integer >= 1 Default: 1 Example: page=2 Page number |
page_size | integer [ 1 .. 100 ] Default: 20 Page size |
string or string (DateOrDateTime) Example: updated_since=2020-01-02T10:00:00Z Return items created or updated since the specified data/time (inclusive). Date times are always in UTC and are specified in RFC3339 format. Can also be specified as simple dates e.g 2020-01-01, in which case midnight is assumed for the time component. | |
is_connected | boolean If true then only include organisations that are connected to the requester's organisation. Note that we always treat our own organisation as connected. Falsey values are ignored. |
is_supplier | boolean If true then only include organisations which are sellers (i.e suppliers) in any trading agreements to the user's organisation. If false then exclude all organisations which act as sellers in any trading agreements visible to the user's organisation. |
search | string Search for name |
name | string Filter by exact name match |
{- "total": 0,
- "results": [
- {
- "reference": "FNAF123",
- "is_farm": true,
- "phone": "+41836736373",
- "email": "example@gmail.com",
- "address": {
- "street_name": "Cambrige Road",
- "village": "Oakington",
- "town_city": "Cambridge",
- "county": "Cambridgeshire",
- "state": "East Anglia",
- "post_code": "AB23 5FR",
- "plus_code": "string",
- "country": "GB",
- "address": "string",
- "locality": "string"
}, - "id": 1,
- "name": "ABC Inc.",
- "logo": {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}, - "team": {
- "id": 1,
- "name": "string"
}
}
]
}
Creates an organisation and a team with the same name, it also creates a connection between the requester org and the created org with can manage permission from the requester org (Auth - KH staff user and reg admins only).
reference | string An ID number/code provided by a government agency/authority in a given region. We are not verifying it. |
is_farm | boolean Whether this organisation has fields in which they might possibly farm. |
website | string <uri> Website uri of the organisation |
phone | string Phone number of the organisation |
string <email> Email address of the organisation | |
object (Address) Address | |
name required | string Name of the organisation. Should be globally unique. |
{- "reference": "FNAF123",
- "is_farm": true,
- "phone": "+41836736373",
- "email": "example@gmail.com",
- "address": {
- "street_name": "Cambrige Road",
- "village": "Oakington",
- "town_city": "Cambridge",
- "county": "Cambridgeshire",
- "state": "East Anglia",
- "post_code": "AB23 5FR",
- "plus_code": "string",
- "country": "GB",
- "address": "string",
- "locality": "string"
}, - "name": "ABC Inc."
}
{- "reference": "FNAF123",
- "is_farm": true,
- "phone": "+41836736373",
- "email": "example@gmail.com",
- "address": {
- "street_name": "Cambrige Road",
- "village": "Oakington",
- "town_city": "Cambridge",
- "county": "Cambridgeshire",
- "state": "East Anglia",
- "post_code": "AB23 5FR",
- "plus_code": "string",
- "country": "GB",
- "address": "string",
- "locality": "string"
}, - "id": 1,
- "name": "ABC Inc.",
- "logo": {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}, - "team": {
- "id": 1,
- "name": "string"
}
}
Get the list of all organisation connections of authorised user's organisation.
is_active | boolean Filter for active or inactive connections only. If not provided, all connections will be returned |
[- {
- "id": 1,
- "organisation_id": 1,
- "can_manage": true,
- "is_active": true,
- "is_sharing_diaries": true
}
]
Connects an organisation with another organisation. Note that this is only available to customer organisations and KisanHub staff
connect_to required | integer ID of the organisation to connect to. |
{- "connect_to": 0
}
{- "id": 1,
- "organisation_id": 1,
- "can_manage": true,
- "is_active": true,
- "is_sharing_diaries": true
}
Update a connection between two organisations
id required | integer >= 1 Organisation connection id |
is_sharing_diaries | boolean If true then the "from" organisation of this connection is allowing the target organisation to view crop monitoring diaries that users of their organisation have created for any plot that the target organisation can see. |
{- "is_sharing_diaries": true
}
{- "id": 1,
- "organisation_id": 1,
- "can_manage": true,
- "is_active": true,
- "is_sharing_diaries": true
}
Get an organisation detail (Auth - all users).
id required | integer >= 1 Organisation id |
{- "reference": "FNAF123",
- "is_farm": true,
- "phone": "+41836736373",
- "email": "example@gmail.com",
- "address": {
- "street_name": "Cambrige Road",
- "village": "Oakington",
- "town_city": "Cambridge",
- "county": "Cambridgeshire",
- "state": "East Anglia",
- "post_code": "AB23 5FR",
- "plus_code": "string",
- "country": "GB",
- "address": "string",
- "locality": "string"
}, - "id": 1,
- "name": "ABC Inc.",
- "logo": {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}, - "team": {
- "id": 1,
- "name": "string"
}
}
Update an organisation (Auth - KH staff, org members and members of manager orgs).
id required | integer >= 1 Organisation id |
reference | string An ID number/code provided by a government agency/authority in a given region. We are not verifying it. |
is_farm | boolean Whether this organisation has fields in which they might possibly farm. |
website | string <uri> Website uri of the organisation |
phone | string Phone number of the organisation |
string <email> Email address of the organisation | |
object (Address) Address | |
name required | string Name of the organisation. Should be globally unique. |
{- "reference": "FNAF123",
- "is_farm": true,
- "phone": "+41836736373",
- "email": "example@gmail.com",
- "address": {
- "street_name": "Cambrige Road",
- "village": "Oakington",
- "town_city": "Cambridge",
- "county": "Cambridgeshire",
- "state": "East Anglia",
- "post_code": "AB23 5FR",
- "plus_code": "string",
- "country": "GB",
- "address": "string",
- "locality": "string"
}, - "name": "ABC Inc."
}
{- "reference": "FNAF123",
- "is_farm": true,
- "phone": "+41836736373",
- "email": "example@gmail.com",
- "address": {
- "street_name": "Cambrige Road",
- "village": "Oakington",
- "town_city": "Cambridge",
- "county": "Cambridgeshire",
- "state": "East Anglia",
- "post_code": "AB23 5FR",
- "plus_code": "string",
- "country": "GB",
- "address": "string",
- "locality": "string"
}, - "id": 1,
- "name": "ABC Inc.",
- "logo": {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}, - "team": {
- "id": 1,
- "name": "string"
}
}
Summary report for all connections in the network of the requesting user's organisation.
group_id | integer >= 1 List only those network connections that have been assigned to the requested organisation-group |
organisation_id | integer >= 1 List only the network connection associated with the requested organisation |
is_active | boolean Filter for active or inactive connections only. If not provided, all connections will be returned |
role | string Enum: "agronomist" "field-officer" Role assigned to an advisor. |
advisor_user_id | integer (PrimaryKey) >= 1 Example: advisor_user_id=1 User assigned to an advisor role for a connected organisation. |
source_organisation_id | integer Source organisation ID. Ignored if |
[- {
- "id": 1,
- "organisation": {
- "id": 1,
- "name": "ABC Inc.",
- "logo": {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}
}, - "group": {
- "id": 1,
- "name": "West region",
- "owner_id": 1
}, - "advisors": [
- {
- "id": 1,
- "source_org_id": 1,
- "target_org_id": 1,
- "role": "agronomist",
- "user_id": 1
}
]
}
]
Creates a new organisation group to which organisations in the user's network can be assigned. Users can only create organisation-groups for the organisation to which they belong.
name required | string The name to be given to the organisation-region |
{- "name": "West region"
}
{- "id": 1,
- "name": "West region",
- "owner_id": 1
}
Updates the name of an existing organisation group. Users can only update organisation-groups that belong their organisation.
id required | integer >= 1 Organisation-group id |
name required | string The name to be given to the organisation-region |
{- "name": "West region"
}
{- "id": 1,
- "name": "West region",
- "owner_id": 1
}
Assigns an organisation to an organisation group. Users can only assign organisation-groups owned by the organisation to which they belong. Users can only assign one organisation-group to each organisation in their network.
group_id required | integer >= 1 Example: 2 id of the organisation-group being assigned |
organisation_id required |
{- "id": 1,
- "group_id": 1,
- "organisation_id": 1
}
Delete an existing assignment of an organisation-group to an organisation using the group_id & organisation_id Users can only delete assignments for organisation-groups that belong to their organisation.
group_id required | integer >= 1 Example: 2 id of the organisation-group being unassigned |
organisation_id required | integer >= 1 Example: 3 id of the organisation being removed from the group |
{- "detail": "string"
}
Retrieve the list of organisation-groups for the requesting user's organisation, with a summary representation that includes a count of assignments (usage).
[- {
- "id": 1,
- "name": "West region",
- "owner_id": 2,
- "assignment_count": 0
}
]
List of assigned advisors by an organisation.
connection_id | integer (PrimaryKey) >= 1 Example: connection_id=1 Connection ID |
role | string Enum: "agronomist" "field-officer" Role assigned to an advisor. |
advisor_user_id | integer (PrimaryKey) >= 1 Example: advisor_user_id=1 User assigned to an advisor role for a connected organisation. |
source_organisation_id | integer Source organisation ID. Ignored if |
assigned_organisation_id | integer (PrimaryKey) >= 1 Example: assigned_organisation_id=1 ID of organisation in the assigning Organisation's network to which an advisor is assigned. |
[- {
- "id": 1,
- "source_org_id": 1,
- "target_org_id": 1,
- "role": "agronomist",
- "user_id": 1
}
]
Assign a user to an advisor role for an organisation in your network.
connection_id | integer Connection ID |
source_organisation_id | integer Source organisation ID. Ignored if |
target_organisation_id | integer Target organisation ID. Ignored if |
role required | string (AdvisorRole) Enum: "agronomist" "field-officer" Role of the advisor assigned. |
user_id required | integer Advisor user ID |
{- "connection_id": 0,
- "source_organisation_id": 0,
- "target_organisation_id": 0,
- "role": "agronomist",
- "user_id": 0
}
{- "id": 1,
- "source_org_id": 1,
- "target_org_id": 1,
- "role": "agronomist",
- "user_id": 1
}
Trading agreements involving the authenticated user's organisation, ordered by latest start_date.
page | integer >= 1 Default: 1 Example: page=2 Page number |
page_size | integer [ 1 .. 100 ] Default: 20 Page size |
is_active | boolean If true then only return agreements that are currently active i.e start_date <= today <= end_date. If not specified then return all agreements. |
organisation_id | integer >= 1 Example: organisation_id=1 Returns agreements matching either the buyer or the seller organisation ID |
buyer_id | |
seller_id | |
string or string (DateOrDateTime) Example: updated_since=2020-01-02T10:00:00Z Return items created or updated since the specified data/time (inclusive). Date times are always in UTC and are specified in RFC3339 format. Can also be specified as simple dates e.g 2020-01-01, in which case midnight is assumed for the time component. | |
team_ids | |
tag_ids | Array of integers Example: tag_ids=2,3 Comma-separated list of crop tag IDs. Includes objects that have been tagged with any of these tags |
tag_id | integer >= 1 Filter by crop tag ID. Include objects that have been tagged with this tag. |
search | string Example: search=kisan Text search by Organisation name, address, post code or phone number of the buyer or seller. |
{- "total": 0,
- "results": [
- {
- "reference": "string",
- "start_date": "2019-08-24",
- "end_date": "2019-08-24",
- "tonnage": 0,
- "email_recipients": [
- "hello@kisanhub.com"
], - "created_at": "2019-08-24T14:15:22Z",
- "created_by": {
- "id": 0,
- "name": "string"
}, - "updated_at": "2019-08-24T14:15:22Z",
- "updated_by": {
- "id": 0,
- "name": "string"
}, - "buyer": {
- "reference": "FNAF123",
- "is_farm": true,
- "phone": "+41836736373",
- "email": "example@gmail.com",
- "address": {
- "street_name": "Cambrige Road",
- "village": "Oakington",
- "town_city": "Cambridge",
- "county": "Cambridgeshire",
- "state": "East Anglia",
- "post_code": "AB23 5FR",
- "plus_code": "string",
- "country": "GB",
- "address": "string",
- "locality": "string"
}, - "id": 1,
- "name": "ABC Inc.",
- "logo": {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}, - "team": {
- "id": 1,
- "name": "string"
}
}, - "seller": {
- "reference": "FNAF123",
- "is_farm": true,
- "phone": "+41836736373",
- "email": "example@gmail.com",
- "address": {
- "street_name": "Cambrige Road",
- "village": "Oakington",
- "town_city": "Cambridge",
- "county": "Cambridgeshire",
- "state": "East Anglia",
- "post_code": "AB23 5FR",
- "plus_code": "string",
- "country": "GB",
- "address": "string",
- "locality": "string"
}, - "id": 1,
- "name": "ABC Inc.",
- "logo": {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}, - "team": {
- "id": 1,
- "name": "string"
}
}, - "crop": {
- "id": 0,
- "name": "string"
}, - "tags": [
- {
- "id": 1,
- "organisation_id": 1,
- "organisation_name": "my organisation",
- "category_label": "string",
- "category_id": 1,
- "label": "string"
}
]
}
]
}
Returns a trading agreement (i.e contract) by id
id required | integer >= 1 Trading agreement ID |
{- "reference": "string",
- "start_date": "2019-08-24",
- "end_date": "2019-08-24",
- "tonnage": 0,
- "email_recipients": [
- "hello@kisanhub.com"
], - "created_at": "2019-08-24T14:15:22Z",
- "created_by": {
- "id": 0,
- "name": "string"
}, - "updated_at": "2019-08-24T14:15:22Z",
- "updated_by": {
- "id": 0,
- "name": "string"
}, - "buyer": {
- "reference": "FNAF123",
- "is_farm": true,
- "phone": "+41836736373",
- "email": "example@gmail.com",
- "address": {
- "street_name": "Cambrige Road",
- "village": "Oakington",
- "town_city": "Cambridge",
- "county": "Cambridgeshire",
- "state": "East Anglia",
- "post_code": "AB23 5FR",
- "plus_code": "string",
- "country": "GB",
- "address": "string",
- "locality": "string"
}, - "id": 1,
- "name": "ABC Inc.",
- "logo": {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}, - "team": {
- "id": 1,
- "name": "string"
}
}, - "seller": {
- "reference": "FNAF123",
- "is_farm": true,
- "phone": "+41836736373",
- "email": "example@gmail.com",
- "address": {
- "street_name": "Cambrige Road",
- "village": "Oakington",
- "town_city": "Cambridge",
- "county": "Cambridgeshire",
- "state": "East Anglia",
- "post_code": "AB23 5FR",
- "plus_code": "string",
- "country": "GB",
- "address": "string",
- "locality": "string"
}, - "id": 1,
- "name": "ABC Inc.",
- "logo": {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}, - "team": {
- "id": 1,
- "name": "string"
}
}, - "crop": {
- "id": 0,
- "name": "string"
}, - "tags": [
- {
- "id": 1,
- "organisation_id": 1,
- "organisation_name": "my organisation",
- "category_label": "string",
- "category_id": 1,
- "label": "string"
}
]
}
reference required | string reference of original agreement between the buyer and seller. |
start_date required | string <date> |
end_date required | string <date> |
tonnage required | integer The amount of produce being traded. |
email_recipients | Array of strings (EmailRecipients) <= 10 items list of email addresses that load tickets will be sent to. |
buyer_id required | integer >= 1 ID of the buyer organisation. |
seller_id required | integer >= 1 ID of the seller organisation. |
additional_party_id | integer >= 1 ID of the "additional party" organisation. This organisation is allowed to view this agreement as well as load tickets linked to this agreement. |
crop_id required | integer >= 1 Crop (i.e genus) ID |
tag_ids | Array of integers List of associated crop tags ids |
{- "reference": "string",
- "start_date": "2019-08-24",
- "end_date": "2019-08-24",
- "tonnage": 0,
- "email_recipients": [
- "hello@kisanhub.com"
], - "buyer_id": 1,
- "seller_id": 1,
- "additional_party_id": 1,
- "crop_id": 1,
- "tag_ids": [
- 0
]
}
{- "reference": "string",
- "start_date": "2019-08-24",
- "end_date": "2019-08-24",
- "tonnage": 0,
- "email_recipients": [
- "hello@kisanhub.com"
], - "buyer_id": 1,
- "seller_id": 1,
- "additional_party_id": 1,
- "crop_id": 1,
- "tag_ids": [
- 0
], - "created_at": "2019-08-24T14:15:22Z",
- "created_by_id": 1,
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_by_id": 1
}
id required | integer >= 1 Trading agreement ID |
{- "reference": "string",
- "start_date": "2019-08-24",
- "end_date": "2019-08-24",
- "tonnage": 0,
- "email_recipients": [
- "hello@kisanhub.com"
], - "buyer_id": 1,
- "seller_id": 1,
- "additional_party_id": 1,
- "crop_id": 1,
- "tag_ids": [
- 0
], - "created_at": "2019-08-24T14:15:22Z",
- "created_by_id": 1,
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_by_id": 1
}
id required | integer >= 1 Trading agreement ID |
reference required | string reference of original agreement between the buyer and seller. |
start_date required | string <date> |
end_date required | string <date> |
tonnage required | integer The amount of produce being traded. |
email_recipients | Array of strings (EmailRecipients) <= 10 items list of email addresses that load tickets will be sent to. |
buyer_id required | integer >= 1 ID of the buyer organisation. |
seller_id required | integer >= 1 ID of the seller organisation. |
additional_party_id | integer >= 1 ID of the "additional party" organisation. This organisation is allowed to view this agreement as well as load tickets linked to this agreement. |
crop_id required | integer >= 1 Crop (i.e genus) ID |
tag_ids | Array of integers List of associated crop tags ids |
{- "reference": "string",
- "start_date": "2019-08-24",
- "end_date": "2019-08-24",
- "tonnage": 0,
- "email_recipients": [
- "hello@kisanhub.com"
], - "buyer_id": 1,
- "seller_id": 1,
- "additional_party_id": 1,
- "crop_id": 1,
- "tag_ids": [
- 0
]
}
{- "reference": "string",
- "start_date": "2019-08-24",
- "end_date": "2019-08-24",
- "tonnage": 0,
- "email_recipients": [
- "hello@kisanhub.com"
], - "buyer_id": 1,
- "seller_id": 1,
- "additional_party_id": 1,
- "crop_id": 1,
- "tag_ids": [
- 0
], - "created_at": "2019-08-24T14:15:22Z",
- "created_by_id": 1,
- "updated_at": "2019-08-24T14:15:22Z",
- "updated_by_id": 1
}
Returns a list of delivery destinations (organisations) sorted by name for a given trading agreement. This will return a list of Organisations which satisfies any of these conditions:
id required | integer >= 1 trading agreement ID. |
[- {
- "id": 1,
- "name": "ABC Inc.",
- "logo": {
- "file_name": "string",
- "geotag": [
- -1.30329,
- 51.17687
], - "timestamp": "2019-08-24T14:15:22Z"
}
}
]
Staff-only API to list organisation permissions
is_customer | boolean If set then only return organisations that are KisanHub customers (i.e have valid subscriptions) |
[- {
- "organisation_id": 0,
- "organisation_name": "string",
- "is_customer": true,
- "monitor": true,
- "supply": true,
- "quality": true,
- "reports": true
}
]
Staff-only API to get permissions for a single organisation
id required | integer (OrganisationId) >= 1 Organisation ID |
{- "organisation_id": 0,
- "organisation_name": "string",
- "is_customer": true,
- "monitor": true,
- "supply": true,
- "quality": true,
- "reports": true
}
Staff-only API to set organisation permissions
id required | integer (OrganisationId) >= 1 Organisation ID |
organisation_id | number Organisation Id |
is_customer | boolean True if this is a KisanHub customer with a valid subscription |
monitor | boolean True to allow access to Crop Monitoring |
supply | boolean True to allow access to Supply Chain |
quality | boolean True to allow access to Quality |
reports | boolean True to allow access to Reports |
{- "organisation_id": 0,
- "is_customer": true,
- "monitor": true,
- "supply": true,
- "quality": true,
- "reports": true
}