---
title: Update a subscription holiday
slug: docs/demo/update-a-subscription-holiday
description: Learn how to use cURL command to send a PATCH request to a fictive API and update a specific holiday associated with an account and subscription. This guide provides a code example along with JSON data in raw format to make the necessary update.
docTags: 
createdAt: 2022-03-21T20:12:45.000Z
---

{
  "id": "el38z9zhj_mTzJ-_FQUCq",
  "data": {
    "url": "https://api.fictive.com/REST/api/accounts/{accountReference}/subscriptions/{subscriptionReference}/holidays/{holidayReference}",
    "name": "Update a subscription holiday",
    "method": "PATCH",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "accountReference",
          "type": "string",
          "description": "The input account reference"
        },
        {
          "kind": "required",
          "name": "subscriptionReference",
          "type": "string",
          "description": "The input subscription reference"
        },
        {
          "kind": "required",
          "name": "holidayReference",
          "type": "string",
          "description": "The input subscription holiday reference"
        }
      ],
      "queryParameters": [],
      "headerParameters": [
        {
          "kind": "optional",
          "name": "X-TokenId",
          "type": "string",
          "description": "The eSuite Token Id"
        },
        {
          "kind": "optional",
          "name": "X-SessionId",
          "type": "string",
          "description": "The eSuite Session Id"
        },
        {
          "kind": "required",
          "name": "X-Version",
          "type": "string",
          "description": "The eSuite Version"
        },
        {
          "kind": "optional",
          "name": "Origin",
          "type": "string",
          "description": "The eSuite Origin"
        }
      ],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "subscriptionHolidayRequest",
          "type": "array",
          "schema": [
            {
              "kind": "optional",
              "name": "value",
              "type": "object",
              "schema": [],
              "modelRef": "#/definitions/System.Object",
              "customType": "System.Object"
            },
            {
              "kind": "optional",
              "name": "path",
              "type": "string",
              "example": ""
            },
            {
              "kind": "optional",
              "name": "op",
              "type": "string",
              "example": ""
            },
            {
              "kind": "optional",
              "name": "from",
              "type": "string",
              "example": ""
            }
          ],
          "modelRef": "#/definitions/Microsoft.AspNet.JsonPatch.JsonPatchDocument[FictiveGlobal.Api.Rest.Dtos.v1.Holidays.SubscriptionHolidayPatch]",
          "customType": "Microsoft.AspNet.JsonPatch.JsonPatchDocument[FictiveGlobal.Api.Rest.Dtos.v1.Holidays.SubscriptionHolidayPatch]",
          "isExpanded": true
        }
      ],
      "formDataParameters": []
    },
    "responses": [
      {
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "schema": [
              {
                "kind": "optional",
                "name": "subscriptionHolidayReference",
                "type": "string",
                "example": "",
                "description": "The subscription holiday reference"
              },
              {
                "kind": "optional",
                "name": "subscriptionReference",
                "type": "string",
                "example": "",
                "description": "The subscription reference"
              },
              {
                "kind": "optional",
                "name": "startDate",
                "type": "string<date-time>",
                "example": "2021-09-21T05:33:24.901147",
                "description": "The start date of the subscription holiday"
              },
              {
                "kind": "optional",
                "name": "endDate",
                "type": "string<date-time>",
                "example": "2021-09-21T05:33:24.901147",
                "description": "The end date of the subscription holiday"
              }
            ],
            "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v1.Holidays.SubscriptionHoliday",
            "customType": "FictiveGlobal.Api.Rest.Dtos.v1.Holidays.SubscriptionHoliday",
            "isExpanded": true,
            "description": "Subscription holiday"
          }
        ],
        "isExpanded": true,
        "statusCode": "200",
        "description": "OK",
        "jsonExample": "{\n  \"subscriptionHolidayReference\": \"QIUQIEUQIEU8173\",\n  \"subscriptionReference\": \"ASJDKAS6712KDASK\",\n  \"startDate\": \"2021-09-21T00:00:00\",\n  \"endDate\": \"2021-10-01T23:59:59\"\n}"
      },
      {
        "isExpanded": true,
        "statusCode": "400",
        "description": "Past deferral instructions cannot be amended.",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "401",
        "description": "Not Authorized",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "404",
        "description": "Subscription holiday not found.",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "412",
        "description": "Subscription has not met the minimum number of subscription periods to be eligible for a holiday period.",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "500",
        "description": "Internal Server Error",
        "jsonExample": ""
      }
    ],
    "contentType": "application/json",
    "description": "This endpoint will provide the ability to update a configured holiday period providing the holiday has not beganat the point of execution",
    "examples": {
      "languages": [
        {
          "id": "xgxeijgK543DFSSj156oj",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request PATCH \\\n     --url https://api.fictive.com/REST/api/accounts/{accountReference}/subscriptions/{subscriptionReference}/holidays/{holidayReference} \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --header 'x-version: string' \\\n     --data '[\n     {}\n     ]'"
        },
        {
          "id": "nSVJ8-eto3rp7zkEnJT5g",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\nmyHeaders.append(\"x-version\", \"string\");\n\nvar raw = JSON.stringify([\n   {}\n]);\n\nvar requestOptions = {\n   method: 'PATCH',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.fictive.com/REST/api/accounts/{accountReference}/subscriptions/{subscriptionReference}/holidays/{holidayReference}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "8WNPQulVaOcMga_UIT5-7",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.fictive.com/REST/api/accounts/{accountReference}/subscriptions/{subscriptionReference}/holidays/{holidayReference}\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Patch.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest[\"x-version\"] = \"string\"\nrequest.body = JSON.dump([\n   {}\n])\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "WBmuxdnBXAbP7R_2_dw-j",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.fictive.com/REST/api/accounts/{accountReference}/subscriptions/{subscriptionReference}/holidays/{holidayReference}\"\n\npayload = json.dumps([\n   {}\n])\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json',\n   'x-version': 'string'\n}\n\nresponse = requests.request(\"PATCH\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "xgxeijgK543DFSSj156oj"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "{\n  \"subscriptionHolidayReference\": \"QIUQIEUQIEU8173\",\n  \"subscriptionReference\": \"ASJDKAS6712KDASK\",\n  \"startDate\": \"2021-09-21T00:00:00\",\n  \"endDate\": \"2021-10-01T23:59:59\"\n}"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// Past deferral instructions cannot be amended.\n"
        },
        {
          "id": "response-2-401",
          "language": "401",
          "code": "// Not Authorized\n"
        },
        {
          "id": "response-3-404",
          "language": "404",
          "code": "// Subscription holiday not found.\n"
        },
        {
          "id": "response-4-412",
          "language": "412",
          "code": "// Subscription has not met the minimum number of subscription periods to be eligible for a holiday period.\n"
        },
        {
          "id": "response-5-500",
          "language": "500",
          "code": "// Internal Server Error\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}