{"_id":"582c7058e4a4920f00ff005c","__v":0,"category":{"_id":"582c7058e4a4920f00ff0048","version":"582c7058e4a4920f00ff0045","__v":0,"project":"56c1e50bce02590d006091c9","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-07-28T15:09:02.677Z","from_sync":false,"order":1,"slug":"orderconnect-sending-an-order","title":"Delivery partners"},"version":{"_id":"582c7058e4a4920f00ff0045","project":"56c1e50bce02590d006091c9","__v":2,"createdAt":"2016-11-16T14:42:32.468Z","releaseDate":"2016-11-16T14:42:32.468Z","categories":["582c7058e4a4920f00ff0046","582c7058e4a4920f00ff0047","582c7058e4a4920f00ff0048","582c7058e4a4920f00ff0049","582c7058e4a4920f00ff004a","582c7058e4a4920f00ff004b","582c7058e4a4920f00ff004c","582c7058e4a4920f00ff004d","582c7058e4a4920f00ff004e","582c7058e4a4920f00ff004f","582d97124b2536250038b392"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"3.0.0","version":"3.0"},"parentDoc":null,"user":"56c1e4bed9e8a90d00f888f3","project":"56c1e50bce02590d006091c9","updates":["57f627588719792200102098"],"next":{"pages":[],"description":""},"createdAt":"2016-02-15T15:22:02.578Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"","results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":3,"body":"Just Eat require all partners to deliver a set of specific, **mandatory** callbacks that record the state of each order.  These callbacks should be supplied by all partners, for each Just Eat order that is successfully received.\n\nThe precise format and content of each of these callbacks is recorded in the [Orderconnect Swagger page](https://uk-deliveryserviceexternalapi.just-eat.co.uk/swagger).  **All callbacks must contain valid GPS coordinates and a valid timestamp**, recorded at the moment in time that the corresponding real world event takes place.  Partners should also supply all additional requested data for each callback.\n\nEach callback should be supplied once, with the exception of \"Driver assigned\", which can be resent if a new driver is assigned.\n\nThe specific callbacks required - and their purpose - are specified below:\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Driver Assigned\",\n  \"body\": \"The *driverassigned *callback should be sent when a driver is assigned to the order.  It should communicate important details about the driver - and also an ETA that records when the driver expects to arrive at the restaurant.\\n\\n**NB: The ETA supplied with this callback should represent the delivery partner's best guess at when the driver will arrive at the restaurant.  In other words, it should not just contain the pick-up time initially requested by Just Eat.**\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"At Restaurant\",\n  \"body\": \"The *atrestaurant* callback should be sent when the driver arrives at the restaurant and is ready to collect the order.\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"On Its Way\",\n  \"body\": \"The *onitsway* callback should be sent when the driver departs the restaurant with the customer's order.  It should contain an ETA that records when the driver expects to arrive at the customer's address.\\n\\n**NB: The ETA supplied with this callback should represent the delivery partner's best guess at when the driver will arrive at the customer's address.  In other words, it should not just contain the delivery time initially requested by Just Eat.**\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"At Delivery Address\",\n  \"body\": \"The *atdeliveryaddress* callback should be sent when the driver *thinks* that they have arrived at the specified delivery address.\\n\\nNB: This callback should be distinct from the *delivered* callback, as Just Eat use this callback to understand how much time is spent locating the customer's address.\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Delivered\",\n  \"body\": \"The *delivered* callback should be sent when the driver has handed the food to the customer and completed the order.\"\n}\n[/block]","excerpt":"","slug":"just-eat-swagger","type":"basic","title":"Send order state updates to Just Eat"}

Send order state updates to Just Eat


Just Eat require all partners to deliver a set of specific, **mandatory** callbacks that record the state of each order. These callbacks should be supplied by all partners, for each Just Eat order that is successfully received. The precise format and content of each of these callbacks is recorded in the [Orderconnect Swagger page](https://uk-deliveryserviceexternalapi.just-eat.co.uk/swagger). **All callbacks must contain valid GPS coordinates and a valid timestamp**, recorded at the moment in time that the corresponding real world event takes place. Partners should also supply all additional requested data for each callback. Each callback should be supplied once, with the exception of "Driver assigned", which can be resent if a new driver is assigned. The specific callbacks required - and their purpose - are specified below: [block:callout] { "type": "info", "title": "Driver Assigned", "body": "The *driverassigned *callback should be sent when a driver is assigned to the order. It should communicate important details about the driver - and also an ETA that records when the driver expects to arrive at the restaurant.\n\n**NB: The ETA supplied with this callback should represent the delivery partner's best guess at when the driver will arrive at the restaurant. In other words, it should not just contain the pick-up time initially requested by Just Eat.**" } [/block] [block:callout] { "type": "info", "title": "At Restaurant", "body": "The *atrestaurant* callback should be sent when the driver arrives at the restaurant and is ready to collect the order." } [/block] [block:callout] { "type": "info", "title": "On Its Way", "body": "The *onitsway* callback should be sent when the driver departs the restaurant with the customer's order. It should contain an ETA that records when the driver expects to arrive at the customer's address.\n\n**NB: The ETA supplied with this callback should represent the delivery partner's best guess at when the driver will arrive at the customer's address. In other words, it should not just contain the delivery time initially requested by Just Eat.**" } [/block] [block:callout] { "type": "info", "title": "At Delivery Address", "body": "The *atdeliveryaddress* callback should be sent when the driver *thinks* that they have arrived at the specified delivery address.\n\nNB: This callback should be distinct from the *delivered* callback, as Just Eat use this callback to understand how much time is spent locating the customer's address." } [/block] [block:callout] { "type": "info", "title": "Delivered", "body": "The *delivered* callback should be sent when the driver has handed the food to the customer and completed the order." } [/block]