{"_id":"582c7058e4a4920f00ff005a","__v":1,"project":"56c1e50bce02590d006091c9","category":{"_id":"582c7058e4a4920f00ff0047","version":"582c7058e4a4920f00ff0045","project":"56c1e50bce02590d006091c9","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-07-28T14:07:04.954Z","from_sync":false,"order":2,"slug":"orderconnect","title":"EPOS partners"},"parentDoc":null,"user":"56c2ea5f2c90fa17001b8383","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":["58d25d16af3e92190041a155"],"next":{"pages":[],"description":""},"createdAt":"2016-02-26T12:26:38.052Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"","results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":5,"body":"## Request\n\nOrderconnect will send an Order using the HTTP PUT\n\nPlease see the [Examples](http://developers.just-eat.com/v3.0/docs/item-with-accessories) section for samples with data.\n\nId is the unique order ID Just eat has assigned to the order. Please use this field when making any callbacks relating to Just Eat orders.\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(100)),\\n    \\n    // This is a deprecated ID field that we maintain to support existing implementations\\n    CustomerOrderId (integer),\\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(32)),\\n    \\n    // This field is used to store external references to the order \\n    OrderReference (string(32)),\\n    Order (Order),\\n    Restaurant (Restaurant),\\n    Payment (Payment),\\n    Customer (Customer),\\n    Basket (Basket),\\n    IsAMiniFistPumpOrder (boolean),\\n    CanBeFinalisedUntilDate (string),\\n}\\n\\nOrder\\n{\\n    NoteToRestaurant (string),\\n    ServiceType (string) = ['Collection' or 'Delivery'],\\n    PlacedDate (string(33)),\\n    DueDate (string(33)),\\n    DueDateWithUtcOffset (string(33)),\\n    RdsPickupTimeWithUtcOffset (string(33)),\\n    InitialDueDate (string(33)),\\n    InitialDueDateWithUtcOffset (string(33)),\\n    PromptAsap (boolean)\\n}\\n\\nRestaurant\\n{\\n    Id (string(32)),\\n    Name (string(100)),\\n    PhoneNumber (string(50)),\\n    AddressLines (array[string]),\\n    City (string(64)),\\n    Postcode (string(50)),\\n    Longitude: (double),\\n\\t\\tLatitude: (double),\\n    DispatchMethod (string(32)),\\n    EmailAddress (string(100))\\n}\\n\\nPayment\\n{\\n    PaymentLines (array[PaymentLine]),\\n    DriverTipValue(number),\\n    Total (number),\\n    TotalComplementary (number),\\n    PaidDate (string(33)),\\n    CashOnDelivery (boolean)\\n}\\n\\nPaymentLine \\n{\\n    Type (string) = ['Cash' or 'Card' or 'AccountCredit' or 'Voucher'],\\n    CardFee (number),\\n    Value (number)\\n}\\n\\nCustomer\\n{\\n    Id (string(32)),\\n    Email (string(100)),\\n    Name (string(100)),\\n    Address (string(100)),\\n    City (string(64)),\\n    Postcode (string(50)),\\n    Longitude: (double),\\n\\t\\tLatitude: (double),\\n    PhoneNumber (string(50)),\\n    TimeZone (string(64)),\\n    PreviousRestuarantOrderCount (integer),\\n    GeoLocationAddressParts (array[string])\\n}\\n\\nBasket\\n{\\n    BasketId (string(32)),\\n    MenuId (integer),\\n    Discounts (array[OfferDetails]),\\n    SubTotal (number),\\n    ToSpend (number),\\n    MultiBuyDiscount (number),\\n    Discount (number),\\n    DeliveryCharge (number),\\n    Total (number),\\n    GroupedBasketItems (array[GroupedBasketItem])\\n}\\n\\nOfferDetails \\n{\\n    Id (integer),\\n    Discount (number),\\n    DiscountType (string(64)),\\n    QualifyingValue (number)\\n}\\n\\nGroupedBasketItem \\n{\\n    BasketItem (BasketItem),\\n    Quantity (integer),\\n    CombinedPrice (number),\\n    OrderSubId (integer),\\n    MenuCardNumber (string(32))\\n}\\n\\nBasketItem \\n{\\n    ProductId (integer),\\n    ProductTypeId (integer),\\n    MenuCardNumber (string(32)),\\n    Name (string(256)),\\n    Synonym (string(64)),\\n    UnitPrice (number),\\n    CombinedPrice (number),\\n    MealParts (array[MealPart]),\\n    OptionalAccessories (array[OptionalAccessory]),\\n    RequiredAccessories (array[RequiredAccessory]),\\n    Discounts (array[Discount]),\\n    MultiBuyDiscounts (array[MultiDiscount])\\n}\\n\\nMealPart \\n{\\n    MealPartId (integer),\\n    GroupId (integer),\\n    Name (string(256)),\\n    Synonym (string(64)),\\n    OptionalAccessories (array[OptionalAccessory]),\\n    RequiredAccessories (array[RequiredAccessory])\\n}\\n\\nOptionalAccessory \\n{\\n    OptionalAccessoryId (integer),\\n    Quantity (integer),\\n    UnitPrice (number),\\n    Name (string(64))\\n}\\n\\nRequiredAccessory \\n{\\n    RequiredAccessoryId (integer),\\n    GroupId (integer),\\n    UnitPrice (number),\\n    Name (string(64))\\n}\\n\\nDiscount \\n{\\n    Amount (number),\\n    DiscountType (string(64))\\n}\\n\\nMultiDiscount \\n{\\n    Amount (number),\\n    DiscountType (string(64)),\\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:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  Timestamp (string),\\n  Message (string),\\n  Details (string),\\n  OrderId (string, optional)\\n}\",\n      \"language\": \"smarty\",\n      \"name\": \"JSON\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"body\": \"In the case of any validation failure or unexpected error, 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\\nPlease see the [Examples](http://developers.just-eat.com/v3.0/docs/receive-order-response-body-with-errors) section for samples with data.\",\n  \"title\": \"Order error or failure\"\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    }\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":"epos-receive-order","type":"basic","title":"Receive Order"}
## Request Orderconnect will send an Order using the HTTP PUT Please see the [Examples](http://developers.just-eat.com/v3.0/docs/item-with-accessories) section for samples with data. Id is the unique order ID Just eat has assigned to the order. Please use this field when making any callbacks relating to Just Eat orders. 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(100)),\n \n // This is a deprecated ID field that we maintain to support existing implementations\n CustomerOrderId (integer),\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(32)),\n \n // This field is used to store external references to the order \n OrderReference (string(32)),\n Order (Order),\n Restaurant (Restaurant),\n Payment (Payment),\n Customer (Customer),\n Basket (Basket),\n IsAMiniFistPumpOrder (boolean),\n CanBeFinalisedUntilDate (string),\n}\n\nOrder\n{\n NoteToRestaurant (string),\n ServiceType (string) = ['Collection' or 'Delivery'],\n PlacedDate (string(33)),\n DueDate (string(33)),\n DueDateWithUtcOffset (string(33)),\n RdsPickupTimeWithUtcOffset (string(33)),\n InitialDueDate (string(33)),\n InitialDueDateWithUtcOffset (string(33)),\n PromptAsap (boolean)\n}\n\nRestaurant\n{\n Id (string(32)),\n Name (string(100)),\n PhoneNumber (string(50)),\n AddressLines (array[string]),\n City (string(64)),\n Postcode (string(50)),\n Longitude: (double),\n\t\tLatitude: (double),\n DispatchMethod (string(32)),\n EmailAddress (string(100))\n}\n\nPayment\n{\n PaymentLines (array[PaymentLine]),\n DriverTipValue(number),\n Total (number),\n TotalComplementary (number),\n PaidDate (string(33)),\n CashOnDelivery (boolean)\n}\n\nPaymentLine \n{\n Type (string) = ['Cash' or 'Card' or 'AccountCredit' or 'Voucher'],\n CardFee (number),\n Value (number)\n}\n\nCustomer\n{\n Id (string(32)),\n Email (string(100)),\n Name (string(100)),\n Address (string(100)),\n City (string(64)),\n Postcode (string(50)),\n Longitude: (double),\n\t\tLatitude: (double),\n PhoneNumber (string(50)),\n TimeZone (string(64)),\n PreviousRestuarantOrderCount (integer),\n GeoLocationAddressParts (array[string])\n}\n\nBasket\n{\n BasketId (string(32)),\n MenuId (integer),\n Discounts (array[OfferDetails]),\n SubTotal (number),\n ToSpend (number),\n MultiBuyDiscount (number),\n Discount (number),\n DeliveryCharge (number),\n Total (number),\n GroupedBasketItems (array[GroupedBasketItem])\n}\n\nOfferDetails \n{\n Id (integer),\n Discount (number),\n DiscountType (string(64)),\n QualifyingValue (number)\n}\n\nGroupedBasketItem \n{\n BasketItem (BasketItem),\n Quantity (integer),\n CombinedPrice (number),\n OrderSubId (integer),\n MenuCardNumber (string(32))\n}\n\nBasketItem \n{\n ProductId (integer),\n ProductTypeId (integer),\n MenuCardNumber (string(32)),\n Name (string(256)),\n Synonym (string(64)),\n UnitPrice (number),\n CombinedPrice (number),\n MealParts (array[MealPart]),\n OptionalAccessories (array[OptionalAccessory]),\n RequiredAccessories (array[RequiredAccessory]),\n Discounts (array[Discount]),\n MultiBuyDiscounts (array[MultiDiscount])\n}\n\nMealPart \n{\n MealPartId (integer),\n GroupId (integer),\n Name (string(256)),\n Synonym (string(64)),\n OptionalAccessories (array[OptionalAccessory]),\n RequiredAccessories (array[RequiredAccessory])\n}\n\nOptionalAccessory \n{\n OptionalAccessoryId (integer),\n Quantity (integer),\n UnitPrice (number),\n Name (string(64))\n}\n\nRequiredAccessory \n{\n RequiredAccessoryId (integer),\n GroupId (integer),\n UnitPrice (number),\n Name (string(64))\n}\n\nDiscount \n{\n Amount (number),\n DiscountType (string(64))\n}\n\nMultiDiscount \n{\n Amount (number),\n DiscountType (string(64)),\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:code] { "codes": [ { "code": "{\n Timestamp (string),\n Message (string),\n Details (string),\n OrderId (string, optional)\n}", "language": "smarty", "name": "JSON" } ] } [/block] [block:callout] { "type": "warning", "body": "In the case of any validation failure or unexpected error, 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\nPlease see the [Examples](http://developers.just-eat.com/v3.0/docs/receive-order-response-body-with-errors) section for samples with data.", "title": "Order error or failure" } [/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" } ] } [/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.