{
    "openapi": "3.1.0",
    "info": {
        "title": "Plateform API",
        "description": "REST API for managing reservations, orders, customers, and locations on Plateform.\n\nInteractive documentation (Swagger UI): **`/documentation/`** on your Plateform domain (e.g. `https://your-restaurant.plateform.app/documentation/`).\n\n**API v2** (same endpoints under `/api/rest/v2/`, plus WiFi/freebies integrations): **`/documentation/v2/`**.\n\nOpenAPI JSON spec: **`/documentation/api.php`** (v1) · **`/documentation/v2/api.php`** (v2).\n\n### Base URL and routing\n\nAll v1 endpoints follow:\n\n```\nPOST|GET https://{domain}/api/rest/v1/{resource}/{action}\n```\n\nExamples: `/api/rest/v1/reserve/create`, `/api/rest/v1/customer/get`, `/api/rest/v1/location/availability`.\n\nThe path is rewritten server-side to `api/rest/v1/{resource}.php?action={action}`.\n\n### Authentication\n\nHTTP **Basic Auth** (see **Authorize** above):\n\n| Field | Value |\n|-------|-------|\n| Username | Location ID (`idTabellaStrutture`) |\n| Password | API Hash of the location |\n\n### Transport and content type\n\n- **HTTPS required** in production (port 443).\n- **POST** endpoints: send parameters in the **JSON request body** (`Content-Type: application/json`). Query-string parameters on POST endpoints are **ignored** by the server.\n- **GET** endpoints (`customer/get`, `reserve/getReservationsByCustomer`, `location/zones`, `utils/checkcredentials`): parameters go in the **query string**.\n\n### Recommended headers\n\n| Header | Required | Description |\n|--------|----------|-------------|\n| `X-Source` | No | Identifies the integration partner (e.g. `MyPOS`, `PartnerApp`). Logged with each API call. |\n| `external_channel` | No | On `reserve/create`, overrides the booking source label (default: `API`). |\n\n### Phone number formats\n\n| Context | Format | Example |\n|---------|--------|---------|\n| Create/update (`reserve`, `customer`, `orders`) | `prefix_number` (no `+`) + `telephone_number` (national digits) | `44` + `7700900123` |\n| Search (`customer/get`, `reserve/getReservationsByCustomer`) | E.164, with or without `+` | `+447700900123` or `447700900123` |\n| Stored / matched in CRM | Digits only: country code + national number (no `+`) | `447700900123` |\n\nEmail **or** a valid phone pair is required on create endpoints when contact data is mandatory.\n\n### Error responses\n\nFailed operations may include an numeric **`errorCode`** field (e.g. `30007` = no slots, `30008` = location closed on date, `30101` = no timetable for date). HTTP status and `msg` / `msgError` describe the outcome.\n\n### Availability vs timetable\n\n- **`location/availability`**: checks a specific date/time/people; returns `30008` when the location is closed, `30007` when open but fully booked.\n- **`location/timetable`**: lists all slots for a date; closed days return HTTP 200 with `status: false` and `errorCode: 30101`.",
        "version": "1.0"
    },
    "paths": {
        "/api/rest/v1/customer/create": {
            "post": {
                "tags": [
                    "Customer"
                ],
                "summary": "Create a Customer",
                "operationId": "bea387e595a712ccbe3a4ec56764c34f",
                "requestBody": {
                    "description": "All parameters must be sent in the JSON body (query parameters are not read). Email or prefix_number+telephone_number required.",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "first_name",
                                    "last_name"
                                ],
                                "properties": {
                                    "first_name": {
                                        "type": "string",
                                        "example": "Mario"
                                    },
                                    "last_name": {
                                        "type": "string",
                                        "example": "Rossi"
                                    },
                                    "email": {
                                        "type": "string",
                                        "format": "email",
                                        "example": "email@example.com"
                                    },
                                    "prefix_number": {
                                        "description": "International prefix without + (e.g. 39 Italy, 44 UK)",
                                        "type": "string",
                                        "example": "44"
                                    },
                                    "telephone_number": {
                                        "description": "National number without country prefix",
                                        "type": "string",
                                        "example": "7700900123"
                                    },
                                    "flag_marketing": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "flag_privacy": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "note": {
                                        "type": "string",
                                        "example": "note"
                                    },
                                    "language": {
                                        "type": "string",
                                        "example": "en"
                                    },
                                    "tags": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        },
                                        "example": [
                                            "tag1",
                                            "tag2"
                                        ]
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "msg": {
                                            "type": "string",
                                            "example": "Customer created successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad Parameters",
                        "content": {
                            "application/json": {
                                "schema": {},
                                "example": {
                                    "status": false,
                                    "msgError": "Missing X Parameter or wrong parameters"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Bad Credentials",
                        "content": {
                            "application/json": {
                                "schema": {},
                                "example": {
                                    "status": false,
                                    "msgError": "USERNAME OR PASSWORD INCORRECT"
                                }
                            }
                        }
                    },
                    "405": {
                        "description": "Method Http not allowed",
                        "content": {
                            "application/json": {
                                "schema": {},
                                "example": {
                                    "status": false,
                                    "msgError": "HTTPS ONLY"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Processing Error",
                        "content": {
                            "application/json": {
                                "schema": {},
                                "example": {
                                    "status": false,
                                    "msgError": "Error during creation"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "basicAuth": []
                    }
                ]
            }
        },
        "/api/rest/v1/customer/get": {
            "get": {
                "tags": [
                    "Customer"
                ],
                "summary": "Retrieve a Customer",
                "operationId": "b78ff668b47bda39a7b66e351d9cd38d",
                "parameters": [
                    {
                        "name": "name",
                        "in": "query",
                        "description": "Client's Name <br>example: Mario",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "lastname",
                        "in": "query",
                        "description": "Client's Surname <br>example: Rossi",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "email",
                        "in": "query",
                        "description": "Client's email (required only without a telephone number)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "email"
                        }
                    },
                    {
                        "name": "phonenumber",
                        "in": "query",
                        "description": "Phone number in E.164 format (with or without +). Example: +447701234567 or 447701234567",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "id",
                        "in": "query",
                        "description": "Customer ID",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad request"
                    }
                },
                "security": [
                    {
                        "basicAuth": []
                    }
                ]
            }
        },
        "/api/rest/v1/location/availability": {
            "post": {
                "tags": [
                    "Location"
                ],
                "summary": "Check if a location is available for a specific date and time",
                "description": "Check if a location is available for a specific date and time. If not, it will return the next available time slots up to 3 hours later from the selected time.",
                "operationId": "5647b9f75b57d5c065315d8aa4518dc2",
                "requestBody": {
                    "description": "All parameters must be sent in the JSON body (query parameters are not read).",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "title": "Api request availability",
                                "description": "Api request availability",
                                "properties": {
                                    "date": {
                                        "description": "Date of the reservation",
                                        "type": "string",
                                        "example": "2023-11-06"
                                    },
                                    "time": {
                                        "description": "Hour of the reservation",
                                        "type": "string",
                                        "example": "22:00"
                                    },
                                    "people": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "zone": {
                                        "type": "integer",
                                        "example": 1190
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success. (Check schema section for more details)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "description": "The response code. Can be true or false depending availability",
                                            "type": "boolean"
                                        },
                                        "msg": {
                                            "description": "The response message",
                                            "type": "string"
                                        }
                                    },
                                    "type": "object",
                                    "example": {
                                        "status": true,
                                        "msg": "Available for 1 people at 22:00 on 2023-11-06"
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "No spots available for selected time and date.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "description": "The response status",
                                            "type": "boolean"
                                        },
                                        "msg": {
                                            "description": "Response message",
                                            "type": "string"
                                        },
                                        "next_availability": {
                                            "description": "Next available time slots",
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "time": {
                                                        "description": "Available time",
                                                        "type": "string"
                                                    },
                                                    "zone": {
                                                        "description": "Time zone",
                                                        "type": "string"
                                                    },
                                                    "pax": {
                                                        "description": "Number of people",
                                                        "type": "integer"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object",
                                    "example": {
                                        "status": false,
                                        "msg": "No spots available for selected time and date.",
                                        "next_availability": [
                                            {
                                                "time": "20:00",
                                                "zone": "0",
                                                "pax": 23
                                            },
                                            {
                                                "time": "20:15",
                                                "zone": "1513",
                                                "pax": 38
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad parameters (3xxxx), fully booked (30007) or location closed (30008)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "oneOf": [
                                        {
                                            "example": {
                                                "status": false,
                                                "msg": "No more slots available for 4 people",
                                                "errorCode": 30007
                                            }
                                        },
                                        {
                                            "example": {
                                                "status": false,
                                                "msg": "Location closed on 2023-11-06",
                                                "errorCode": 30008
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Bad Credentials",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "example": {
                                        "status": false,
                                        "msgError": "USERNAME OR PASSWORD INCORRECT"
                                    }
                                }
                            }
                        }
                    },
                    "405": {
                        "description": "Method Http not allowed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "example": {
                                        "status": false,
                                        "msgError": "HTTPS ONLY"
                                    }
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Processing Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "example": {
                                        "status": false,
                                        "msgError": "Error during creation"
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "basicAuth": []
                    }
                ]
            }
        },
        "/api/rest/v1/location/timetable": {
            "post": {
                "tags": [
                    "Location"
                ],
                "summary": "Return a list of available time slots for a specific date",
                "operationId": "892e2a8fd98d0cf2eb90cd380f839bfc",
                "requestBody": {
                    "description": "Send `date` in the JSON body (query parameters are not read).",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "title": "Api request timetable",
                                "description": "Api request timetable",
                                "properties": {
                                    "date": {
                                        "description": "Date which you want to check the timetable",
                                        "type": "string",
                                        "example": "2023-11-06"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success. (Check schema section for more details)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "description": "The response code. Can be true or false depending the operation",
                                            "type": "boolean"
                                        },
                                        "msg": {
                                            "description": "The response message",
                                            "type": "string"
                                        },
                                        "data": {
                                            "description": "The response data",
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "spots_total": {
                                                        "description": "Total spots available",
                                                        "type": "integer",
                                                        "example": 100
                                                    },
                                                    "spots_open": {
                                                        "description": "Spots open",
                                                        "type": "integer",
                                                        "example": 46
                                                    },
                                                    "duration_sec": {
                                                        "description": "Duration in seconds",
                                                        "type": "integer",
                                                        "example": 900
                                                    },
                                                    "service_id": {
                                                        "description": "Service id",
                                                        "type": "string",
                                                        "example": "reservation"
                                                    },
                                                    "start_sec": {
                                                        "description": "Start time in unix timestamp",
                                                        "type": "integer",
                                                        "example": 1709506800
                                                    },
                                                    "resources": {
                                                        "description": "Resources available. Available if zone timetable's enabled",
                                                        "type": "array",
                                                        "items": {
                                                            "properties": {
                                                                "room_name": {
                                                                    "description": "Room name",
                                                                    "type": "string",
                                                                    "example": "Main Room"
                                                                },
                                                                "room_id": {
                                                                    "description": "Room id",
                                                                    "type": "string",
                                                                    "example": "1"
                                                                }
                                                            },
                                                            "type": "object"
                                                        }
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        },
                                        "timezone": {
                                            "description": "Location's timezone",
                                            "type": "string",
                                            "example": "Europe/Rome"
                                        }
                                    },
                                    "type": "object",
                                    "example": {
                                        "status": true,
                                        "msg": "Timetable retrieved successfully",
                                        "data": [
                                            {
                                                "spots_total": 100,
                                                "spots_open": 44,
                                                "duration_sec": 900,
                                                "service_id": "reservation",
                                                "start_sec": 1709506800,
                                                "resources": {
                                                    "room_name": "Main Room",
                                                    "room_id": "1"
                                                }
                                            }
                                        ],
                                        "timezone": "Europe/Rome"
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad Parameters",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "example": {
                                        "status": false,
                                        "msgError": "DATE REQUIRED (Y-m-d)",
                                        "errorCode": 30100
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Bad Credentials",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "example": {
                                        "status": false,
                                        "msgError": "USERNAME OR PASSWORD INCORRECT"
                                    }
                                }
                            }
                        }
                    },
                    "405": {
                        "description": "Method Http not allowed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "example": {
                                        "status": false,
                                        "msgError": "HTTPS ONLY"
                                    }
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Processing Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "example": {
                                        "status": false,
                                        "msgError": "Error during creation"
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "basicAuth": []
                    }
                ]
            }
        },
        "/api/rest/v1/location/zones": {
            "get": {
                "tags": [
                    "Location"
                ],
                "summary": "Get a list of zones with details and table information",
                "operationId": "d9acdd4ca25e4180c701fe00e1d6b49d",
                "responses": {
                    "200": {
                        "description": "Richiesta completata con successo",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "description": "Indica l'esito della richiesta",
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "description": "Messaggio della richiesta",
                                            "type": "string"
                                        },
                                        "data": {
                                            "description": "Elenco delle zone",
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "description": "ID della zona",
                                                        "type": "integer"
                                                    },
                                                    "name": {
                                                        "description": "Nome della zona",
                                                        "type": "string"
                                                    },
                                                    "is_open": {
                                                        "description": "Stato di apertura della zona",
                                                        "type": "integer"
                                                    },
                                                    "is_bookable": {
                                                        "description": "Indica se la zona è prenotabile",
                                                        "type": "integer"
                                                    },
                                                    "priority": {
                                                        "description": "Priorità della zona",
                                                        "type": "integer"
                                                    },
                                                    "translatedNames": {
                                                        "description": "Nomi tradotti della zona",
                                                        "properties": {
                                                            "it": {
                                                                "description": "Nome in italiano",
                                                                "type": "string"
                                                            },
                                                            "fr": {
                                                                "description": "Nome in francese",
                                                                "type": "string"
                                                            },
                                                            "en": {
                                                                "description": "Nome in inglese",
                                                                "type": "string"
                                                            },
                                                            "es": {
                                                                "description": "Nome in spagnolo",
                                                                "type": "string"
                                                            },
                                                            "de": {
                                                                "description": "Nome in tedesco",
                                                                "type": "string"
                                                            }
                                                        },
                                                        "type": "object"
                                                    },
                                                    "translatedDescriptions": {
                                                        "description": "Descrizioni tradotte della zona",
                                                        "properties": {
                                                            "it": {
                                                                "description": "Descrizione in italiano",
                                                                "type": "string"
                                                            },
                                                            "fr": {
                                                                "description": "Descrizione in francese",
                                                                "type": "string"
                                                            },
                                                            "en": {
                                                                "description": "Descrizione in inglese",
                                                                "type": "string"
                                                            },
                                                            "es": {
                                                                "description": "Descrizione in spagnolo",
                                                                "type": "string"
                                                            },
                                                            "de": {
                                                                "description": "Descrizione in tedesco",
                                                                "type": "string"
                                                            }
                                                        },
                                                        "type": "object"
                                                    },
                                                    "tables": {
                                                        "description": "Elenco dei tavoli nella zona",
                                                        "type": "array",
                                                        "items": {
                                                            "properties": {
                                                                "id": {
                                                                    "description": "ID del tavolo",
                                                                    "type": "integer"
                                                                },
                                                                "idZone": {
                                                                    "description": "ID della zona a cui appartiene il tavolo",
                                                                    "type": "integer"
                                                                },
                                                                "name": {
                                                                    "description": "Nome del tavolo",
                                                                    "type": "string"
                                                                },
                                                                "seats": {
                                                                    "description": "Numero di posti del tavolo",
                                                                    "type": "integer"
                                                                },
                                                                "externalID": {
                                                                    "description": "ID esterno del tavolo",
                                                                    "type": "string"
                                                                },
                                                                "is_virtual": {
                                                                    "description": "Indica se il tavolo è virtuale",
                                                                    "type": "integer"
                                                                },
                                                                "is_available_online": {
                                                                    "description": "Indica se il tavolo è disponibile online",
                                                                    "type": "integer"
                                                                },
                                                                "score": {
                                                                    "description": "Punteggio del tavolo",
                                                                    "type": "integer"
                                                                }
                                                            },
                                                            "type": "object"
                                                        }
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No zone found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "description": "Indica l'esito della richiesta",
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "description": "Messaggio di errore",
                                            "type": "string",
                                            "example": "No zone found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Processing Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "example": {
                                        "status": false,
                                        "message": "Error during processing"
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "basicAuth": []
                    }
                ]
            }
        },
        "/api/rest/v1/orders/create": {
            "post": {
                "tags": [
                    "Orders"
                ],
                "summary": "Create a new Order",
                "operationId": "7e77b0cc55c22cefffa469d9e2333373",
                "requestBody": {
                    "description": "All parameters must be sent in the JSON body (query parameters are not read).",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "first_name",
                                    "last_name",
                                    "order_type",
                                    "receipt"
                                ],
                                "properties": {
                                    "first_name": {
                                        "description": "Nome",
                                        "type": "string"
                                    },
                                    "last_name": {
                                        "description": "Cognome",
                                        "type": "string"
                                    },
                                    "email": {
                                        "description": "Email (required if no valid phone)",
                                        "type": "string",
                                        "format": "email"
                                    },
                                    "telephone_number": {
                                        "description": "National number without country prefix",
                                        "type": "string",
                                        "example": "7700900123"
                                    },
                                    "prefix_number": {
                                        "description": "International prefix without +",
                                        "type": "string",
                                        "example": "44"
                                    },
                                    "order_type": {
                                        "description": "Tipo di ordine",
                                        "type": "string",
                                        "enum": [
                                            "takeaway",
                                            "delivery",
                                            "selforder"
                                        ]
                                    },
                                    "date": {
                                        "description": "Data dell'ordine (required without datetimeutc)",
                                        "type": "string",
                                        "format": "date"
                                    },
                                    "time": {
                                        "description": "Ora dell'ordine (required without datetimeutc)",
                                        "type": "string",
                                        "format": "time"
                                    },
                                    "datetimeutc": {
                                        "description": "Alternative to date+time: UTC ISO 8601",
                                        "type": "string"
                                    },
                                    "language": {
                                        "type": "string",
                                        "enum": [
                                            "en",
                                            "it",
                                            "fr",
                                            "de",
                                            "es"
                                        ]
                                    },
                                    "status": {
                                        "$ref": "#/components/schemas/OrderStatus"
                                    },
                                    "note": {
                                        "description": "Note aggiuntive",
                                        "type": "string"
                                    },
                                    "receipt": {
                                        "properties": {
                                            "items": {
                                                "description": "Array di oggetti Item",
                                                "type": "array",
                                                "items": {
                                                    "$ref": "#/components/schemas/Item"
                                                }
                                            },
                                            "total": {
                                                "properties": {
                                                    "initial_total": {
                                                        "description": "Totale iniziale",
                                                        "type": "number",
                                                        "format": "float"
                                                    },
                                                    "final_total": {
                                                        "description": "Totale finale",
                                                        "type": "number",
                                                        "format": "float"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        },
                                        "type": "object"
                                    },
                                    "address": {
                                        "properties": {
                                            "street": {
                                                "description": "Via",
                                                "type": "string"
                                            },
                                            "zip": {
                                                "description": "CAP",
                                                "type": "string"
                                            },
                                            "civic": {
                                                "description": "Numero civico",
                                                "type": "string"
                                            },
                                            "city": {
                                                "description": "Città",
                                                "type": "string"
                                            },
                                            "province": {
                                                "description": "Provincia",
                                                "type": "string"
                                            },
                                            "country": {
                                                "description": "Paese",
                                                "type": "string"
                                            }
                                        },
                                        "type": "object"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success. (Check schema section for more details)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "description": "The response code",
                                            "type": "boolean"
                                        },
                                        "order_id": {
                                            "description": "Order ID",
                                            "type": "string"
                                        },
                                        "msg": {
                                            "description": "The response message",
                                            "type": "string"
                                        }
                                    },
                                    "type": "object",
                                    "example": {
                                        "status": true,
                                        "order_id": "e4da3b7fbbce2345d7772b0674a318d5",
                                        "msg": "order created successfully"
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad Parameters",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "example": {
                                        "status": false,
                                        "order_id": "",
                                        "message": "Missing X Parameter or wrong parameters"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Bad Credentials",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "example": {
                                        "status": false,
                                        "message": "USERNAME OR PASSWORD INCORRECT"
                                    }
                                }
                            }
                        }
                    },
                    "405": {
                        "description": "Method Http not allowed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "example": {
                                        "status": false,
                                        "message": "HTTPS ONLY"
                                    }
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Processing Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "example": {
                                        "status": false,
                                        "message": "Error during order creation"
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "basicAuth": []
                    }
                ]
            }
        },
        "/api/rest/v1/orders/update": {
            "put": {
                "tags": [
                    "Orders"
                ],
                "summary": "Update status of an Order",
                "operationId": "b80f3b070dd38b32f764e25a1b89477c",
                "requestBody": {
                    "description": "All parameters must be sent in the JSON body (query parameters are not read).",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "title": "Api request update",
                                "required": [
                                    "order_id",
                                    "status"
                                ],
                                "properties": {
                                    "order_id": {
                                        "type": "string",
                                        "example": "e4da3b7fbbce2345d7772b0674a318d5"
                                    },
                                    "status": {
                                        "$ref": "#/components/schemas/OrderStatus"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success. (Check schema section for more details)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "example": {
                                        "status": true,
                                        "message": "Order status updated successfully"
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad Parameters"
                    },
                    "401": {
                        "description": "Bad Credentials"
                    },
                    "405": {
                        "description": "Method Http not allowed"
                    },
                    "500": {
                        "description": "Processing Error"
                    }
                },
                "security": [
                    {
                        "basicAuth": []
                    }
                ]
            }
        },
        "/api/rest/v1/orders/edit": {
            "put": {
                "tags": [
                    "Orders"
                ],
                "summary": "Edit an existing Order",
                "operationId": "3991982866f67d4f63952f93d2bb0be0",
                "requestBody": {
                    "description": "All parameters must be sent in the JSON body (query parameters are not read).",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "order_id"
                                ],
                                "properties": {
                                    "order_id": {
                                        "description": "Order ID to be updated",
                                        "type": "string"
                                    },
                                    "first_name": {
                                        "description": "Updated first name",
                                        "type": "string"
                                    },
                                    "last_name": {
                                        "description": "Updated last name",
                                        "type": "string"
                                    },
                                    "email": {
                                        "description": "Updated email",
                                        "type": "string",
                                        "format": "email"
                                    },
                                    "telephone_number": {
                                        "description": "Updated national number",
                                        "type": "string"
                                    },
                                    "prefix_number": {
                                        "description": "Updated prefix without +",
                                        "type": "string"
                                    },
                                    "order_type": {
                                        "description": "Updated order type",
                                        "type": "string",
                                        "enum": [
                                            "takeaway",
                                            "delivery",
                                            "selforder"
                                        ]
                                    },
                                    "date": {
                                        "description": "Updated order date",
                                        "type": "string",
                                        "format": "date"
                                    },
                                    "time": {
                                        "description": "Updated order time",
                                        "type": "string",
                                        "format": "time"
                                    },
                                    "datetimeutc": {
                                        "description": "Updated UTC ISO 8601",
                                        "type": "string"
                                    },
                                    "language": {
                                        "type": "string",
                                        "enum": [
                                            "en",
                                            "it",
                                            "fr",
                                            "de",
                                            "es"
                                        ]
                                    },
                                    "note": {
                                        "description": "Updated notes",
                                        "type": "string"
                                    },
                                    "receipt": {
                                        "properties": {
                                            "items": {
                                                "description": "Updated items array",
                                                "type": "array",
                                                "items": {
                                                    "$ref": "#/components/schemas/Item"
                                                }
                                            },
                                            "total": {
                                                "properties": {
                                                    "initial_total": {
                                                        "description": "Updated initial total",
                                                        "type": "number",
                                                        "format": "float"
                                                    },
                                                    "final_total": {
                                                        "description": "Updated final total",
                                                        "type": "number",
                                                        "format": "float"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        },
                                        "type": "object"
                                    },
                                    "address": {
                                        "properties": {
                                            "street": {
                                                "description": "Updated street",
                                                "type": "string"
                                            },
                                            "zip": {
                                                "description": "Updated postal code",
                                                "type": "string"
                                            },
                                            "civic": {
                                                "description": "Updated civic number",
                                                "type": "string"
                                            },
                                            "city": {
                                                "description": "Updated city",
                                                "type": "string"
                                            },
                                            "province": {
                                                "description": "Updated province",
                                                "type": "string"
                                            },
                                            "country": {
                                                "description": "Updated country",
                                                "type": "string"
                                            }
                                        },
                                        "type": "object"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success. (Check schema section for more details)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "description": "The response code",
                                            "type": "boolean"
                                        },
                                        "order_id": {
                                            "description": "Order ID",
                                            "type": "string"
                                        },
                                        "msg": {
                                            "description": "The response message",
                                            "type": "string"
                                        }
                                    },
                                    "type": "object",
                                    "example": {
                                        "status": true,
                                        "order_id": "e4da3b7fbbce2345d7772b0674a318d5",
                                        "msg": "Order updated successfully"
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad Parameters",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "example": {
                                        "status": false,
                                        "order_id": "",
                                        "message": "Missing X Parameter or wrong parameters"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Bad Credentials",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "example": {
                                        "status": false,
                                        "message": "USERNAME OR PASSWORD INCORRECT"
                                    }
                                }
                            }
                        }
                    },
                    "405": {
                        "description": "Method Http not allowed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "example": {
                                        "status": false,
                                        "message": "HTTPS ONLY"
                                    }
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Processing Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "example": {
                                        "status": false,
                                        "message": "Error during order update"
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "basicAuth": []
                    }
                ]
            }
        },
        "/api/rest/v1/reserve/create": {
            "post": {
                "tags": [
                    "Reservation"
                ],
                "summary": "Create a Reservation",
                "operationId": "4ff1369fa3ccff96ee66fc61f5bd7b26",
                "requestBody": {
                    "description": "All parameters must be sent in the JSON body (query parameters are not read).",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "title": "Api request create",
                                "required": [
                                    "first_name",
                                    "last_name",
                                    "date",
                                    "time",
                                    "people"
                                ],
                                "properties": {
                                    "first_name": {
                                        "description": "Client's Name",
                                        "type": "string",
                                        "example": "Mario"
                                    },
                                    "last_name": {
                                        "description": "Client's Surname",
                                        "type": "string",
                                        "example": "Rossi"
                                    },
                                    "date": {
                                        "description": "Date of the reservation (Y-m-d)",
                                        "type": "string",
                                        "example": "2022-12-12"
                                    },
                                    "time": {
                                        "description": "Hour of the reservation (H:i)",
                                        "type": "string",
                                        "example": "16:00"
                                    },
                                    "datetimeutc": {
                                        "description": "Alternative to date+time: UTC ISO 8601",
                                        "type": "string",
                                        "example": "2022-12-30T16:00:00Z"
                                    },
                                    "email": {
                                        "description": "Required if no valid phone",
                                        "type": "string",
                                        "example": "email@example.com"
                                    },
                                    "prefix_number": {
                                        "description": "International prefix without +",
                                        "type": "string",
                                        "example": "44"
                                    },
                                    "telephone_number": {
                                        "description": "National number without country prefix",
                                        "type": "string",
                                        "example": "7700900123"
                                    },
                                    "people": {
                                        "type": "integer",
                                        "example": 4
                                    },
                                    "flagMarketing": {
                                        "type": "integer",
                                        "example": 0,
                                        "maximum": 1,
                                        "minimum": 0
                                    },
                                    "flagPrivacy": {
                                        "type": "integer",
                                        "example": 0,
                                        "maximum": 1,
                                        "minimum": 0
                                    },
                                    "flagDisableSms": {
                                        "type": "integer",
                                        "example": 0,
                                        "maximum": 1,
                                        "minimum": 0
                                    },
                                    "flagDisableEmail": {
                                        "type": "integer",
                                        "example": 0,
                                        "maximum": 1,
                                        "minimum": 0
                                    },
                                    "note": {
                                        "type": "string",
                                        "example": ""
                                    },
                                    "period": {
                                        "description": "Duration in minutes",
                                        "type": "integer",
                                        "example": 90
                                    },
                                    "language": {
                                        "description": "Notification language: it, en, es, de, fr",
                                        "type": "string",
                                        "example": "en"
                                    },
                                    "status": {
                                        "description": "0=not confirmed, 1=confirmed, 3=waiting list. Use 1 to assign tables.",
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "tables": {
                                        "type": "array",
                                        "items": {
                                            "type": "string",
                                            "example": "external_ID"
                                        }
                                    },
                                    "zone": {
                                        "description": "Zone id (default 0)",
                                        "type": "integer",
                                        "example": 0
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success. (Check schema section for more details)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "description": "The response code",
                                            "type": "boolean"
                                        },
                                        "reserve_id": {
                                            "description": "Reservation Id",
                                            "type": "string"
                                        },
                                        "reserve_status": {
                                            "description": "Status assigned to the reservation after creation (may differ from requested status due to saturation rules)",
                                            "properties": {
                                                "code": {
                                                    "description": "Numeric status code (0=not_confirmed, 1=confirmed, 2=rejected, 3=waiting_list, 10=pending_payment, ...)",
                                                    "type": "integer"
                                                },
                                                "key": {
                                                    "description": "Machine-readable status key in snake_case English",
                                                    "type": "string"
                                                },
                                                "label": {
                                                    "description": "Human-readable status label, localized in the request language",
                                                    "type": "string"
                                                }
                                            },
                                            "type": "object"
                                        },
                                        "msg": {
                                            "description": "The response message",
                                            "type": "string"
                                        }
                                    },
                                    "type": "object",
                                    "example": {
                                        "status": true,
                                        "reserve_id": "e4da3b7fbbce2345d7772b0674a318d5",
                                        "reserve_status": {
                                            "code": 0,
                                            "key": "not_confirmed",
                                            "label": "Not confirmed"
                                        },
                                        "msg": "Reservation created successfully"
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad Parameters",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "example": {
                                        "status": false,
                                        "reserve_id": "",
                                        "msgError": "Missing X Parameter or wrong parameters"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Bad Credentials",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "example": {
                                        "status": false,
                                        "reserve_id": "",
                                        "msgError": "USERNAME OR PASSWORD INCORRECT"
                                    }
                                }
                            }
                        }
                    },
                    "405": {
                        "description": "Method Http not allowed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "example": {
                                        "status": false,
                                        "reserve_id": "",
                                        "msgError": "HTTPS ONLY"
                                    }
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Processing Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "example": {
                                        "status": false,
                                        "reserve_id": "",
                                        "msgError": "Error during creation"
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "basicAuth": []
                    }
                ]
            }
        },
        "/api/rest/v1/reserve/update": {
            "post": {
                "tags": [
                    "Reservation"
                ],
                "summary": "Update status of a Reservation",
                "operationId": "4882145daa926d2660a5458760341208",
                "requestBody": {
                    "description": "All parameters must be sent in the JSON body (query parameters are not read).",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "title": "Api request update",
                                "required": [
                                    "reserve_id",
                                    "status"
                                ],
                                "properties": {
                                    "reserve_id": {
                                        "description": "Reservation Id",
                                        "type": "string",
                                        "example": "439fjdsktrjoeinmf19023tmfdkm1239"
                                    },
                                    "status": {
                                        "description": "New status. Allowed transitions: 0→1,2,8; 1→6,7,8; 2→8; 6→8,9; 7→8; 9→8; 8=frozen",
                                        "type": "integer",
                                        "example": 8
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success. (Check schema section for more details)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "example": {
                                        "status": true,
                                        "msg": "STATUS CHANGED SUCCESSFULLY INTO (NEW STATUS)"
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad Parameters"
                    },
                    "401": {
                        "description": "Bad Credentials"
                    },
                    "405": {
                        "description": "Method Http not allowed"
                    },
                    "500": {
                        "description": "Processing Error"
                    }
                },
                "security": [
                    {
                        "basicAuth": []
                    }
                ]
            }
        },
        "/api/rest/v1/reserve/edit": {
            "post": {
                "tags": [
                    "Reservation"
                ],
                "summary": "edit reservation parameters",
                "operationId": "a6c444797aad99ff4a3d9c3f5e223f96",
                "requestBody": {
                    "description": "All parameters must be sent in the JSON body (query parameters are not read).",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "title": "Api request edit",
                                "required": [
                                    "reserve_id"
                                ],
                                "properties": {
                                    "reserve_id": {
                                        "description": "Reservation Id",
                                        "type": "string",
                                        "example": "439fjdsktrjoeinmf19023tmfdkm1239"
                                    },
                                    "first_name": {
                                        "type": "string",
                                        "example": "Giulio"
                                    },
                                    "last_name": {
                                        "type": "string",
                                        "example": "Rossi"
                                    },
                                    "date": {
                                        "type": "string",
                                        "example": "2022-12-30"
                                    },
                                    "time": {
                                        "type": "string",
                                        "example": "16:00"
                                    },
                                    "datetimeutc": {
                                        "type": "string",
                                        "example": "2022-12-30T16:00:00Z"
                                    },
                                    "email": {
                                        "type": "string",
                                        "example": "email@example.com"
                                    },
                                    "prefix_number": {
                                        "type": "string",
                                        "example": "44"
                                    },
                                    "telephone_number": {
                                        "type": "string",
                                        "example": "7700900123"
                                    },
                                    "people": {
                                        "type": "integer",
                                        "example": 4
                                    },
                                    "flagDisableSms": {
                                        "type": "integer",
                                        "example": 0,
                                        "maximum": 1,
                                        "minimum": 0
                                    },
                                    "flagDisableEmail": {
                                        "type": "integer",
                                        "example": 0,
                                        "maximum": 1,
                                        "minimum": 0
                                    },
                                    "note": {
                                        "type": "string",
                                        "example": ""
                                    },
                                    "period": {
                                        "type": "integer",
                                        "example": 90
                                    },
                                    "tables": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success. (Check schema section for more details)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "description": "The response code",
                                            "type": "boolean"
                                        },
                                        "reserve_id": {
                                            "description": "Reservation Id",
                                            "type": "string"
                                        },
                                        "msg": {
                                            "description": "The response message",
                                            "type": "string"
                                        }
                                    },
                                    "type": "object",
                                    "example": {
                                        "status": true,
                                        "reserve_id": "qsadfg234",
                                        "msg": "Booking edited successfully"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Bad Credentials",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "example": {
                                        "status": false,
                                        "reserve_id": "",
                                        "msgError": "USERNAME OR PASSWORD INCORRECT"
                                    }
                                }
                            }
                        }
                    },
                    "405": {
                        "description": "Method Http not allowed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "example": {
                                        "status": false,
                                        "reserve_id": "",
                                        "msgError": "HTTPS ONLY"
                                    }
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Processing Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "example": {
                                        "status": false,
                                        "reserve_id": "",
                                        "msgError": "Error editing booking"
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "basicAuth": []
                    }
                ]
            }
        },
        "/api/rest/v1/reserve/list": {
            "post": {
                "tags": [
                    "Reservation"
                ],
                "summary": "Get list of reservations",
                "operationId": "6f4a25f564a76472ca37aada8cbf6d47",
                "requestBody": {
                    "description": "All parameters must be sent in the JSON body (query parameters are not read).",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "title": "Api request list",
                                "required": [
                                    "dateFrom",
                                    "dateTo"
                                ],
                                "properties": {
                                    "dateFrom": {
                                        "description": "Period start date (Y-m-d)",
                                        "type": "string",
                                        "example": "2023-01-01"
                                    },
                                    "dateTo": {
                                        "description": "Period end date (Y-m-d)",
                                        "type": "string",
                                        "example": "2023-01-25"
                                    },
                                    "timeFrom": {
                                        "description": "Start time on dateFrom (default 00:00)",
                                        "type": "string",
                                        "example": "14:00"
                                    },
                                    "timeTo": {
                                        "description": "End time on dateTo (default 23:59)",
                                        "type": "string",
                                        "example": "19:00"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success. (Check schema section for more details)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "description": "The response status",
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "description": "list of reservations",
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "reserve_id": {
                                                        "description": "Reservation Id",
                                                        "type": "string"
                                                    },
                                                    "date": {
                                                        "description": "Date",
                                                        "type": "string"
                                                    },
                                                    "time": {
                                                        "description": "Time",
                                                        "type": "string"
                                                    },
                                                    "datetimeutc": {
                                                        "description": "UTC date and time of the reservation using ISO 8601 format",
                                                        "type": "string"
                                                    },
                                                    "people": {
                                                        "description": "Number of people",
                                                        "type": "integer"
                                                    },
                                                    "updated_at": {
                                                        "description": "Last update",
                                                        "type": "string"
                                                    },
                                                    "source": {
                                                        "description": "Id sorgente registrato in creazione. 0 Web, 1 Manual, 2 Queue, 3 Walk-in, 4 Google, 5 API, 6 Platecall, 7 QR self-service. Null solo se assente in database.",
                                                        "type": [
                                                            "integer",
                                                            "null"
                                                        ],
                                                        "example": 0
                                                    },
                                                    "external_channel": {
                                                        "description": "Canale indicato in creazione via API (header external_channel). Stringa vuota se assente.",
                                                        "type": "string",
                                                        "example": ""
                                                    },
                                                    "custom_reserve_source": {
                                                        "description": "Sorgente custom del modulo prenotazione. Stringa vuota se assente.",
                                                        "type": "string",
                                                        "example": ""
                                                    },
                                                    "tables": {
                                                        "description": "Array with your table id.",
                                                        "type": "array",
                                                        "items": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object",
                                    "example": {
                                        "status": true,
                                        "data": [
                                            {
                                                "reserve_id": "439fjdsktrjoeinmf19023tmfdkm1239",
                                                "date": "2023-01-01",
                                                "time": "14:00",
                                                "datetimeutc": "2023-01-01T13:00:00Z",
                                                "people": 2,
                                                "updated_at": "2023-01-01 15:00:00",
                                                "source": 0,
                                                "external_channel": "",
                                                "custom_reserve_source": ""
                                            },
                                            {
                                                "reserve_id": "gtrjunjfwoeioeinmf19023tmfdkm1239",
                                                "date": "2023-01-03",
                                                "time": "17:00",
                                                "datetimeutc": "2023-01-01T16:00:00Z",
                                                "people": 4,
                                                "updated_at": "2023-01-03 18:00:00",
                                                "source": 5,
                                                "external_channel": "partner",
                                                "custom_reserve_source": "",
                                                "tables": [
                                                    "externalID1",
                                                    "externalID2"
                                                ]
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Bad Credentials",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "example": {
                                        "status": false,
                                        "reserve_id": "",
                                        "msgError": "USERNAME OR PASSWORD INCORRECT"
                                    }
                                }
                            }
                        }
                    },
                    "405": {
                        "description": "Method Http not allowed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "example": {
                                        "status": false,
                                        "reserve_id": "",
                                        "msgError": "HTTPS ONLY"
                                    }
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Processing Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "example": {
                                        "status": false,
                                        "reserve_id": "",
                                        "msgError": "ERROR DURING PROCESSING"
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "basicAuth": []
                    }
                ]
            }
        },
        "/api/rest/v1/reserve/details": {
            "post": {
                "tags": [
                    "Reservation"
                ],
                "summary": "get all information about a reservation",
                "operationId": "0b35f252d5f0883f599cbd777bbb2db8",
                "requestBody": {
                    "description": "All parameters must be sent in the JSON body (query parameters are not read).",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "title": "Api request details",
                                "required": [
                                    "reserve_id"
                                ],
                                "properties": {
                                    "reserve_id": {
                                        "description": "Reservation Id",
                                        "type": "string",
                                        "example": "439fjdsktrjoeinmf19023tmfdkm1239"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success. (Check schema section for more details)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "description": "The response code",
                                            "type": "boolean"
                                        },
                                        "reserve_id": {
                                            "description": "Reservation Id",
                                            "type": "string"
                                        },
                                        "data": {
                                            "description": "Reservation details",
                                            "properties": {
                                                "first_name": {
                                                    "description": "Client's Name",
                                                    "type": "string"
                                                },
                                                "last_name": {
                                                    "description": "Client's Surname",
                                                    "type": "string"
                                                },
                                                "email": {
                                                    "description": "Client's Email",
                                                    "type": "string"
                                                },
                                                "telephone_number": {
                                                    "description": "Client's Phone",
                                                    "type": "string"
                                                },
                                                "date": {
                                                    "description": "Reservation Date",
                                                    "type": "string"
                                                },
                                                "time": {
                                                    "description": "Reservation Time",
                                                    "type": "string"
                                                },
                                                "datetimeutc": {
                                                    "description": "UTC date and time of the reservation using ISO 8601 format",
                                                    "type": "string"
                                                },
                                                "people": {
                                                    "description": "Number of people",
                                                    "type": "string"
                                                },
                                                "note": {
                                                    "description": "Client's Message",
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "description": "Reservation Status",
                                                    "type": "number"
                                                },
                                                "source": {
                                                    "description": "Id sorgente registrato in creazione. 0 Web, 1 Manual, 2 Queue, 3 Walk-in, 4 Google, 5 API, 6 Platecall, 7 QR self-service. Null solo se assente in database.",
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ],
                                                    "example": 5
                                                },
                                                "external_channel": {
                                                    "description": "Canale indicato in creazione via API (header external_channel). Stringa vuota se assente.",
                                                    "type": "string",
                                                    "example": "partner"
                                                },
                                                "custom_reserve_source": {
                                                    "description": "Sorgente custom del modulo prenotazione. Stringa vuota se assente.",
                                                    "type": "string",
                                                    "example": ""
                                                },
                                                "created_at": {
                                                    "description": "Reservation Creation Date",
                                                    "type": "string"
                                                },
                                                "updated_at": {
                                                    "description": "Reservation Last Update",
                                                    "type": "string"
                                                },
                                                "period": {
                                                    "description": "Reservation Period",
                                                    "type": "number"
                                                },
                                                "flagDisableSms": {
                                                    "description": "flag disable sms",
                                                    "type": "number"
                                                },
                                                "flagDisableEmail": {
                                                    "description": "flag disable email",
                                                    "type": "number"
                                                },
                                                "flagPrivacy": {
                                                    "description": "flag privacy",
                                                    "type": "number"
                                                },
                                                "flagMarketing": {
                                                    "description": "flag marketing",
                                                    "type": "number"
                                                },
                                                "language": {
                                                    "description": "language",
                                                    "type": "string"
                                                },
                                                "tables": {
                                                    "description": "Array with your table id.",
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object",
                                    "example": {
                                        "status": true,
                                        "reserve_id": "qsadfg234",
                                        "data": {
                                            "first_name": "John",
                                            "last_name": "Doe",
                                            "email": "email@plateform.app",
                                            "prefix_number": "39",
                                            "telephone_number": "123456789",
                                            "date": "2023-01-01",
                                            "time": "14:00",
                                            "datetimeutc": "2023-01-01T12:00Z",
                                            "people": 2,
                                            "note": "",
                                            "status": 1,
                                            "source": 5,
                                            "external_channel": "partner",
                                            "custom_reserve_source": "",
                                            "created_at": "2020-01-01 14:00:00",
                                            "updated_at": "2020-01-01 14:30:00",
                                            "period": 20,
                                            "flagDisableSms": 0,
                                            "flagDisableEmail": 0,
                                            "flagPrivacy": "1",
                                            "flagMarketing": "0",
                                            "language": "en",
                                            "tables": [
                                                "externalID1",
                                                "externalID2"
                                            ]
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Bad Credentials",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "example": {
                                        "status": false,
                                        "reserve_id": "",
                                        "msgError": "USERNAME OR PASSWORD INCORRECT"
                                    }
                                }
                            }
                        }
                    },
                    "405": {
                        "description": "Method Http not allowed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "example": {
                                        "status": false,
                                        "reserve_id": "",
                                        "msgError": "HTTPS ONLY"
                                    }
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Processing Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "example": {
                                        "status": false,
                                        "reserve_id": "",
                                        "msgError": "Error editing booking"
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "basicAuth": []
                    }
                ]
            }
        },
        "/api/rest/v1/reserve/receipt": {
            "post": {
                "tags": [
                    "Reservation"
                ],
                "summary": "Send a Receipt",
                "description": "When you send a receipt, the booking must be ended. Otherwise you will receive an error. Also consider that prices are expressed in Euro and cents. For example, 1050 means 10.50 Euro",
                "operationId": "fce36838b4837d94b2cfce115985c7b3",
                "requestBody": {
                    "description": "All parameters must be sent in the JSON body (query parameters are not read). Booking must be ended (status 9).",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "title": "Api request receipt",
                                "description": "Api request receipt",
                                "properties": {
                                    "reserve_id": {
                                        "description": "Reservation id",
                                        "type": "string",
                                        "example": "8fa14cdd754f91cc6554c9e71929cce7"
                                    },
                                    "code": {
                                        "type": "string",
                                        "example": "6ac754b738c9"
                                    },
                                    "local_point": {
                                        "type": "string",
                                        "example": "8723"
                                    },
                                    "payment": {
                                        "properties": {
                                            "paid": {
                                                "description": "Payment status",
                                                "type": "boolean",
                                                "example": true
                                            },
                                            "amount": {
                                                "description": "Amount of payment",
                                                "type": "number",
                                                "example": 100.5
                                            },
                                            "due": {
                                                "description": "Amount due",
                                                "type": "number",
                                                "example": 5.4
                                            }
                                        },
                                        "type": "object"
                                    },
                                    "items": {
                                        "type": "array",
                                        "items": {
                                            "properties": {
                                                "sku": {
                                                    "description": "SKU of the item",
                                                    "type": "string",
                                                    "example": "V007375"
                                                },
                                                "quantity": {
                                                    "description": "Quantity of the item",
                                                    "type": "number",
                                                    "example": 1
                                                },
                                                "initial_price": {
                                                    "description": "Initial Price of the item",
                                                    "type": "number",
                                                    "example": 100
                                                },
                                                "final_price": {
                                                    "description": "Final Price of the item",
                                                    "type": "number",
                                                    "example": 120
                                                },
                                                "title": {
                                                    "description": "title of the item",
                                                    "type": "string",
                                                    "example": "Gelato Grande"
                                                },
                                                "variants": {
                                                    "type": "array",
                                                    "items": {
                                                        "properties": {
                                                            "code": {
                                                                "description": "variation code",
                                                                "type": "string",
                                                                "example": "5ef5e0f49bd07"
                                                            },
                                                            "title": {
                                                                "description": "variation title",
                                                                "type": "string",
                                                                "example": "Pasta"
                                                            },
                                                            "price_variation": {
                                                                "description": "variation price",
                                                                "type": "number",
                                                                "example": 20
                                                            },
                                                            "default": {
                                                                "description": "default",
                                                                "type": "number",
                                                                "example": 2
                                                            },
                                                            "price_part": {
                                                                "description": "price part",
                                                                "type": "boolean",
                                                                "example": true
                                                            },
                                                            "quantity": {
                                                                "description": "variation quantity",
                                                                "type": "number",
                                                                "example": 1
                                                            }
                                                        },
                                                        "type": "object"
                                                    }
                                                },
                                                "typology": {
                                                    "description": "Typology of item",
                                                    "type": "string",
                                                    "example": "Beverages"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "total": {
                                        "properties": {
                                            "initial_total": {
                                                "type": "number",
                                                "example": 120.9
                                            },
                                            "final_total": {
                                                "type": "number",
                                                "example": 110.9
                                            }
                                        },
                                        "type": "object"
                                    },
                                    "people": {
                                        "type": "integer",
                                        "example": 4
                                    },
                                    "department": {
                                        "properties": {
                                            "id": {
                                                "type": "string",
                                                "example": "acbd24"
                                            },
                                            "title": {
                                                "type": "string",
                                                "example": "Restaurant"
                                            }
                                        },
                                        "type": "object"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success. (Check schema section for more details)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "description": "The response code",
                                            "type": "boolean"
                                        },
                                        "msg": {
                                            "description": "The response message",
                                            "type": "string"
                                        }
                                    },
                                    "type": "object",
                                    "example": {
                                        "status": true,
                                        "msg": "RECEIPT SAVED SUCCESSFULLY"
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad Parameters",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "example": {
                                        "status": false,
                                        "msgError": "X NOT FOUND OR NOT VALID"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Bad Credentials",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "example": {
                                        "status": false,
                                        "msgError": "USERNAME OR PASSWORD INCORRECT"
                                    }
                                }
                            }
                        }
                    },
                    "405": {
                        "description": "Method Http not allowed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "example": {
                                        "status": false,
                                        "msgError": "HTTPS ONLY"
                                    }
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Processing Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "example": {
                                        "status": false,
                                        "msgError": "Error during creation"
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "basicAuth": []
                    }
                ]
            }
        },
        "/api/rest/v1/reserve/walkin": {
            "post": {
                "tags": [
                    "Reservation"
                ],
                "summary": "Create a Walk-in Reservation",
                "operationId": "e399be6c539012cf8e99f1e6c2fe0a85",
                "requestBody": {
                    "description": "All parameters must be sent in the JSON body (query parameters are not read).",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "last_name",
                                    "people"
                                ],
                                "properties": {
                                    "first_name": {
                                        "type": "string",
                                        "example": "Mario"
                                    },
                                    "last_name": {
                                        "type": "string",
                                        "example": "Rossi"
                                    },
                                    "email": {
                                        "type": "string",
                                        "example": "email@example.com"
                                    },
                                    "prefix_number": {
                                        "type": "string",
                                        "example": "44"
                                    },
                                    "telephone_number": {
                                        "type": "string",
                                        "example": "7700900123"
                                    },
                                    "people": {
                                        "type": "integer",
                                        "example": 4
                                    },
                                    "flagMarketing": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "flagPrivacy": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "note": {
                                        "type": "string",
                                        "example": "Customer is allergic to peanuts"
                                    },
                                    "language": {
                                        "type": "string",
                                        "example": "en"
                                    },
                                    "tables": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        },
                                        "example": [
                                            "t1",
                                            "t2"
                                        ]
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean"
                                        },
                                        "reserve_id": {
                                            "type": "string"
                                        },
                                        "msg": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad Parameters"
                    },
                    "401": {
                        "description": "Bad Credentials"
                    },
                    "405": {
                        "description": "Method Not Allowed"
                    },
                    "500": {
                        "description": "Server Error"
                    }
                },
                "security": [
                    {
                        "basicAuth": []
                    }
                ]
            }
        },
        "/api/rest/v1/reserve/getReservationsByCustomer": {
            "get": {
                "tags": [
                    "Reservation"
                ],
                "summary": "Get reservations by customer",
                "description": "Returns reservation details filtered by customer information and optional date range. An ID, email, or phone number must be provided to filter the results.",
                "operationId": "4f6e154280680e2161a361a6b7d7e6a8",
                "parameters": [
                    {
                        "name": "customer_id",
                        "in": "query",
                        "description": "Customer ID",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "12345"
                        }
                    },
                    {
                        "name": "dateFrom",
                        "in": "query",
                        "description": "Start date for filtering (format: YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2025-07-01"
                        }
                    },
                    {
                        "name": "dateTo",
                        "in": "query",
                        "description": "End date for filtering (format: YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2025-07-14"
                        }
                    },
                    {
                        "name": "email",
                        "in": "query",
                        "description": "Customer's email address",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "email@example.com"
                        }
                    },
                    {
                        "name": "phonenumber",
                        "in": "query",
                        "description": "Customer phone in E.164 format (with or without +). Matched as digits only in CRM. Example: +447700900123",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "+447700900123"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of reservations by customer",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "customer_id": {
                                                        "type": "string",
                                                        "example": "12345"
                                                    },
                                                    "customer_email": {
                                                        "type": "string",
                                                        "example": "email@example.com"
                                                    },
                                                    "customer_phone": {
                                                        "description": "CRM mobile: country code + national digits, no +",
                                                        "type": "string",
                                                        "example": "447700900123"
                                                    },
                                                    "customer_name": {
                                                        "type": "string",
                                                        "example": "Name"
                                                    },
                                                    "customer_lastname": {
                                                        "type": "string",
                                                        "example": "Lastname"
                                                    },
                                                    "reservations": {
                                                        "type": "array",
                                                        "items": {
                                                            "properties": {
                                                                "reserve_id": {
                                                                    "type": "string",
                                                                    "example": "abc123"
                                                                },
                                                                "status": {
                                                                    "type": "integer",
                                                                    "example": 1
                                                                },
                                                                "people": {
                                                                    "type": "integer",
                                                                    "example": 4
                                                                },
                                                                "date": {
                                                                    "type": "string",
                                                                    "format": "date",
                                                                    "example": "2025-07-14"
                                                                },
                                                                "time": {
                                                                    "type": "string",
                                                                    "example": "20:30"
                                                                },
                                                                "source": {
                                                                    "description": "Id sorgente registrato in creazione. 0 Web, 1 Manual, 2 Queue, 3 Walk-in, 4 Google, 5 API, 6 Platecall, 7 QR self-service. Null solo se assente in database.",
                                                                    "type": [
                                                                        "integer",
                                                                        "null"
                                                                    ],
                                                                    "example": 0
                                                                },
                                                                "external_channel": {
                                                                    "description": "Canale indicato in creazione via API. Stringa vuota se assente.",
                                                                    "type": "string",
                                                                    "example": ""
                                                                },
                                                                "custom_reserve_source": {
                                                                    "description": "Sorgente custom del modulo prenotazione. Stringa vuota se assente.",
                                                                    "type": "string",
                                                                    "example": "instagram"
                                                                }
                                                            },
                                                            "type": "object"
                                                        }
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid parameters",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "msgError": {
                                            "type": "string",
                                            "example": "Invalid date range"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized - invalid credentials",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "msgError": {
                                            "type": "string",
                                            "example": "Unauthorized"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "msgError": {
                                            "type": "string",
                                            "example": "Internal server error"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "basicAuth": []
                    }
                ]
            }
        },
        "/api/rest/v1/utils/checkcredentials": {
            "get": {
                "tags": [
                    "Utils"
                ],
                "summary": "Check the given credentials",
                "operationId": "11c1d428d2456a3a0a81da6912c53568",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "example": {
                                        "status": true,
                                        "msg": "Credentials OK"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Bad Credentials",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "example": {
                                        "status": false,
                                        "msgError": "USERNAME OR PASSWORD INCORRECT"
                                    }
                                }
                            }
                        }
                    },
                    "405": {
                        "description": "Method Http not allowed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "example": {
                                        "status": false,
                                        "msgError": "HTTPS ONLY"
                                    }
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Processing Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "example": {
                                        "status": false,
                                        "msgError": "Error during check"
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "basicAuth": []
                    }
                ]
            }
        }
    },
    "components": {
        "schemas": {
            "Item": {
                "properties": {
                    "sku": {
                        "description": "SKU dell'item",
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "quantity": {
                        "description": "Quantità dell'item",
                        "type": "integer"
                    },
                    "initial_price": {
                        "description": "Prezzo iniziale dell'item",
                        "type": "number",
                        "format": "float"
                    },
                    "final_price": {
                        "description": "Prezzo finale dell'item",
                        "type": "number",
                        "format": "float"
                    },
                    "title": {
                        "description": "Titolo dell'item",
                        "type": "string"
                    },
                    "typology": {
                        "description": "Tipologia dell'item",
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "Total": {
                "properties": {
                    "initial_total": {
                        "description": "Totale iniziale",
                        "type": "number",
                        "format": "float"
                    },
                    "final_total": {
                        "description": "Totale finale",
                        "type": "number",
                        "format": "float"
                    }
                },
                "type": "object"
            },
            "ItemsCollection": {
                "properties": {
                    "items": {
                        "description": "Array di oggetti Item",
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Item"
                        }
                    },
                    "total": {
                        "$ref": "#/components/schemas/Total",
                        "description": "Oggetto che contiene i totali"
                    }
                },
                "type": "object"
            },
            "OrderStatus": {
                "description": "Stati possibili per un ordine",
                "type": "string",
                "enum": [
                    "unconfirmed",
                    "confirmed",
                    "ended",
                    "rejected",
                    "cancelled"
                ]
            },
            "Address": {
                "properties": {
                    "street": {
                        "description": "Via dell'indirizzo",
                        "type": "string"
                    },
                    "civic": {
                        "description": "Numero civico",
                        "type": "string"
                    },
                    "city": {
                        "description": "Città",
                        "type": "string"
                    },
                    "zip": {
                        "description": "Codice di avviamento postale",
                        "type": "string"
                    },
                    "province": {
                        "description": "Province (ex: BO)",
                        "type": "string"
                    },
                    "country": {
                        "description": "Italy",
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "CustomerData": {
                "description": "CRM customer payload, enriched from Elastic when available",
                "required": [
                    "email",
                    "phone"
                ],
                "properties": {
                    "elasticCustomerID": {
                        "description": "Schema condivisi e definizioni webhook per la documentazione OpenAPI.\nQuesto file viene scansionato insieme a api/rest/v1/ dal generatore in documentation/api.php.",
                        "type": "string",
                        "example": "abc123"
                    },
                    "name": {
                        "type": "string",
                        "example": "Mario"
                    },
                    "lastname": {
                        "type": "string",
                        "example": "Rossi"
                    },
                    "email": {
                        "type": "string",
                        "format": "email",
                        "example": "mario@example.com"
                    },
                    "prefix": {
                        "description": "Country code without +",
                        "type": "string",
                        "example": "39"
                    },
                    "phone": {
                        "description": "National number, or full digits (country+national) in CRM search payloads",
                        "type": "string",
                        "example": "3331234567"
                    },
                    "language": {
                        "type": "string",
                        "example": "it"
                    },
                    "privacy": {
                        "type": "integer",
                        "example": 1
                    },
                    "marketing": {
                        "type": "integer",
                        "example": 0
                    },
                    "vip": {
                        "type": "integer",
                        "example": 0
                    },
                    "blacklist": {
                        "type": "integer",
                        "example": 0
                    },
                    "lastSeen": {
                        "type": "string",
                        "format": "date-time",
                        "example": "2026-01-15T10:30:00Z"
                    },
                    "lastUpdate": {
                        "type": "string",
                        "format": "date-time",
                        "example": "2026-01-15T10:30:00Z"
                    },
                    "lastReserve": {
                        "type": "string",
                        "format": "date-time",
                        "example": "2026-01-10T19:00:00Z"
                    },
                    "lastDelivery": {
                        "type": "string",
                        "format": "date-time",
                        "example": "2026-01-12T12:30:00Z"
                    },
                    "tags": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "example": [
                            "VIP",
                            "Allergie"
                        ]
                    },
                    "reserveTotalAmount": {
                        "type": "number",
                        "format": "float",
                        "example": 450
                    },
                    "reserveCovers": {
                        "type": "integer",
                        "example": 12
                    },
                    "reserveAverageCoverAmount": {
                        "type": "number",
                        "format": "float",
                        "example": 37.5
                    },
                    "orderTotal": {
                        "description": "Numero totale ordini",
                        "type": "integer",
                        "example": 8
                    },
                    "orderTotalAmount": {
                        "description": "Spesa totale ordini",
                        "type": "number",
                        "format": "float",
                        "example": 320
                    },
                    "orderAverageAmount": {
                        "description": "Spesa media per ordine",
                        "type": "number",
                        "format": "float",
                        "example": 40
                    },
                    "note": {
                        "type": "string",
                        "example": "Allergia ai crostacei"
                    },
                    "gender": {
                        "type": "string",
                        "example": "M"
                    },
                    "birthday": {
                        "type": "string",
                        "format": "date",
                        "example": "1990-05-20"
                    }
                },
                "type": "object"
            },
            "ZoneData": {
                "description": "Table zone details",
                "properties": {
                    "id": {
                        "type": "integer",
                        "example": 5
                    },
                    "name": {
                        "type": "string",
                        "example": "Sala interna"
                    },
                    "enabled": {
                        "type": "integer",
                        "example": 1
                    },
                    "bookable": {
                        "type": "integer",
                        "example": 1
                    },
                    "description_it": {
                        "type": "string"
                    },
                    "description_en": {
                        "type": "string"
                    },
                    "description_de": {
                        "type": "string"
                    },
                    "description_fr": {
                        "type": "string"
                    },
                    "description_es": {
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "TableData": {
                "description": "Assigned table details",
                "properties": {
                    "id": {
                        "type": "integer",
                        "example": 12
                    },
                    "name": {
                        "type": "string",
                        "example": "Tavolo 7"
                    },
                    "minimal_capacity": {
                        "type": "integer",
                        "example": 2
                    },
                    "maximal_capacity": {
                        "type": "integer",
                        "example": 6
                    },
                    "virtual_table": {
                        "type": "string",
                        "example": "false",
                        "enum": [
                            "true",
                            "false"
                        ]
                    },
                    "available_online": {
                        "type": "string",
                        "example": "true",
                        "enum": [
                            "true",
                            "false"
                        ]
                    },
                    "composed_by": {
                        "type": "string",
                        "example": ""
                    },
                    "externalID": {
                        "type": "string",
                        "example": ""
                    },
                    "zone": {
                        "$ref": "#/components/schemas/ZoneData"
                    }
                },
                "type": "object"
            },
            "BookingWebhookData": {
                "description": "Booking payload sent with BOOKINGS_CREATE and BOOKINGS_UPDATE events",
                "required": [
                    "booking_id",
                    "date",
                    "time",
                    "people",
                    "status"
                ],
                "properties": {
                    "booking_id": {
                        "description": "Hash univoco prenotazione",
                        "type": "string",
                        "example": "a1b2c3d4e5"
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "example": "2026-04-28 14:30:00"
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "example": "2026-04-28 15:00:00"
                    },
                    "date": {
                        "type": "string",
                        "format": "date",
                        "example": "2026-04-29"
                    },
                    "time": {
                        "type": "string",
                        "example": "20:00"
                    },
                    "datetimeutc": {
                        "type": "string",
                        "format": "date-time",
                        "example": "2026-04-29T18:00:00Z"
                    },
                    "people": {
                        "type": "integer",
                        "example": 4
                    },
                    "status": {
                        "description": "0: Not Confirmed | 1: Confirmed | 2: Rejected | 3: Waiting List | 4: On Queue | 5: Table Ready | 6: Arrived | 7: Not Arrived | 8: Deleted | 9: Ended | 10: Waiting for credit card | 11: Expired | 12: Seated",
                        "type": "integer",
                        "example": 1
                    },
                    "source": {
                        "description": "Id sorgente registrato in creazione. 0 Web, 1 Manual, 2 Queue, 3 Walk-in, 4 Google, 5 API, 6 Platecall, 7 QR self-service. Null solo se assente in database.",
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 0
                    },
                    "external_channel": {
                        "description": "Canale indicato in creazione via API (header external_channel). Stringa vuota se assente.",
                        "type": "string",
                        "example": ""
                    },
                    "custom_reserve_source": {
                        "description": "Sorgente custom del modulo prenotazione (facebook, instagram, whatsApp, telegram, passaparola, telefono). Stringa vuota se assente.",
                        "type": "string",
                        "example": ""
                    },
                    "flagPrivacy": {
                        "type": "integer",
                        "example": 1
                    },
                    "flagMarketing": {
                        "type": "integer",
                        "example": 0
                    },
                    "duration": {
                        "description": "Durata in minuti",
                        "type": "integer",
                        "example": 90
                    },
                    "note": {
                        "type": "string",
                        "example": "Tavolo vicino alla finestra"
                    },
                    "private_note": {
                        "type": "string",
                        "example": "Nota interna staff"
                    },
                    "message": {
                        "type": "string",
                        "example": ""
                    },
                    "extra_fields": {
                        "type": "object",
                        "example": []
                    },
                    "flagNoEmail": {
                        "type": "integer",
                        "example": 0
                    },
                    "flagNoSms": {
                        "type": "integer",
                        "example": 0
                    },
                    "idStripe": {
                        "type": "string",
                        "example": ""
                    },
                    "idCustomerStripe": {
                        "type": "string",
                        "example": ""
                    },
                    "required_guarantee_card": {
                        "type": "integer",
                        "example": 0
                    },
                    "guarantee_deposit": {
                        "type": "number",
                        "format": "float",
                        "example": 0
                    },
                    "guarantee_policy": {
                        "type": "string",
                        "example": ""
                    },
                    "guarantee_type": {
                        "type": "string",
                        "example": ""
                    },
                    "booking_created_via_API": {
                        "type": "string",
                        "example": "false",
                        "enum": [
                            "true",
                            "false"
                        ]
                    },
                    "booking_reason": {
                        "type": "string",
                        "example": "Cena"
                    },
                    "ad_click_ids": {
                        "description": "Click ID ads (gclid/gbraid/wbraid/fbclid) catturati da URL di atterraggio e/o postMessage dal parent in embed; sanitize server-side (max 255, charset alfanumerico + ._-)",
                        "properties": {
                            "gclid": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "example": "Cj0KCQjw..."
                            },
                            "gbraid": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "wbraid": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "fbclid": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "example": "IwAR..."
                            }
                        },
                        "type": "object",
                        "example": {
                            "gclid": "Cj0KCQjw..."
                        }
                    },
                    "table": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/TableData"
                        }
                    },
                    "customer": {
                        "$ref": "#/components/schemas/CustomerData"
                    },
                    "customFields": {
                        "description": "Campi custom configurati per il webhook",
                        "type": [
                            "object",
                            "null"
                        ]
                    }
                },
                "type": "object"
            },
            "CartItemVariantOptionData": {
                "description": "Singola opzione selezionata all'interno di un gruppo variante",
                "required": [
                    "name",
                    "price"
                ],
                "properties": {
                    "name": {
                        "description": "Nome opzione nella lingua dell'ordine",
                        "type": "string",
                        "example": "Mozzarella di bufala"
                    },
                    "price": {
                        "description": "Sovrapprezzo opzione (0 se inclusa)",
                        "type": "number",
                        "format": "float",
                        "example": 1.5
                    }
                },
                "type": "object"
            },
            "CartItemVariantData": {
                "description": "Gruppo variante selezionato per un prodotto (es. \"Tipo mozzarella\", \"Cottura\")",
                "required": [
                    "group_name",
                    "options"
                ],
                "properties": {
                    "group_name": {
                        "description": "Nome del gruppo variante nella lingua dell'ordine",
                        "type": "string",
                        "example": "Quale mozzarella?"
                    },
                    "group_internal_name": {
                        "description": "Nome interno del gruppo (backend)",
                        "type": "string",
                        "example": "Tipo mozzarella"
                    },
                    "options": {
                        "description": "Opzioni selezionate dal cliente",
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/CartItemVariantOptionData"
                        }
                    }
                },
                "type": "object"
            },
            "CartItemData": {
                "description": "Singolo prodotto nel carrello dell'ordine",
                "required": [
                    "id",
                    "name",
                    "unit_price",
                    "quantity",
                    "line_total"
                ],
                "properties": {
                    "id": {
                        "description": "ID prodotto nel catalogo",
                        "type": "integer",
                        "example": 342
                    },
                    "name": {
                        "description": "Nome prodotto nella lingua dell'ordine",
                        "type": "string",
                        "example": "Margherita"
                    },
                    "internal_name": {
                        "description": "Nome interno (backend)",
                        "type": "string",
                        "example": "Margherita"
                    },
                    "unit_price": {
                        "description": "Prezzo unitario applicato per la tipologia ordine",
                        "type": "number",
                        "format": "float",
                        "example": 8.5
                    },
                    "variants_price": {
                        "description": "Totale sovrapprezzi varianti",
                        "type": "number",
                        "format": "float",
                        "example": 1.5
                    },
                    "quantity": {
                        "description": "Quantita' ordinata",
                        "type": "integer",
                        "example": 2
                    },
                    "line_total": {
                        "description": "(unit_price + variants_price) * quantity",
                        "type": "number",
                        "format": "float",
                        "example": 20
                    },
                    "category_id": {
                        "description": "ID categoria di appartenenza",
                        "type": "integer",
                        "example": 12
                    },
                    "variants": {
                        "description": "Gruppi variante selezionati per questo prodotto",
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/CartItemVariantData"
                        }
                    }
                },
                "type": "object"
            },
            "CartData": {
                "description": "Carrello curato dell'ordine con totali e lista prodotti",
                "required": [
                    "subtotal",
                    "total",
                    "items_count",
                    "items"
                ],
                "properties": {
                    "subtotal": {
                        "description": "Subtotale prodotti prima di consegna e sconti",
                        "type": "number",
                        "format": "float",
                        "example": 25.5
                    },
                    "delivery_fee": {
                        "description": "Spese di consegna (0 per takeaway/selforder)",
                        "type": "number",
                        "format": "float",
                        "example": 3.5
                    },
                    "discount": {
                        "description": "Sconto applicato (coupon o promozione)",
                        "type": "number",
                        "format": "float",
                        "example": 2
                    },
                    "total": {
                        "description": "Totale finale = subtotal + delivery_fee - discount",
                        "type": "number",
                        "format": "float",
                        "example": 27
                    },
                    "items_count": {
                        "description": "Quantita' totale pezzi nel carrello",
                        "type": "integer",
                        "example": 3
                    },
                    "items": {
                        "description": "Lista dei prodotti ordinati",
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/CartItemData"
                        }
                    }
                },
                "type": "object"
            },
            "OrderWebhookData": {
                "description": "Order payload sent with ORDERS_CREATE and ORDERS_UPDATE events",
                "required": [
                    "order_hash",
                    "internal_id",
                    "type",
                    "status"
                ],
                "properties": {
                    "order_hash": {
                        "type": "string",
                        "example": "f8d3a1b2c4"
                    },
                    "internal_id": {
                        "type": "integer",
                        "example": 1042
                    },
                    "type": {
                        "description": "delivery | takeaway | selforder",
                        "type": "string",
                        "example": "delivery"
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "example": "2026-04-28 12:00:00"
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "example": "2026-04-28 12:30:00"
                    },
                    "date": {
                        "type": "string",
                        "format": "date",
                        "example": "2026-04-28"
                    },
                    "time": {
                        "type": "string",
                        "example": "13:00"
                    },
                    "datetimeutc": {
                        "type": "string",
                        "format": "date-time",
                        "example": "2026-04-28T11:00:00Z"
                    },
                    "status": {
                        "type": "string",
                        "example": "Confirmed",
                        "enum": [
                            "Not Confirmed",
                            "Confirmed",
                            "Fulfilled",
                            "Rejected",
                            "Cancelled",
                            "Incomplete Payment"
                        ]
                    },
                    "source": {
                        "type": "string",
                        "example": "Web",
                        "enum": [
                            "API",
                            "Manual",
                            "Web"
                        ]
                    },
                    "amount": {
                        "type": "number",
                        "format": "float",
                        "example": 42.5
                    },
                    "payment_status": {
                        "type": "integer",
                        "example": 1
                    },
                    "payment_method": {
                        "type": "string",
                        "example": "stripe"
                    },
                    "flagPrivacy": {
                        "type": "integer",
                        "example": 1
                    },
                    "flagMarketing": {
                        "type": "integer",
                        "example": 0
                    },
                    "flagNoEmail": {
                        "type": "integer",
                        "example": 0
                    },
                    "flagNoSms": {
                        "type": "integer",
                        "example": 0
                    },
                    "note": {
                        "type": "string",
                        "example": "Senza cipolla"
                    },
                    "message": {
                        "type": "string",
                        "example": ""
                    },
                    "address": {
                        "type": "string",
                        "example": "Via Roma 10, Milano"
                    },
                    "address_infos": {
                        "description": "Dettagli indirizzo strutturati",
                        "type": "object"
                    },
                    "extra_fields": {
                        "type": "object",
                        "example": []
                    },
                    "cart": {
                        "$ref": "#/components/schemas/CartData"
                    },
                    "customer": {
                        "$ref": "#/components/schemas/CustomerData"
                    },
                    "customFields": {
                        "description": "Campi custom configurati per il webhook",
                        "type": [
                            "object",
                            "null"
                        ]
                    }
                },
                "type": "object"
            },
            "WebhookEnvelope": {
                "description": "Top-level webhook envelope wrapping event-specific data",
                "required": [
                    "location",
                    "event",
                    "datetime",
                    "notification_uuid",
                    "attempt",
                    "data"
                ],
                "properties": {
                    "location": {
                        "description": "MD5 hash della location",
                        "type": "string",
                        "example": "d41d8cd98f00b204e9800998ecf8427e"
                    },
                    "event": {
                        "type": "string",
                        "example": "BOOKINGS_CREATE",
                        "enum": [
                            "BOOKINGS_CREATE",
                            "BOOKINGS_UPDATE",
                            "ORDERS_CREATE",
                            "ORDERS_UPDATE"
                        ]
                    },
                    "datetime": {
                        "description": "Timestamp UTC ISO 8601",
                        "type": "string",
                        "format": "date-time",
                        "example": "2026-04-28T14:30:00Z"
                    },
                    "notification_uuid": {
                        "description": "UUID univoco della notifica",
                        "type": "string",
                        "example": "662fae4b3c5e81.23456789"
                    },
                    "attempt": {
                        "description": "Numero tentativo di invio",
                        "type": "integer",
                        "example": 1
                    },
                    "timezone": {
                        "type": "string",
                        "example": "Europe/Rome"
                    },
                    "source": {
                        "description": "Sorgente evento (API, Manual, Web)",
                        "type": "string",
                        "example": "Web",
                        "enum": [
                            "API",
                            "Manual",
                            "Web"
                        ]
                    },
                    "data": {
                        "description": "Event-specific payload (BookingWebhookData or OrderWebhookData)",
                        "type": "object"
                    }
                },
                "type": "object"
            }
        },
        "securitySchemes": {
            "basicAuth": {
                "type": "http",
                "description": "HTTP Basic Authentication. Use your Location ID as username and your API Hash as password. Credentials are provided by Plateform.",
                "scheme": "basic"
            }
        }
    },
    "tags": [
        {
            "name": "Customer",
            "description": "Customer"
        },
        {
            "name": "Location",
            "description": "Location"
        },
        {
            "name": "Orders",
            "description": "Orders"
        },
        {
            "name": "Reservation",
            "description": "Reservation"
        },
        {
            "name": "Utils",
            "description": "Utils"
        }
    ],
    "webhooks": {
        "BOOKINGS_CREATE": {
            "post": {
                "summary": "Booking created",
                "description": "Fired when a new booking is created (Web, API, or Backend)",
                "operationId": "webhookBookingsCreate",
                "requestBody": {
                    "description": "Webhook envelope with booking data",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "allOf": [
                                    {
                                        "$ref": "#/components/schemas/WebhookEnvelope"
                                    },
                                    {
                                        "properties": {
                                            "event": {
                                                "type": "string",
                                                "example": "BOOKINGS_CREATE",
                                                "enum": [
                                                    "BOOKINGS_CREATE"
                                                ]
                                            },
                                            "data": {
                                                "$ref": "#/components/schemas/BookingWebhookData"
                                            }
                                        },
                                        "type": "object"
                                    }
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Return 200 to confirm receipt"
                    }
                }
            }
        },
        "BOOKINGS_UPDATE": {
            "post": {
                "summary": "Booking updated",
                "description": "Fired when a booking is modified or its status changes",
                "operationId": "webhookBookingsUpdate",
                "requestBody": {
                    "description": "Webhook envelope with booking data",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "allOf": [
                                    {
                                        "$ref": "#/components/schemas/WebhookEnvelope"
                                    },
                                    {
                                        "properties": {
                                            "event": {
                                                "type": "string",
                                                "example": "BOOKINGS_UPDATE",
                                                "enum": [
                                                    "BOOKINGS_UPDATE"
                                                ]
                                            },
                                            "data": {
                                                "$ref": "#/components/schemas/BookingWebhookData"
                                            }
                                        },
                                        "type": "object"
                                    }
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Return 200 to confirm receipt"
                    }
                }
            }
        },
        "ORDERS_CREATE": {
            "post": {
                "summary": "Order created",
                "description": "Fired when a new order is placed (delivery, takeaway, or self-order)",
                "operationId": "webhookOrdersCreate",
                "requestBody": {
                    "description": "Webhook envelope with order data",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "allOf": [
                                    {
                                        "$ref": "#/components/schemas/WebhookEnvelope"
                                    },
                                    {
                                        "properties": {
                                            "event": {
                                                "type": "string",
                                                "example": "ORDERS_CREATE",
                                                "enum": [
                                                    "ORDERS_CREATE"
                                                ]
                                            },
                                            "data": {
                                                "$ref": "#/components/schemas/OrderWebhookData"
                                            }
                                        },
                                        "type": "object"
                                    }
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Return 200 to confirm receipt"
                    }
                }
            }
        },
        "ORDERS_UPDATE": {
            "post": {
                "summary": "Order updated",
                "description": "Fired when an order is modified or its status changes",
                "operationId": "webhookOrdersUpdate",
                "requestBody": {
                    "description": "Webhook envelope with order data",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "allOf": [
                                    {
                                        "$ref": "#/components/schemas/WebhookEnvelope"
                                    },
                                    {
                                        "properties": {
                                            "event": {
                                                "type": "string",
                                                "example": "ORDERS_UPDATE",
                                                "enum": [
                                                    "ORDERS_UPDATE"
                                                ]
                                            },
                                            "data": {
                                                "$ref": "#/components/schemas/OrderWebhookData"
                                            }
                                        },
                                        "type": "object"
                                    }
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Return 200 to confirm receipt"
                    }
                }
            }
        }
    }
}