KDS_API.json

{
  "openapi": "3.1.0",
  "info": {
    "title": "KDS API",
    "description": " Deliverect allows restaurants to directly connect channels like UberEats, Takeaway.com, Glovo and others with their POS system. More info on features and platforms supported on [https://deliverect.com/](https://deliverect.com/) This API can be used to integrate additional channels or POS systems, but also by bigger restaurants",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.staging.deliverect.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Authentication",
      "description": " "
    },
    {
      "name": "Deliverect Endpoints"
    },
    {
      "name": "Partner Webhooks"
    }
  ],
  "paths": {
    "/oauth/token": {
      "post": {
        "tags": ["Authentication"],
        "summary": "Machine 2 Machine Access Token",
        "requestBody": {
          "content": {
            "*/*": {
              "schema": {
                "type": "string",
                "examples": [
                  {
                    "client_id": "{{clientId}}",
                    "client_secret": "{{clientSecret}}",
                    "audience": "https://api.deliverect.com",
                    "grant_type": "token"
                  }
                ]
              }
            }
          }
        },
        "parameters": [
          {
            "name": "content-type",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "example": "application/json"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "Date": {
                "schema": {
                  "type": "string",
                  "examples": ["Wed, 20 Feb 2019 13:18:00 GMT"]
                }
              },
              "Content-Type": {
                "schema": {
                  "type": "string",
                  "examples": ["application/json"]
                }
              },
              "Content-Length": {
                "schema": {
                  "type": "integer",
                  "examples": ["828"]
                }
              },
              "Connection": {
                "schema": {
                  "type": "string",
                  "examples": ["keep-alive"]
                }
              },
              "X-Auth0-RequestId": {
                "schema": {
                  "type": "string",
                  "examples": ["521b1266bf81fec2fb6b"]
                }
              },
              "X-RateLimit-Limit": {
                "schema": {
                  "type": "integer",
                  "examples": ["30"]
                }
              },
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer",
                  "examples": ["29"]
                }
              },
              "X-RateLimit-Reset": {
                "schema": {
                  "type": "integer",
                  "examples": ["1550668681"]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "examples": [
                    "private, no-store, no-cache, must-revalidate, post-check=0, pre-check=0"
                  ]
                }
              },
              "Pragma": {
                "schema": {
                  "type": "string",
                  "examples": ["no-cache"]
                }
              },
              "Strict-Transport-Security": {
                "schema": {
                  "type": "string",
                  "examples": ["max-age=15724800"]
                }
              },
              "X-Robots-Tag": {
                "schema": {
                  "type": "string",
                  "examples": ["noindex, nofollow, nosnippet, noarchive"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "access_token": "ey**-**-Q",
                  "expires_at": 1620899002,
                  "token_type": "Bearer",
                  "scope": "genericPOS provisioning"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "Date": {
                "schema": {
                  "type": "string",
                  "examples": ["Wed, 20 Feb 2019 13:11:39 GMT"]
                }
              },
              "Content-Type": {
                "schema": {
                  "type": "string",
                  "examples": ["application/json"]
                }
              },
              "Content-Length": {
                "schema": {
                  "type": "integer",
                  "examples": ["60"]
                }
              },
              "Connection": {
                "schema": {
                  "type": "string",
                  "examples": ["keep-alive"]
                }
              },
              "X-Auth0-RequestId": {
                "schema": {
                  "type": "string",
                  "examples": ["1bb8a6bbea0c249b00dd"]
                }
              },
              "X-RateLimit-Limit": {
                "schema": {
                  "type": "integer",
                  "examples": ["30"]
                }
              },
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer",
                  "examples": ["29"]
                }
              },
              "X-RateLimit-Reset": {
                "schema": {
                  "type": "integer",
                  "examples": ["1550668300"]
                }
              },
              "WWW-Authenticate": {
                "schema": {
                  "type": "string",
                  "examples": ["Basic realm={{Users}}"]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "examples": [
                    "private, no-store, no-cache, must-revalidate, post-check=0, pre-check=0"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "error": "access_denied",
                  "error_description": "Unauthorized"
                }
              }
            }
          }
        }
      }
    },
    "/kds/orderStatus/{orderId}": {
      "post": {
        "tags": ["Deliverect Endpoints"],
        "summary": "Update Order Status",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "examples": [
                  {
                    "orderId": "6239****835f",
                    "status": 50,
                    "reason": "Order is being prepared."
                  }
                ]
              }
            }
          }
        },
        "parameters": [
          {
            "name": "orderId",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    },
    "/orderStatus/{orderId}": {
      "post": {
        "tags": ["Deliverect Endpoints"],
        "summary": "Update order status",
        "description": "This endpoint allows a POS to update the status of an order at each stage in its preparation. It also allows for the modification of the pickupTime",
        "requestBody": {
          "content": {
            "*/*": {
              "schema": {
                "type": "string",
                "examples": [
                  {
                    "orderId": "5d****e3448c290010****53",
                    "status": 10,
                    "reason": "new order",
                    "timeStamp": "2019-09-05 07:44:15.000Z",
                    "receiptId": "1234"
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "Content-Type",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "example": "application/json"
          },
          {
            "name": "orderId",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "examples": {
                  "example-0": {
                    "summary": "NEW order",
                    "value": {
                      "result": "OK"
                    }
                  },
                  "example-1": {
                    "summary": "Order CANCELED",
                    "value": {
                      "result": "OK"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "default",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "example": null
              }
            }
          }
        }
      }
    },
    "/products/snoozeByTags": {
      "post": {
        "tags": ["Deliverect Endpoints"],
        "summary": "Mark products out of stock by tag",
        "description": "Mark products out of stock for a certain amount of time based on their tag and location. You can use the same call to unsnooze product passing `snoozeEnd` time in the past. ##### NOTE Please note, that here and later all dates and times, coming from/to Deliverect are UTC.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "examples": [
                  {
                    "account": "{{account_id}}",
                    "location": "{{location_id}}",
                    "tags": [1],
                    "snoozeStart": "2019-03-06T15:45:00.000Z",
                    "snoozeEnd": "2019-03-07T15:45:00.000Z"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "default": {
            "description": "default",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "examples": {
                  "example-0": {
                    "summary": "Single tag for all locations",
                    "value": null
                  },
                  "example-1": {
                    "summary": "Single tag for one location",
                    "value": null
                  },
                  "example-2": {
                    "summary": "Multiple tags for all locations",
                    "value": null
                  },
                  "example-3": {
                    "summary": "Multiple tag for one location",
                    "value": null
                  }
                }
              }
            }
          }
        }
      }
    },
    "/products/snoozeByPlus": {
      "post": {
        "tags": ["Deliverect Endpoints"],
        "summary": "Mark products out of stock by PLU",
        "description": "Mark products out of stock for a certain amount of time based on their PLU and location. You can use the same call to unsnooze product passing `snoozeEnd` time in the past.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "examples": [
                  {
                    "account": "{{account_id}}",
                    "location": "{{location_id}}",
                    "plus": ["PLU1"],
                    "snoozeStart": "2019-03-06T15:45:00.000Z",
                    "snoozeEnd": "2019-03-07T15:45:00.000Z"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "default": {
            "description": "default",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "examples": {
                  "example-0": {
                    "summary": "Multiple PLUs across all locations",
                    "value": null
                  },
                  "example-1": {
                    "summary": "Multiple PLUs for one location",
                    "value": null
                  },
                  "example-2": {
                    "summary": "Single PLU for one location",
                    "value": null
                  },
                  "example-3": {
                    "summary": "Single PLU across all locations",
                    "value": null
                  }
                }
              }
            }
          }
        }
      }
    },
    "/allAllergens/": {
      "get": {
        "tags": ["Deliverect Endpoints"],
        "summary": "Allergens and tags",
        "description": "This allows a channel to get allergens and tags existing in Deliverect.",
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "example": "{authToken}"
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": [
                  {
                    "name": "Alcohol",
                    "allergenId": 1
                  },
                  {
                    "name": "Halal",
                    "allergenId": 2
                  },
                  {
                    "name": "Kosher",
                    "allergenId": 3
                  },
                  {
                    "name": "Vegan",
                    "allergenId": 4
                  },
                  {
                    "name": "Vegetarian",
                    "allergenId": 5
                  }
                ]
              }
            }
          }
        }
      }
    },
    "/products": {
          "get": {
          "tags": [
            "Partner Webhooks"
          ],
          "summary": "",
          "description": "Your KDS will receive this type of request every time a user pushes products from within Deliverect.Using these products you can match products in orders coming from Deliverect.",
          "responses": {
            "200": {
              "description": "200",
              "content": {
                "application/json": {
                  "schema": {
                    "type": "object"
                  },
                  "examples": {}
                }
              }
            }
          }
         }
        },
 "/orders": {
          "get": {
          "tags": [
            "Partner Webhooks"
          ],
          "summary": "",
          "description": "An order represents what a customer ordered using a channel",
          "responses": {
            "200": {
              "description": "200",
              "content": {
                "application/json": {
                  "schema": {
                    "type": "object"
                  },
                  "examples": {
                    
                              "orderId": "6239****835f",
                              "account": "620d****0f77",
                              "location": "620d1****0f79",
                              "channelOrderId": "31yr****vyz1",
                              "channelOrderDisplayId": "1z3pW****xCZQ4",
                              "posReceiptId": "",
                              "orderType": 3,
                              "channel": 10000,
                              "pickupTime": "2022-03-03T13:03:00Z",
                              "deliveryIsAsap": false,
                              "note": "",
                              "items": [
                                {
                                  "plu": "CMB-02",
                                  "name": "Vegetarian Rames",
                                  "quantity": 1,
                                  "subItems": [
                                    {
                                      "plu": "VEG-01",
                                      "name": "Vegetables Sayur Lodeh",
                                      "quantity": 1,
                                      "subItems": []
                                    },
                                    {
                                      "plu": "VEG-02",
                                      "name": "Vegetables Mix Tumisan",
                                      "quantity": 1,
                                      "subItems": []
                                    },
                                    {
                                      "plu": "DRN-02",
                                      "name": "Coca Cola Zero Sugar",
                                      "itemRemark": "Iced.",
                                      "quantity": 1,
                                      "subItems": []
                                    }
                                  ],
                                  "itemRemark": "No garlic sauce"
                                }
                              ],
                              "packaging": {
                                "includeCutlery": false
                              },
                              "brandId": "60ba****4c57",
                              "brandName": "Space Bar",
                              "remake": false,
                              "customerName": "MD1",
                              "status": 1
                            
                  }
                }
              }
            }
          }
         }
        },
        "/register": {
          "post": {
            "tags": [
              "Partner Webhooks"
            ],
            "summary": "Register KDS",
            "description": "Webhook called during registration of a KDS in Deliverect. For instance, when a new customer enables a KDS for a location, you will receive the register event.",
            "requestBody": {
              "content": {}
            },
            "responses": {
              "default": {
                "description": "default",
                "headers": {
                  "Content-Type": {
                    "schema": {
                      "type": "string",
                      "examples": [
                        "application/json"
                      ]
                    }
                  }
                },
                "content": {
                  "application/json": {
                    "schema": {
                      "type": "object"
                    },
                    "example": {
                              "productSyncUrl": "https://integrator.com/productSyncUrl",
                              "orderWebhookUrl": "https://integrator.com/orderWebhookUrl",
                              "orderStatusUpdateUrl": "https://integrator.com/orderStatusUpdateUrl"
                          }
                  }
                }
              }
            }
          }
        }

  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}