You can use the Manufacturer V2 API to integrate the shopfloor and the enterprise resource planning (ERP) systems with the Serialized Manufacturing application.


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


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


The following figure provides an overview of all the requests that you can send by using the Manufacturer V2 API:




This article describes how to commission serials to Movilitas.Cloud for a specific product using the Manufacturer V2 API. Commissioning serials is essential before reporting the items to the markets.


You can commission any unique, GS1-compliant serial number, even external ones. After commissioning the external serial number, the serial number pool is updated in the background to ensure that all the serials are stored and unique in the system.


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


1. You must enable the Serialized Manufacturing application.

2. You must create an API key and secret. 

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

4. You must configure the Serialized Manufacturing application and the channels required to connect to external systems.

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 POST method and the following URL:


https://api.movilitas.cloud/v1/manufacturer/v2/api/serials/commission


2. For the header, define the following:


KeyAction
Content-TypeApply JSON format for the content. Use the value application/json.
x-access-tokenProvide the authentication token.
x-channel-keyProvide the channel key of your Manufacturer V2 API channel.


3. In the body of the request, define the parameters and their values based on the table below.


FieldRequired or Optional?TypeDescription
product_code
RequiredStringProduct code
product_code_schema
RequiredStringProduct code schema. The application supports one value, "GTIN".
batch
Required
StringProduct batch
expiry_dateRequiredStringProduct expiry date (YYMMDD)
serialsRequiredString[]The array of serials to be commissioned.


4. Send the request.


Sample cURL Request



curl -X POST \
  https://api.movilitas.cloud/v1/manufacturer/v2/api/serials/commission \
  -H 'Content-Type: application/json' \
  -H 'x-access-token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJrZXkiOiJzX2FqazQyS2RLQWhHciE3TUZtY1Q2UzhTQ3NDQ2hzc2RoTXRFUlNBIUNwUDhlZDkzU2htQ0hoaHIyTmg3Y0dBIiwiX2lkIjoiNWQyNzA4ZDc3NDQ1OTcxYjI5MmY4ZDI3IiwiaWF0IjoxNTY0MDU5ODc2LCJleHAiOjE1NjQxNDYyNzZ9.TBMv71CaxCNtE1opQMk0f1ncfbnZ0Cwnu7MWkTzkQqA' \
  -H 'x-channel-key: Ky1SpfEXmjj05fW3USBFD3pgoEi9AQ29Atsnj4Zy' \
  -d '{
    "product_code": "01234567891234",
    "product_code_schema": "GTIN",
    "batch": "BATCH002",
    "expiry_date": "221115",
    "serials": [
        "ZQGR6410LZTYTAQJ9V9L",
        "T5KJ35SROE4C471HKAD5",
        "SV902P05IYI4ARW5WWHJ",
        "DI8U86IYQI9KS4G87WGI"
    ]
}'



Sample Response (Success 200) 


{
    "success": true,
    "message": "Serials commissioned",
    "data": [
        {
            "serial_number": "DI8U86IYQI9KS4G87WGI",
            "status": "Assigned"
        },
        {
            "serial_number": "SV902P05IYI4ARW5WWHJ",
            "status": "Assigned"
        },
        {
            "serial_number": "T5KJ35SROE4C471HKAD5",
            "status": "Assigned"
        },
        {
            "serial_number": "ZQGR6410LZTYTAQJ9V9L",
            "status": "Assigned"
        }
    ]
}


5. Commission the packs and report to a market under the Serialized Manufacturing application --> Commissioning tab.


IMPORTANT: In partnership mode, the Contract Manufacturing Organization (CMO) sending the request over API cannot see the packs under the Serialized Manufacturing application --> Commissioning tab. The CMO is not authorized to release the packs to the market. Only the Marketing Authorization Holder (MAH) is authorized to release the packs to the market. The packs are visible in the MAH view and the MAH can release them to the market.




Error Types and Resolution


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


Error TypeDescription
ProductErrorThe product does not exist. Register the product in the Serialized Manufacturing application --> Products tab in the Admin UI.
NoTokenErrorNo authentication token is provided. Ensure that you add the authentication token to the header of the request.
InvalidTokenError
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.
ValidationErrorThe data or its format is not valid. Make sure you give the data in JSON format as described above.