{"_id":"586d183ea63f5d2500c86b7a","parentDoc":null,"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"},"user":"5809ea66629bf91900cd139f","__v":2,"project":"56c1e50bce02590d006091c9","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"},"updates":["58ca7f93d8e4f11b0033ab34","596691604a864e00295aac81"],"next":{"pages":[],"description":""},"createdAt":"2017-01-04T15:43:58.958Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"","results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":2,"body":"## Request\n\nOrderconnect will send Orders to a URL specified by the partner (for instance, http://partnerdomain.com/orders).  This event will be sent using the PUT HTTP method.\n\nPlease see the [Examples](http://developers.just-eat.com/v3.0/docs/item-with-accessories) section for samples with data.\n\nId (string(32)) is the unique ID that Just Eat has assigned to each order.  Please use this ID whenever sending requests related to the order.\n\nJSON Format:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"ConnectOrder \\n{\\n\\t\\t// This is the unique JE ID which should be used when sending JE updates about the order\\n    Id: string,\\n    \\n    // This is a deprecated customer-facing ID that we maintain to support existing implementations\\n    CustomerOrderId: number,\\n  \\n  \\t// This is the customer-facing ID for the order, which should be used in any UI or receipts to identify the order to the customer, driver or restaurant\\n    FriendlyOrderReference : string,\\n  \\n  \\t// This field is used to store external references to the order \\n    OrderReference: string,\\n    \\n    // Order Information\\n    Order: OrderInfo,\\n    \\n    // Restaurant Information\\n    RestaurantInfo: RestaurantInfo,\\n    \\n    // Payment Information\\n    PaymentInfo: PaymentInfo,\\n    \\n    // Delivery Information\\n    CustomerInfo: CustomerInfo,\\n    \\n    // Food Ordered\\n    BasketInfo: BasketInfo,\\n    \\n    // Legacy Promotion - Ignore\\n    IsAMiniFistPumpOrder: boolean\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"OrderInfo \\n{\\n\\t\\t// Notes from the customer about their order.  In addition to notes for the\\n  \\t// restaurant, this field can also delivery instructions - and should be \\n\\t\\t// displayed to the delivery driver\\n    NoteToRestaurant: string,\\n    \\n    ServiceType: string = ['Collection' or 'Delivery'],\\n    \\n    // Date Customer placed the order. Note that JE accepts pre-orders therefore\\n  \\t// there may be a significant difference between Placed Date and Due Date\\n  \\t// This Date/Time is set as UTC without an offset, regardless of Country\\n    PlacedDate: string,\\n    \\n    // Ignore - use DueDateWithUtcOffset\\n    DueDate: string(33),\\n    \\n    // The DateTime when the Customer has been told they will receive the Order\\n    DueDateWithUtcOffset: string,\\n    \\n    // When the RDS Partner needs to be at the Restaurant to pickup the Order\\n    RdsPickupTimeWithUtcOffset: string,\\n    \\n  \\t// Ignore - use IntialDueDateWithUtcOffset\\n    InitialDueDate: string,\\n  \\n  \\t// When the Customer was originally told the order would be delivered\\n  \\t// (prior to Restaurant adjustment)\\n    InitialDueDateWithUtcOffset: string,\\n    \\n    // Did the Customer request the Order to ready ASAP\\n    PromptAsap: boolean\\n}\\n\\nRestaurantInfo \\n{\\n\\t\\t// Unique ID of the Restaurant\\n    Id: string,\\n    \\n    // The name of the Restaurant\\n    Name: string,\\n    \\n    // The Restaurant phone number\\n    PhoneNumber: string,\\n    \\n    // The Restaurant address\\n    AddressLines: string[],\\n    City: string,\\n    Postcode: string,\\n  \\n  \\t// Restaurant address longitude. Will be 0 if not provided\\n  \\tLongitude: number,\\n  \\n  \\t// Restaurant address latitude. Will be 0 if not provided\\n    Latitude: number,\\n  \\n  \\t// GPS, Wifi\\n    LocationSource: string,\\n    LocationAccuracyInMeters: number,\\n  \\n  \\t// Human readable description of accuracy\\n    LocationAccuracyDescription: string,\\n    \\n    // JustEat device used by the Restaurant\\n    DispatchMethod: string,\\n    \\n    // Email address for the Restaurant\\n    EmailAddress: string\\n}\\n\\nPaymentInfo \\n{\\n\\t\\t// How the Customer has paid for the Order\\n    PaymentLines: PaymentLine[],\\n    \\n    // The value of the tip given to the Driver\\n    DriverTipValue: number,\\n    \\n    // The total order value\\n    Total: number,\\n  \\n  \\t// Order amount covered by Just Eat\\n    TotalComplementary: number,\\n    \\n    // DateTime when the Order was Paid (excludes UTC offset)\\n    PaidDate: string,\\n    \\n    // Is the Customer paying on Delivery\\n    CashOnDelivery: boolean\\n}\\n\\nPaymentLine \\n{\\n\\t\\t// How was the order Paid\\n    Type: string = ['Cash' or 'Card' or 'AccountCredit' or 'Voucher'],\\n    \\n    // Was there a fee for the payment mechanism\\n    CardFee: number,\\n    \\n    // The value of the payment\\n    Value: number\\n}\\n\\nCustomerInfo \\n{\\n\\t\\t// JE Customer Id\\n    Id: string,\\n    \\n    // Customer email address\\n    Email: string,\\n    \\n    // Customer Name\\n    Name: string,\\n    \\n    // Customer Address. Note that Address is comma delimited\\n    Address: string,\\n    City: string,\\n    Postcode: string,\\n    \\n    // Customer contact telephone number\\n    PhoneNumber: string,\\n    \\n    // Customer timezone, e.g. 'Central European Standard Time'\\n    TimeZone: string,\\n    \\n    // The number of Orders the Customer has placed at this Restaurant via JE\\n    PreviousRestuarantOrderCount: number,\\n    \\n    // As per Address field, but split into an array of Address parts\\n    GeoLocationAddressParts: string[]\\n}\\n\\n// Information about the Order\\nBasketInfo \\n{\\n  \\t// Unique Basket Id for the Order\\n    BasketId: string,\\n  \\n  \\t// The Id of the Menu the Basket was populated from\\n    MenuId: number,\\n  \\t\\n  \\t// Any Discounts applied to the Order\\n  \\t// see http://developers.just-eat.com/docs/mealdeal-with-accessories-and-discount\\n    Discounts: OfferDetails[],\\n  \\n  \\t// The Basket total cost, excluding any discounts\\n    SubTotal: number,\\n  \\n  \\t\\n    ToSpend: number,\\n  \\n  \\t// Discount amount related to MultiBuy offers\\n    MultiBuyDiscount: number,\\n  \\n  \\t// Discount amount related to oter offers\\n    Discount: number,\\n  \\n  \\t// The Delivery charge for the Order\\n    DeliveryCharge: number,\\n  \\n  \\t// The total charge to the Customer\\n    Total: number,\\n  \\n  \\t// The Basket contents\\n    GroupedBasketItems: GroupedBasketItem[]\\n}\\n\\nOfferDetails \\n{\\n  \\t// Unique discount Id\\n    Id: number,\\n  \\n  \\t// The discount amount, used in conjunction with DiscountType\\n    Discount: number,\\n  \\n  \\t// The type of discount, e.g. a percentage or the order or fixed amount\\n    DiscountType: string,\\n  \\n  \\t// The minimum order amount in order for this discount to be applicable\\n    QualifyingValue: number\\n}\\n\\nGroupedBasketItem \\n{\\n  \\t// An item in the Basket\\n  \\tBasketItem: BasketItem,\\n  \\n  \\t// The quanity of Basket Items requested\\n    Quantity: number,\\n  \\n  \\t// The total price of the Basket Item (including discounts)\\n    CombinedPrice: number,\\n  \\n    OrderSubId: integer,\\n    MenuCardNumber: string\\n}\\n\\nBasketItem \\n{\\n  \\t// Unique Product Id\\n    ProductId: number,\\n    ProductTypeId: number,\\n    MenuCardNumber: string,\\n  \\n  \\t// The Item name, e.g. Chicken Tikka Masala or Family Meal Deal 3\\n    Name: string,\\n  \\n  \\t// Legacy - ignore\\n    Synonym: string,\\n  \\n  \\t// The price of the item\\n    UnitPrice: number,\\n  \\n  \\t// Unit Price plus individual Meal Part item cost\\n    CombinedPrice: number,\\n  \\n  \\t// Represents sub-parts of a meal. See http://developers.just-eat.com/docs/mealdeal-with-accessories-and-discount\\n    MealParts: MealPart[],\\n  \\n  \\t// An option item added to the Basket Item, this may be options such as Garlic Bread or a bottle of Coke\\n    OptionalAccessories: OptionalAccessory[],\\n  \\n  \\t// Items required as part of the Item, for example, Pizza base sauce\\n    RequiredAccessories: RequiredAccessory[],\\n  \\n  \\t// Any discounts applied to this specfic item\\n    Discounts: Discount[],\\n  \\n  \\t// Any multi-purchase discounts appled to this item\\n    MultiBuyDiscounts: MultiDiscount[]\\n}\\n\\n \\nMealPart \\n{  \\t\\n    MealPartId: number,\\n    GroupId: number,\\n    Name: string,\\n    Synonym: string,\\n    OptionalAccessories: OptionalAccessory[],\\n    RequiredAccessories: RequiredAccessory[]\\n}\\n\\nOptionalAccessory \\n{\\n    OptionalAccessoryId: number,\\n    Quantity: number,\\n    UnitPrice: number,\\n    Name: string\\n}\\n\\nRequiredAccessory \\n{\\n    RequiredAccessoryId: number,\\n    GroupId: number,\\n    UnitPrice: number,\\n    Name: string\\n}\\n\\nDiscount \\n{\\n    Amount: number,\\n    DiscountType string\\n}\\n\\nMultiDiscount \\n{\\n    Amount: number,\\n    DiscountType: string,\\n    OrderItemId: string,\\n    ProductTypeId: integer\\n}\",\n      \"language\": \"json\",\n      \"name\": \"JSON\"\n    }\n  ]\n}\n[/block]\n## Response\n\nIn the event of successful receipt of an Order, a 201 status code should be returned, indicating acknowledgement of transmission success.\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"body\": \"In the case that the order cannot be accepted, an appropriate HTTP status code, such as 400 (Bad request) or 500 (Internal server error) should be returned.\\n\\nIn addition to the HTTP status code, a specific reason code and explanatory message should be provided within the response body.  Please see below for the required format and content of this response.\",\n  \"title\": \"Order rejection\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"errors\\\": [\\n        {\\n            \\\"code\\\": \\\"string\\\",\\n            \\\"message\\\": \\\"string (optional)\\\"\\n        },\\n        {\\n            \\\"code\\\": \\\"string\\\",\\n            \\\"message\\\": \\\"string (optional)\\\"\\n        }\\n    ]\\n}\",\n      \"language\": \"json\",\n      \"name\": \"JSON\"\n    }\n  ]\n}\n[/block]\n**Error codes**\n\nEach code should be selected from the following list of valid reasons.\n\n**outside_hours**\nDelivery partner is closed and not accepting requests.\n**too_busy**\nDelivery partner does not have enough capacity to accept this request.\n**too_far**\nThe customer is too far away from the restaurant, either by time or distance.\n**not_supported**\nDelivery partner is currently unable to deliver to the customer's location.\n**bad_address**\nThe order contains an address that could not be processed or understood.\n**bad_request**\nThe order format is invalid or the order contains required data or information that cannot be processed.\n**restaurant_not_configured**\nDelivery partner is not configured to accept requests for given restaurant.\n**duplicate**\nThe request has already been processed before.\n**other**\nAny validation failure or unexpected error not covered by the above codes.\n\n**Error messages**\n\nThe accompanying message should, in each case, provide an explanation of the **specific** problem that was experienced.  Please note that the accompanying explanatory text above is only intended as an explanation of each reason code - and should **not** be returned to us as the message.","excerpt":"","slug":"receive-order","type":"basic","title":"Receive orders from Just Eat"}

