Public API
Orders API
Order Accept
11min
accepting orders accepting an order is a simple mutation that requires only the uuid for the order that’s to be accepted to be automatically be informed when an order has been submitted and can be accepted please see subscribing to order notifications docid\ rwxihcsbkow9wv238z7mh mutation mutation mutation acceptorder($orderid id!, $acceptmodification boolean) { acceptorder(orderid $orderid, acceptmodification $acceptmodification) { order { uuid lifecycle { orderiscurrently } } } } variables variables initial acceptance { "orderid" "your ezcater order id", "acceptmodification" false } variables modification acceptance { "orderid" "your ezcater order id", "acceptmodification" true } arguments argument name description orderid order schema reference docid\ u2uigsyo0gfpxj 5tuif0 the ezcater order uuid that is provided within the payload of order subscription notifications acceptmodification order schema reference docid\ u2uigsyo0gfpxj 5tuif0 = false a boolean representing whether a modification to an order is accepted acceptmodification true is required when accepting an order modification return type returns an order schema reference docid\ u2uigsyo0gfpxj 5tuif0 successful responses when the acceptorder mutation succeeds you can expect the response payload to look like response { "data" { "acceptorder" { "order" { 	 "uuid" "your ezcater order id", "lifecycle" { "orderiscurrently" "accepted" } } } } } you will also receive the accepted order event notification shortly afterwards, if you choose to subscribe to it via subscription create docid\ ywds1a gxebjwkne8v90s failure responses acceptorder calls may fail for a variety of reasons the order not being found, or the feature not being enabled for your brand in the event that an acceptorder call fails, one of the below errors may be returned 404 couldn’t find order you will get a 404 error when the specified order couldn’t be found response { "errors" \[ { "message" "couldn't find order", "path" \[ "acceptorder" ], "extensions" { "type" "request", "statuscode" 404, "servicename" "orders public", "code" "downstream service error", "exception" { "message" "couldn't find order", "locations" \[ { "line" 1, "column" 54 } ], "path" \[ "acceptorder" ] } } } ], "data" { "acceptorder" null } } 403 unauthorized you will get a 403 error when the api user account doesn’t have permission to perform this action for this caterer location response { "errors" \[ { "message" "you are not authorized to access this data", "path" \[ "acceptorder" ], "extensions" { "type" "request", "statuscode" 403, "servicename" "orders public", "code" "downstream service error", "exception" { "message" "you are not authorized to access this data", "locations" \[ { "line" 1, "column" 54 } ], "path" \[ "acceptorder" ] } } } ], "data" { "acceptorder" null } } feature not enabled (feature not enabled) you will get this error if this api feature has not yet been enabled for your brand response { "data" { "acceptorder" null }, "errors" \[ { "message" "feature not enabled for the caterer associated with this order", "locations" \[ { "line" 4, "column" 3 } ], "path" \[ "acceptorder" ], "extensions" { "type" "summary", "code" "feature not enabled" } } ] } invalid state transition (invalid state transition) you will get this error when the order is no longer in a valid state to be accepted (the order hasn’t been submitted yet; the customer may have canceled it; it may have already been accepted or rejected by api or one of the other channels for accepting/rejecting orders) this error can also occur when attempting to accept an order modification without providing the argument "acceptmodification" true response { "errors" \[ { "message" "sorry, we were unable to accept this order ", "path" \[ "acceptorder" ], "extensions" { "type" "summary", "code" "invalid state transition", "servicename" "orders public", "exception" { "message" "sorry, we were unable to accept this order ", "locations" \[ { "line" 1, "column" 54 } ], "path" \[ "acceptorder" ] } } } ], "data" { "acceptorder" null } }