---
title: Sell Threshold
slug: caAe-sell-threshold
createdAt: 2025-09-10T12:17:20.793Z
---

:::ApiMethodV2
```json
{
  "name": "Sell Threshold",
  "method": "POST",
  "url": "https://aggregate.bakuun.com/api/UpdateRoomThreshold/MPBXX/invupdate",
  "description": "Pushes the sell threshold configuration from Bakuun to the partner system.\n\nThis action informs the partner about threshold rules for specific rooms and date ranges.\nThe sell threshold determines the minimum number of rooms that must remain unsold before the property stops being available for sale.\n\nApplies to each date within the provided date range. Threshold value is typically an integer between 0 and the total number of available rooms. \nA threshold of 0 means no restriction (sell until all rooms are gone). \n\nUsed mainly to prevent overbookings or control yield.\n\n\n\n",
  "tab": "examples",
  "examples": {
    "languages": [
      {
        "id": "iBKpYJYZSJXvngOIIkoHV",
        "language": "json",
        "code": "{\n    \"username\": \"string\",\n    \"password\": \"string\",\n    \"hotelId\": \"string\",\n    \"action\": \"sellThresholdUpdate\",\n    \"data\": [\n        {\n            \"startDateYmd\": \"YYYY-MM-DD\",\n            \"endDateYmd\": \"YYYY-MM-DD\",\n            \"roomCode\": \"string\",\n            \"threshold\": \"string\"\n        }\n    ]\n}",
        "customLabel": ""
      },
      {
        "id": "H7h4pQ6dLbwoDXc7LH5vx",
        "language": "curl",
        "code": "curl --location 'https://aggregate.bakuun.com/api/UpdateRoomThreshold/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    \"threshold\": \"\"\n  }\n}'",
        "customLabel": ""
      },
      {
        "id": "GvEMeQMJ3HPBsaEcAbNMS",
        "language": "nodejs",
        "code": "var request = require('request');\nvar options = {\n   'method': 'POST',\n   'url': 'https://aggregate.bakuun.com/api/UpdateRoomThreshold/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         \"threshold\": \"\"\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": "ckzmdXouEJa4qvQIAabgo",
        "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      \"threshold\": \"\"\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/UpdateRoomThreshold/MPBXX/invupdate\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));",
        "customLabel": ""
      },
      {
        "id": "vPHVAyW368_T0kaNksaaL",
        "language": "python",
        "code": "import requests\nimport json\n\nurl = \"https://aggregate.bakuun.com/api/UpdateRoomThreshold/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      \"threshold\": \"\"\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": "KV7t1N-f5i3HHfbbraHwP",
        "language": "ruby",
        "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://aggregate.bakuun.com/api/UpdateRoomThreshold/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      \"threshold\": \"\"\n   }\n})\n\nresponse = https.request(request)\nputs response.read_body\n",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "iBKpYJYZSJXvngOIIkoHV"
  },
  "results": {
    "languages": [
      {
        "id": "RquppNRlZjCPOoypIlGaQ",
        "language": "200",
        "code": "{\n  \"success\": true\n}\n",
        "customLabel": ""
      },
      {
        "id": "qvHdFBqSVgRw131z22ysN",
        "language": "500",
        "code": "{\n  \"success\": false, \n  \"errors\": [\n    {\n      \"code\": 500,\n      \"message\": \"Internal server error\"\n    }\n  ]\n}",
        "customLabel": ""
      },
      {
        "id": "J4mxUvJ4AO7nrB9yYvJhb",
        "language": "502",
        "code": "{\n  \"success\": false,\n  \"errors\": [\n    {\n      \"code\": 502,\n      \"message\": \"Bad gateway\"\n    }\n  ]\n}",
        "customLabel": ""
      },
      {
        "id": "cdhGq4MAExO1TlVZpPoA-",
        "language": "503",
        "code": "{\n  \"success\": false,  \n  \"errors\": [\n    {\n      \"code\": 503,\n      \"message\": \"Service unavailable\"\n    }\n  ]\n}",
        "customLabel": ""
      },
      {
        "id": "Men6SxhzchlyhkHPQdLEm",
        "language": "504",
        "code": "{\n  \"success\": false, \n  \"errors\": [\n    {\n      \"code\": 504,\n      \"message\": \"Endpoint request timed-out\"\n    }\n  ]\n}",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "Men6SxhzchlyhkHPQdLEm"
  },
  "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 as sellThresholdUpdate",
        "": "Always set as sellThresholdUpdate"
      },
      {
        "name": "data",
        "kind": "required",
        "type": "object",
        "description": "",
        "": "object",
        "children": [
          {
            "name": "startDateYmd",
            "kind": "required",
            "type": "string",
            "description": "Start date of the period affected, in YYYY-MM-DD format."
          },
          {
            "name": "endDateYmd",
            "kind": "required",
            "type": "string",
            "description": "End date of the period affected, in YYYY-MM-DD format."
          },
          {
            "name": "roomCode",
            "kind": "required",
            "type": "string",
            "description": "Code identifying the room (as per the room mapping)."
          },
          {
            "name": "threshold",
            "kind": "required",
            "type": "string",
            "description": "Defines the minimum room allotment that must remain unsold. When this threshold is reached, sales will automatically stop.\nValid range: 0–999. N/A to clear the value."
          }
        ],
        "schema": [
          {
            "name": "startDateYmd",
            "kind": "required",
            "type": "string",
            "description": "Start date of the period affected, in YYYY-MM-DD format."
          },
          {
            "name": "endDateYmd",
            "kind": "required",
            "type": "string",
            "description": "End date of the period affected, in YYYY-MM-DD format."
          },
          {
            "name": "roomCode",
            "kind": "required",
            "type": "string",
            "description": "Code identifying the room (as per the room mapping)."
          },
          {
            "name": "threshold",
            "kind": "required",
            "type": "string",
            "description": "Defines the minimum room allotment that must remain unsold. When this threshold is reached, sales will automatically stop.\nValid range: 0–999. N/A to clear the value."
          }
        ]
      }
    ],
    "formDataParameters": []
  },
  "currentNewParameter": {
    "label": "Query Parameter",
    "value": "queryParameters"
  },
  "hasTryItOut": false,
  "response": [
    {
      "name": "success",
      "kind": "optional",
      "type": "boolean",
      "description": ""
    }
  ],
  "autoGeneratedAnchorSlug": "sell-threshold",
  "legacyHash": "tg6E7n_1lcAVjH6i-fYi-"
}
```
:::

.

