Units
Serialized units and their custody trail.
List units
https://api.dawatrack.com/partner-api/v1/units/
The serialized units your credential can see, most recently active first.
batches:read
Limit 5,000 per day
Query parameters
-
batch_numberstring Optional -
facility_schemastring Optional -
gtinstring Optional -
pageinteger OptionalA page number within the paginated result set.
-
page_sizeinteger OptionalNumber of results to return per page.
-
ssccstring OptionalOnly units currently packed in this SSCC.
-
statusstring OptionalOnly units whose latest event is of this type.
Example request
curl -X GET https://api.dawatrack.com/partner-api/v1/units/ \
-H "Authorization: Bearer $DAWATRACK_TOKEN"
import requests
token = "..." # from POST /oauth/token/
response = requests.get(
"https://api.dawatrack.com/partner-api/v1/units/",
headers={"Authorization": f"Bearer {token}"},
)
response.raise_for_status()
print(response.json())
const token = "..."; // from POST /oauth/token/
const response = await fetch("https://api.dawatrack.com/partner-api/v1/units/", {
method: "GET",
headers: {
Authorization: `Bearer ${token}`,
},
});
console.log(await response.json());
Response fields
A page of results. These are the fields of each item in results. See Pagination.
-
gtinstringThe product's GS1 GTIN, as 14 digits.
-
serial_numberstringThe unit's serial number.
-
batch_numberstringThe batch or lot number.
-
current_ssccstring or null Read-onlyThe SSCC the unit is currently packed in, if any.
-
current_statusstringThe type of the unit's latest event.
-
facility_schemastringThe facility's identifier on DawaTrack.
-
last_event_atdatetimeWhen the unit's latest event happened.
Example response
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"gtin": "06164004321562",
"serial_number": "SN-0007731",
"batch_number": "BTH-2026-041",
"current_sscc": "106164004000007317",
"current_status": "SHIP",
"facility_schema": "pharmacy_a",
"last_event_at": "2026-10-10T09:00:00Z"
}
]
}
Status codes
200 | OK |
401 | No valid access token |
403 | Your credential lacks the scope, partner type or environment this needs |
429 | Rate limit exceeded |
Fetch a unit's custody trail
https://api.dawatrack.com/partner-api/v1/units/{gtin}/{serial}/
One physical unit's events, newest first, and its current status.
batches:read
Limit 5,000 per day
status is the type of the most recent event. Returns 404 if the unit was never commissioned or isn't visible to your credential.
Path parameters
-
gtinstring Required -
serialstring Required
Example request
curl -X GET https://api.dawatrack.com/partner-api/v1/units/06164004321562/SN-0007731/ \
-H "Authorization: Bearer $DAWATRACK_TOKEN"
import requests
token = "..." # from POST /oauth/token/
response = requests.get(
"https://api.dawatrack.com/partner-api/v1/units/06164004321562/SN-0007731/",
headers={"Authorization": f"Bearer {token}"},
)
response.raise_for_status()
print(response.json())
const token = "..."; // from POST /oauth/token/
const response = await fetch("https://api.dawatrack.com/partner-api/v1/units/06164004321562/SN-0007731/", {
method: "GET",
headers: {
Authorization: `Bearer ${token}`,
},
});
console.log(await response.json());
Response fields
-
gtinstringThe product's GS1 GTIN, as 14 digits.
-
serial_numberstringThe unit's serial number.
-
statusstringThe type of the unit's most recent event.
-
eventsarray of objectsThe unit's events, newest first.
-
idinteger Read-onlyThe record's id.
-
event_typeenumThe kind of event.
Possible values:COMMISSIONSHIPRECEIVETRANSFERDISPENSEQUARANTINERELEASEAGGREGATEDISAGGREGATERECEIVE_LINKSHIP_ANSWERRECALL_ACKNOWLEDGMENTRECEIPT_ANSWERRETRACT -
gtinstringThe product's GS1 GTIN, as 14 digits.
-
batch_numberstringThe batch or lot number.
-
serial_numberstringThe unit's serial number.
-
ssccstringAn 18-digit GS1 Serial Shipping Container Code.
-
quantityintegerQuantity of units/items involved in this event (for batch-level or aggregated events).
-
expiry_datedate or nullThe lot's expiry date (GS1 AI 17). Optional. When the lot (GTIN and batch) is already on DawaTrack it must match the lot's, and a blank one takes the lot's; the first declaration with an expiry creates the lot. A raw_payload.expiry_date is still read for a lot not yet known.
-
manufacture_datedate or nullThe lot's manufacture date (GS1 AI 11). Optional, checked against the lot like expiry_date; not in the future, and before the expiry.
-
parent_eventinteger or nullParent event forming the distribution graph (e.g. COMMISSION/RECEIVE -> SHIP/DISPENSE).
-
corrects_eventinteger or nullEvent being corrected by this immutable record.
-
actor_idstringWho or what produced the event.
-
facility_idstringThe facility where the event happened.
-
idempotency_keystringOptional key making this single event idempotent for your credential.
-
occurred_atdatetimeDefaults to now if omitted.
-
raw_payloadobjectFor AGGREGATE events, the packed children as a list of {gtin, serial}.
-
destination_schema_namestringSHIP only, optional: the DawaTrack facility (its schema_name) receiving this shipment. When that facility receives the same GTIN and batch, its receipt is linked to this event.
-
destination_supplier_ppb_license_numberstringSHIP only, optional, for a partner linked to a supplier account: the PPB licence number of the approved DawaTrack supplier receiving this shipment. It confirms receipt on its Receiving screen. Use this or destination_schema_name, not both.
-
senderobjectRECEIVE only, optional: the sender of stock that came from outside DawaTrack, so there is no SHIP to name as parent_event. The receipt is where the graph picks the lot up. Not with parent_event; not for a sender on DawaTrack, whose SHIP you name instead.
-
namestring -
ppb_licencestring -
glnstring -
emailstringHow a recall reaches this party: kept on its party record, off the ledger, and only used to send it recall notices. An email and a phone are both required; the email is what a recall notice is sent to now. The phone is stored in E.164 (+254...); a Kenyan number may be given as 07... or 01...
-
phonestringHow a recall reaches this party: kept on its party record, off the ledger, and only used to send it recall notices. An email and a phone are both required; the email is what a recall notice is sent to now. The phone is stored in E.164 (+254...); a Kenyan number may be given as 07... or 01...
-
-
opening_balancebooleanRECEIVE only, optional: true when this is stock you held when you started on DawaTrack (opening stock, as an ERP's initial stock entry), so it came from no one on record: no parent_event, no sender. Once per lot, only for a lot you have no events on yet, and within 30 days of your first opening-stock receipt. The trace reads "Opening stock, declared by <you> on <date>".
Default:
False -
recipientobjectSHIP only, optional: the buyer of stock you sent outside DawaTrack, so a recall can reach it. Not with destination_schema_name or destination_supplier_ppb_license_number; not for a party on DawaTrack, which you name by those instead.
-
namestring -
ppb_licencestring -
emailstringHow a recall reaches this party: kept on its party record, off the ledger, and only used to send it recall notices. An email and a phone are both required; the email is what a recall notice is sent to now. The phone is stored in E.164 (+254...); a Kenyan number may be given as 07... or 01...
-
phonestringHow a recall reaches this party: kept on its party record, off the ledger, and only used to send it recall notices. An email and a phone are both required; the email is what a recall notice is sent to now. The phone is stored in E.164 (+254...); a Kenyan number may be given as 07... or 01...
-
-
consignmentobjectSHIP only, optional: the consignment (despatch advice) this shipment is a line of: your number, carrier, waybill, vehicle, driver and expected date. Without it, the SHIP is a one-line consignment DawaTrack numbers. The response's consignment_number names it.
-
numberstringYour own despatch advice number, unique among your consignments (1 to 40 letters, digits, '.', '_', '/' or '-'). SHIP events with the same number are lines of one consignment, to one receiver. Leave it out and DawaTrack numbers a one-line consignment.
-
referencestringYour order.
-
carrier_namestring -
waybill_numberstring -
vehicle_registrationstring -
driver_namestring -
driver_phonestring -
expected_delivery_datedate or null
-
-
consignment_numberstring Read-onlyThe consignment (despatch advice) a SHIP left on: its number, or blank.
-
created_atdatetime Read-onlyWhen the record was created.
-
Example response
{
"gtin": "06164004321562",
"serial_number": "SN-0007731",
"status": "SHIP",
"events": [
{
"event_type": "SHIP",
"occurred_at": "2026-10-02T10:00:00Z"
},
{
"event_type": "COMMISSION",
"occurred_at": "2026-10-01T09:00:00Z"
}
]
}
Status codes
200 | OK |
400 | The request is invalid, for example a malformed GTIN or a missing field |
401 | No valid access token |
403 | Your credential lacks the scope, partner type or environment this needs |
404 | Not found, or not visible to your credential |
429 | Rate limit exceeded |
Partner API v1. The API reference is generated from the API's own code.