NHLMIS-integration-api

Version: draft

The Field Supply Web API for the NHLMIS exists to enable integration with external stock reporting and tendering systems like ONE network.

PSM 3PLs need to be able to read LMD orders from Field Supply once they're finalised, so that they can be fulfilled. These orders will be dispatched to the relevant 3PL managing the necessary warehouse and transport legs. 3PLs can update inventory levels in NHLMIS for certain warehouses.

This documentation is intended to aid technical audiences to implement an integration of an external system carrying stock levels with the NHLMIS by sending a stock report to the system to update the stock levels of one or more products in a location.

Schemes: https

Summary

Tag: orders

The /orders endpoint allows for sequential polling and updating of deployment orders. Implementers can look up information about accepted orders in Field Supply, and then complete or cancel these orders by sending information about the shipment or a cancellation request. In case an order is completed, Field Supply will also create a shipment record matching the deployment order.

Operation Description
GET /orders

Retrieve a list of accepted orders

GET /orders/{suborderId}

Retrieve a single deployment order

PATCH /orders/{suborderId}

Update a deployment order

Tag: stock-counts

The /stock-counts API allows implementers to look up the latest recorded stock levels at locations, and to perform updates on these levels in batch. It also allows the retrieval of batched inventory stock for the last reporting cycle.

Operation Description
POST /stock-counts

Submit a batched list of inventory levels

GET /stock-counts

Retrieves a list of stock counts including batch information within the last 12 months.

Tag: locations

The /locations API provides read-only access to information about service locations by PSM Warehouse Code.

Operation Description
GET /locations

Retrieve a filterable list of locations

GET /locations/{identifier}

Retrieve a location document

Tag: products

The /products endpoint provides read-only access to information about products.

Operation Description
GET /products

Retrieve a filterable list of products

GET /products/{productId}

Retrieve a single product

Tag: batches

The /batches endpoint provides access to information about existing product batches as well as the possibility to add new or update batches for an existing product.

Operation Description
GET /batches

Retrieve a list of product batches.

POST /batches

Create new or update product batch

Tag: services

The /services endpoint provides read-only access to information about services.

Operation Description
GET /services

Retrieve a list of available services.

GET /services/{serviceId}

Retrieve a service by service id

Security

apiKeyAuth

Type: apiKey
Name:

x-api-key

In:

header

Description:

Authentication is done using an API key tied to your application’s security scope which is expected to be sent in the request's x-api-key header. This key is tied to a location, program(s) and optionally funder(s). Here is an example key you can use to test the API on the development server at https://dev.api.nscip.field.supply/v1:

LXXmQYQZdi2zHVhxjF3XG35URVuJr2ph4PLAU8P1
    

Note this API Key is tied to the national location, so the returned datasets might be very big.

You can test if your API key is working by doing a simple GET request for a product:

curl -X GET \
https://dev.api.nscip.field.supply/v1/products/product:100000DGA04S04K \
-H 'x-api-key: <api_key_value>'

Paths

Retrieve a list of product batches.

GET /batches

Tags: batches

In case filtering is applied, all three parameters are needed in order to yield a successful response. This response will then contain a single batch document only.

productId

id of the product to look up

query string
manufacturer

id of the manufacturer to look up

query string
batchNo

batch number to look up

query string
alias

If set to "none" the endpoint will expects PSM product codes instead of ONE ItemIds in the productId field.

query string , x ∈ { one , none }

application/json

200 OK

Return a list of batches

batches: object[]
apiKeyAuth read
Create new or update product batch

POST /batches

Tags: batches

Send information about a new batch for a product that already exists in the database.

In case the sent information matches a batch that already exists, the existing batch will be updated and returned.

The product batch to create or update

alias

If set to "none" the endpoint will expects PSM product codes instead of ONE ItemIds in the productId field.

query string , x ∈ { one (default) , none }
updatedAliasId

If set, the endpoint would update the batch alias with this value

query string

application/json

201 Created

Return a newly created or an updated batch

400 Bad Request

Sent payload could not be processed successfully

