You can use the Serialized Logistics V2 API to integrate the third-party systems with the Serialized Logistics application.


The Serialized Logistics V2 API uses the Representational State Transfer (REST) standard to interact with other systems.


The Serialized Logistics V2 API is an extension of the Serialized Logistics application of Movilitas.Cloud and enables you to send requests from external systems to the application.


This article describes how to receive an EPCIS file in Movilitas.Cloud by using the Serialized Logistics V2 API.


API Tool to Use


In this document, we provide examples by using the cURL command-line tool. To send the API request, you can find a lot of user-friendly REST API tools on the Internet, for example, Postman.


Before You Begin


Before you start sending any messages:


1. You must enable the Serialized Logistics application in the Admin UI.

2. You must create an API key and secret. 

3. You must create a shopfloor channel with Serialized Logistics V2 API source. You will need the channel key for your requests.

4. You must configure the Serialized Logistics application.

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/v2/api/suppliers/receive_epcis_file/


2. Define the query params. Add the following key-value pairs:


KeyValue
messagetypeepcis
formatxml


3. For the header, define the authentication token and the channel key. The token can be given in one of the following ways:

  • As x-access-token header.
  • As Authorization header by using the Bearer schema.


Header Option 1:


KeyAction
x-access-tokenProvide the authentication token.
x-channel-keyProvide the channel key of your Serialized Logistics V2 API channel.


Header Option 2:


KeyAction
AuthorizationProvide the authentication token as Bearer <token>.
x-channel-keyProvide the channel key of your Serialized Logistics V2 API channel.


4. Provide the body of the request in the form-data format. Specify the key-value pair as follows:


KeyKey TypeAction
fileFileProvide the file path / Select the file on your local computer.


5. Send the request. Movilitas.Cloud processes the EPCIS file:

  • The request is logged on the related Serialized Logistics V2 API channel.
  • The EPCIS file is linked to the sender (supplier) in the Serialized Logistics application. Find the supplier and verify the result under the Site management --> Suppliers --> Uploads tab.


Sample cURL Request 


curl --location 'https://api.movilitas.cloud/v1/serialized_logistics/v2/api/suppliers/receive_epcis_file/?messagetype=epcis&format=xml' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1MiIsInR5cCI6IkpXVDJ9.eyJrZVkiOiJqNlBFYXJiVEdUR1A5UEVtRS1rYlJmaEs2NWdDQ0UqQ19fNW1lZkVDS240MkJf' \
--header 'x-channel-key: 6WVJmzYsqlyZwgQGQ6tD590whpotaQMH0HIzqMIT' \
--form 'file=@"/C:/Users/JohnDoe/Documents/import_sscc_containing_two_products_test_EPCIS_receive_over_API.xml"'

The application sends back a response that contains the following fields in the body:


FieldTypeDescription
successBooleanIndicates whether the request was successful (true) or not (false).
messageStringMessage response.


Sample Response (Success 200) 


{
    "success": true,
    "message": "EPCIS file received"
}


Admin UI - Result After the Request is Sent


The following example illustrates the log about the EPCIS message on the respective Serialized Logistics V2 API channel. The log is collected at the bottom of the page in the EPCIS messages table. To find the log, data from the EPCIS file - for example, an SGTIN (product code and serial number) - is entered in the search field:



The following example illustrates the log on the supplier's page in the Serialized Logistics application:



Errors and Resolution


This section lists some of the most general error messages or error types when sending the request.


Error Message or Error TypeError CodeDescription
No token providedERR0001No authentication token is provided. Ensure that you add the authentication token to the header of the request.
Failed to authenticate tokenERR0000Failed to authenticate the provided token. Double-check if your token has expired or has been revoked. Obtain a valid token by generating a static one or by getting a dynamic one through Authentication API.
Channel ID is missing or it needs to be in correct format-The channel key of your Serialized Logistics V2 API channel is not specified in the request. To get the channel key, go to Tenant Dashboard --> Channels in the Admin UI, open your Serialized Logistics V2 API channel, and find the channel key on the top of the Edit shopfloor channel panel.
No matching supplier for sender GLN
-The sender in the EPCIS file (supplier) is unknown in the Serialized Logistics application. Make sure that the supplier is registered with the SGLN (location data) in the Serialized Logistics application.
No matching warehouse for receiver GLN-The receiver in the EPCIS file (warehouse) is unknown in the Serialized Logistics application. Make sure that the warehouse is registered with the SGLN (location data) in the Serialized Logistics application.