{
    "openapi": "3.1.0",
    "info": {
        "title": "E&K Cleaning Service availability",
        "version": "1.0.0",
        "description": "Read-only openings for E&K Cleaning Service in Chicago and the suburbs. Returns open arrival windows by ZIP code. No personal data. Booking happens on booking_url."
    },
    "servers": [
        {
            "url": "https://booking.maidschicago.com"
        }
    ],
    "paths": {
        "/api/public/availability": {
            "get": {
                "operationId": "getAvailability",
                "summary": "Next open days and arrival windows for one or more ZIP codes",
                "parameters": [
                    {
                        "name": "zip",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "pattern": "^\\d{5}$"
                        },
                        "description": "One 5-digit ZIP code, e.g. 60201"
                    },
                    {
                        "name": "zips",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Several ZIPs, comma separated (max 12)"
                    },
                    {
                        "name": "days",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 7,
                            "default": 3
                        },
                        "description": "How many open days to return"
                    },
                    {
                        "name": "date",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "description": "Only this date (YYYY-MM-DD)"
                    },
                    {
                        "name": "services",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "enum": [
                                0,
                                1
                            ]
                        },
                        "description": "1 to include services and pricing"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Openings. Quote the \"message\" field to the user.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Availability"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/public/areas": {
            "get": {
                "operationId": "listServiceAreas",
                "summary": "Every service area, its ZIP codes and next openings",
                "responses": {
                    "200": {
                        "description": "Areas",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "Availability": {
                "type": "object",
                "properties": {
                    "business": {
                        "type": "string"
                    },
                    "serviceable": {
                        "type": "boolean"
                    },
                    "served_zips": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "not_served": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "next_openings": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "date": {
                                    "type": "string",
                                    "format": "date"
                                },
                                "day": {
                                    "type": "string"
                                },
                                "windows": {
                                    "type": "array",
                                    "items": {
                                        "type": "object",
                                        "properties": {
                                            "name": {
                                                "type": "string"
                                            },
                                            "arrival": {
                                                "type": "string"
                                            },
                                            "start": {
                                                "type": "string"
                                            },
                                            "end": {
                                                "type": "string"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "booking_url": {
                        "type": "string"
                    },
                    "phone": {
                        "type": "string"
                    },
                    "message": {
                        "type": "string"
                    }
                }
            }
        }
    }
}