You can use the Manufacturer for Agro API to integrate the third-party systems with the Manufacturer for Agro application.
The Manufacturer for Agro API uses the Representational State Transfer (REST) standard to interact with other systems.
The Manufacturer for Agro API is an extension of the Manufacturer for Agro application of Movilitas.Cloud and enables you to send requests from external systems to the application.
This article describes how to create a production order by using the Manufacturer for Agro API.
API Tool to Use
In this document, we provide examples by using the cURL command-line tool. You can use any API tool to perform the API requests, for example, Postman or Katalon Studio.
Before You Begin
Before you start sending any messages:
1. You must enable the Manufacturer for Agro application in the Admin UI.
2. You must create an API key and secret.
3. You must create a shopfloor channel with Manufacturer for Agro API source. You will need the channel key for your requests.
4. You must configure the Manufacturer for Agro application and the channel required to connect to SAP AII in the Admin UI.
5. You must have the authentication token to send requests over API. Select one of the following ways:
- Apply a dynamic token. Send an authentication request over the Authentication API. For more information about the Authentication API, open the Tenant Dashboard in Movilitas.Cloud, select API keys, and choose Authentication API Documentation. Also, see Authentication Request.
- Apply a static token. Generate a static token for your previously created API key.
For more information, see Configuring the Movilitas.Cloud APIs.
Procedure
1. Use the POST method and the following URL:
https://api.movilitas.cloud/v1/manufacturer_agro/v1/api/production_order
2. For the header, define the following:
Key | Action |
---|---|
Content-Type | Apply JSON format for the content. Use the value application/json. |
x-access-token | Provide the authentication token. |
3. In the body of the request, define the parameters and their values based on the table below.
Field | Required or Optional? | Type | Description |
---|---|---|---|
channel_key | Required | String | The channel key of your Manufacturer for Agro API channel. |
order_id | Required | String | Order ID |
product_code | Required | String | Product code for the output product as per the GS1 standard. |
product_code_type | Required | String | Product code type for the output product. The application supports one value, "GTIN". |
product_description | Optional | String | Product description for the output product. |
quantity | Optional | Number | The quantity of the output product. |
unit_of_measurement | Optional | String | The unit of measurement for the quantity of the output product. For example, "Liter" or "Kg". Mandatory when the quantity is provided. |
batch | Optional | String | Batch of the output product as per the GS1 standard. |
expiry_date | Optional | String | Expiry date of the output product in the "YYMMDD" format. For the last day of the month, '00' is accepted, for example, 2022-December-31 can be written as 221200. |
scheduled_start | Optional | String | Scheduled start date/time as per ISO 8601 for the order. The applied format is "YYYY-MM-DD HH:MMZ" (UTC). |
scheduled_end | Optional | String | Scheduled end date/time as per ISO 8601 for the order. The applied format is "YYYY-MM-DD HH:MMZ" (UTC). |
bom | Required | Object[] | Bill of materials. Contains the list of input materials and their details as objects. |
product_code | Required | String | Item product code as per the GS1 standard. |
product_code_type | Required | String | Item product code type. The application supports one value, "GTIN". |
product_description | Optional | String | Item product description |
quantity | Required | Number | The required quantity of the material. |
unit_of_measurement | Required | String | The unit of measurement for the quantity of the material. For example, "Liter" or "Kg". |
batch | Optional | String | Item batch as per the GS1 standard |
sscc | Optional | String | Item SSCC as per the GS1 standard |
serial_number | Optional | String | Item serial number |
serial_number_type | Optional | String | The type of the item serial number. The value is either SGTIN or Customer. Mandatory if the serial number is provided. |
4. Send the request. After creation, the production order is listed under the Manufacturer for Agro application --> Production orders tab in Open status.
Sample cURL Request
curl -X POST \ https://api-dev.movilitas.cloud/v1/manufacturer_agro/v1/api/production_order \ -H 'Content-Type: application/json' \ -H 'x-access-token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJrZXkiOiJzX2FqazQyS2RLQWhHciE3TUZtY1Q2UzhTQ3NDQ2hzc2RoTXRFUlNBIUNwUDhlZDkzU2htQ0hoaHIyTmg3Y0dBIiwiX2lkIjoiNWQyNzA4ZDc3NDQ1OTcxYjI5MmY4ZDI3IiwiaWF0IjoxNTY0MDU5ODc2LCJleHAiOjE1NjQxNDYyNzZ9.TBMv71CaxCNtE1opQMk0f1ncfbnZ0Cwnu7MWkTzkQqA' \ -d '{ "channel_key": "QL6faDom0pvnuhTTgwwZyStl52VCMxHqsZSd547w", "order_id": "ORDER115", "product_code": "01122334455667", "product_code_type": "GTIN", "product_description": "Salty Water", "quantity": 100, "unit_of_measurement": "Liter", "batch": "ENO9A1010", "expiry_date": "231200", "bom": [ { "product_code": "01234567891000", "product_code_type": "GTIN", "product_description": "Water", "quantity": 80, "unit_of_measurement": "Liter", "sscc": "000000000000000110", "serial_number": "A1B2C3100", "serial_number_type": "Customer", "batch": "ENO9B1010" }, { "product_code": "01234567891001", "product_code_type": "GTIN", "product_description": "Salt", "quantity": 20, "unit_of_measurement": "Kg", "sscc": "000000000000000210", "serial_number": "A1B2C4100", "serial_number_type": "Customer", "batch": "ENO9C1010" } ] }'
Sample Response (Success 200)
{ "success": true, "message": "Production order created" }