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_tagRequiredStringThe 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_orderOptionalBooleanIndicates whether the order is a sample order:
  • true - The order is a sample order.
  • false - The order is not a sample order. Default setting.


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_underdeliveryOptionalBoolean

Enables you to deliver an unlimited amount for the order, ignoring the target quantity. The setting can be one of the following:

  • true - You can deliver an unlimited amount. The tolerances are not used.
  • false - You cannot deliver an unlimited amount and you need to keep the target quantity. Default setting. You need to set the overdelivery tolerance and underdelivery tolerance as described below. The default tolerance value is 0%.


If the field is not included in the request, the value is set to "false" with the default tolerance values.

overdelivery_toleranceOptionalNumber

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_toleranceOptionalNumber

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_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_quantityRequiredNumberThe 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"
}