apiKeyAuth read , write
Retrieve a filterable list of locations

GET /locations

Tags: locations

Get a list of locations, filtered by the given query parameters.

serviceId

id of the service to filter against

query string

application/json

200 OK

Return a list of locations

locations: object[]
apiKeyAuth read
Retrieve a location document

GET /locations/{identifier}

Tags: locations

Look up information about a location.

identifier

PSM warehouse code of the location to look up

path string
useWarehouseCodes

If set to "false" the endpoint will expect a Field Supply location id instead of a PSM warehouse code for looking up the target location.

query string , x ∈ { true (default) , false }

application/json

200 OK

Return location document

404 Not Found

No such location

apiKeyAuth read
Retrieve a list of accepted orders

GET /orders

Tags: orders

On default, this endpoint returns a list of all suborder whose parent orders are of status accepted. The suborder can have a closedStatus of packed, in-transit, received or failed in case it has already been completed.

If the status parameter is set to "new", orders instead will be of status "new", and other statuses will be filtered out.

Each response will contain a sequence identifier that can be used by implementers to periodically poll for updated orders. In case the returned sequence number is passed to a later request using the since parameter, the response will only include orders that have been created or transitioned state since.

A response will contain at most 50 suborders. In case there are more entities currently available (which is signalled by the value of pending being true), the returned sequence identifier will immediately yield more suborders when passed to a subsequent call.

since

A sequence identifier defining a previously polled state from which to include updates.

query string
limit

If given, limits the response to contain at most n items. Defaults to 50.

query number
alias

If set to "none" the endpoint will expects PSM product codes instead of ONE ItemIds in the batch and product identifiers sent.

query string , x ∈ { one (default) , none }
status

If set to "new" the endpoint will return orders not yet submitted to the regional step.

query string , x ∈ { accepted (default) , new }
programId

If set, orders will be filtered to only those on the given NHLMIS program ID

query string , x ∈ { program:hiv-aids , program:family-planning , program:malaria }
funderId

If set, orders will be filtered by funder ID

query string , x ∈ { funder:global-fund }
geolocationId

If set, "geolocationId" will filter orders by the given NHLMIS platform state identifier.

query string , x ∈ { zone:north-central:state:benue , zone:north-central:state:fct , zone:north-central:state:kogi , zone:north-central:state:kwara , zone:north-central:state:nasarawa , zone:north-central:state:niger , zone:north-central:state:plateau , zone:north-east:state:adamawa , zone:north-east:state:bauchi , zone:north-east:state:borno , zone:north-east:state:gombe , zone:north-east:state:taraba , zone:north-east:state:yobe , zone:north-west:state:jigawa , zone:north-west:state:kaduna , zone:north-west:state:kano , zone:north-west:state:katsina , zone:north-west:state:kebbi , zone:north-west:state:sokoto , zone:north-west:state:zamfara , zone:south-east:state:abia , zone:south-east:state:anambra , zone:south-east:state:ebonyi , zone:south-east:state:enugu , zone:south-east:state:imo , zone:south-south:state:akwa-ibom , zone:south-south:state:bayelsa , zone:south-south:state:cross-river , zone:south-south:state:delta , zone:south-south:state:edo , zone:south-south:state:rivers , zone:south-west:state:ekiti , zone:south-west:state:lagos , zone:south-west:state:ogun , zone:south-west:state:ondo , zone:south-west:state:osun , zone:south-west:state:oyo }
closedStatus

When not set, defaults to filtering out orders with any "closedStatus". If set, orders will be filtered to only those with the given "closedStatus"

query string , x ∈ { in-transit , packed , received , failed }
useGenericParent

If set to true, will return the products at the generic parent level, and the quantities will be converted to the generic parent level.

query boolean

application/json

200 OK

Returns a list of orders

sequence: string
pending: bool
orders: object[]
apiKeyAuth read
Retrieve a single deployment order

GET /orders/{suborderId}

Tags: orders

Get the document for the deployment order specified by the given suborderId

