Public API for Catering Partne...
Delivery API
Couriers Assign
8 min
 assigning a courier the couriersassign mutation is for managing the individual(s) assigned to fulfill the ezcater delivery that includes creating or updating couriers in the ezcater system the list of couriers provided to the mutation will replace any existing assigned couriers providing an empty list will unassign all the couriers mutation mutation mutation couriersassign($input couriersassigninput!) { couriersassign(input $input) { delivery { id } usererrors { on usererror { message path } } } } variables variables { "input" { "couriers" \[ { "id" "your courier id1", "firstname" "jane", "lastname" "doe", "phone" "+16175551234", "providersource" "in house", "vehicle" { "color" "silver", "make" "toyota", "model" "rav4" } }, { "id" "your courier id2", "providersource" "in house" }, { "id" "your courier id3", "firstname" "john", "lastname" "smith", "phone" "+16175554567", "providersource" "third party", "providername" "doordash", "vehicle" { "color" "blue", "make" "honda", "model" "accord" } } ], "deliveryid" "ezcater delivery id" } } arguments argument name description input courier schema reference docid 7gv344rnwmuoknj9u4rw7 the input object for assigning a courier return type returns a courier schema reference docid 7gv344rnwmuoknj9u4rw7 success response when the couriersassign mutation succeeds you can expect the response payload to look like response { "data" { "couriersassign" { "delivery" { "id" "ezcater delivery id" }, "usererrors" \[] } } } failure response user errors when the couriersassign mutation fails due to user errors you can expect a http 200 and the response payload to look like invalid courier attributes { "data" { "couriersassign" { "delivery" null, "usererrors" \[ { "message" "phone can't be blank", "path" \[ "input", "couriers", "0", "phone" ] }, { "message" "first name can't be blank", "path" \[ "input", "couriers", "0", "firstname" ] }, { "message" "phone is invalid for u s ", "path" \[ "input", "couriers", "2", "phone" ] }, { "message" "last name can't be blank", "path" \[ "input", "couriers", "2", "lastname" ] } ] } } } past event time { "data" { "couriersassign" { "delivery" null, "usererrors" \[ { "message" "delivery cannot receive updates 2 hours past its event time", "path" \[ "input", "deliveryid" ] } ] } } } delivery completed { "data" { "couriersassign" { "delivery" null, "usererrors" \[ { "message" "delivery is finalized and cannot receive any more updates", "path" \[ "input", "deliveryid" ] } ] } } } delivery cancelled { "data" { "couriersassign" { "delivery" null, "usererrors" \[ { "message" "delivery is inactive and cannot receive any more updates", "path" \[ "input", "deliveryid" ] } ] } } } 404 not found request when a delivery is not found for the provided deliveryid you can expect a http 200 and the response payload to look like { "errors" \[ { "message" "delivery not found", "path" \[ "couriersassign" ], "extensions" { "type" "request", "statuscode" 404, "servicename" "delivery public", "code" "downstream service error", "exception" { "message" "delivery not found", "locations" \[ { "line" 1, "column" 72 } ], "path" \[ "couriersassign" ] } } } ], "data" { "couriersassign" null } }