Public API
Delivery API
Courier Event Create
8min
creating courier events throughout the course of the delivery fulfillment lifecycle, there are a variety of events that can happen to a delivery to help us understand where it is at in the fulfillment process capturing these events is important to the ezcater fulfillment process as they can be tied to other side effects, like communicating to our customers that their food is on the way or has arrived if you already had a courier assigned to a delivery and are now assigning a new courier, we automatically take care of un assigning the previous courier mutation mutation mutation couriereventcreate($input couriereventcreateinput!) { couriereventcreate(input $input) { clientmutationid delivery { id } usererrors { on deliveryvalidationerror { message path } } } } variables variables { "input" { "clientmutationid" "your mutation id", "coordinates" { "latitude" 42 360081, "longitude" 71 058884 }, "courier" { "id" "your courier id", "firstname" "test", "lastname" "courier", "phone" "+15555555555", "vehicle" { "make" "your vehicle make", "model" "your vehicle model", "color" "your vehicle color" } }, "deliveryid" "ezcater delivery id", "eventtype" "en route to pickup", "occurredat" "2024 02 05t17 27 55+0000" } } arguments argument name description input courier event create docid\ k2qrzk03w9db66zorcaqt the input object for creating a new menu return type returns a courier schema reference docid 7gv344rnwmuoknj9u4rw7 success responses when the couriereventcreate mutation succeeds you can expect the response payload to look like response { "data" { "couriereventcreate" { "clientmutationid" "your mutation id", "delivery" { "id" "ezcater delivery id" }, "usererrors" \[] } } } failure responses user errors when the couriereventcreate mutation fails because it is too early to add courier events you can expect the response payload to look like response too early { "data" { "couriereventcreate" { "clientmutationid" "your mutation id", "delivery" null, "usererrors" \[ { "message" "it's too early to add the event for courier en route to pickup", "path" \[ "input", "occurredat" ] } ] } } } response too late { "data" { "couriereventcreate" { "clientmutationid" "your mutation id", "delivery" null, "usererrors" \[ { "message" "delivery cannot receive updates 2 hours past its event time", "path" \[ "input", "deliveryid" ] } ] } } } 400 bad request when the couriereventcreate mutation fails due to bad user input, such as a invalid eventtype enum or invalid field, you can expect a http 400 bad request and the response payload to look like response invalid enum { "errors" \[ { "message" "variable \\"$input\\" got invalid value \\"pickedup\\" at \\"input eventtype\\"; value \\"pickedup\\" does not exist in \\"couriereventcreateinputeventtype\\" enum ", "extensions" { "code" "bad user input" } } ] } response invalid field { "errors" \[ { "message" "variable \\"$input\\" got invalid value { clientmutationid \\"your mutation id\\", coordinates { latitude 42 360081, longitude 71 058884 }, courier { id \\"your courier id\\", firstname \\"test\\", lastname \\"courier\\", phone \\"+15555555555\\", vehicle \[object] }, deliveryid \\"your ezcater delivery id\\", eventtype \\"picked up\\", occurredat \\"2025 05 07t19 52 32 841z\\" }; field \\"eventtype\\" is not defined by type \\"couriertrackingeventcreateinput\\" ", "extensions" { "code" "bad user input" } } ] }