suborderId path string
alias path string one
useGenericParent

If set to true, will return the products at the generic parent level, and the quantities will be converted to the generic parent level.

path boolean

application/json

200 OK

Returns a deployment order

404 Not Found

Requested deployment order was not found

apiKeyAuth read
Update a deployment order

PATCH /orders/{suborderId}

Tags: orders

Complete or cancel a deployment order by suborderId, adding the given information and updating product counts. When an order is completed, Field Supply will also create a matching shipment record from the order's origin to the order's destination, containing the deployed products.

application/json

suborderId path string
alias path string one
useGenericParent

If set to true, will return the products at the generic parent level, and the quantities will be converted to the generic parent level.

path boolean

application/json

200 OK

Successfully updated order and return the updated model

order: Order
shipment: string

In case the update successfully closed the suborder, this field will contain the matching Field Supply shipment id.

400 Bad Request

Could not update shipment as given payload was invalid

apiKeyAuth read , write
Retrieve a filterable list of products

GET /products

Tags: products

This endpoint is used to find a set of products that matches a service or all products that Field Supply is currently tracking.

serviceId

id of the service to filter against

query string
expanded

if set to true, will return additional data for each product: genericFactor, genericParent, aliases, programs (array of program IDs)

query boolean

application/json

200 OK

Return a list of products

products: object[]
apiKeyAuth read
Retrieve a single product

GET /products/{productId}

Tags: products

This endpoint enables implementers to look up information about a single product in the Field Supply database.

productId

id of the requested product

path string

application/json

200 OK

Return a single products

apiKeyAuth read
Retrieve a list of available services.

GET /services

Tags: services

Implementers can use this endpoint to retrieve information about which services are available in Field Supply.

application/json

200 OK

Return a list of services

services: object[]
apiKeyAuth read
Retrieve a service by service id

GET /services/{serviceId}

Tags: services

Implementers can use this endpoint to retrieve information about a specific service and the products that are associated with it.

application/json

200 OK

Return a services

404 Not Found

Service not found

apiKeyAuth read
Retrieves a list of stock counts including batch information within the last 12 months.

GET /stock-counts

Tags: stock-counts

Retrieves a list of inventory updates.

This API endpoint returns the latest inventory stock on a given location and service within the last 12 months.

location

This is the warehouse ID. You can get this by querying the "/locations" endpoint and copying the warehouse ID.

query string
service

This is the service we are retrieving inventory stock quantity

query string
200 OK

Returns a batched inventory stock quantity in the specified warehouse

404 Not Found

Location or Service not found

apiKeyAuth read
Submit a batched list of inventory levels

POST /stock-counts

Tags: stock-counts

Submit a list of inventory updates. In case these updates contain product batches that do not exist in the database yet, the implementer needs to create these batches using the /batches endpoint beforehand.

The update will be tied to the given funderId and programId.

application/json text/csv

A list of stock counts to be created or updated

stockCounts: object[]
alias

If set to "none" the endpoint will return PSM product codes instead of ONE ItemIds in the product identifiers sent.

query string , x ∈ { one (default) , none }
useWarehouseCodes

If set to "false" the endpoint will expect a Field Supply location id instead of a PSM warehouse code for looking up the target location.

query string , x ∈ { true (default) , false }

application/json

201 Created

Stock count data successfully submitted

stockCounts: object[]
400 Bad Request

Submitted data was invalid

apiKeyAuth read , write

Schema definitions

Batch: object

{
"expiry": "2025-01-01T00:00:00.000Z",
"id": "product:100019AAA08A02B:manufacturer:micro-labs:batchNo:037G5022",
"manufacturer": "Micro Labs",
"productId": "product:100019AAA08A02B"
}
id: string
manufacturer: string
productId: string
expiry: string

BatchUpdate: object

{
"batchNo": "1222333/45",
"expiry": "2021-05-22T12:32:28.123Z",
"manufacturer": "Aurobindo",
"productId": "product:100002AAA07G04K"
}
message: object

