Skip to main content

Units

Serialized units and their custody trail.

List units

GET https://api.dawatrack.com/partner-api/v1/units/

The serialized units your credential can see, most recently active first.

Scope batches:read Limit 5,000 per day

Query parameters

  • batch_number string Optional
  • facility_schema string Optional
  • gtin string Optional
  • page integer Optional

    A page number within the paginated result set.

  • page_size integer Optional

    Number of results to return per page.

  • sscc string Optional

    Only units currently packed in this SSCC.

  • status string Optional

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

  • gtin string

    The product's GS1 GTIN, as 14 digits.

  • serial_number string

    The unit's serial number.

  • batch_number string

    The batch or lot number.

  • current_sscc string or null Read-only

    The SSCC the unit is currently packed in, if any.

  • current_status string

    The type of the unit's latest event.

  • facility_schema string

    The facility's identifier on DawaTrack.

  • last_event_at datetime

    When the unit's latest event happened.

Example response

JSON
{
  "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

200OK
401No valid access token
403Your credential lacks the scope, partner type or environment this needs
429Rate limit exceeded

Fetch a unit's custody trail

GET https://api.dawatrack.com/partner-api/v1/units/{gtin}/{serial}/

One physical unit's events, newest first, and its current status.

Scope 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

  • gtin string Required
  • serial string 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

  • gtin string

    The product's GS1 GTIN, as 14 digits.

  • serial_number string

    The unit's serial number.

  • status string

    The type of the unit's most recent event.

  • events array of objects

    The unit's events, newest first.

    • id integer Read-only

      The record's id.

    • event_type enum

      The kind of event.

      Possible values: COMMISSIONSHIPRECEIVETRANSFERDISPENSEQUARANTINERELEASEAGGREGATEDISAGGREGATERECEIVE_LINKSHIP_ANSWERRECALL_ACKNOWLEDGMENTRECEIPT_ANSWERRETRACT
    • gtin string

      The product's GS1 GTIN, as 14 digits.

    • batch_number string

      The batch or lot number.

    • serial_number string

      The unit's serial number.

    • sscc string

      An 18-digit GS1 Serial Shipping Container Code.

    • quantity integer

      Quantity of units/items involved in this event (for batch-level or aggregated events).

    • expiry_date date or null

      The 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_date date or null

      The lot's manufacture date (GS1 AI 11). Optional, checked against the lot like expiry_date; not in the future, and before the expiry.

    • parent_event integer or null

      Parent event forming the distribution graph (e.g. COMMISSION/RECEIVE -> SHIP/DISPENSE).

    • corrects_event integer or null

      Event being corrected by this immutable record.

    • actor_id string

      Who or what produced the event.

    • facility_id string

      The facility where the event happened.

    • idempotency_key string

      Optional key making this single event idempotent for your credential.

    • occurred_at datetime

      Defaults to now if omitted.

    • raw_payload object

      For AGGREGATE events, the packed children as a list of {gtin, serial}.

    • destination_schema_name string

      SHIP 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_number string

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

    • sender object

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

      • name string
      • ppb_licence string
      • gln string
      • email string

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

      • phone string

        How 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_balance boolean

      RECEIVE 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

    • recipient object

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

      • name string
      • ppb_licence string
      • email string

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

      • phone string

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

    • consignment object

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

      • number string

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

      • reference string

        Your order.

      • carrier_name string
      • waybill_number string
      • vehicle_registration string
      • driver_name string
      • driver_phone string
      • expected_delivery_date date or null
    • consignment_number string Read-only

      The consignment (despatch advice) a SHIP left on: its number, or blank.

    • created_at datetime Read-only

      When the record was created.

Example response

JSON
{
  "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

200OK
400The request is invalid, for example a malformed GTIN or a missing field
401No valid access token
403Your credential lacks the scope, partner type or environment this needs
404Not found, or not visible to your credential
429Rate limit exceeded

Partner API v1. The API reference is generated from the API's own code.