Harvest API icon

Harvest API

(0 reviews)
Harvest API

home

Harvest API

This Api creates Harvest batch in ICS system. It also provides information about the Harvest details from the ICS.

Introduction

The Harvest API allows to fetch/initiate batch details from ICS account. Harvest Api is secured by OAuth token validation, allowing customer to access any or all of the following depending on the API use case:
1. Fetch all Harvest batch details.
2. Fetch Harvest batch details with specific query parameters.
3. Create Harvest batch.
4. Update Harvest batch.


Overview

The Harvest batch API is a REST-based solution that deals secure and convenient customer and business access to harvest records from ICS system to respective facilities.
It is secured using OAuth 2.0 and has below endpoints,
/ping: This endpoint returns API health.
This endpoint consists of GET method, which gives the health status of the API.
/harvest: This endpoint returns harvest batch details from the ICS.
This endpoint consists of GET, POST, PATCH methods, these are used to fetch, create and update the Harvest batch.
1. When the Harvest details are passed from the request it initiate Harvest batch details
2. When the Harvest batch details are passed in queryparms then it retrieves Harvest batch details..
GET: This method returns harvest details by using below query parameters.
1. sourceSystem: It is mandatory parameter and it is a 3 letter code for respective source system
2. sourceSystemBatchId: This is an external (source) harvest batch Id used for querying the harvest details.
3. icsHarvestId: This is the ICS harvest Id generated by the ICS system. This is an optional field.
4. pageNumber: It is a optional field used for querying the harvest details on specific page number.
POST: This method creates harvest batch details in ICS system. While creating harvest records below are the key points to consider,
1. The sourceSystem, SourceSystemHarvestBatchId, sourceSystemPlantIds, strain, quantity etc. are required parameters need to be passed.
2. Harvest of plants with same strain can be created.
PATCH: This method partially update harvest batch details in ICS system. While creating batch records below are the validation performed.
1. User can update existing harvest record by passing sourceSystem, sourceSystemHarvestBatchId
2. Location, weights can be updated using this operation.


Key features and benefits

The following are features and benefits of the Harvest API:
1. Provides access to account details including token validation and initiates/retrieves for a Harvest.
2. Puts your customers in control of their data sharing permissions and grants through API Security.
3. Data is access strictly by record owner facility.


How it works

resources/Screenshot%202024-05-10%20212822-ae27dbca-ecd4-4b99-ad21-9c9aa3a0bd3d.png

The following diagram illustrates how the Harvest API works.
1. The customer sends client ID and Secret requesting authorization token to access Mule APi.
2. Mule API sends the secure token.
3. The customer enters their secure token and valid Json request for Harvest.
4. Mule OAuth provider processes the customer credentials and token to determine the authorization.
5. If the access is successful, the request is passed from Mule Api to ICS.
6. Response received from ICS is captured.
7. Mule API sends the response back the customer in Json format.
8. If any error in the flow or validation error, Mule API handles and reverts the specific error with the customer along with standard error codes.

Validations

The following are the validations for data transformation in Harvest API.
1. Harvest batch cannot be created if one or more plants are not in Flowering phase.
2. Storage building and storage room should be passed from the request, zone and section are non manadatory.
3. Harvest batch cannot be updated if final quantity value flag is set to true.
4. Location details such as room, section, zone, building must be passed through the request which are associated to the sourcesystem or facility.
5. Harvest is created only for the plants having same strain and active plants.


Use cases

The Harvest API supports data access for the following use cases.

resources/Screenshot%202024-04-30%20174449-d7caa3c2-352f-4e91-954f-8721727f4157.png


Reviews