---
title: Max Length of Stay Rate Plan Level
slug: max-length-of-stay-rate-plan-level
docTags: 
createdAt: 2025-09-10T11:52:05.061Z
---

:::ApiMethodV2
```json
{
  "name": "Max Length of Stay Rate Plan Level",
  "method": "POST",
  "url": "https://aggregate.bakuun.com/api/updateRates/MPBXX/invupdate",
  "description": "Pushes Max Length of Stay (LOS) condition updates from Bakuun to the partner system.\nThis action communicates max stay rules for one or more rooms and date ranges.\nIt ensures the partner system aligns with Bakuun’s restrictions when hotels define new stay-length conditions or modify existing ones.",
  "tab": "examples",
  "examples": {
    "languages": [
      {
        "id": "F6DFMY8yp37HbzLk13k1v",
        "language": "json",
        "code": "{\n    \"username\": \"string\",\n    \"password\": \"string\",\n    \"hotelId\": \"string\",\n    \"action\": \"SetLosCondRQ\",\n    \"data\": [\n        {\n            \"startDateYmd\": \"YYYY-MM-DD\",\n            \"endDateYmd\": \"YYYY-MM-DD\",\n            \"roomCode\": \"string\",\n            \"condCode\": \"string\",\n            \"minMaxMessageType\": \"SetMaxLOS\"\n            \"Time\": \"1\"\n        }\n    ]\n}",
        "customLabel": ""
      },
      {
        "id": "CHVCxadyGnwXz-K2dEocv",
        "language": "curl",
        "code": "curl --location 'https://aggregate.bakuun.com/api/updateRates/MPBXX/invupdate' \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/json' \\\n--data '{\n  \"username\": \"String\",\n  \"password\": \"String\",\n  \"hotelId\": \"String\",\n  \"action\": \"String\",\n  \"data\": {\n    \"startDateYmd\": \"\",\n    \"endDateYmd\": \"\",\n    \"roomCode\": \"\",\n    \"condCode\": \"\",\n    \"minMaxMessageType\": \"\",\n    \"Time\": \"\"\n  }\n}'",
        "customLabel": ""
      },
      {
        "id": "8ob8TPMkpFlHpvDmbFIYo",
        "language": "nodejs",
        "code": "var request = require('request');\nvar options = {\n   'method': 'POST',\n   'url': 'https://aggregate.bakuun.com/api/updateRates/MPBXX/invupdate',\n   'headers': {\n      'Accept': 'application/json',\n      'Content-Type': 'application/json'\n   },\n   body: JSON.stringify({\n      \"username\": \"String\",\n      \"password\": \"String\",\n      \"hotelId\": \"String\",\n      \"action\": \"String\",\n      \"data\": {\n         \"startDateYmd\": \"\",\n         \"endDateYmd\": \"\",\n         \"roomCode\": \"\",\n         \"condCode\": \"\",\n         \"minMaxMessageType\": \"\",\n         \"Time\": \"\"\n      }\n   })\n\n};\nrequest(options, function (error, response) {\n   if (error) throw new Error(error);\n   console.log(response.body);\n});\n",
        "customLabel": ""
      },
      {
        "id": "2btUhybAaktbQ24EUcSHP",
        "language": "javascript",
        "code": "var myHeaders = new Headers();\nmyHeaders.append(\"Accept\", \"application/json\");\nmyHeaders.append(\"Content-Type\", \"application/json\");\n\nvar raw = JSON.stringify({\n   \"username\": \"String\",\n   \"password\": \"String\",\n   \"hotelId\": \"String\",\n   \"action\": \"String\",\n   \"data\": {\n      \"startDateYmd\": \"\",\n      \"endDateYmd\": \"\",\n      \"roomCode\": \"\",\n      \"condCode\": \"\",\n      \"minMaxMessageType\": \"\",\n      \"Time\": \"\"\n   }\n});\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://aggregate.bakuun.com/api/updateRates/MPBXX/invupdate\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));",
        "customLabel": ""
      },
      {
        "id": "dTnsQRJTz5Sr7GLIaTjpD",
        "language": "python",
        "code": "import requests\nimport json\n\nurl = \"https://aggregate.bakuun.com/api/updateRates/MPBXX/invupdate\"\n\npayload = json.dumps({\n   \"username\": \"String\",\n   \"password\": \"String\",\n   \"hotelId\": \"String\",\n   \"action\": \"String\",\n   \"data\": {\n      \"startDateYmd\": \"\",\n      \"endDateYmd\": \"\",\n      \"roomCode\": \"\",\n      \"condCode\": \"\",\n      \"minMaxMessageType\": \"\",\n      \"Time\": \"\"\n   }\n})\nheaders = {\n   'Accept': 'application/json',\n   'Content-Type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n",
        "customLabel": ""
      },
      {
        "id": "5LXVIHnfQ0TcVWRd0x_1g",
        "language": "ruby",
        "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://aggregate.bakuun.com/api/updateRates/MPBXX/invupdate\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"Accept\"] = \"application/json\"\nrequest[\"Content-Type\"] = \"application/json\"\nrequest.body = JSON.dump({\n   \"username\": \"String\",\n   \"password\": \"String\",\n   \"hotelId\": \"String\",\n   \"action\": \"String\",\n   \"data\": {\n      \"startDateYmd\": \"\",\n      \"endDateYmd\": \"\",\n      \"roomCode\": \"\",\n      \"condCode\": \"\",\n      \"minMaxMessageType\": \"\",\n      \"Time\": \"\"\n   }\n})\n\nresponse = https.request(request)\nputs response.read_body\n",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "F6DFMY8yp37HbzLk13k1v"
  },
  "results": {
    "languages": [
      {
        "id": "Nk06oAPM-SJCHzGv2ZylY",
        "language": "200",
        "code": "{\n    \"success\": true,\n}",
        "customLabel": ""
      },
      {
        "id": "zcwpkCoaI2Gcs_LMjv5yy",
        "language": "500",
        "code": "{\n    \"success\": false,\n    \"errors\": [\n        {\n            \"code\": 500,\n            \"message\": \"Internal server error\"\n        }\n    ]\n}",
        "customLabel": ""
      },
      {
        "id": "em_Kpv2oZfn8MCO7_f1SV",
        "language": "502",
        "code": "{\n    \"success\": false,\n    \"errors\": [\n        {\n            \"code\": 502,\n            \"message\": \"Bad gateway\"\n        }\n    ]\n}",
        "customLabel": ""
      },
      {
        "id": "zzzE2J6Y7YZDula_qc4OD",
        "language": "503",
        "code": "{\n    \"success\": false,\n    \"errors\": [\n        {\n            \"code\": 503,\n            \"message\": \"Service unavailable\"\n        }\n    ]\n}",
        "customLabel": ""
      },
      {
        "id": "B4wRfM8K9w0KuyctvGtOu",
        "language": "504",
        "code": "{\n    \"success\": false,\n    \"errors\": [\n        {\n            \"code\": 504,\n            \"message\": \"Endpoint request timed-out\"\n        }\n    ]\n}",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "B4wRfM8K9w0KuyctvGtOu"
  },
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [],
    "bodyDataParameters": [
      {
        "name": "username",
        "kind": "required",
        "type": "string",
        "description": "API username provided by the partner to authenticate incoming pushes from Bakuun.",
        "": "API username provided by the partner to authenticate incoming pushes from Bakuun."
      },
      {
        "name": "password",
        "kind": "required",
        "type": "string",
        "description": "API password provided by the partner to authenticate incoming requests from Bakuun.",
        "": "API password provided by the partner to authenticate incoming requests from Bakuun."
      },
      {
        "name": "hotelId",
        "kind": "required",
        "type": "string",
        "description": "Unique property identifier (shared mapping between Bakuun and the partner).",
        "": "Unique property identifier (shared mapping between Bakuun and the partner)."
      },
      {
        "name": "action",
        "kind": "required",
        "type": "string",
        "description": "Always set to SetLosCondRQ.",
        "": "Always set to SetLosCondRQ."
      },
      {
        "name": "data",
        "kind": "required",
        "type": "object",
        "description": "List of LOS condition updates for one or more rooms and date ranges.",
        "": "List of LOS condition updates for one or more rooms and date ranges.",
        "children": [
          {
            "name": "startDateYmd",
            "kind": "required",
            "type": "string",
            "description": "Start date of the update range, formatted as YYYY-MM-DD. "
          },
          {
            "name": "endDateYmd",
            "kind": "required",
            "type": "string",
            "description": "End date of the update range, formatted as YYYY-MM-DD."
          },
          {
            "name": "roomCode",
            "kind": "required",
            "type": "string",
            "description": "Code identifying the room code as per mapping"
          },
          {
            "name": "condCode",
            "kind": "required",
            "type": "string",
            "description": "Code identifying the rate plan code as per mapping."
          },
          {
            "name": "minMaxMessageType",
            "kind": "required",
            "type": "string",
            "description": "Always set to SetMaxLOS"
          },
          {
            "name": "Time",
            "kind": "required",
            "type": "string",
            "description": "Value of maximum stay , accepted value between 1 to 999. N/A to clear the value."
          }
        ],
        "schema": [
          {
            "name": "startDateYmd",
            "kind": "required",
            "type": "string",
            "description": "Start date of the update range, formatted as YYYY-MM-DD. "
          },
          {
            "name": "endDateYmd",
            "kind": "required",
            "type": "string",
            "description": "End date of the update range, formatted as YYYY-MM-DD."
          },
          {
            "name": "roomCode",
            "kind": "required",
            "type": "string",
            "description": "Code identifying the room code as per mapping"
          },
          {
            "name": "condCode",
            "kind": "required",
            "type": "string",
            "description": "Code identifying the rate plan code as per mapping."
          },
          {
            "name": "minMaxMessageType",
            "kind": "required",
            "type": "string",
            "description": "Always set to SetMaxLOS"
          },
          {
            "name": "Time",
            "kind": "required",
            "type": "string",
            "description": "Value of maximum stay , accepted value between 1 to 999. N/A to clear the value."
          }
        ]
      }
    ],
    "formDataParameters": []
  },
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  },
  "hasTryItOut": false,
  "response": [
    {
      "name": "success",
      "kind": "optional",
      "type": "boolean",
      "description": ""
    }
  ],
  "autoGeneratedAnchorSlug": "max-length-of-stay-rate-plan-level",
  "legacyHash": "vzhSUehopTtLCuG25WWeH"
}
```
:::

