{
  "openapi": "3.1.0",
  "info": {
    "title": "Amsterdam Experiences API",
    "description": "Book private guided tours and experiences in Amsterdam. Most tours are private (your own guide); a few are small-group tours, marked tour_type small_group. Enquiries are responded to within 24 hours.",
    "version": "1.0.0",
    "contact": {
      "name": "Amsterdam Experiences",
      "url": "https://amsterdamexperiences.nl",
      "email": "info@amsterdamexperiences.nl"
    }
  },
  "servers": [
    {
      "url": "https://amsterdamexperiences.nl/wp-json/aex/v1",
      "description": "AEX REST API v1"
    }
  ],
  "paths": {
    "/tours": {
      "get": {
        "operationId": "listTours",
        "summary": "List all available tours",
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Keywords; every word must appear in the tour name, slug, description or its categories"
          },
          {
            "name": "category",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Extra keyword, matched the same way as search"
          },
          {
            "name": "group",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "a",
                "b"
              ]
            },
            "description": "Filter by duration: a = up to about 4 hours, b = full day"
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 1,
              "minimum": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 20,
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of tours",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TourList"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/tours/{slug}": {
      "get": {
        "operationId": "getTour",
        "summary": "Get a single tour by slug",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Tour details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TourDetail"
                }
              }
            }
          },
          "404": {
            "description": "Tour not found"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/inquiry": {
      "post": {
        "operationId": "submitInquiry",
        "summary": "Submit a booking enquiry",
        "description": "Submit an enquiry for a tour. AEX will confirm availability and pricing within 24 hours.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InquiryRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Enquiry received",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InquiryResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation error"
          },
          "429": {
            "description": "Rate limited (10 per hour)"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Tour": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "group": {
            "type": "string",
            "enum": [
              "a",
              "b"
            ],
            "description": "a = up to about 4 hours, b = full day"
          },
          "description": {
            "type": "string"
          },
          "max_guests": {
            "type": [
              "integer",
              "null"
            ],
            "description": "null: no fixed limit in the API, see group_size_note and the tour page"
          },
          "group_size_note": {
            "type": "string"
          },
          "tour_type": {
            "type": "string",
            "enum": [
              "private",
              "small_group"
            ]
          },
          "price_from": {
            "type": [
              "number",
              "null"
            ],
            "description": "Starting price in EUR as shown on the tour page (private tours per booking, small-group tours per person). null means price on request."
          },
          "currency": {
            "type": "string",
            "example": "EUR"
          },
          "booking_url": {
            "type": "string",
            "format": "uri"
          },
          "pricing_on_request": {
            "type": "boolean"
          }
        }
      },
      "TourList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Tour"
            }
          },
          "meta": {
            "type": "object",
            "properties": {
              "total": {
                "type": "integer"
              },
              "total_pages": {
                "type": "integer"
              },
              "page": {
                "type": "integer"
              },
              "per_page": {
                "type": "integer"
              },
              "currency": {
                "type": "string"
              }
            }
          }
        }
      },
      "TourDetail": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Tour"
          }
        }
      },
      "InquiryRequest": {
        "type": "object",
        "required": [
          "tour_slug",
          "date",
          "guests",
          "name",
          "email"
        ],
        "properties": {
          "tour_slug": {
            "type": "string",
            "description": "Slug of the tour (from /tours)"
          },
          "date": {
            "type": "string",
            "format": "date",
            "description": "Preferred date (YYYY-MM-DD, must be future)"
          },
          "guests": {
            "type": "integer",
            "minimum": 1,
            "maximum": 500,
            "description": "Total group size. Larger private groups are split over more guides."
          },
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "message": {
            "type": "string",
            "description": "Optional notes"
          }
        }
      },
      "InquiryResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "inquiry_id": {
                "type": "string"
              },
              "status": {
                "type": "string",
                "example": "received"
              },
              "message": {
                "type": "string"
              },
              "idempotency_key": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          }
        }
      }
    }
  }
}