---
title: Closed Departure Restriction Room Level
slug: closed-departure-restriction-room-level
docTags: 
createdAt: 2025-09-10T12:18:34.268Z
---

:::ApiMethodV2
```json
{
  "name": "Closed Departure Restriction Room Level",
  "method": "POST",
  "url": "https://aggregate.bakuun.com/api/updateroomdeparture/MPBXX/invupdate",
  "description": "Pushes departure restriction updates from Bakuun to the partner system.\n\nThis action notifies the partner when a property or specific room type is closed or open for departures (check-out) on certain dates.\nIt ensures that the partner system does not allow guests to depart on dates where the property has configured no-checkout restrictions.\n",
  "tab": "examples",
  "examples": {
    "languages": [
      {
        "id": "R-8Ym-yOAjHTo8F4BBLrM",
        "language": "json",
        "code": "{\n    \"username\": \"string\",\n    \"password\": \"string\",\n    \"hotelId\": \"string\",\n    \"action\": \"DepartureClosedRQ\",\n    \"data\": [\n       {\n           \"startDateYmd\": \"YYYY-MM-DD\",\n            \"endDateYmd\": \"YYYY-MM-DD\",\n            \"roomCode\": \"string\",\n            \"restriction\": \"Departure\",\n            \"status\": \"0\"\n        }.\n        {\n            \"startDateYmd\": \"YYYY-MM-DD\",\n            \"endDateYmd\": \"YYYY-MM-DD\",\n            \"roomCode\": \"string\",\n            \"restriction\": \"Departure\",\n            \"status\": \"1\"\n        }\n    ]\n}",
        "customLabel": ""
      },
      {
        "id": "s_HI4VFvIQ2yHy3eGylSw",
        "language": "curl",
        "code": "curl --location 'https://aggregate.bakuun.com/api/updateroomdeparture/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    \"restriction\": \"\",\n    \"status\": \"\"\n  }\n}'",
        "customLabel": ""
      },
      {
        "id": "mpi00du1Wg5Kfrksy1WqP",
        "language": "nodejs",
        "code": "var request = require('request');\nvar options = {\n   'method': 'POST',\n   'url': 'https://aggregate.bakuun.com/api/updateroomdeparture/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         \"restriction\": \"\",\n         \"status\": \"\"\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": "evmdjAYUKwpFMSxHPp-zn",
        "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      \"restriction\": \"\",\n      \"status\": \"\"\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/updateroomdeparture/MPBXX/invupdate\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));",
        "customLabel": ""
      },
      {
        "id": "-Zy-TapTCeSIP2DrrE7u1",
        "language": "python",
        "code": "import requests\nimport json\n\nurl = \"https://aggregate.bakuun.com/api/updateroomdeparture/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      \"restriction\": \"\",\n      \"status\": \"\"\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": "63ZjGXhQcI4hinIS0KhMC",
        "language": "ruby",
        "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://aggregate.bakuun.com/api/updateroomdeparture/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      \"restriction\": \"\",\n      \"status\": \"\"\n   }\n})\n\nresponse = https.request(request)\nputs response.read_body\n",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "R-8Ym-yOAjHTo8F4BBLrM"
  },
  "results": {
    "languages": [
      {
        "id": "HiFBZgQCHsln3H59TZ70S",
        "language": "200",
        "code": "{\n  \"success\": true\n}\n",
        "customLabel": ""
      },
      {
        "id": "LraLOoXCGg6WjxiJB6cco",
        "language": "500",
        "code": "{\n  \"success\": false,  \n  \"errors\": [\n    {\n      \"code\": 500,\n      \"message\": \"Internal server error\"\n    }\n  ]\n}",
        "customLabel": ""
      },
      {
        "id": "DrdN5lV6p-2a09ua1JEOO",
        "language": "502",
        "code": "{\n  \"success\": false, \n  \"errors\": [\n    {\n      \"code\": 502,\n      \"message\": \"Bad gateway\"\n    }\n  ]\n}",
        "customLabel": ""
      },
      {
        "id": "4gIJ8cKKWXseR_xDHXZ6O",
        "language": "503",
        "code": "{\n  \"success\": false,\n  \"errors\": [\n    {\n      \"code\": 503,\n      \"message\": \"Service unavailable\"\n    }\n  ]\n}",
        "customLabel": ""
      },
      {
        "id": "b4r1K_CB7VfyxM9yypFNA",
        "language": "504",
        "code": "{\n  \"success\": false,\n  \"errors\": [\n    {\n      \"code\": 504,\n      \"message\": \"Endpoint request timed-out\"\n    }\n  ]\n}",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "HiFBZgQCHsln3H59TZ70S"
  },
  "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 DepartureClosedRQ.",
        "": "Always set to DepartureClosedRQ."
      },
      {
        "name": "data",
        "kind": "required",
        "type": "object",
        "description": "List of departure restriction records (each corresponding to a room/date range).",
        "": "List of departure restriction records (each corresponding to a room/date range).",
        "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 (as per the room mapping)."
          },
          {
            "name": "restriction",
            "kind": "required",
            "type": "string",
            "description": "Restriction type — always \"Departure\" for this action."
          },
          {
            "name": "status",
            "kind": "required",
            "type": "string",
            "description": "Restriction flag:\n\"0\" =  Open for departure\n\"1\" = Closed for departure"
          }
        ],
        "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 (as per the room mapping)."
          },
          {
            "name": "restriction",
            "kind": "required",
            "type": "string",
            "description": "Restriction type — always \"Departure\" for this action."
          },
          {
            "name": "status",
            "kind": "required",
            "type": "string",
            "description": "Restriction flag:\n\"0\" =  Open for departure\n\"1\" = Closed for departure"
          }
        ]
      }
    ],
    "formDataParameters": []
  },
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  },
  "hasTryItOut": false,
  "response": [
    {
      "name": "success",
      "kind": "optional",
      "type": "boolean",
      "description": ""
    }
  ],
  "autoGeneratedAnchorSlug": "closed-departure-restriction-room-level",
  "legacyHash": "3-d-EQH6hysDBaNqBLSqv"
}
```
:::

