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 get all non-received EPCIS files from 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 GET method and the following URL:
https://api.movilitas.cloud/v1/serialized_logistics/v2/api/suppliers/get_all_non_received_epcis
2. Define the query params.
Key | Required or Optional? | Type | Action |
---|---|---|---|
supplier_tag | Required | String | Provide the supplier tag that identifies your supplier. Note: Make sure that you have registered the supplier in the Serialized Logistics application --> Site management --> Suppliers tab and apply the value given in the Supplier tag field. |
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:
Key | Action |
---|---|
x-access-token | Provide the authentication token. |
x-channel-key | Provide the channel key of your Serialized Logistics V2 API channel. |
Header Option 2:
Key | Action |
---|---|
Authorization | Provide the authentication token as Bearer <token>. |
x-channel-key | Provide the channel key of your Serialized Logistics V2 API channel. |
4. Leave the body of the request empty.
5. Send the request.
Sample cURL Request
curl -X GET \ https://api.movilitas.cloud/v1/serialized_logistics/v2/api/suppliers/get_all_non_received_epcis?supplier_tag=supplier-for-distributor-usa \ -H 'x-access-token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJrZXkiOiJzX2FqazQyS2RLQWhHciE3TUZtY1Q2UzhTQ3NDQ2hzc2RoTXRFUlNBIUNwUDhlZDkzU2htQ0hoaHIyTmg3Y0dBIiwiX2lkIjoiNWQyNzA4ZDc3NDQ1OTcxYjI5MmY4ZDI3IiwiaWF0IjoxNTY0MDU5ODc2LCJleHAiOjE1NjQxNDYyNzZ9.TBMv71CaxCNtE1opQMk0f1ncfbnZ0Cwnu7MWkTzkQqA' \ -H 'x-channel-key: Ky1SpfEXmjj05fW3USBFD3pgoEi9AQ29Atsnj4Zy'
The application sends back a response that contains the following fields in the body:
Field | Type | Description |
---|---|---|
success | Boolean | Indicates whether the request was successful (true) or not (false). |
message | String | Message response. |
data | Object[] | The object array that contains the details of each non-received EPCIS file. |
epcis_object_id | String | The identifier of the EPCIS file upload. The identifier is necessary to mark the EPCIS file as received in Movilitas.Cloud at the end of the receiving process. |
products | Object[] | The object array of the products. Each product object contains the details of a product:
Note: The application returns the top-level trade items only. Containers (SSCCs) are not returned. |
code | String | The product code (GTIN). |
batches | Object[] | The object array of the batches. Each batch object contains the details of a batch:
|
id | String | The batch ID. |
expiration_date | String | Product expiration date. GS1 format YYMMDD. For example, 2021 December 15 is "211215". |
serials | String[] | The array of serial numbers. The serial numbers follow the GS1 standard. |
Sample Response (Success 200)
{ "success": true, "message": "Successfully retrieved all Non-Received EPCIS files", "data": [ { "epcis_object_id": "6707c66a6735572c348db286", "products": [ { "code": "30300024463302", "batches": [ { "id": "0612C", "expiration_date": "270612", "serials": [ "3GZRA24101000", "3GZRA24101001", "3GZRA24101002", "3GZRA24101003" ] } ] }, { "code": "50300090260014", "batches": [ { "id": "0612A", "expiration_date": "250612", "serials": [ "5GHTZ0024101000" ] } ] }, { "code": "50300238842058", "batches": [ { "id": "0612B", "expiration_date": "260612", "serials": [ "5YTRW1124101000" ] } ] } ] }, { "epcis_object_id": "67b87273b2b12a7acd8d1280", "products": [ { "code": "30300040068017", "batches": [ { "id": "0821B", "expiration_date": "270821", "serials": [ "3PFWE2502210", "3PFWE2502211" ] }, { "id": "0821C", "expiration_date": "280821", "serials": [ "3ZSWQ2502210", "3ZSWQ2502211" ] } ] }, { "code": "30300040039093", "batches": [ { "id": "0821A", "expiration_date": "260821", "serials": [ "3GXAS2502210", "3GXAS2502211" ] } ] } ] } ]
Errors and Resolution
This section lists some of the most general error messages or error types when sending the request.
Error Message or Error Type | Error Code | Description |
---|---|---|
No token provided | ERR0001 | No authentication token is provided. Ensure that you add the authentication token to the header of the request. |
Failed to authenticate token | ERR0000 | Failed 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. |
Validation error | - | The given data is invalid. It does not follow the required data type or pattern. The response includes details about the specific issue. Follow the explanation in the response and correct your data. |
Supplier not found | - | The system cannot identify the supplier based on the given supplier tag. The supplier is not registered or the supplier is registered but lacks the supplier tag. Go to the Serialized Logistics application --> Site management --> Suppliers tab in the Admin UI and complete the supplier registration before sending the request over API. Make sure that you specify a supplier tag and that you use this tag in your request over API. |
EPCIS not found with specified Supplier Tag | - | The supplier does not have any EPCIS file upload.
|