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 pack serial shipping container codes (SSCCs) or packs into an SSCC, or multiple packs into a pack 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 POST method and the following URL:
https://api.movilitas.cloud/v1/manufacturer/v1/api/pack
2. For the header, define the following:
Key | Action |
---|---|
Content-Type | Apply JSON format for the content. Use the value application/json. |
x-access-token | Provide the authentication token. |
3. In the body of the request, define the parameters and their values based on the table below.
Field | Required or Optional? | Type | Description |
---|---|---|---|
channel_key | Required | String | The channel key of your Manufacturer for Pharma API channel. |
parent_pack | Optional | Object | Parent pack data |
product_code | Required | String | Product code of the parent pack |
serial_number | Required | String | Serial number of the parent pack |
schema | Optional | String | Product schema of the parent pack |
batch | Optional | String | Batch number of the parent pack |
expiry_date | Optional | String | Expiration date of the parent pack |
parent_sscc | Optional | String | SSCC number of the parent container |
ssccs | Optional | String[] | Array of child SSCCs to be packed. It can only be used if the parent is an SSCC, as packs cannot contain SSCCs. |
packs | Optional | Object[] | Array of child pack objects to be packed. It can be used if the parent is an SSCC or if the parent is another pack. |
product_code | Required | String | Product code of the child pack |
serial_number | Required | String | Serial number of the child pack |
schema | Optional | String | Product schema of the child pack |
batch | Optional | String | Batch number of the child pack |
expiry_date | Optional | String | Expiration date of the child pack |
4. Send the request.
Sample cURL Request
curl --location --request POST 'https://api.movilitas.cloud/v1/manufacturer/v1/api/pack' \ --header 'Content-Type: application/json' \ --header 'x-access-token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJrZXkiOiJCdGRqQV9QdCo5cG5lUFQtSG5EYkFHRmY5OUhqOGo0ZDQ3TWJSNEI0QyFIUk1HKl9hQjU2czlULUs5LWRIbS1yIiwiX2lkIjoiNWUxZWQ1NWEwMzQxMjYwNDc1MjY4MjkwIiwiaWF0IjoxNTgwNzIyMjYzLCJleHAiOjE1ODA4MDg2NjN9.qDQHjXL2yj-idULroAjnhka2CDcCRwxejkpVRNa-JOg' \ --data-raw '{ "channel_key": "Ky1SpfEXmjj05fW3USBFD3pgoEi9AQ29Atsnj4Zy", "parent_sscc": "312345600000050599", "ssccs": [ "312345600000050605" ] }'
Sample Response (Success 200)
{ "success": true, "message": "Items were packed successfully", "data": { "parent": { "sscc": "312345600000050599" }, "packed_SSCCs": [ "312345600000050605" ], "packed_packs": [] } }