Plants API icon

Plants API

(0 reviews)
The plants API creates plants in batches and update the multiple plants. It also return data of plants based on filter parameters.

home

Plant API

The Plants API creates, update the plant records in the ICS system. It also fetch plants or plant batch details by using query parameters.

Introduction

The Plant API allows to fetch/initiate batch details from ICS account. Plant 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 Plant batch details.
  2. Fetch Plant details with specific query parameters.
  3. Create Plant batch.
  4. Update Plant batch.

Overview

The Plant batch API is a REST-based solution that deals with secure and convenient customer and business access to Plant data.

The Plant Api is secured by Mule OAuth

The Plant API provides information about Plant batch details from the ICS. It has below endpoints

/ping: This endpoint returns API health.

This endpoint consists of GET method, which gives the health status of the API.

/Plants: This endpoint returns Plant batch details from the ICS.

This endpoint consists of GET, POST, PATCH methods, these are used to fetch, create and update the Plant batch.

  1. When the Mother Plant/ Plant details are passed from the request it initiate Plant batch and plants within a batch creation.
  2. When the Plant batch details are passed in queryparms then it retrieves Plants information.

GET: This method returns Plant details by using below query parameters.

  1. sourceSystem: It is a mandatory parameter
  2. sourceSystemPlantIds: This is an external (source) Plant Ids used for querying the plant details. Provide single or comma separated Plant Ids on source side.
  3. sourceSystemBatchId: This is the ICS batch ID generated by the ICS system. This is an optional field.

POST: This method creates Plant batch and Plant records in ICS system. While creating Plant records below are the validation performed.

  1. The sourceSystem,sourceSystemPlantBatchId,sourceSystemPlantIds and strain are required parameters.
  2. The comma seperated sourceSystemPlantIds and quantity should match.
  3. The mother Plant Id and new Plants should have same strain.
  4. Location details provided in the request should be registered in ICS System.

PATCH: This method updates the records in ICS Hub for the respective batch or single or multiple Plants..

  1. User can update existing Plant record by passing sourceSystem, sourceSystemBatchId or sourceSystemPlantIds
  2. User can activate plants by updating records using sourceSystemPlantIds.
  3. While updating plants using sourceSystemBatchId, only active plants gets updated.

Key features and benefits

The following are features and benefits of the Plant API:

  1. Provides access to account details including token validation and initiates/retrieves for a Plant.
  2. Puts your customers in control of their data sharing permissions and grants through our Security.

How it works

The following diagram illustrates how the Plant API works.

resources/Screenshot%202024-06-03%20211200-f986ea54-c407-4cad-96e2-bc3c1b2cd81f.png

  1. The customer sends client ID and Secret requesting authorization token to access Mule APi.
  2. Mule API sends the secure token.T
  3. The customer enters their secure token and valid Json request for Plant.
  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 is the validations for Inventory API
1. To fetch plants - sourceSystem is the mandatory queryParam to be passed, sourceSystem along with sourceSystemPlantIds or sourceSystem along with sourceSystemBatchId can also be passed to get specific record details.
2. To update plants - sourceSystem need to pass along with sourceSystemPlantIds or sourceSystemBatchId
3. In creation of plants - the number of plant Ids need to match the quantity given in the request.
4. In creation of plants - the plant strain and mother plant strain should be same.
5. In creation of plants - Location details such as room, section, zone, building must be passed through the request which are associated to the sourcesystem or facility.


Use cases

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

resources/Screenshot%202024-04-30%20180202-3d578f62-0621-4141-a132-33b35e3f10e7.png


Reviews