---
title: Cancellation and Deposit
slug: cancellation-and-deposit
createdAt: 2025-09-10T11:52:05.061Z
---

:::ApiMethodV2
```json
{
  "name": "Cancellation and Deposit ",
  "method": "POST",
  "url": "https://aggregate.bakuun.com/api/updateRates/MPBXX/invupdate",
  "description": "Returns the cancellation and deposit policy for a specific hotel / room / rate plan and date range.\n\nThis action is used by the partner to retrieve:\n\nCancellation rules (deadlines, penalty type & amount, level 1 / level 2, etc.)\n\nDeposit rules (if a deposit is required, how much, when it’s charged)",
  "tab": "examples",
  "examples": {
    "languages": [
      {
        "id": "F6DFMY8yp37HbzLk13k1v",
        "language": "json",
        "code": "{\n    \"password\": \"string\",\n    \"username\": \"string\",\n    \"hotelId\": \"string\",\n    \"roomId\": \"string\",\n    \"ratePlanId\": \"string\",\n    \"startDate\": \"YYYY-MM-DD\",\n    \"endDate\": \"YYYY-MM-DD\",\n    \"refundable\": \"true\",\n    \"action\": \"getCancellation\",\n    \"policyDetails\": {\n        \"cancellation\": [\n            {\n                \"policyId\": XX,\n                \"daysPriorCheckin\": XX,\n                \"penaltyType\": XX,\n                \"penaltyAmount\": XX,\n                \"penaltyApplied\": XX,\n                \"level\": 1\n            },\n            {\n                \"policyId\": XX,\n                \"daysPriorCheckin\": XX,\n                \"penaltyType\": XX,\n                \"penaltyAmount\": XX,\n                \"penaltyApplied\": XX,\n                \"level\": 2\n            }\n        ],\n        \"deposit\": {\n            \"depositPolicy\": \"string\",\n            \"depositType\": 3,\n            \"depositAmount\": 10,\n            \"depositApplied\": 3,\n            \"depositIntervalUnits\": X,\n            \"depositTimeInterval\": X\n        }\n    }\n}",
        "customLabel": ""
      },
      {
        "id": "WCzRZ3rr9to-T8Goo9aUs",
        "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  \"roomId\": \"String\",\n  \"ratePlanId\": \"String\",\n  \"startDate\": \"String\",\n  \"endDate\": \"String\",\n  \"refundable\": \"String\",\n  \"action\": \"String\",\n  \"policyDetails\": {\n    \"cancellation\": {\n      \"policyId\": \"\",\n      \"daysPriorCheckin\": \"\",\n      \"penaltyType\": \"\",\n      \"penaltyAmount\": \"\",\n      \"penaltyApplied\": \"\",\n      \"level\": \"\"\n    },\n    \"deposit\": {\n      \"depositPolicy\": \"\",\n      \"depositType\": \"\",\n      \"depositAmount\": \"\",\n      \"depositApplied\": \"\",\n      \"depositIntervalUnits\": \"\",\n      \"depositTimeInterval\": \"\"\n    }\n  }\n}'",
        "customLabel": ""
      },
      {
        "id": "wHNUlDOfLMQHZuPRxEsCv",
        "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      \"roomId\": \"String\",\n      \"ratePlanId\": \"String\",\n      \"startDate\": \"String\",\n      \"endDate\": \"String\",\n      \"refundable\": \"String\",\n      \"action\": \"String\",\n      \"policyDetails\": {\n         \"cancellation\": {\n            \"policyId\": \"\",\n            \"daysPriorCheckin\": \"\",\n            \"penaltyType\": \"\",\n            \"penaltyAmount\": \"\",\n            \"penaltyApplied\": \"\",\n            \"level\": \"\"\n         },\n         \"deposit\": {\n            \"depositPolicy\": \"\",\n            \"depositType\": \"\",\n            \"depositAmount\": \"\",\n            \"depositApplied\": \"\",\n            \"depositIntervalUnits\": \"\",\n            \"depositTimeInterval\": \"\"\n         }\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": "T4mWc1D1cFdyByyiMaWRE",
        "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   \"roomId\": \"String\",\n   \"ratePlanId\": \"String\",\n   \"startDate\": \"String\",\n   \"endDate\": \"String\",\n   \"refundable\": \"String\",\n   \"action\": \"String\",\n   \"policyDetails\": {\n      \"cancellation\": {\n         \"policyId\": \"\",\n         \"daysPriorCheckin\": \"\",\n         \"penaltyType\": \"\",\n         \"penaltyAmount\": \"\",\n         \"penaltyApplied\": \"\",\n         \"level\": \"\"\n      },\n      \"deposit\": {\n         \"depositPolicy\": \"\",\n         \"depositType\": \"\",\n         \"depositAmount\": \"\",\n         \"depositApplied\": \"\",\n         \"depositIntervalUnits\": \"\",\n         \"depositTimeInterval\": \"\"\n      }\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": "i7Q16gzKETutcTl9K0SGU",
        "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   \"roomId\": \"String\",\n   \"ratePlanId\": \"String\",\n   \"startDate\": \"String\",\n   \"endDate\": \"String\",\n   \"refundable\": \"String\",\n   \"action\": \"String\",\n   \"policyDetails\": {\n      \"cancellation\": {\n         \"policyId\": \"\",\n         \"daysPriorCheckin\": \"\",\n         \"penaltyType\": \"\",\n         \"penaltyAmount\": \"\",\n         \"penaltyApplied\": \"\",\n         \"level\": \"\"\n      },\n      \"deposit\": {\n         \"depositPolicy\": \"\",\n         \"depositType\": \"\",\n         \"depositAmount\": \"\",\n         \"depositApplied\": \"\",\n         \"depositIntervalUnits\": \"\",\n         \"depositTimeInterval\": \"\"\n      }\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": "oGUvhkvjv_s-xzM0eUfol",
        "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   \"roomId\": \"String\",\n   \"ratePlanId\": \"String\",\n   \"startDate\": \"String\",\n   \"endDate\": \"String\",\n   \"refundable\": \"String\",\n   \"action\": \"String\",\n   \"policyDetails\": {\n      \"cancellation\": {\n         \"policyId\": \"\",\n         \"daysPriorCheckin\": \"\",\n         \"penaltyType\": \"\",\n         \"penaltyAmount\": \"\",\n         \"penaltyApplied\": \"\",\n         \"level\": \"\"\n      },\n      \"deposit\": {\n         \"depositPolicy\": \"\",\n         \"depositType\": \"\",\n         \"depositAmount\": \"\",\n         \"depositApplied\": \"\",\n         \"depositIntervalUnits\": \"\",\n         \"depositTimeInterval\": \"\"\n      }\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": "Nk06oAPM-SJCHzGv2ZylY"
  },
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [],
    "bodyDataParameters": [
      {
        "name": "username",
        "kind": "required",
        "type": "string",
        "description": "API username provided by the partner to authenticate incoming pushes from Bakuun.\n",
        "": "API username provided by the partner to authenticate incoming pushes from Bakuun.\n"
      },
      {
        "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": "roomId",
        "kind": "required",
        "type": "string",
        "description": "Code identifying the room code as per mapping.",
        "": "Code identifying the room code as per mapping."
      },
      {
        "name": "ratePlanId",
        "kind": "required",
        "type": "string",
        "description": "Code identifying the rate plan code as per mapping.",
        "": "Code identifying the rate plan code as per mapping."
      },
      {
        "name": "startDate",
        "kind": "required",
        "type": "string",
        "description": "Start date of the update range, formatted as YYYY-MM-DD.",
        "": "Start date of the update range, formatted as YYYY-MM-DD."
      },
      {
        "name": "endDate",
        "kind": "required",
        "type": "string",
        "description": "End date of the update range, formatted as YYYY-MM-DD.",
        "": "End date of the update range, formatted as YYYY-MM-DD."
      },
      {
        "name": "refundable",
        "kind": "required",
        "type": "string",
        "description": "\"true\" if the rate is refundable, \"false\" if non-refundable.",
        "": "\"true\" if the rate is refundable, \"false\" if non-refundable."
      },
      {
        "name": "action",
        "kind": "required",
        "type": "string",
        "description": "Always set as getCancellation.",
        "": "Always set as getCancellation."
      },
      {
        "name": "policyDetails",
        "kind": "required",
        "type": "object",
        "description": "",
        "": "required",
        "children": [
          {
            "name": "cancellation",
            "kind": "required",
            "type": "object",
            "description": "Each entry represents one cancellation rule level (e.g. first deadline, second deadline).",
            "children": [
              {
                "name": "policyId",
                "kind": "required",
                "type": "integer",
                "description": "Type of cancellation policy linked to the rate plan: 1 = Standard, 2 = Flexible 1, 3 = Flexible 2, 4 = Flexible 3, 5 = Flexible 4"
              },
              {
                "name": "daysPriorCheckin",
                "kind": "required",
                "type": "integer",
                "description": "Number of days before check-in a guest can cancel without penalty. Use 0 if cancellation is set at 18:00 on day of arrival."
              },
              {
                "name": "penaltyType",
                "kind": "required",
                "type": "integer",
                "description": "Penalty cost type. 3 = Percentage of the stay."
              },
              {
                "name": "penaltyAmount",
                "kind": "required",
                "type": "integer",
                "description": "Percentage value from 1 to 100."
              },
              {
                "name": "penaltyApplied",
                "kind": "required",
                "type": "integer",
                "description": "Where the penalty is applied: 3 = First Night, 4 = Full stay"
              },
              {
                "name": "level",
                "kind": "required",
                "type": "integer",
                "description": "Level of the cancellation rule: 1 = First Level, 2 = Second Level (for multi-step policies)."
              }
            ]
          },
          {
            "name": "deposit",
            "kind": "required",
            "type": "object",
            "description": "Represents the deposit policy for the rate plan.",
            "children": [
              {
                "name": "depositPolicy",
                "kind": "required",
                "type": "string",
                "description": "Whether a deposit is required: \"Required\" = \"true\", \"Not Required\" = \"false\". When refundable is false, deposit will always be \"Required\""
              },
              {
                "name": "depositType",
                "kind": "required",
                "type": "integer",
                "description": "Deposit cost parameter. 3 = Percentage."
              },
              {
                "name": "depositAmount",
                "kind": "required",
                "type": "integer",
                "description": "Percentage value from 1 to 100."
              },
              {
                "name": "depositApplied",
                "kind": "required",
                "type": "integer",
                "description": "Where the deposit is applied: 3 = First Night, 4 = Full stay."
              },
              {
                "name": "depositIntervalUnits",
                "kind": "required",
                "type": "integer",
                "description": "When deposit is charged: 1 = Days before arrival, 0 = At moment of booking"
              },
              {
                "name": "depositTimeInterval",
                "kind": "required",
                "type": "integer",
                "description": "Interval value applied only if depositIntervalUnits = 1. Allowed values: 1–10 or 10, 30, 45, 60. Represents number of days before arrival when deposit is charged."
              }
            ]
          }
        ],
        "schema": [
          {
            "name": "cancellation",
            "kind": "required",
            "type": "object",
            "description": "Each entry represents one cancellation rule level (e.g. first deadline, second deadline).",
            "children": [
              {
                "name": "policyId",
                "kind": "required",
                "type": "integer",
                "description": "Type of cancellation policy linked to the rate plan: 1 = Standard, 2 = Flexible 1, 3 = Flexible 2, 4 = Flexible 3, 5 = Flexible 4"
              },
              {
                "name": "daysPriorCheckin",
                "kind": "required",
                "type": "integer",
                "description": "Number of days before check-in a guest can cancel without penalty. Use 0 if cancellation is set at 18:00 on day of arrival."
              },
              {
                "name": "penaltyType",
                "kind": "required",
                "type": "integer",
                "description": "Penalty cost type. 3 = Percentage of the stay."
              },
              {
                "name": "penaltyAmount",
                "kind": "required",
                "type": "integer",
                "description": "Percentage value from 1 to 100."
              },
              {
                "name": "penaltyApplied",
                "kind": "required",
                "type": "integer",
                "description": "Where the penalty is applied: 3 = First Night, 4 = Full stay"
              },
              {
                "name": "level",
                "kind": "required",
                "type": "integer",
                "description": "Level of the cancellation rule: 1 = First Level, 2 = Second Level (for multi-step policies)."
              }
            ]
          },
          {
            "name": "deposit",
            "kind": "required",
            "type": "object",
            "description": "Represents the deposit policy for the rate plan.",
            "children": [
              {
                "name": "depositPolicy",
                "kind": "required",
                "type": "string",
                "description": "Whether a deposit is required: \"Required\" = \"true\", \"Not Required\" = \"false\". When refundable is false, deposit will always be \"Required\""
              },
              {
                "name": "depositType",
                "kind": "required",
                "type": "integer",
                "description": "Deposit cost parameter. 3 = Percentage."
              },
              {
                "name": "depositAmount",
                "kind": "required",
                "type": "integer",
                "description": "Percentage value from 1 to 100."
              },
              {
                "name": "depositApplied",
                "kind": "required",
                "type": "integer",
                "description": "Where the deposit is applied: 3 = First Night, 4 = Full stay."
              },
              {
                "name": "depositIntervalUnits",
                "kind": "required",
                "type": "integer",
                "description": "When deposit is charged: 1 = Days before arrival, 0 = At moment of booking"
              },
              {
                "name": "depositTimeInterval",
                "kind": "required",
                "type": "integer",
                "description": "Interval value applied only if depositIntervalUnits = 1. Allowed values: 1–10 or 10, 30, 45, 60. Represents number of days before arrival when deposit is charged."
              }
            ]
          }
        ]
      }
    ],
    "formDataParameters": []
  },
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  },
  "hasTryItOut": false,
  "response": [
    {
      "name": "success",
      "kind": "optional",
      "type": "boolean",
      "description": ""
    }
  ],
  "autoGeneratedAnchorSlug": "cancellation-and-deposit",
  "legacyHash": "vzhSUehopTtLCuG25WWeH"
}
```
:::

1
