Public API
Delivery API
Courier Assign
9min
assigning a courier the courierassign mutation tells us about the individual who has been assigned to fulfill the ezcater delivery 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 if you have dispatched the delivery to another 3rd party (e g doordash, uber direct, etc ) it is important for you to fill in the deliveryserviceprovider with the name of that delivery provider otherwise, you may populate the value of this field with the name of your company mutation mutation mutation courierassign($input courierassigninput!) { courierassign(input $input) { clientmutationid delivery { id } usererrors { on deliveryvalidationerror { message path } } } } variables variables { "input" { "clientmutationid" "your mutation id", "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", "deliveryserviceprovider" "your delivery service provider" } } 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 courierassign mutation succeeds you can expect the response payload to look like response { "data" { "courierassign" { "clientmutationid" "your mutation id", "delivery" { "id" "ezcater delivery id" }, "usererrors" \[] } } } failure response user errors when the courierassign mutation fails due to user errors you can expect a http 200 and the response payload to look like response invalid phone number { "data" { "courierassign" { "clientmutationid" "4cbc6b56 3636 4692 b3d8 9b9a6a4b92a1", "delivery" null, "usererrors" \[ { "message" "phone 55555555 is an invalid us phone number", "path" \[ "input", "courier", "phone" ] } ] } } } response too far past event time { "data" { "courierassign" { "clientmutationid" "c3c047d9 e8e4 4431 b485 60c67fab8763", "delivery" null, "usererrors" \[ { "message" "delivery cannot receive updates 2 hours past its event time", "path" \[ "input", "deliveryid" ] } ] } } } 400 bad request when the courierassign mutation fails due to an invalid deliveryid you can expect a http 200 and the response payload to look like response { "errors" \[ { "message" "delivery not found", "path" \[ "courierassign" ], "extensions" { "type" "request", "statuscode" 404, "servicename" "delivery public", "code" "downstream service error", "exception" { "message" "delivery not found", "locations" \[ { "line" 1, "column" 72 } ], "path" \[ "courierassign" ] } } } ], "data" { "courierassign" null } }