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 Create Outbound Order request to Movilitas.Cloud by using the Serialized Logistics 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 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 POST method and the following URL:


https://api.movilitas.cloud/v1/serialized_logistics_agro/v1/api/outbound_order


2. For the header, define the following:


KeyAction
Content-TypeApply JSON format for the content. Use the value application/json.
x-access-tokenProvide the authentication token.


3. In the body of the request, define the parameters and their values based on the table below.


FieldRequired or Optional?TypeDescription
channel_keyRequiredStringThe channel key of your Serialized Logistics for Agro API channel. 
order_idRequiredStringOrder ID
order_typeRequiredString

The type of the order. Enter one of the following values:

  • Internal
  • External
order_exp_dateOptionalStringOrder expiration date. Free text field.
warehouse_tagRequiredStringIdentifies the warehouse.
allow_unlimited_overdelivery_underdeliveryOptionalBoolean

Enables you to deliver an unlimited amount for the order, ignoring the target quantity. The available values are "true" or "false".

  • When it is "false", you cannot deliver an unlimited amount and you need to keep the target quantity. You need to set the overdelivery tolerance and underdelivery tolerance as described below. 
  • When it is "true", you can deliver an unlimited amount. The tolerances are out of use.

The default value is "false" with 0% tolerance values, meaning that by default, unlimited delivery is not allowed and you need to keep the target quantity.

overdelivery_toleranceOptionalNumber

Overdelivery tolerance in percentage (%) for the order. Only applicable when "allow_unlimited_overdelivery_underdelivery" is set to "false".


The default value is 0. Only positive values are accepted and there is no upper limit.

underdelivery_toleranceOptionalNumber

Underdelivery tolerance in percentage (%) for the order. Only applicable when "allow_unlimited_overdelivery_underdelivery" is set to "false".


The default value is 0. Only positive values are accepted and there is no upper limit.

item_listRequiredObject[]

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:

  • You have two line items with the same product code and batch but with different sales parameters.
  • You have line items with completely different product codes, batches, and other data.
      item_numberRequiredStringLine item number
      product_codeRequiredStringProduct code as per the GS1 standard.
      product_code_typeRequiredStringProduct code type. The application supports one value, "GTIN".
      product_descriptionOptionalStringProduct description
      product_groupOptionalStringProduct group code (AGI code)
      product_group_typeOptionalStringProduct group type (AGI)
      product_group_descriptionOptionalStringProduct group description
      batchOptionalStringProduct batch
      unit_of_measurementRequiredStringThe unit of measurement for the quantity. For example, "Liter", "Pcs", or "Kg".
      quantityRequiredNumberThe quantity of the line item.
      sales_unit_of_measurementRequiredString

The sales unit of measurement for the sales quantity. Enter one of the following values:

  • IGB
  • GEB
  • PAL
  • LTR
  • KGM

      sales_quantityRequired
NumberThe sales quantity of the line item.


4. Send the request. After creation, the outbound order is listed under the Serialized Logistics for Agro application --> Outbound orders tab in Open status.


Sample cURL Request 


curl -X POST \
  https://api.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": "pK9RPfiLctzVn2cl5B2cqHCqrrLZouKxSBjynNEh",
    "order_id": "89002",
    "order_type": "External",
    "order_exp_date": "230409",
    "warehouse_tag": "DG_MVC_GREY",
    "allow_unlimited_overdelivery_underdelivery": "false",
    "overdelivery_tolerance": "2",
    "underdelivery_tolerance": "2",
    "item_list": [
        {
            "item_number": "0010",
            "product_code": "02562151256",
            "product_code_type": "GTIN",
            "product_description": "Herbicide 10L",
            "product_group": "00987865",
            "product_group_type": "AGI",
            "batch": "ENO9B5678",
            "unit_of_measurement": "Liter",
            "quantity": 1000,
            "sales_unit_of_measurement": "PAL",
            "sales_quantity": 2
        }
        
    ]
}




Sample Response (Success 200) 


{
    "success": true,
    "message": "Outbound order created"
}