Add updatedAliasId as queryparams while updating alias using the API. Example, /batches?updatedAliasId=GGG-MAL4444. Without updatedAliasId, alias update will not work.

productId: string
manufacturer: string
batchNo: string
expiry: string

Error: object

{
"errors": [
{
"dataPath": ".receiptData.closedStatus",
"keyword": "enum",
"message": "should be equal to one of the allowed values",
"params": {
"allowedValues": [
"received",
"failed",
"in-transit"
]
}
,
"schemaPath": "#/properties/receiptData/properties/closedStatus/enum"
}
]
,
"message": "Validating the payload against the defined schema failed."
}
message: string

A message explaining the error that prevented the request from being successfully processed.

errors: object[]

An optional array of objects giving further information about the error. This will likely contain information about payloads that failed schema validation.

object

Location: object

{
"id": "zone:north-central:state:plateau:lga:wase:sdp:cottage-hospital-wase",
"level": "sdp",
"location": {
"country": "ng",
"id": "country:ng:zone:north-central:state:plateau:lga:wase",
"lga": "wase",
"sdp": "cottage-hospital-wase",
"state": "plateau",
"zone": "north-central"
}
,
"name": "Wase - Cottage Hospital Wase",
"services": [
"program:family-planning:service:family-planning",
"program:tb:service:dstb",
"program:tb:service:laboratory-microscopy"
]
,
"tracksBatches": false,
"warehouseCode": "PSM/PLT/17/002"
}
id: string
name: string
location: object
services: string[]
string
level: string
warehouseCode: string
tracksBatches: boolean

Order: object

{
"additionalData": {
"remark": "all went well",
"updatedAt": "2018-12-20T14:01:03.462Z"
}
,
"closedStatus": "received",
"createdAt": "2018-11-01T00:00:00.000Z",
"destinationId": "zone:south-south:state:akwa-ibom:lga:abak:sdp:general-hospital-ukpom-abak",
"destinationWarehouseCode": "PSM/AKB/01/004",
"funderId": "funder:usaid",
"orderId": "-OfCX3EhVwhn",
"productQuantities": {
"product:100000DGA04S04K": 3883,
"product:100000DGA04S09G": 4054
}
,
"programId": "program:hiv-aids",
"route": "sampleRouteName",
"routeId": "route:0192ed1b-6d86-4f79-8989-d253e4c3a551",
"status": "accepted",
"suborderId": "VlmNxW0Yee",
"supplierId": "zone:north-central:name:abuja-mds",
"supplierWarehouseCode": "DC-301 :: MDS Abuja",
"updatedAt": "2019-03-01T00:00:00.000Z",
"version": "1.0.0"
}
destinationId: string

The destination of the suborder, represented as a Field Supply location id.

destinationWarehouseCode: string

The destination of the suborder, represented as a PSM Warehouse Code.

supplierId: string

The supplier of the suborder, represented as a Field Supply location id.

supplierWarehouseCode: string

The supplier of the suborder, represented as a PSM Warehouse Code.

version: string

The API version that created this response.

programId: string

The Field Supply program id of the program associated with the suborder.

status: string , x ∈ { accepted }

This is the status of the parent order, which might be split into cold-chain and non-cold-chain suborders with different suborderIds.

closedStatus: string , x ∈ { , in-transit , received , failed }

This is the delivery status of this suborder. In case the suborder has not yet been shipped, the value will be the empty string.

orderId: string

This is the id of the parent order.

suborderId: string

This is the id of the suborder which contains all products that are delivered from the given supplier to the given target.

createdAt: string

The time when this suborder has been created, i.e. when its parent order got accepted.

updatedAt: string

The time when this suborder has last changed.

productQuantities: object

An object containg a key/value mapping of product ids and quantities.

funderId: string

The Field Supply funder id of the funder associated with the suborder.

additionalData: object

This contains arbitrary data attached when closing an order via API

route: string

This contains the name of the route the suborder is assigned to

routeId: string

This contains the routeId the suborder is assigned to

OrderUpdate: object

