You can use the Serialized Logistics for Agro API to integrate the third-party systems with the Serialized Logistics for Agro application.
The Serialized Logistics for Agro API uses the Representational State Transfer (REST) standard to interact with other systems.
The Serialized Logistics for Agro API is an extension of the Serialized Logistics for Agro application of Movilitas.Cloud and enables you to send requests from external systems to the application.
This article describes how to send a Replace Outbound Order request to Movilitas.Cloud by using the Serialized Logistics for Agro API.
Note: Through API, you can update orders in Open status only. To update ongoing orders, you need to go to the Serialized Logistics for Agro application. Make sure that the Enable ongoing orders update checkbox is selected under the Settings tab.
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 Serialized Logistics for Agro application in the Admin UI.
2. You must create an API key and secret.
3. You must create a shopfloor channel with Serialized Logistics for Agro API source. You will need the channel key for your requests.
4. You must configure the Serialized Logistics 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 PUT method and the following URL:
https://api-acc.movilitas.cloud/v1/serialized_logistics_agro/v1/api/outbound_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 Serialized Logistics for Agro API channel. |
order_id | Required | String | Order ID |
order_type | Required | String | The type of the order. Enter one of the following values:
|
order_exp_date | Optional | String | Order expiration date. Free text field. |
warehouse_tag | Required | String | The warehouse tag that identifies your warehouse. Note: Make sure that you have registered the warehouse under the Serialized Logistics for Agro application --> Warehouses tab and apply the value given in the Warehouse tag field. |
sample_order | Optional | Boolean | Indicates whether the order is a sample order:
A sample order is an order for which the customer does not pay. If the field is not included in the request, the value is set to "false". |
allow_unlimited_overdelivery_underdelivery | Optional | Boolean | Enables you to deliver an unlimited amount for the order, ignoring the target quantity. The setting can be one of the following:
If the field is not included in the request, the value is set to "false" with the default tolerance values. |
overdelivery_tolerance | Optional | Number | Overdelivery tolerance in percentage (%) for the order. Only applicable when "allow_unlimited_overdelivery_underdelivery" is set to "false". The allowed value is 0 or a value that is greater than 0. The default value is 0. |
underdelivery_tolerance | Optional | Number | Underdelivery tolerance in percentage (%) for the order. Only applicable when "allow_unlimited_overdelivery_underdelivery" is set to "false". The allowed value is 0 or a value that is greater than 0. The default value is 0. |
item_list | Required | Object[] | The object array of the line items related to the order. Each line item object contains the details of the line item. You can add multiple line items that have different or the same product data, there is no restriction. For example:
|
item_number | Required | String | Line item number |
product_code | Required | String | Product code as per the GS1 standard. |
product_code_type | Required | String | Product code type. The application supports one value, "GTIN". |
product_description | Optional | String | Product description |
product_group | Optional | String | Product group code (AGI code) |
product_group_type | Optional | String | Product group type (AGI) |
product_group_description | Optional | String | Product group description |
batch | Optional | String | Product batch |
unit_of_measurement | Required | String | The unit of measurement for the quantity. For example, "Liter", "Pcs", or "Kg". |
quantity | Required | Number | The quantity of the line item. |
sales_unit_of_measurement | Required | String | The sales unit of measurement for the sales quantity. Enter one of the following values:
|
sales_quantity | Required | Number | The sales quantity of the line item. |
4. Send the request. The outbound order is updated and listed under the Serialized Logistics for Agro application --> Outbound orders tab in Open status.
Sample cURL Request
curl -X PUT \ https://api-acc.movilitas.cloud/v1/serialized_logistics_agro/v1/api/outbound_order \ -H 'Content-Type: application/json' \ -H 'x-access-token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJrZXkiOiJzX2FqazQyS2RLQWhHciE3TUZtY1Q2UzhTQ3NDQ2hzc2RoTXRFUlNBIUNwUDhlZDkzU2htQ0hoaHIyTmg3Y0dBIiwiX2lkIjoiNWQyNzA4ZDc3NDQ1OTcxYjI5MmY4ZDI3IiwiaWF0IjoxNTYzOTU3MjA4LCJleHAiOjE1NjQwNDM2MDh9.dYGzl-K1UT8jAeb-XQ0n_chI8VJzKRJiXhtnU4GenPc' \ -d '{ "channel_key": "EunyP8TFMvFDEJH12bXeEhumUh03v91KiI2Zdemy", "order_id": "11112", "order_type": "Internal", "order_exp_date": "230409", "warehouse_tag": "ADFT", "allow_unlimited_overdelivery_underdelivery": "false", "overdelivery_tolerance": "5", "underdelivery_tolerance": "5", "item_list": [ { "item_number": "001", "product_code": "20562151256246", "product_code_type": "GTIN", "product_description": "Herbicide 10L", "product_group": "00987865", "product_group_type": "AGI", "batch": "ENO9F0203", "unit_of_measurement": "Liter", "quantity": 800, "sales_unit_of_measurement": "GEB", "sales_quantity": 40 } ] }
Sample Response (Success 200)
{ "success": true, "message": "Outbound order replaced" }