{
  "openapi": "3.2.0",
  "info": {
    "title": "Xeniola API",
    "description": "Read the menu, place takeaway and delivery orders, follow them, quote delivery and book tables for one restaurant. Send a key from Integrations as Authorization: Bearer xen_live_… from your own server, never from a browser. Creates need an Idempotency-Key header; sending the same key again answers the first result. A refusal answers 422 with error.code, error.message and error.field.",
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://xeniola.com"
    }
  ],
  "paths": {
    "/api/v1/delivery/quote": {
      "get": {
        "tags": [
          "Delivery"
        ],
        "parameters": [
          {
            "name": "pinCode",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    },
    "/api/v1/menu": {
      "get": {
        "tags": [
          "Menu"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    },
    "/api/v1/menu/availability": {
      "get": {
        "tags": [
          "Menu"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    },
    "/api/v1/orders": {
      "post": {
        "tags": [
          "Orders"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OnlineOrderRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/OnlineOrderRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/OnlineOrderRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    },
    "/api/v1/orders/{id}": {
      "get": {
        "tags": [
          "Orders"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    },
    "/api/v1/reservations/slots": {
      "get": {
        "tags": [
          "Reservations"
        ],
        "parameters": [
          {
            "name": "day",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "people",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    },
    "/api/v1/reservations": {
      "post": {
        "tags": [
          "Reservations"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BookingRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/BookingRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/BookingRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": { }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "BookingRequest": {
        "required": [
          "name",
          "phone",
          "day",
          "time"
        ],
        "type": "object",
        "properties": {
          "name": {
            "maxLength": 120,
            "minLength": 0,
            "type": [
              "null",
              "string"
            ]
          },
          "phone": {
            "type": [
              "null",
              "string"
            ]
          },
          "email": {
            "type": [
              "null",
              "string"
            ]
          },
          "people": {
            "maximum": 200,
            "minimum": 1,
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "day": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "time": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "maxLength": 500,
            "minLength": 0,
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "OnlineOrderLine": {
        "required": [
          "itemId"
        ],
        "type": "object",
        "properties": {
          "itemId": {
            "type": [
              "null",
              "string"
            ]
          },
          "variantId": {
            "type": [
              "null",
              "string"
            ]
          },
          "modifierIds": {
            "type": [
              "null",
              "string"
            ]
          },
          "quantity": {
            "maximum": 999,
            "minimum": 1,
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "note": {
            "maxLength": 200,
            "minLength": 0,
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "OnlineOrderRequest": {
        "required": [
          "kind",
          "name",
          "phone",
          "lines"
        ],
        "type": "object",
        "properties": {
          "kind": {
            "type": [
              "null",
              "string"
            ]
          },
          "name": {
            "maxLength": 100,
            "minLength": 0,
            "type": [
              "null",
              "string"
            ]
          },
          "phone": {
            "type": [
              "null",
              "string"
            ]
          },
          "email": {
            "type": [
              "null",
              "string"
            ]
          },
          "address": {
            "type": [
              "null",
              "string"
            ]
          },
          "pinCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "landmark": {
            "type": [
              "null",
              "string"
            ]
          },
          "payMode": {
            "type": [
              "null",
              "string"
            ]
          },
          "dueAt": {
            "type": [
              "null",
              "string"
            ]
          },
          "lines": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/OnlineOrderLine"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "api_key": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "xen_live_…"
      }
    }
  },
  "security": [
    {
      "api_key": [ ]
    }
  ],
  "tags": [
    {
      "name": "Delivery"
    },
    {
      "name": "Menu"
    },
    {
      "name": "Orders"
    },
    {
      "name": "Reservations"
    }
  ]
}