Product Types are used to group products for quality purposes.
List
The Product Type – List API call reads existing Product Types from Eyelit MES-M. The data can be filtered based on the parameters passed in the body/payload of the JSON packet giving the flexibility to search for one or multiple Product Types.
Using the Product Type – List API call has no impact on the data within the given Eyelit MES-M application, it is read-only.
Figure 1: Logic within ProductType/List API Call
Data Prerequisites
There is no data required in Eyelit MES-M to act as a pre-requisite to make the API call to list Product Types. If parameters are passed in through the body that return no valid results, an empty payload will be returned.
Request
Table 1 shows the method and endpoint required to make the API call to list Product Types.
Table 1 - Outbound Message Detail for Product Type - List
Method | URL Structure | Endpoint |
PUT | https://[environment].mestec.net | /api/ProductType/List |
The body of the payload should follow the format below.
See Table 2 for information on which fields are optional, the appropriate data types and the mappings to fields in Eyelit MES-M.
Table 2 - Parameter Information for Product Type - List
Parameter Name | Data Mapping | Data Type | Mandatory | Case Sensitive | Match Type |
ID | producttype.id | NUMBER | No | N/A | Exact |
Name | producttype.name | VARCHAR2(250 BYTE) | No | No | Exact |
Note: For any fields where the match type is ‘Like’, a percent symbol should be used as a wildcard character to indicate a number of characters within the given string.
Sample Request
See below for sample use cases with examples of the JSON payload format required.
To list all Product Types
Figure 3 - JSON Sample for Product Type List Request A
To list Product Types where the name is ‘Controlled’:
Figure 4 - JSON Sample for Product Type List Request B
Response
When using the Product Type – List API call, if any data has been found in Eyelit MES-M that meets the parameter values passed in the original payload, a JSON payload will be returned containing data in the following structure:
Sample Response
See below for sample use cases with examples of the JSON payload format returned.
No results were found that matched given parameters:
Multiple Product Types were found that matched given parameters:
Upsert
When Product Type ID is provided, The Product Type – Upsert API call checks if a Product Type with the given ID already exists. If it does, appropriate fields are updated in the matching product in Eyelit MES-M.
When the Product Type ID is omitted, a new Product Type will be created.
Figure 5 - Logic within ProductType/Upsert API Call
Data Prerequisites
There is no data required in Eyelit MES-M to act as a pre-requisite to make the API call to upsert Product Types. If parameters are passed in through the body that return no valid results a new Product Type will be created, otherwise the Product Type identified will be updated.
Request
Table 3 shows the method and endpoint required to make the API call to list Product Types.
Table 3 - Outbound Message Detail for Product Type - Upsert
Method | URL Structure | Endpoint |
PUT | https://[environment].mestec.net | /api/ProductType/Upsert |
The body of the payload should follow the format below.
See Table 4 for information on which fields are optional, the appropriate data types and the mappings to fields in Eyelit MES-M.
Table 4 - Parameter Information for Product Group - Upsert
Parameter Name | Data Mapping | Data Type | Mandatory | Case Sensitive | Match Type |
ID | producttype.id | NUMBER | No1 | N/A | Exact |
Name | producttype.name | VARCHAR2(250 BYTE) | No | N/A | N/A |
Description | producttype.description | VARCHAR2(2000 BYTE) | No | N/A | N/A |
Note: For any fields where the match type is ‘Like’, a percent symbol should be used as a wildcard character to indicate a number of characters within the given string.
Sample Request
See below for sample use cases with examples of the JSON payload format required.
To create a Product Type.
To update name and description by ID.
Response
When using the Product Type – Upsert API call, if a Product Type has been Created or Updated a JSON payload will be returned containing data in the following structure:
Sample Response
See below for sample use cases with examples of the JSON payload format returned.
Delete
The Product Type – Delete API call attempts to delete a Product Type. A Product Type can be deleted as long as there are no Products currently assigned to the Product Type.
Figure 6 shows the logic used within the Product Group – Delete API call.
Figure 6 - Logic within ProductType/Delete API Call
Data Prerequisites
In order to delete a Product Type, the Product Type must exist in Eyelit MES-M.
The Product Type must have no Products currently assigned.
Request
Table 5 shows the method and endpoint required to make the API call to list Product Groups.
Table 5 - Outbound Message Detail for Product Type - Delete
Method | URL Structure | Endpoint |
PUT | https://[environment].mestec.net | /api/ProductType/Delete |
The body of the payload should follow the format below.
See Table 6 for information on which fields are optional, the appropriate data types and the mappings to fields in Eyelit MES-M.
Table 6 - Parameter Information for Product Type - Delete
Parameter Name | Data Mapping | Data Type | Mandatory | Case Sensitive | Match Type |
ID | producttype.id | NUMBER | No | N/A | Exact |
Note: For any fields where the match type is ‘Like’, a percent symbol should be used as a wildcard character to indicate a number of characters within the given string.
Sample Request
See below for sample use cases with examples of the JSON payload format required.
Delete by ID
Response
When using the Product Type – Delete API call, if a Product Type has been Deleted a JSON payload will be returned containing data in the following structure:
Sample Response
See below for sample use cases with examples of the JSON payload format returned.