{
"productQuantities": {
"product:100002AAA07G04K": {
"batches": {
"product:100002AAA07G04K:manufacturer:cipla:batchNo:1234567": {
"amount": 5000
}
,
"product:100002AAA07G04K:manufacturer:cipla:batchNo:AB34568": {
"amount": 400
}
}
}
,
"product:100004AAK0A210B": {
"batches": {
"product:100004AAK0A210B:manufacturer:medopharm:batchNo:35C12": {
"amount": 7000
}
}
}
,
"product:100010KARMYXX006": {
"batches": {
"product:100010KARMYXX006:manufacturer:karex:batchNo:7UJJZ": {
"amount": 1000
}
,
"product:100010KARMYXX006:manufacturer:karex:batchNo:KU1JA": {
"amount": 6500
}
}
}
}
,
"receiptData": {
"closedStatus": "received",
"remark": "all went well",
"updatedAt": "2018-12-20T14:01:03.462Z"
}
,
"shipmentNumber": "ONE#S-1080"
}
productQuantities: object

The delivered product quantities by product id. For a failed shipment this key can be omitted.

receiptData: object
closedStatus: string , x ∈ { packed , in-transit , received , failed }

The current status of the suborder which has either been moved into transit, fulfilled or failed.

remark: string

Optional remarks about the shipment.

updatedAt: string

A timestamp defining the point in time when the suborder has transitioned state.

shipmentId: string

The ONE shipment number. Field Supply will associate this value with the document that represents the shipment internally.

Product: object

{
"basicUnit": "25x3 tabs",
"fullName": "Artesunate/Amodiaquine 25/67.5 mg Tablet, 25 Blisters of 3 Tablets [Sanofi]",
"id": "product:06930381AA2293Z",
"name": "Artesunate/Amodiaquine 25/67.5 mg Tablet",
"storageType": "non-cold-chain",
"tracer": false,
"tracksBatches": true
}
id: string
storageType: string
tracer: boolean
tracksBatches: boolean
name: string
fullName: string
basicUnit: string

Service: object

{
"id": "program:hiv-aids:service:pmtct",
"name": "PMTCT",
"products": [
{
"basicUnit": "240ml",
"fullName": "Abacavir 20 mg/mL Solution, 240 mL [Aurobindo]",
"id": "product:100000DGA04S04K",
"name": "Abacavir 20 mg/mL Solution",
"storageType": "cold-chain",
"tracer": false,
"tracksBatches": true
}
]
,
"program": {
"id": "program:hiv-aids",
"name": "HIV/AIDS"
}
}
id: string
name: string
program: object
products: object[]

Shipment: object

{
"productQuantities": {
"product:ghsc-mal0009": {
"batches": {
"product:ghsc-mal0009:manufacturer:chemonics:batchNo:4000028716": {
"amount": 300
}
}
}
}
,
"receiptData": {
"closedStatus": "packed"
}
,
"shipmentNumber": 4010,
"suborderId": "EsbLC_E2iTon"
}
productQuantities: object

An object contianing key/value pairs of products and their batch quantities/amount.

receiptData: object

An object containing details about the shipment status to be created via the closedStatus property

suborderId: string

The id of the suborderId whose shipment we want to advance to the next status

shipmentNumber: number

The number of the external shipment to be created, must be unique across existing suborder created shipments

ShipmentGetResponse: object

