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 fill the SSCC pool with SSCCs from the SAP AII system by using the Receive SSCCs request through the Serialized Logistics for Agro API.

  1. You need to request SSCCs by using the Request SSCCs option under the Serialized Logistics for Agro application --> SSCC pool tab. The request is sent to the SAP AII system with a request ID.
  2. The SAP AII system sends the Receive SSCCs request as an asynchronous response through the Serialized Logistics for Agro API. The response must contain the request ID and the list of SSCCs that will be stored in the application in Available status.


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. Request SSCCs by using the Request SSCCs option under the Serialized Logistics for Agro application --> SSCC pool tab.


2. Open the API tool, and use the POST method and the following URL:


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


3. For the header, define the following:


KeyAction
Content-Type
Apply JSON format for the content. Use the value application/json.
x-access-token
Provide the authentication token.


4. 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.
request_idRequiredStringRequest ID from the request message sent to the SAP AII system.
ssccsRequiredString[]The array of SSCCs to be stored in the application.


5. Send the request. The SSCC pool is updated with the SSCCs. For more information, see the Serialized Logistics for Agro application --> SSCC pool tab.



Sample cURL Request  


curl -X POST \
  https://api.movilitas.cloud/v1/serialized_logistics_agro/v1/api/receive_ssccs \
  -H 'Content-Type: application/json' \
  -H 'x-access-token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJrZXkiOiJzX2FqazQyS2RLQWhHciE3TUZtY1Q2UzhTQ3NDQ2hzc2RoTXRFUlNBIUNwUDhlZDkzU2htQ0hoaHIyTmg3Y0dBIiwiX2lkIjoiNWQyNzA4ZDc3NDQ1OTcxYjI5MmY4ZDI3IiwiaWF0IjoxNTYzOTU3MjA4LCJleHAiOjE1NjQwNDM2MDh9.dYGzl-K1UT8jAeb-XQ0n_chI8VJzKRJiXhtnU4GenPc' \
  -d '{
    {
    "channel_key": "Y9p2PPCBNBuGBMpdc0tZpU7oJM2IHjitUd1awPIT",
    "request_id": "20201123161930",
      "ssccs": [
           "000000000000000002",
           "000000000000000003"
       ]
    }
}'



Sample Response (Success 200) 


{
    "success": true,
    "message": "SSCCs received",
    "data": [
          "000000000000000002",
          "000000000000000003"
    ]
}