{"openapi":"3.0.0","x-samples-languages":["curl","javascript","node","java","kotlin","python","php","go","swift"],"info":{"description":"The Connect Delivery API","version":"v1.0","title":"Connect API 1.0","contact":{"email":"api@karhoo.com"},"x-hugo-values":{"tags":["api"],"public":true}},"servers":[{"url":"https://svc-just-eat-sandbox.yuso-platform.com/","description":"Sandbox"},{"url":"https://just-eat-prod.yuso-platform.com/","description":"Production"}],"paths":{"/saas_companies/{company_id}/orders":{"put":{"summary":"Create a order for delivery (with callbacks)","tags":["Order"],"security":[{"apiKey":[]}],"parameters":[{"name":"company_id","in":"path","description":"Company ID","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"Creates an order, has logic to prevent duplication","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrder"}}}},"responses":{"201":{"description":"Order Succesfully created"}},"callbacks":{"OrderState":{"{your_base_url}/orders/{order_id}/deliverystate/{status}":{"put":{"parameters":[{"name":"order_id","in":"path","description":"Order ID","required":true,"schema":{"type":"string"}},{"name":"status","in":"path","description":"Order Status. Is one of `driverassigned`, `atrestaurant`, `onitsway`, `atdeliveryaddress` or `delivered`","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"Informs you about a delivery state change","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusCallback"}}}},"responses":{"204":{"description":"Your server implementation should return this HTTP status code\nif the data was received successfully\n"}}}}},"ETAUpdate":{"{your_base_url}/orders/{order_id}/deliverystate/atrestaurantetaupdate":{"put":{"parameters":[{"name":"order_id","in":"path","description":"Order ID","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"A special request body sent for an ETA update in the `atrestaurantetaupdate` state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ETACallback"}}}},"responses":{"204":{"description":"Your server implementation should return this HTTP status code\nif the data was received successfully\n"}}}}},"DriverPositions":{"{your_base_url}/orders/deliverystate/driverlocation":{"put":{"requestBody":{"description":"This is a distinct callback for driver location without Order Id in the URL path. This runs every 10 seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DriverLocationCallback"}}}},"responses":{"204":{"description":"Your server implementation should return this HTTP status code\nif the data was received successfully\n"}}}}},"ZoneETA":{"{your_base_url}/delivery/pools/{zone_id}/availability/relative":{"put":{"parameters":[{"name":"zone_id","in":"path","description":"The ID used to identify the zone","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"Informs you of our best guess of the ETA of the closest free driver in a given predefined area. Runs every 30 seconds.","content":{"application/json":{"schema":{"type":"object","properties":{"bestGuess":{"type":"string","description":"(HH:mm:ss format)"}}}}}},"responses":{"204":{"description":"Your server implementation should return this HTTP status code\nif the data was received successfully\n"}}}}}}}}},"components":{"schemas":{"DriverLocationCallback":{"type":"object","properties":{"OrderId":{"type":"string"},"TimeStampWithUtcOffset":{"description":"Date time format ISO8601","type":"string"},"EtaAtRestaurant":{"type":"string"},"Location":{"type":"object","properties":{"Longitude":{"type":"number","format":"float"},"Latitude":{"type":"number","format":"float"}}}}},"ETACallback":{"type":"object","properties":{"estimatedAt":{"description":"Date time format ISO8601","type":"string","example":"2022-05-31T12:19:34.0241600Z"},"bestGuess":{"description":"Date format ISO8601","type":"string","example":"2022-05-31T12:20:42Z"}}},"StatusCallback":{"type":"object","properties":{"TimeStampWithUtcOffset":{"description":"ISO8601 format","type":"string"},"DriverName":{"type":"string"},"DriverFirstName":{"type":"string"},"DriverLastName":{"type":"string"},"DriverContactNumber":{"type":"string"},"VehicleDetails":{"type":"object","properties":{"Vehicle":{"type":"string"},"VehicleRegistration":{"type":"string"}}},"EstimatedArrivalTime":{"type":"string"},"EtaAtRestaurant":{"type":"string"},"EtaAtDeliveryAddress":{"type":"string"},"Location":{"type":"object","properties":{"Longitude":{"type":"number","format":"float"},"Latitude":{"type":"number","format":"float"}}}}},"CreateOrder":{"type":"object","required":["Id","last_name","email","id"],"properties":{"Id":{"description":"Order ID","type":"string"},"FriendlyOrderReference":{"type":"string"},"Order":{"$ref":"#/components/schemas/Order"},"RestaurantInfo":{"$ref":"#/components/schemas/RestaurantInfo"},"PaymentInfo":{"$ref":"#/components/schemas/PaymentInfo"},"CustomerInfo":{"$ref":"#/components/schemas/CustomerInfo"},"BasketInfo":{"$ref":"#/components/schemas/BasketInfo"}}},"Order":{"type":"object","properties":{"NoteToRestaurant":{"description":"Restaurant notes","type":"string"},"DueDateWithUtcOffset":{"description":"(format YYYY-MM-DDThh:mm:ssTZD)","type":"string"},"RdsPickupTimeWithUtcOffset":{"description":"(format YYYY-MM-DDThh:mm:ssTZD)","type":"string"},"PickupNoticePeriod":{"description":"Number format HH:mm:ss","type":"string"},"PromptAsap":{"type":"boolean"}}},"RestaurantInfo":{"type":"object","properties":{"Id":{"description":"Restuarant ID","type":"string"},"Name":{"type":"string"},"PhoneNumber":{"type":"string"},"AddressLines":{"type":"array","items":{"type":"string"}},"Longitude":{"type":"number","format":"float"},"Latitude":{"type":"number","format":"float"},"City":{"type":"string"},"Postcode":{"type":"string"}}},"PaymentInfo":{"type":"object","properties":{"PaymentLines":{"type":"array","items":{"$ref":"#/components/schemas/PaymentLine"}}}},"PaymentLine":{"type":"object","properties":{"Type":{"type":"string"},"Value":{"type":"number","format":"float"}}},"CustomerInfo":{"type":"object","properties":{"Email":{"type":"string"},"Name":{"type":"string"},"Address":{"type":"string"},"Longitude":{"type":"number","format":"float"},"Latitude":{"type":"number","format":"float"},"Postcode":{"type":"string"},"PhoneNumber":{"type":"string"},"DisplayPhoneNumber":{"type":"string"}}},"BasketInfo":{"type":"object","properties":{"GroupedBasketItems":{"type":"array","items":{"$ref":"#/components/schemas/BasketItem"}}}},"BasketItem":{"type":"object","properties":{"Name":{"type":"string"},"Quantity":{"type":"integer"}}}},"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"Authorization"}}},"x-readme":{"explorer-enabled":true,"proxy-enabled":true}}