{
"changes": [
]
,
"comments": [
]
,
"counts": {
"product:ghsc-aid0146:manufacturer:chemonics:batchNo:219100830LPZA": {
"checked": false,
"paymentType": "pay_as_you_sell",
"quantity": 7,
"skuMarket": "originSKU"
}
,
"product:ghsc-mal0031:manufacturer:chemonics:batchNo:I-STK": {
"checked": false,
"paymentType": "pay_as_you_sell",
"quantity": 38,
"skuMarket": "originSKU"
}
}
,
"createdAt": "2024-08-29T06:10:37.153Z",
"createdBy": {
"agent": "",
"user": "psm-api-user"
}
,
"date": "2024-08-29",
"destination": {
"id": "zone:north-central:state:fct:lga:abaji:sdp:ni-ima-clinic",
"lga": "abaji",
"sdp": "ni-ima-clinic",
"state": "fct",
"zone": "north-central"
}
,
"externalShipmentId": "ONE-9899",
"funder": "funder:global-fund",
"funderId": "funder:global-fund",
"history": {
"origin:zone-north-central-name-abuja-global-fund:destination:zone-north-central-state-fct-lga-abaji-sdp-ni-ima-clinic:date:2024-08-29:shipmentNo:1322:status:packed:agent:": {
"counts": {
"product:ghsc-aid0146:manufacturer:chemonics:batchNo:219100830LPZA": {
"quantity": 7
}
,
"product:ghsc-mal0031:manufacturer:chemonics:batchNo:I-STK": {
"quantity": 38
}
}
,
"createdAt": "2024-08-29T06:10:37.153Z",
"createdBy": {
"agent": "",
"user": "psm-api-user"
}
}
}
,
"id": "origin:zone-north-central-name-abuja-global-fund:destination:zone-north-central-state-fct-lga-abaji-sdp-ni-ima-clinic:date:2024-08-29:shipmentNo:1322",
"orderId": "type:orderSnapshot:groupId:1SO0OKVYI:orderId:mo3Gcmx_BFm:suborderId:0H2lOD6Ezbl",
"origin": {
"id": "zone:north-central:name:abuja-global-fund",
"name": "abuja-global-fund",
"zone": "north-central"
}
,
"planningType": "routine",
"shipmentNo": "1322",
"shipmentType": {
"abbreviation": "FUNDER",
"id": "allocated:funder:global-fund",
"name": "funder:global-fund"
}
,
"snapshotDates": {
"packed": "2024-08-29T06:10:37.153Z"
}
,
"snapshotId": "origin:zone-north-central-name-abuja-global-fund:destination:zone-north-central-state-fct-lga-abaji-sdp-ni-ima-clinic:date:2024-08-29:shipmentNo:1322:status:packed:agent:",
"status": "packed",
"statusType": "arrival",
"updatedAt": "2024-08-29T06:10:37.153Z",
"updatedBy": {
"agent": "",
"user": "psm-api-user"
}
}
shipmentNo: string

The shipments internal tagged number

origin: object

Contains information about the origin of the shipment i.e the source

destination: object

Contains information about the destination of the shipment i.e the receiver

status: string

The current status of the shipment

statusType: string

The semantic definition of the shipment current status

orderId: string

The id of the order shipment was created from

externalShipmentId: string

The shipment ID defined by the integrating party on shipment creation

funderId: string

The id of the funder for given shipment

planningType: string

The type of plan shipment falls under. Typically will be defined as routine

createdAt: string

Date shipment was created at

createdBy: object

User who created the shipment

updatedAt: string

Last updated at timestamp of the shipment

updatedBy: object

Last user who updated the shipment

funder: string

Name of the funder

counts: object

Object containing information of products and quantities packed in the shipment

date: string

The date shipment is scheduled to be delivered

snapshotId: string

Id of the most recent shipment snapshot indicating the current status of the shipment

id: string

The unique id of the shipment

history: object

Contains historical information of the shipment snapshots created through its life cycle

changes: object[]

Contains information of all changes made on the shipment

comments: object[]

Array of comment entries made during the shipment lifecyle

shipmentType: object

details of the shipment type

snapshotDates: object

An object containing each shipment status as keys and the corresponding date they were created

ShipmentGetResponseError: object

{
"error": "Shipment not found"
}
error: string

Shipment not found for given shipmentNumber parameter

Shipments400ErrorResponse: object

{
"error": "packed snapshot already exists for suborder EsbLC_E2iTon"
}
error: string

A message describing the validation error that prevented the request from being processed

Shipments404ErrorResponse: object

{
"error": "No uncompleted suborder with id \"EsbLC_E2iTonss\" was found. Cannot continue."
}
error: string

Not found error message returned if suborder for given shipment doesn't exist

