{
  "info": {
    "description": "Tours, availability and bookings. Payment is taken on arrival.",
    "title": "Fernhollow Apiary booking API",
    "version": "1.4.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/availability": {
      "get": {
        "parameters": [
          {
            "in": "query",
            "name": "tour",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "first day, YYYY-MM-DD (default today)",
            "in": "query",
            "name": "date",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "party",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "1-14 (default 7)",
            "in": "query",
            "name": "days",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "summary": "Open start times for a tour"
      }
    },
    "/booking": {
      "delete": {
        "parameters": [
          {
            "in": "header",
            "name": "X-CSRF-Token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "summary": "Release the slot"
      },
      "get": {
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "summary": "Current booking"
      },
      "post": {
        "parameters": [
          {
            "in": "header",
            "name": "X-CSRF-Token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "addons": {
                    "additionalProperties": {
                      "type": "integer"
                    },
                    "type": "object"
                  },
                  "company": {
                    "description": "optional",
                    "type": "string"
                  },
                  "fax": {
                    "description": "optional",
                    "type": "string"
                  },
                  "middle_name": {
                    "description": "optional",
                    "type": "string"
                  },
                  "nickname": {
                    "description": "optional",
                    "type": "string"
                  },
                  "party": {
                    "type": "integer"
                  },
                  "promo_code": {
                    "description": "optional",
                    "type": "string"
                  },
                  "referral_code": {
                    "description": "optional",
                    "type": "string"
                  },
                  "session": {
                    "type": "string"
                  },
                  "start": {
                    "format": "date-time",
                    "type": "string"
                  },
                  "tour_id": {
                    "type": "string"
                  },
                  "website": {
                    "description": "optional",
                    "type": "string"
                  }
                },
                "required": [
                  "tour_id",
                  "start",
                  "party"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "summary": "Hold a slot"
      }
    },
    "/checkout": {
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "company": {
                    "description": "optional",
                    "type": "string"
                  },
                  "email": {
                    "type": "string"
                  },
                  "fax": {
                    "description": "optional",
                    "type": "string"
                  },
                  "middle_name": {
                    "description": "optional",
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "nickname": {
                    "description": "optional",
                    "type": "string"
                  },
                  "phone": {
                    "type": "string"
                  },
                  "promo_code": {
                    "description": "optional",
                    "type": "string"
                  },
                  "referral_code": {
                    "description": "optional",
                    "type": "string"
                  },
                  "session": {
                    "type": "string"
                  },
                  "website": {
                    "description": "optional",
                    "type": "string"
                  }
                },
                "required": [
                  "name",
                  "email"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "summary": "Request the held booking (payment on arrival)"
      }
    },
    "/contact": {
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "company": {
                    "description": "optional",
                    "type": "string"
                  },
                  "email": {
                    "type": "string"
                  },
                  "fax": {
                    "description": "optional",
                    "type": "string"
                  },
                  "message": {
                    "type": "string"
                  },
                  "middle_name": {
                    "description": "optional",
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "nickname": {
                    "description": "optional",
                    "type": "string"
                  },
                  "promo_code": {
                    "description": "optional",
                    "type": "string"
                  },
                  "referral_code": {
                    "description": "optional",
                    "type": "string"
                  },
                  "session": {
                    "type": "string"
                  },
                  "website": {
                    "description": "optional",
                    "type": "string"
                  }
                },
                "required": [
                  "message"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "summary": "Send a message"
      }
    },
    "/newsletter": {
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "company": {
                    "description": "optional",
                    "type": "string"
                  },
                  "email": {
                    "type": "string"
                  },
                  "fax": {
                    "description": "optional",
                    "type": "string"
                  },
                  "middle_name": {
                    "description": "optional",
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "nickname": {
                    "description": "optional",
                    "type": "string"
                  },
                  "promo_code": {
                    "description": "optional",
                    "type": "string"
                  },
                  "referral_code": {
                    "description": "optional",
                    "type": "string"
                  },
                  "session": {
                    "type": "string"
                  },
                  "website": {
                    "description": "optional",
                    "type": "string"
                  }
                },
                "required": [
                  "email"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "summary": "Newsletter signup"
      }
    },
    "/policies": {
      "get": {
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "summary": "Cancellation policy"
      }
    },
    "/session": {
      "post": {
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "summary": "Get a CSRF token for API-only clients"
      }
    },
    "/tours": {
      "get": {
        "parameters": [
          {
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "summary": "List or search tours"
      }
    },
    "/tours/{id}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "summary": "Tour detail"
      }
    }
  },
  "servers": [
    {
      "url": "https://fernhollow-apiary.fly.dev/api/o3"
    }
  ]
}
