{
  "openapi": "3.1.0",
  "info": {
    "title": "Elivaas Partner API",
    "version": "1.0.0",
    "description": "Partner-facing distribution API. Read listings, daily inventory, and occupancy-based rates."
  },
  "servers": [
    {
      "url": "https://partner-api.elivaas.com",
      "description": "Production"
    }
  ],
  "paths": {
    "/api/rates": {
      "get": {
        "tags": [
          "rate-controller"
        ],
        "operationId": "list",
        "parameters": [
          {
            "name": "listingIds",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "propertyIds",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RateRow"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/ping": {
      "get": {
        "tags": [
          "ping-controller"
        ],
        "operationId": "ping",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          }
        }
      }
    },
    "/api/listings": {
      "get": {
        "tags": [
          "listing-controller"
        ],
        "operationId": "list_1",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/PageResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/inventories": {
      "get": {
        "tags": [
          "inventory-controller"
        ],
        "operationId": "list_2",
        "parameters": [
          {
            "name": "listingIds",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "propertyIds",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Inventory"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "RateRow": {
        "type": "object",
        "properties": {
          "propertyId": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "mealPlan": {
            "type": "string"
          },
          "adults": {
            "type": "integer",
            "format": "int32"
          },
          "rate": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "ListingWithProperties": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "maxAdults": {
            "type": "integer",
            "format": "int32"
          },
          "maxChildren": {
            "type": "integer",
            "format": "int32"
          },
          "latitude": {
            "type": "number",
            "format": "double"
          },
          "longitude": {
            "type": "number",
            "format": "double"
          },
          "locality": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "addressLine": {
            "type": "string"
          },
          "price": {
            "type": "number",
            "format": "double"
          },
          "amenities": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "properties": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PropertyDetails"
            }
          }
        }
      },
      "PageResponse": {
        "type": "object",
        "description": "A page of results with offset-based pagination metadata.",
        "properties": {
          "data": {
            "type": "array",
            "description": "Rows on this page.",
            "items": {
              "$ref": "#/components/schemas/ListingWithProperties"
            }
          },
          "total": {
            "type": "integer",
            "format": "int64",
            "description": "Total rows across all pages.",
            "example": 237
          },
          "page": {
            "type": "integer",
            "format": "int32",
            "description": "1-based page index.",
            "example": 1
          },
          "size": {
            "type": "integer",
            "format": "int32",
            "description": "Requested page size.",
            "example": 20
          }
        }
      },
      "PropertyDetails": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "bedrooms": {
            "type": "integer",
            "format": "int32"
          },
          "bathrooms": {
            "type": "integer",
            "format": "int32"
          },
          "numberOfPets": {
            "type": "integer",
            "format": "int32"
          },
          "isPetFriendly": {
            "type": "boolean"
          },
          "isStressed": {
            "type": "boolean"
          },
          "isHighDemand": {
            "type": "boolean"
          },
          "brand": {
            "type": "string"
          },
          "quantity": {
            "type": "integer",
            "format": "int32"
          },
          "price": {
            "type": "number",
            "format": "double"
          },
          "city": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "location": {
            "type": "string"
          },
          "latitude": {
            "type": "number",
            "format": "double"
          },
          "longitude": {
            "type": "number",
            "format": "double"
          },
          "name": {
            "type": "string"
          },
          "applicableAdult": {
            "type": "integer",
            "format": "int32"
          },
          "applicableChild": {
            "type": "integer",
            "format": "int32"
          },
          "extraAdultRate": {
            "type": "integer",
            "format": "int32"
          },
          "extraChildRate": {
            "type": "integer",
            "format": "int32"
          },
          "maxAdults": {
            "type": "integer",
            "format": "int32"
          },
          "numberOfBeds": {
            "type": "integer",
            "format": "int32"
          },
          "maxChildren": {
            "type": "integer",
            "format": "int32"
          },
          "imageUrl": {
            "type": "string"
          },
          "photos": {
            "type": "string"
          },
          "amenities": {
            "type": "string"
          }
        }
      },
      "Inventory": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "quantity": {
            "type": "integer",
            "format": "int32"
          },
          "propertyId": {
            "type": "string"
          },
          "minimumStay": {
            "type": "integer",
            "format": "int32"
          },
          "maximumStay": {
            "type": "integer",
            "format": "int32"
          },
          "stopSell": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      }
    },
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "basic",
        "description": "HTTP Basic Auth — pass your API key as the username and leave the password empty. Example: `Authorization: Basic base64(\"dk_live_xxxxx:\")`"
      }
    }
  },
  "security": [
    {
      "apiKey": []
    }
  ]
}