ShipmentsResponse: object

{
"id": "origin:zone-north-central-name-abuja-global-fund:destination:zone-north-central-state-niger-lga-agaie-sdp-basic-health-centre-etsugaie:date:2024-07-17:shipmentNo:6474:status:packed:agent:"
}
id: string

Id of the newly created shipment with its status information embedded in id

StockCount: object

{
"stockCounts": [
{
"date": "2018-05-28",
"funderId": "funder:usaid",
"id": "zone:north-central:state:akwa-ibom:2018-W05:lga:itu:sdp:model-health-centre-ntak-inyang:funder:usaid",
"serviceId": "program:hiv-aids:service:warehouse",
"stock": {
"product:100002AAA07G04K": {
"batches": {
"product:100002AAA07G04K:manufacturer:cipla:batchNo:1234567": {
"amount": 12000
}
,
"product:100002AAA07G04K:manufacturer:mylan:batchNo:AB34568": {
"amount": 4000
}
}
}
,
"product:100010KARMYXX006": {
"batches": {
"product:100010KARMYXX006:manufacturer:karex:batchNo:7UJJZ": {
"amount": 1000
}
,
"product:100010KARMYXX006:manufacturer:suretex:batchNo:KU1JA": {
"amount": 8500
}
}
}
}
,
"version": "2.0.0",
"warehouseCode": "PSM/AKB/16/013"
}
]
}
id: string
warehouseCode: string
funderId: string
version: string
serviceId: string
stock: object
date: string

StockCountGet: object

{
"_id": "zone:south-west:name:lagos-global-fund:bimonth:2021-M05:program:malaria:service:warehouse",
"_rev": "2-fb7e7169261ae90a5af831c16c63fca5",
"createdAt": "2021-06-10T12:10:55.619Z",
"createdBy": "psm-api-user",
"date": {
"month": 5,
"period": {
"effectiveEnd": "2021-06-30T00:00:00.000Z",
"effectiveStart": "2021-05-01T00:00:00.000Z"
}
,
"reportingPeriod": "2021-M05",
"year": 2021
}
,
"idVersion": 1,
"location": {
"id": "zone:south-west:name:lagos-global-fund",
"level": "zone",
"name": "lagos-global-fund",
"zone": "south-west"
}
,
"partialCount": false,
"serviceId": "program:malaria:service:warehouse",
"stock": {
"product:ghsc-mal0004": {
"amount": 8000,
"available": 8000,
"availableTotal": 8000,
"batches": {
"product:ghsc-mal0004:manufacturer:chemonics:batchNo:PA05090": {
"fields": {
"field:standard-physical-count": {
"amount": 5000
}
}
}
,
"product:ghsc-mal0004:manufacturer:chemonics:batchNo:PA05091": {
"fields": {
"field:standard-physical-count": {
"amount": 3000
}
}
}
}
}
}
,
"submittedAt": "2021-06-17T08:56:14.321Z",
"type": "stockCount",
"updatedAt": "2021-06-17T08:56:14.814Z",
"updatedBy": "psm-api-user",
"version": "2.0.0"
}
location: string

The id of the warehouse, the stock is retrieved from

"zone:south-west:name:lagos-global-fund"
                                                        
service: string

The id of the service, the stock is retrieved for.

"program:malaria:service:warehouse"
                                                        

StockCountGetError: object

{
"message": "Could not find stock count for zone:south-west:name:lagos-global-fund, program:family-planning:service:family-planning between now and period 2021-M05."
}
message: string

A message explaining the error that prevented the request from being successfully processed.

StockCountUpdate: object

