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 request the addresses of a client 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-acc.movilitas.cloud/v1/serialized_logistics/v2/api/clients/get_by_client_id/:client_id


2. Define the path variable.


KeyRequired or Optional?TypeAction
client_idRequiredStringProvide the client ID.

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 in the client master data.


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. Leave the body of the request empty.


5. Send the request. 


Sample cURL Request  


curl -X GET 'https://api-acc.movilitas.cloud/v1/serialized_logistics/v2/api/clients/get_by_client_id/california-client-usa' \
-H 'x-access-token: eyJhbGciOiJIUtI1NiIsInR5cCI6IkpXVCJ1.eyJrZXkiPiJqNlBFYXJiWE' \
-H 'x-channel-key: 1NRtO5Jr2ET0S05ktokAz2s7ynSuLwByDlZMib9k'


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.
dataObjectThe client address details.
    nameStringThe name of the client.
    addressObjectThe client master data address (sold-to address) object. If a field is not populated, Movilitas.Cloud returns "null".
          cityStringThe city in the client master data address.
         street_line_01StringThe street line 1 in the client master data address.
         street_line_02StringThe street line 2 in the client master data address.
         street_line_03StringThe street line 3 in the client master data address.
         stateStringThe state in the client master data address.
         postal_codeStringThe postal code in the client master data address.
         countryStringThe country in the client master data address.
    delivery_addressObject[]The object array of the client delivery addresses. Each object contains the details of a client delivery address.
  • Delivery address ID
  • City
  • Street (Line 1, 2, and 3)
  • State
  • Postal code
  • Delivery address name
  • Country


If a field is not populated, Movilitas.Cloud returns "null".

         delivery_address_idStringThe ID of the client delivery address.
         cityStringThe city in the client delivery address.
         street_line_01StringThe street line 1 in the client delivery address.
         street_line_02StringThe street line 2 in the client delivery address.
         street_line_03StringThe street line 3 in the client delivery address.
         stateStringThe state in the client delivery address.
         postal_codeStringThe postal code in the client delivery address.
         delivery_address_nameStringThe name of the client delivery address.
         countryStringThe country in the client delivery address.


Sample Response


{
    "success": true,
    "message": "Client master data",
    "data": {
        "name": "California Client USA",
        "address": {
            "city": "Los Angeles",
            "street_line_01": "15 Superstar Street",
            "street_line_02": null,
            "street_line_03": null,
            "state": "CA",
            "postal_code": "3420",
            "country": "United States"
        },
        "delivery_address": [
            {
                "delivery_address_id": "202201312322",
                "city": "Los Angeles",
                "street_line_01": "100 Central Depo",
                "street_line_02": null,
                "street_line_03": null,
                "state": "CA",
                "postal_code": "3422",
                "delivery_address_name": "CA Client Delivery",
                "country": "United States"
            },
            {
                "delivery_address_id": "2023120802",
                "city": "San Jose",
                "street_line_01": "23123 Depo Lane",
                "street_line_02": null,
                "street_line_03": null,
                "state": "CA",
                "postal_code": "23534",
                "delivery_address_name": "SJ Client Delivery 2",
                "country": "United States"
            }
        ]
    }
}


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.
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.
Client doesn't exist-The client cannot be found in Movilitas.Cloud.

Make sure that you provide a client ID that points to an existing client in Movilitas.Cloud. To verify the client ID, find the client under the Site management --> Clients tab in the Admin UI and check the client master data settings.