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 create an outbound external transfer 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/transfer/external
2. For the header, define the content type (JSON), 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 |
---|---|
Content-Type | Apply JSON format for the content. Use the value application/json. |
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 |
---|---|
Content-Type | Apply JSON format for the content. Use the value application/json. |
Authorization | Provide the authentication token as Bearer <token>. |
x-channel-key | Provide the channel key of your Serialized Logistics V2 API channel. |
3. In the body of the request, define the parameters and their values based on the table below.
Field | Required or Optional? | Type | Description |
---|---|---|---|
purchase_order_id | Required | String | The purchase order ID. |
warehouse_tag | Required | String | The warehouse tag identifies the sending warehouse. Note: Make sure that you have registered the warehouse in the Serialized Logistics application --> Site management --> Warehouses tab and apply the value given in the Warehouse tag field. |
client_id | Required | String | The client ID identifies the client who purchased the order. Note: Make sure that you have registered the client in the Serialized Logistics application --> Site management --> Clients tab and apply the value given in the Client ID field. |
client_delivery_address_id | Optional | String | The client delivery address ID identifies the delivery address where the shipment is sent. Note: Make sure that you have registered the client delivery address for the client in the Serialized Logistics application --> Site management --> Clients --> Delivery addresses tab and apply the value given in the Delivery Address ID field. |
shipped_products | Required | Object[] | The object array of the products related to the order. Each product object contains the details of the product:
Note: If the product is aggregated into a container (SSCC) in Movilitas.Cloud, the application unpacks the product before creating the transfer. |
gtin | Required | String | Product code according to GTIN product code type. |
batches | Required | Object[] | The object array of the product batches. Each batch object contains the details of the batch:
|
batch | Required | String | Product batch as per the GS1 standard. |
expiration_date | Required | String | Product expiration date. GS1 format YYMMDD. For example, 2021 December 15 is "211215". |
serials | Required | String[] | The array of serial numbers. The serial numbers follow the GS1 standard. |
4. Send the request. The transfer is created that you can check under the Serialized Logistics application --> Transfers --> Outbound external --> Transfers tab. You can download the DSCSA EPCIS file about the transfer (USA).
Sample cURL Request
curl -X POST \ https://api.movilitas.cloud/v1/serialized_logistics/v2/api/outbound_orders \ -H 'Content-Type: application/json' \ -H 'x-access-token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJrZXkiOiJzX2FqazQyS2RLQWhHciE3TUZtY1Q2UzhTQ3NDQ2hzc2RoTXRFUlNBIUNwUDhlZDkzU2htQ0hoaHIyTmg3Y0dBIiwiX2lkIjoiNWQyNzA4ZDc3NDQ1OTcxYjI5MmY4ZDI3IiwiaWF0IjoxNTY0MDU5ODc2LCJleHAiOjE1NjQxNDYyNzZ9.TBMv71CaxCNtE1opQMk0f1ncfbnZ0Cwnu7MWkTzkQqA' \ -H 'x-channel-key: Ky1SpfEXmjj05fW3USBFD3pgoEi9AQ29Atsnj4Zy' \ -d '{ "purchase_order_id": "POAPI061501", "client_id":"maine-client-usa", "client_delivery_address_id":"202305032131", "warehouse_tag": "distributor-in-the-usa", "shipped_products": [ { "gtin": "30300040244510", "batches": [ { "batch": "0424C", "expiration_date": "270424", "serials": [ "3YZAB23061400", "3YZAB23061401" ] } ] } ] }'
Sample Response (Success 200)
{ "success": true, "message": "External transfer created" }
Admin UI Example
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. |
Request body could not be parsed | - | The syntax of the request body is not correct, for example, a comma is missing at the end of a field. Make sure that the request body is defined in the correct way and that you use JSON format. |
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. |
Some scanned items are unknown to the system. | - | The given product code is not known in Movilitas.Cloud. Make sure that you provide a product code that comes from an existing Advanced Shipping Notification in Movilitas.Cloud:
|
Some serial can't be added as it's status is not Assigned | - | The given serial numbers are not in the right status. In practice, it means the trade items are not registered in the Serialized Logistics application. Make sure that you provide a serial number that comes from an existing Advanced Shipping Notification in Movilitas.Cloud:
|
Some scanned items have different batch or expiry date in the system | - | The batch or expiration date in the request does not match the data stored in the Serialized Logistics application. The system returns the trade item data of conflicting batches and/or conflicting expiration dates. |
Item not in possession, please contact your administrator. | - | The given items are already shipped. You can ship items that are still in stock. |