Just Eat Order Webhooks API
The Order Webhooks API from Just Eat — 3 operation(s) for order webhooks.
The Order Webhooks API from Just Eat — 3 operation(s) for order webhooks.
openapi: 3.0.0
info:
contact:
x-twitter: JustEatUK
description: "# Just Eat API\nJust Eat offers services for our various business partners and our consumer applications.\nHow you interact with the API depends on the services you wish to interact with.\n## Security\n### HTTPS\nAll api calls and callbacks require HTTPS. Your service will need a valid SSL certificate and be accessible via the standard SSL port (port 443).\n## Making an API request\nSome API calls require an API key, to authenticate the partner calling the API.\n```\nPUT https://uk-partnerapi.just-eat.io/orders/abcd1234 HTTP/1.1\nAuthorization: JE-API-KEY abcd123456789\n```\nOther calls require a user token in the form of a JWT.\n```\nGET https://uk.api.just-eat.io/consumer/me/orders/uk HTTP/1.1\nAuthorization: Bearer abcd123456789\n```\n\n## Date Formats\n### Date and time formats\nAll dates and times should use the [ISO 8601 standard for representation of dates and times](https://en.wikipedia.org/wiki/ISO_8601).\n\n#### For instance:\n* DueDateWithUtcOffset: `\"2015-05-26T14:52:35.5444292+01:00\"`\n - Local time: `14:52`\n - UTC time: `13:52`\n - UTC offset: `+1hr` (due to daylight time saving)\n* DueDateWithUtcOffset: `\"2015-02-03T11:10:00.0000000+00:00\"`\n - Local time: `11:10`\n - UTC time: `11:10`\n - UTC offset: `0` (no daylight time saving, local time is equivalent to UTC)\n\nNote that the offset may be for a timezone different to your own, so you should alway convert to your own local time for display purposes (e.g. on receipts and terminals).\n\n### Callback timestamps\nTimestamps sent to Just Eat should be recorded as the current local time (including any changes needed to account for daylight saving) with an accompanying offset that shows the difference between the recorded local time and the current UTC time.\n\nIf it is not possible to record timestamps in local time, timestamps may be recorded in UTC time with a 00:00 offset.\n## Async Webhooks\nSome of the webhooks on the platform are configured as being 'async' webhooks. These are for long-running operations, and work as follows:\n 1. Your webhook is invoked with a `?callback={returnUrl}` query string parameter. The `returnUrl` is a unique URL that you will need to send the async response to.\n 2. Return an immediate `202 Accepted` response from the webhook endpoint, to indicate that you have received the request.\n 3. Perform the long-running operation. This can be deemed either a _success_; or a _failure_.\n 4. If the result is a _**success**_, return the following:\n ```\n POST {returnUrl} HTTP/1.1\n\n {\n \"status\": \"Success\",\n \"message\": \"{successMessage}\",\n \"data\": {} // webhook-specific response object\n }\n ```\n 5. Otherwise, if the result is a _**failure**_, return the following:\n ```\n POST {returnUrl} HTTP/1.1\n\n {\n \"status\": \"Failure\",\n \"message\": \"{failureMessage}\",\n \"data\": {} // webhook-specific response object\n }\n ```"
title: Just Eat UK Attempted Delivery API Order Webhooks API
version: 1.0.0
x-apisguru-categories:
- ecommerce
x-logo:
url: https://api.apis.guru/v2/cache/logo/https_twitter.com_JustEatUK_profile_image.png
x-origin:
- format: openapi
url: https://uk.api.just-eat.io/docs/openapi.json
version: '3.0'
x-providerName: just-eat.co.uk
servers:
- description: Production URL for the UK API
url: https://uk.api.just-eat.io
- description: Production URL for the DK, ES, IE, IT and NO API
url: https://i18n.api.just-eat.io
- description: Production URL for the AU and NZ API
url: https://aus.api.just-eat.io
tags:
- name: Order Webhooks
paths:
/order-ready-for-preparation-async:
post:
description: "This webhook will be invoked when we have determined that an order is ready for preparation. Upon receiving the request, you should perform any preparation-related activities, such as sending the order to the POS system / kitchen screen.\n**NOTE:** This version of the webhook is asynchronous, and we expect a response in two parts:\n 1. We expect an immediate `202` response from this webhook to denote that you have received the request;\n 2. Following that, we expect an [async callback](#section/Async-Webhooks) - indicating either success or failure of the operation. The body for the async callbacks are as below:\n \n **Success callback**\n ```\n {\n \"status\": \"Success\",\n \"message\": \"Order successfully sent to POS\",\n \"data\": {}\n }\n ```\n **Failure callback**\n ```\n {\n \"status\": \"Failure\",\n \"message\": \"{errorMessage}\", // e.g. \"The POS is currently in use\"\n \"data\": {}\n }\n ```\n"
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/order-ready-for-preparation'
required: true
responses:
'202':
description: Upon successful receipt of this event, a `202` status code should be returned, indicating the request has been accepted. You should then later respond with the result of processing this request, via the [callback URL](#section/Async-Webhooks) endpoint.
'400':
description: 'Should the initial validation of the order fail, return a `400` status code. NOTE: In this instance we do not also expect a failure callback via the async callback URL.'
summary: Order ready for preparation (async)
tags:
- Order Webhooks
/order-ready-for-preparation-sync:
post:
description: 'This webhook will be invoked when we have determined that an order is ready for preparation. Upon receiving the request, you should perform any preparation-related activities, such as sending the order to the POS system / kitchen screen.
'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/order-ready-for-preparation'
required: true
responses:
'200':
description: Respond with a 200 status code to indicate that you have received the notification.
summary: Order ready for preparation (sync)
tags:
- Order Webhooks
/send-to-pos-failed:
post:
description: 'This webhook will be invoked if we experience an error or timeout in sending an order to the underlying POS / kitchen screen. When notified via this webhook, typically you will perform some form of alerting or backup flow (e.g. ask the operator to enter the order manually into the POS). NOTE: This message contains the `OrderId`, but not the full order. It is assumed that you have stored/cached the full order details earlier in the flow - e.g. via the [/order-ready-for-preparation](#/paths/~1order-ready-for-preparation-sync/post) webhook.'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/send-to-pos-failed'
required: true
responses:
'200':
description: Respond with a 200 status code to indicate that you have received the notification.
summary: Send to POS failed
tags:
- Order Webhooks
components:
schemas:
item-v2:
properties:
Items:
items:
$ref: '#/components/schemas/item-v2'
type: array
Name:
type: string
Quantity:
type: integer
Reference:
type: string
UnitPrice:
format: money
type: integer
type: object
send-to-pos-failed:
properties:
OrderId:
type: string
type: object
order-ready-for-preparation:
example:
Currency: GBP
Customer:
Id: Batman
Name: Bruce Wayne
CustomerNotes:
- Key: Floor
Value: 5th floor
- Key: Code
Value: Code 1234
Fulfilment:
Address:
City: London
Geolocation:
Latitude: 51.51641
Longitude: -0.103198
Lines:
- Fleet Place House
- Fleet Pl
PostalCode: EC4M 7RD
CustomerDueAsap: false
CustomerDueDate: '2018-03-10T14:45:28Z'
Method: Delivery
PhoneNumber: '+441234567890'
IsTest: true
Items:
- Items:
- Items: []
Name: Fries
Quantity: 1
Reference: '9876'
Synonym: Regular
UnitPrice: 0
- Items: []
Name: Pepsi
Quantity: 2
Reference: '6789'
Synonym: 330ml
UnitPrice: 0
Name: Chicken Box Meal
Quantity: 2
Reference: '1234'
Synonym: ''
TotalPrice: 10
UnitPrice: 5
- Items: []
Name: Milkshake
Quantity: 1
Reference: '4321'
Synonym: ''
TotalPrice: 7.25
UnitPrice: 7.25
OrderId: XYZ123456
Payment:
Lines:
- Paid: false
Type: card
Value: 19.25
PlacedDate: '2018-03-10T14:45:28Z'
PriceBreakdown:
Discount: 0
Fees:
Delivery: 1
Other: 0
ServiceCharge: 0.5
Items: 17.25
Taxes: 3.85
Tips: 0.5
Restaurant:
Address:
City: London
Geolocation:
Latitude: 51.4484
Longitude: -0.1504
Lines:
- Oldridge Road
PostalCode: SW12 8PW
Id: '99999'
Name: Just Eat Test Restaurant
PhoneNumber: '+441200000000'
Refererence: R99999
TotalPrice: 19.25
properties:
Currency:
type: string
Customer:
properties:
Id:
type: string
Name:
type: string
type: object
CustomerNotes:
additionalProperties:
type: string
type: object
Fulfilment:
properties:
Address:
properties:
City:
type: string
Geolocation:
$ref: '#/components/schemas/location'
Lines:
items:
type: string
type: array
PostalCode:
type: string
type: object
CustomerDueAsap:
type: boolean
CustomerDueDate:
format: date-time
type: string
Method:
enum:
- Delivery
- Collection
type: string
PhoneNumber:
type: string
PreparationTime:
format: timespan
type: string
PrepareFor:
format: date-time
type: string
type: object
IsTest:
type: boolean
Items:
items:
$ref: '#/components/schemas/item-v2'
type: array
OrderId:
type: string
Payment:
properties:
Lines:
items:
properties:
Paid:
type: boolean
Type:
enum:
- card
- cash
- credit
- other
type: string
Value:
format: money
type: number
type: object
type: array
type: object
PlacedDate:
format: date-time
type: string
PriceBreakdown:
properties:
Discount:
format: money
type: number
Fees:
properties:
Delivery:
format: money
type: number
Other:
format: money
type: number
ServiceCharge:
format: money
type: number
type: object
Items:
format: money
type: number
Taxes:
format: money
type: number
Tips:
format: money
type: number
type: object
Restaurant:
properties:
Address:
properties:
City:
type: string
Geolocation:
$ref: '#/components/schemas/location'
Lines:
items:
type: string
type: array
PostalCode:
type: string
type: object
Id:
type: string
Name:
type: string
PhoneNumber:
type: string
Reference:
type: string
type: object
TotalPrice:
format: money
type: number
type: object
location:
description: GeoLocation object containing latitude and longitude values.
example:
Accuracy: 12.814
Heading: 357.10382
Latitude: 51.51641
Longitude: -0.103198
Speed: 8.68
properties:
Accuracy:
description: This should represent the accuracy of driver's location.
format: double
type: number
Heading:
description: This should represent the degree of heading direction, for example, 0 is north, 90 is east.
format: double
type: number
Latitude:
description: This should represent the latitude of the driver's location.
format: double
type: number
Longitude:
description: This should represent the longitude of the driver's location.
format: double
type: number
Speed:
description: This should represent the travel speed of the driver.
format: double
type: number
required:
- Latitude
- Longitude
type: object
securitySchemes:
Bearer:
bearerFormat: JWT
description: Bearer token authentication using a JSON Web Token (JWT).
scheme: bearer
type: http
api_key:
description: APIs for delivery partners require an API key that will have been issued to you.
in: header
name: Authorization
type: apiKey
basic_auth:
description: A few services allow the use of basic authentication when a partner doesn't support OAuth based authentication.
scheme: basic
type: http
justeat_adfs:
description: ADFS authentication provider for internal Just Eat tools.
openIdConnectUrl: https://adfs.just-eat.com/adfs/.well-known/openid-configuration
type: openIdConnect
restaurantsignup_jwt:
bearerFormat: JWT token with payload `RestaurantId` and Role `[RestaurantRead | VerifyEmail | RestaurantWrite | FullAccess | DocumentRead]`
description: Bearer token authentication using a JSON Web Token (JWT), used by the restaurant sign up system
scheme: bearer
type: http
x-tagGroups:
- name: Consumer Experience
tags:
- Authorization
- Consumers
- ConsumerOffers
- ConsumerQueries
- Consumer Queries Webhooks
- ConsumerOrders
- Search
- Basket
- Payments
- Giftcards
- Experiments
- Vouchers
- Promoted Placement
- Menu
- Recommendations
- Location Services
- name: Manage Order Journey
tags:
- Order Acceptance API
- Order Acceptance Webhooks
- Order Delivery API
- Order Delivery Webhooks
- Order API
- Order Webhooks
- Customer Order Details
- DeliveryFee
- Delivery Pools API
- Attempted Delivery API
- Attempted Delivery Webhooks
- Checkout
- Courier Feedback
- name: Restaurant Management
tags:
- Restaurant Product
- Restaurants
- RestaurantOffers
- Restaurant OrderTimes
- Restaurants Webhooks
- RestaurantSignup
- RestaurantQueries
- RestaurantQueries Webhooks
- Restaurant Claims
- Restaurant Events
- Restaurant Events Webhooks
- Restaurant API
- Restaurant Webhooks
- Products
- Logistics POS Restaurants
- Restaurant Smiley Rating