Receive orders from Just Eat


## Request Orderconnect will send Orders to a URL specified by the partner (for instance, http://partnerdomain.com/orders). This event will be sent using the PUT HTTP method. Please see the [Examples](http://developers.just-eat.com/v3.0/docs/item-with-accessories) section for samples with data. Id (string(32)) is the unique ID that Just Eat has assigned to each order. Please use this ID whenever sending requests related to the order. JSON Format: [block:code] { "codes": [ { "code": "ConnectOrder \n{\n\t\t// This is the unique JE ID which should be used when sending JE updates about the order\n Id: string,\n \n // This is a deprecated customer-facing ID that we maintain to support existing implementations\n CustomerOrderId: number,\n \n \t// This is the customer-facing ID for the order, which should be used in any UI or receipts to identify the order to the customer, driver or restaurant\n FriendlyOrderReference : string,\n \n \t// This field is used to store external references to the order \n OrderReference: string,\n \n // Order Information\n Order: OrderInfo,\n \n // Restaurant Information\n RestaurantInfo: RestaurantInfo,\n \n // Payment Information\n PaymentInfo: PaymentInfo,\n \n // Delivery Information\n CustomerInfo: CustomerInfo,\n \n // Food Ordered\n BasketInfo: BasketInfo,\n \n // Legacy Promotion - Ignore\n IsAMiniFistPumpOrder: boolean\n}", "language": "json" } ] } [/block] [block:code] { "codes": [ { "code": "OrderInfo \n{\n\t\t// Notes from the customer about their order. In addition to notes for the\n \t// restaurant, this field can also delivery instructions - and should be \n\t\t// displayed to the delivery driver\n NoteToRestaurant: string,\n \n ServiceType: string = ['Collection' or 'Delivery'],\n \n // Date Customer placed the order. Note that JE accepts pre-orders therefore\n \t// there may be a significant difference between Placed Date and Due Date\n \t// This Date/Time is set as UTC without an offset, regardless of Country\n PlacedDate: string,\n \n // Ignore - use DueDateWithUtcOffset\n DueDate: string(33),\n \n // The DateTime when the Customer has been told they will receive the Order\n DueDateWithUtcOffset: string,\n \n // When the RDS Partner needs to be at the Restaurant to pickup the Order\n RdsPickupTimeWithUtcOffset: string,\n \n \t// Ignore - use IntialDueDateWithUtcOffset\n InitialDueDate: string,\n \n \t// When the Customer was originally told the order would be delivered\n \t// (prior to Restaurant adjustment)\n InitialDueDateWithUtcOffset: string,\n \n // Did the Customer request the Order to ready ASAP\n PromptAsap: boolean\n}\n\nRestaurantInfo \n{\n\t\t// Unique ID of the Restaurant\n Id: string,\n \n // The name of the Restaurant\n Name: string,\n \n // The Restaurant phone number\n PhoneNumber: string,\n \n // The Restaurant address\n AddressLines: string[],\n City: string,\n Postcode: string,\n \n \t// Restaurant address longitude. Will be 0 if not provided\n \tLongitude: number,\n \n \t// Restaurant address latitude. Will be 0 if not provided\n Latitude: number,\n \n \t// GPS, Wifi\n LocationSource: string,\n LocationAccuracyInMeters: number,\n \n \t// Human readable description of accuracy\n LocationAccuracyDescription: string,\n \n // JustEat device used by the Restaurant\n DispatchMethod: string,\n \n // Email address for the Restaurant\n EmailAddress: string\n}\n\nPaymentInfo \n{\n\t\t// How the Customer has paid for the Order\n PaymentLines: PaymentLine[],\n \n // The value of the tip given to the Driver\n DriverTipValue: number,\n \n // The total order value\n Total: number,\n \n \t// Order amount covered by Just Eat\n TotalComplementary: number,\n \n // DateTime when the Order was Paid (excludes UTC offset)\n PaidDate: string,\n \n // Is the Customer paying on Delivery\n CashOnDelivery: boolean\n}\n\nPaymentLine \n{\n\t\t// How was the order Paid\n Type: string = ['Cash' or 'Card' or 'AccountCredit' or 'Voucher'],\n \n // Was there a fee for the payment mechanism\n CardFee: number,\n \n // The value of the payment\n Value: number\n}\n\nCustomerInfo \n{\n\t\t// JE Customer Id\n Id: string,\n \n // Customer email address\n Email: string,\n \n // Customer Name\n Name: string,\n \n // Customer Address. Note that Address is comma delimited\n Address: string,\n City: string,\n Postcode: string,\n \n // Customer contact telephone number\n PhoneNumber: string,\n \n // Customer timezone, e.g. 'Central European Standard Time'\n TimeZone: string,\n \n // The number of Orders the Customer has placed at this Restaurant via JE\n PreviousRestuarantOrderCount: number,\n \n // As per Address field, but split into an array of Address parts\n GeoLocationAddressParts: string[]\n}\n\n// Information about the Order\nBasketInfo \n{\n \t// Unique Basket Id for the Order\n BasketId: string,\n \n \t// The Id of the Menu the Basket was populated from\n MenuId: number,\n \t\n \t// Any Discounts applied to the Order\n \t// see http://developers.just-eat.com/docs/mealdeal-with-accessories-and-discount\n Discounts: OfferDetails[],\n \n \t// The Basket total cost, excluding any discounts\n SubTotal: number,\n \n \t\n ToSpend: number,\n \n \t// Discount amount related to MultiBuy offers\n MultiBuyDiscount: number,\n \n \t// Discount amount related to oter offers\n Discount: number,\n \n \t// The Delivery charge for the Order\n DeliveryCharge: number,\n \n \t// The total charge to the Customer\n Total: number,\n \n \t// The Basket contents\n GroupedBasketItems: GroupedBasketItem[]\n}\n\nOfferDetails \n{\n \t// Unique discount Id\n Id: number,\n \n \t// The discount amount, used in conjunction with DiscountType\n Discount: number,\n \n \t// The type of discount, e.g. a percentage or the order or fixed amount\n DiscountType: string,\n \n \t// The minimum order amount in order for this discount to be applicable\n QualifyingValue: number\n}\n\nGroupedBasketItem \n{\n \t// An item in the Basket\n \tBasketItem: BasketItem,\n \n \t// The quanity of Basket Items requested\n Quantity: number,\n \n \t// The total price of the Basket Item (including discounts)\n CombinedPrice: number,\n \n OrderSubId: integer,\n MenuCardNumber: string\n}\n\nBasketItem \n{\n \t// Unique Product Id\n ProductId: number,\n ProductTypeId: number,\n MenuCardNumber: string,\n \n \t// The Item name, e.g. Chicken Tikka Masala or Family Meal Deal 3\n Name: string,\n \n \t// Legacy - ignore\n Synonym: string,\n \n \t// The price of the item\n UnitPrice: number,\n \n \t// Unit Price plus individual Meal Part item cost\n CombinedPrice: number,\n \n \t// Represents sub-parts of a meal. See http://developers.just-eat.com/docs/mealdeal-with-accessories-and-discount\n MealParts: MealPart[],\n \n \t// An option item added to the Basket Item, this may be options such as Garlic Bread or a bottle of Coke\n OptionalAccessories: OptionalAccessory[],\n \n \t// Items required as part of the Item, for example, Pizza base sauce\n RequiredAccessories: RequiredAccessory[],\n \n \t// Any discounts applied to this specfic item\n Discounts: Discount[],\n \n \t// Any multi-purchase discounts appled to this item\n MultiBuyDiscounts: MultiDiscount[]\n}\n\n \nMealPart \n{ \t\n MealPartId: number,\n GroupId: number,\n Name: string,\n Synonym: string,\n OptionalAccessories: OptionalAccessory[],\n RequiredAccessories: RequiredAccessory[]\n}\n\nOptionalAccessory \n{\n OptionalAccessoryId: number,\n Quantity: number,\n UnitPrice: number,\n Name: string\n}\n\nRequiredAccessory \n{\n RequiredAccessoryId: number,\n GroupId: number,\n UnitPrice: number,\n Name: string\n}\n\nDiscount \n{\n Amount: number,\n DiscountType string\n}\n\nMultiDiscount \n{\n Amount: number,\n DiscountType: string,\n OrderItemId: string,\n ProductTypeId: integer\n}", "language": "json", "name": "JSON" } ] } [/block] ## Response In the event of successful receipt of an Order, a 201 status code should be returned, indicating acknowledgement of transmission success. [block:callout] { "type": "warning", "body": "In the case that the order cannot be accepted, an appropriate HTTP status code, such as 400 (Bad request) or 500 (Internal server error) should be returned.\n\nIn addition to the HTTP status code, a specific reason code and explanatory message should be provided within the response body. Please see below for the required format and content of this response.", "title": "Order rejection" } [/block] [block:code] { "codes": [ { "code": "{\n \"errors\": [\n {\n \"code\": \"string\",\n \"message\": \"string (optional)\"\n },\n {\n \"code\": \"string\",\n \"message\": \"string (optional)\"\n }\n ]\n}", "language": "json", "name": "JSON" } ] } [/block] **Error codes** Each code should be selected from the following list of valid reasons. **outside_hours** Delivery partner is closed and not accepting requests. **too_busy** Delivery partner does not have enough capacity to accept this request. **too_far** The customer is too far away from the restaurant, either by time or distance. **not_supported** Delivery partner is currently unable to deliver to the customer's location. **bad_address** The order contains an address that could not be processed or understood. **bad_request** The order format is invalid or the order contains required data or information that cannot be processed. **restaurant_not_configured** Delivery partner is not configured to accept requests for given restaurant. **duplicate** The request has already been processed before. **other** Any validation failure or unexpected error not covered by the above codes. **Error messages** The accompanying message should, in each case, provide an explanation of the **specific** problem that was experienced. Please note that the accompanying explanatory text above is only intended as an explanation of each reason code - and should **not** be returned to us as the message.