{
"stockCounts": [
{
"funderId": "funder:usaid",
"programId": "program:hiv-aids",
"stock": {
"product:100002AAA07G04K": {
"batches": {
"product:100002AAA07G04K:manufacturer:cipla:batchNo:1234567": {
"amount": 5000
}
,
"product:100002AAA07G04K:manufacturer:mylan:batchNo:AB34568": {
"amount": 3777
}
}
}
,
"product:100010KARMYXX006": {
"batches": {
"product:100010KARMYXX006:manufacturer:karex:batchNo:7UJJZ": {
"amount": 1000
}
,
"product:100010KARMYXX006:manufacturer:suretex:batchNo:KU1JA": {
"amount": 6500
}
}
}
}
,
"warehouseCode": "NDC-202 :: Lagos Premier Medical Warehouse"
}
]
}
funderId: string

The id of the funder the sent stock should be associated with.

programId: string

The id of the program the sent stock is being used for.

"program:hiv-aids"
                                                        
stock: object

The batched stock levels. In case alias is used (which is the default behavior, this expects ONE ItemIds to be used in the product ids as well as batch ids.

warehouseCode: string

The PSM warehouse code of the target destination. Either this or locationId needs to be sepcified.

"NDC-202 :: Lagos Premier Medical Warehouse"
                                                        
locationId: string

The location id of the target destination. Either this or warehouseCode needs to be sepcified.

"zone:lagos:name:lagos"
                                                        

Release notes

v1.3 (13.09.2024)

  1. Order response now returns an additional property called route, i.e the name of the delivery route suborder falls under.
  2. POST /shipments api endpoint now supported to allow integrators to create shipments for their suborder.
  3. PATCH /shipments/{shipmentNumber} api endpoint now supported to allow integrators to incrementally update the status and product quantites of their created shipments for suborders.
  4. GET /shipments/{shipmentNumber} endpoints allows integrators to get shipment information using their own specific shipment ids used in the creation of the shipment.

Note: The /shipment endpoints are currently disabled on production. This is a feature that is currently undergoing testing and will be released sometime in the future.

v1.2 (04.04.2019)

Order payloads will now omit the requestedDeliveryDate value as ONE Network does not use the value in any way.

v1.1 (12.02.2019)

In order to support FEFO deployment orders, the NHLMIS API has been updated with the following:

  1. When a Field Supply suborder is being finalized using a PATCH /orders/{suborderId} request, the endpoint now expects batch level product information. This means that instead of echoing the ARTMIS ItemId level information contained in an accepted order without a closedStatus like

     {
         // ...additional keys
         "productQuantities": {
             "product:100004AAK0A210B": 5000
         }
     }

    the counts of the stock delivered will need to include batch level information like this:

     {
         // ...additional keys
         "productQuantities": {
             "product:100004AAK0A210B": {
                 "batches": {
                     "product:100004AAK0A210B:manufacturer:cipla:batchNo:4512": {
                         "amount": 3550                        
                     },
                     "product:100004AAK0A210B:manufacturer:cipla:batchNo:1983": {
                         "amount": 1450                        
                     }
                 }
             }
         }
     }

    This aligns with the way inventory levels are being submitted using POST /stock-counts, and is a breaking change.

  2. We added an additional value for closedStatus of a suborder, which is in-transit, signifying that a DO has been shipped out of the warehouse. This means that in order to mark a suborder as "in transit" you can send the following payload to PATCH /orders/{suborderId}:

     {
         "receiptData": {
             "closedStatus": "in-transit",
             "updatedAt": "2018-12-20T14:01:03.462Z"
         }
     }

    which extends the list of possible values to in-transit, received, failed. An OrderUpdate with an in-transit status can include batch level inventory in order to let the NHLMIS know exactly what was shipped.

  3. When sending product meta information alongside an inventory update or an order update, the itemName and basicUnit parameters at product level are now optional. This means if they will not be sent, the ARTMIS ItemId will be enough to match the product against our catalog.

     {
         // ...additional keys
         "productQuantities": {
             "product:100004AAK0A210B": {
                 "itemName": "Amoxicillin 250 mg Dispersible Tablet", // this is now optional as it contains redundant information
                 "basicUnit": "100 tabs", // this is now optional as it contains redundant information
                 "batches": {
                     "product:100004AAK0A210B:manufacturer:cipla:batchNo:4512": {
                         "amount": 3550                        
                     }
                 }
             }
         }
     }