curl --request GET \
--url https://api.decodahealth.com/medications/{medication_id}/available-lots \
--header 'API-KEY: <api-key>' \
--header 'TENANT: <tenant>'import requests
url = "https://api.decodahealth.com/medications/{medication_id}/available-lots"
headers = {
"TENANT": "<tenant>",
"API-KEY": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {TENANT: '<tenant>', 'API-KEY': '<api-key>'}};
fetch('https://api.decodahealth.com/medications/{medication_id}/available-lots', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.decodahealth.com/medications/{medication_id}/available-lots",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"API-KEY: <api-key>",
"TENANT: <tenant>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.decodahealth.com/medications/{medication_id}/available-lots"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("TENANT", "<tenant>")
req.Header.Add("API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.decodahealth.com/medications/{medication_id}/available-lots")
.header("TENANT", "<tenant>")
.header("API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.decodahealth.com/medications/{medication_id}/available-lots")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["TENANT"] = '<tenant>'
request["API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"id": "<string>",
"stockId": "<string>",
"locationId": "<string>",
"remainingQuantity": 123,
"quantity": 123,
"lotNumber": "<string>",
"expiryDate": "2023-11-07T05:31:56Z",
"ndc": "<string>",
"cost": 123,
"createdDate": "2023-11-07T05:31:56Z",
"allocatedRemainingQuantity": 123,
"unallocatedRemainingQuantity": 123,
"providerAvailableQuantity": 123,
"chargedTodayQuantity": 123,
"chargedTodayChargeCount": 123
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Get Available Lots
Get the lots and quantities the administering provider may use.
A provider holding any allocation for this medication picks only from the lots they are allocated on; a provider with no allocation keeps the shared pool. Quantities are the same either way: on an allocated shipment the provider may use their own remaining allocation plus the unassigned remainder, and another provider’s reservation is never exposed.
By default only lots with stock remaining are returned (for dispensing). Pass include_depleted=True to also return fully-consumed lots, e.g. to look up the NDC/expiry of the exact lot an already-administered dose drew from.
Pass patient_id to mark the lots a checkout already billed and drew for that patient today via charged_today_quantity. Recording the dose against one of those lots reuses the existing drawdown instead of deducting stock twice, so they are returned even when the charge left them depleted (and therefore archived).
curl --request GET \
--url https://api.decodahealth.com/medications/{medication_id}/available-lots \
--header 'API-KEY: <api-key>' \
--header 'TENANT: <tenant>'import requests
url = "https://api.decodahealth.com/medications/{medication_id}/available-lots"
headers = {
"TENANT": "<tenant>",
"API-KEY": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {TENANT: '<tenant>', 'API-KEY': '<api-key>'}};
fetch('https://api.decodahealth.com/medications/{medication_id}/available-lots', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.decodahealth.com/medications/{medication_id}/available-lots",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"API-KEY: <api-key>",
"TENANT: <tenant>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.decodahealth.com/medications/{medication_id}/available-lots"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("TENANT", "<tenant>")
req.Header.Add("API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.decodahealth.com/medications/{medication_id}/available-lots")
.header("TENANT", "<tenant>")
.header("API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.decodahealth.com/medications/{medication_id}/available-lots")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["TENANT"] = '<tenant>'
request["API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"id": "<string>",
"stockId": "<string>",
"locationId": "<string>",
"remainingQuantity": 123,
"quantity": 123,
"lotNumber": "<string>",
"expiryDate": "2023-11-07T05:31:56Z",
"ndc": "<string>",
"cost": 123,
"createdDate": "2023-11-07T05:31:56Z",
"allocatedRemainingQuantity": 123,
"unallocatedRemainingQuantity": 123,
"providerAvailableQuantity": 123,
"chargedTodayQuantity": 123,
"chargedTodayChargeCount": 123
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Headers
The tenant you are making this request on behalf of
Your api key
Path Parameters
Query Parameters
Response
Successful Response
The administering provider's own remaining allocation of this lot. Zero when this shipment is allocated only to other providers; None when the shipment is unmanaged.
Unassigned physical quantity available to any provider; None when the shipment is unmanaged.
Total quantity available to the administering provider (their allocation plus unassigned quantity); None when the shipment is unmanaged.
Billed quantity on the next checkout line claimable from this lot for this patient today. None when no checkout line is claimable or patient/location context was not supplied.
Number of unclaimed checkout lines available on this lot for the patient today.

