Returns the pending route for the authenticated driver, including all stops, products, collections, and OSD data.
Endpoint: GET /api/route
Authentication: Required: headers: employee_id, api_token
Stop types:
delivery: standard customer stopbackhaul: second-to-last stop on the routewarehouse: stop ID 999, the return-to-home-base stopProduct / collection fields:
name: item name from PDITMNAM. May differ from description (PDPRDESC).required: from PDREQCOL. Whether the collection entry is mandatory.count_in_totes: from PDCNTCOL. Whether this item is included in the return count.add_photos: from PDADDPIC. Whether an optional photo is allowed for this collection item.Customer contact fields:
contact.email: customer contact email (PDCUSEML).contact.contact_email: GSC broker/manager contact email (CONTEMAIL).OSD data fields (v21+):
product.updates.osd_data: OSD entries for this product: [{ osd_id, osd_code, data: [{ osd_parent, comment, quantity, images_id, barcodes, quantity_type }] }]. barcodes is a single barcode string per entry. Reconstructed from GPODOSD rows where PDIDCODE matches the product_id; the barcode is returned from PDUPCCD. osd_id/osd_parent v23 are echoed back from PDOSDID/PDOSDPAR exactly as stored (null if blank).product.action.updates.osd_data: itemized OSD (PDOSDITMZ=Y) for products with an action object. Same grouped format as product.updates.osd_data; barcodes field is always empty string on GET.stop.updates.overage_items: items found at the stop that are not on the manifest: [{ barcode, osd_code, quantity, comment, images_id }]. Each entry is a GPODOSD row whose barcode did not match any ordered product. No quantity_type on this shape.quantity_type v23: "units", "cases", or null. Read from the PDQTYIS column on GPODOSD.Example response:
{
"success": true,
"message": "Pending route found for driver.",
"data": {
"id": "17140",
"facility": "011",
"name": "ROUTE NAME",
"week_end": "20251031",
"last_updated": "2025-10-31T12:00:00.000Z",
"drivers": [
{ "id": "T0048", "name": "DRIVER NAME", "type": "driver" }
],
"stops": [
{
"id": 258,
"type": "delivery",
"updates": {
"status": "P",
"followup": false,
"delivered_by_driver_id": null,
"store_emp_id": null,
"store_emp_name": null,
"driver_comments": null,
"signature_id": null,
"osd_emails": [],
"overage_items": []
},
"osd_emails": [],
"customer": {
"id": "CUSTID",
"name": "STORE NAME",
"verify_returns": false,
"contact": { "phone": "5551234567", "email": "store@example.com", "contact_email": "gsc-contact@example.com",
"salesrep": { "id": "SR01", "name": "REP NAME", "phone": "5559876543" } },
"location": {
"address": ["123 Main St"], "city": "ANYTOWN", "state": "IL", "zip": "60601",
"coordinates": { "latitude": "41.8781", "longitude": "-87.6298" }
}
},
"invoices": [{ "id": "0806591", "date": "2025-10-31" }],
"products": [
{
"id": "038976",
"name": "GARDETTOS SPEC RQST",
"description": "GARDETTOS SPEC RQST RYE CHPS 7/4.75 OZ",
"invoice": "0806591",
"quantity": 7,
"box_upc": "00016000148710",
"item_upc": "016000502789",
"section": "GROCERY",
"updates": {
"delivered": 6,
"accounting_complete": false,
"image_ids": null,
"osd_data": [
{
"osd_id": "ABCDEF",
"osd_code": "51",
"data": [
{ "osd_parent": "ABCDEF", "comment": "1 bag missing", "quantity": 1, "images_id": null, "barcodes": "00016000148710", "quantity_type": "units" },
{ "osd_parent": null, "comment": "1 damaged box", "quantity": 1, "images_id": null, "barcodes": "016000502789", "quantity_type": null }
]
}
]
},
"action": null
}
],
"collections": [
{
"id": "9010", "name": "PLASTIC TOTE", "description": "RECLAMATION TOTES",
"required": true, "count_in_totes": true, "add_photos": false,
"container_type": "PLASTIC TOTE", "section": "COLLECTIONS",
"quantity": 2,
"updates": { "returned": 0, "osd_data": [] },
"action": { "type": "collect" }
}
]
}
]
}
}
Result:
...
Returns a list of employee IDs currently assigned to active (non-completed) routes.
Endpoint: GET /api/route/drivers
Authentication: None
Result:
...