Cropwise
powered by syngenta

Working with Crops 🌾

Overview

The Crops domain provides a hierarchical catalog system for managing agricultural crop species and their localized configurations.

Cardinality summary

  • Crop ➜ 0..1 Parent Crop (hierarchical structure)
  • Crop ➜ 1..* Crop Names (multilingual support)
  • Crop ➜ 1..* Localized Crops (country-specific configurations)
Crop (Species Level)
β”œβ”€β”€ Crop Names 1..*
└── Localized Crops 1..*

Key Concepts

ConceptDescription
Cropagricultural species entity with global properties
Crop NamesMultilingual name translations
Localized CropCountry/region-specific crop configuration with local parameters
EPPO CodeUnique taxonomic identifier from the EPPO Global Database (European and Mediterranean Plant Protection Organization). These standardized codes ensure consistent plant species identification across agricultural systems and countries.

API Documentation

For complete API reference including request/response schemas, authentication, and interactive testing, visit:

πŸ“š Crops API Documentation - Interactive API documentation with request/response examples

Available Endpoints

MethodEndpointDescription
POST/v2/catalog/cropsCreate a new crop
GET/v2/catalog/crops/{id}Get crop by ID
PUT/v2/catalog/crops/{id}Update crop information
DELETE/v2/catalog/crops/{id}Delete a crop
GET/v2/catalog/cropsList crops with filtering and pagination
GET/v2/catalog/crops/localized/{id}Get crop by localized crop ID
POST/v2/catalog/crops/{cropId}/imageUpload an image to a crop

Business Rules

Name Uniqueness

Each crop must have unique language codes across its names. A crop cannot have multiple names in the same language.

Location Uniqueness

Each crop must have unique locations across its localized crop configurations. A crop cannot have multiple localized configurations for the same country.

EPPO Code Validation

When associating a crop with an EPPO taxonomic code:

  • EPPO codes are standardized plant identifiers from the EPPO Global Database
  • If eppo_code is provided, it must exist in the EPPO database
  • Invalid EPPO codes will result in an error
  • EPPO codes ensure interoperability with international phytosanitary and agricultural systems
  • Examples: ZEAMX (Zea mays - Maize), TRZAX (Triticum aestivum - Wheat), HORVX (Hordeum vulgare - Barley)

Error Codes

CodeMessageHTTP StatusWhen Triggered
ECRP001Parent crop does not exist404 NOT_FOUNDparent_id references a non-existent crop during CREATE or UPDATE
ECRP002Crop does not exist404 NOT_FOUNDRequested crop ID not found during GET, UPDATE, or DELETE operations
ECRP003The crop cannot be its parent id400 BAD_REQUESTparent_id equals crop ID during UPDATE operation
ECRP004The crop can not have more than 1 name for the same language400 BAD_REQUESTDuplicate language values in name array during CREATE or UPDATE
ELCR001The same crop can not have duplicated countries400 BAD_REQUESTDuplicate location values in localized_crops array during CREATE or UPDATE
ELCR002This location does not exist for this crop404 NOT_FOUNDQuerying a location that doesn't exist for the specified crop
ELCR003The localized id does not exist404 NOT_FOUNDLocalized crop ID not found in database
ELCR004One or more of the localized crops Ids does not exist404 NOT_FOUNDOne or more IDs in a localized crops list don't exist
ELCR005Crop not found404 NOT_FOUNDCrop not found through adapter/external service lookup

Typical Workflows

Basic Crop Management

  1. Create Crop - Set up new crop species with multilingual names and localized configurations
  2. Update Crop - Modify crop properties like names, images, or localized settings
  3. Retrieve Crop - Get crop details for display or analysis
  4. List Crops - Query crops by filters like specialization type or parent relationship
  5. Delete Crop - Soft delete crops no longer in use

Next Steps

After creating your crops, you can:

  1. Working with Seeds β†’
  2. Managing Growth Scales β†’