You can use the Manufacturer for Pharma API to integrate the third-party systems with the Manufacturer for Pharma application.


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


The Manufacturer for Pharma API is an extension of the Manufacturer for Pharma application of Movilitas.Cloud and enables you to send requests from external systems to the application.


This article describes how to request the open production orders and move them to Pending Release status in Movilitas.Cloud by using the Manufacturer for Pharma API.


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


Before you start sending any messages:


1. You must enable the Manufacturer for Pharma application in the Admin UI.

2. You must create an API key and secret. 

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

4. You must configure the Manufacturer for Pharma 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 the GET method and the following URL:


https://api.movilitas.cloud/v1/manufacturer/v1/api/request_open_orders


2. In the query string params, define the following:


KeyAction
channel_keyProvide the channel key of your Manufacturer for Pharma API channel. 


3. 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.


4. Leave the body of the request empty.


5. Send the request. The orders that are in Open status go to Pending Release status.



Sample cURL Request


curl -X GET 'https://api.movilitas.cloud/v1/manufacturer/v1/api/request_open_orders?channel_key=vZ3CLygFckqG9cKXbrnSIVGVm3z3nQW87lNsfU7U' \
  -H 'Content-Type: application/json' \
  -H 'x-access-token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJrZXkiOiJzX2FqazQyS2RLQWhHciE3TUZtY1Q2UzhTQ3NDQ2hzc2RoTXRFUlNBIUNwUDhlZDkzU2htQ0hoaHIyTmg3Y0dBIiwiX2lkIjoiNWQyNzA4ZDc3NDQ1OTcxYjI5MmY4ZDI3IiwiaWF0IjoxNTYzOTU3MjA4LCJleHAiOjE1NjQwNDM2MDh9.dYGzl-K1UT8jAeb-XQ0n_chI8VJzKRJiXhtnU4GenPc' \
  


Sample Response (Success 200)


{
   "success": true,
   "message": "Open production orders requested",
   "data": [
        {
             "_id": "5ffdd6ea6ae6f50436b89e7d",
             "amount": 10,
             "extra_percentage": 10,
             "order_id": "Order004",
             "description": "Pharma Product 001",
             "batch": "LOT1234",
             "expiry_date": "220904",
             "gtin": "01234567891122"
        }
   ]
}