---
title: Modify Token
slug: modify-token
docTags: 
createdAt: 2023-09-22T04:41:57.775Z
---

:::ApiMethodV2
```json
{
  "name": "Modify",
  "method": "PATCH",
  "url": "https://secure.paydocker.com/{version}/token/{partnerid}/{randomkey}/modify",
  "description": "",
  "tab": "examples",
  "examples": {
    "languages": [
      {
        "id": "lRnfE1SSpNqWPEw1gpM4Q",
        "language": "json",
        "code": "{\n    \"share_secret\": \"string\",\n    \"token_event\": \"modify\",\n    \"source_id\": \"string\",\n    \"destination_id\": \"string\",\n    \"token_id\": \"string\",\n    \"token_status\": \"string\",\n    \"available_date\": \"string\",\n    \"expiry_date\": \"string\",\n    \"check_in\": \"string\",\n    \"check_out\": \"string\",\n    \"room_count\": \"number\",\n    \"customer_name\": \"string\",\n    \"booking_reference\": \"string\",\n    \"email_token\": \"Boolean\",\n    \"email_settings\": [\n        {\n            \"email_to\": \"string\",\n            \"email_encrypted\": \"Boolean\"\n        }\n    ]\n}",
        "customLabel": ""
      },
      {
        "id": "Wp-ErTKKhJ-W8HBTQ6d6r",
        "language": "curl",
        "code": "curl --location -g --request PATCH 'https://secure.paydocker.com/{version}/token/{partnerid}/{randomkey}/modify' \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\"share_secret\":\"string\",\"token_event\":\"string\",\"source_id\":\"string\",\"destination_id\":\"string\",\"token_id\":\"string\",\"token_status\":\"string\",\"available_date\":\"string\",\"expiry_date\":\"string\",\"token_name\":\"string\",\"token_reference\":\"string\",\"email_token\":\"Boolean\",\"email_settings\":\"Object\"}'",
        "customLabel": ""
      },
      {
        "id": "epE2fb5FL1v_bY1bYTV_M",
        "language": "nodejs",
        "code": "var request = require('request');\nvar options = {\n   'method': 'PATCH',\n   'url': 'https://secure.paydocker.com/{version}/token/{partnerid}/{randomkey}/modify',\n   'headers': {\n      'Accept': 'application/json',\n      'Content-Type': 'application/json'\n   },\n   body: JSON.stringify({\n      \"share_secret\": \"string\",\n      \"token_event\": \"string\",\n      \"source_id\": \"string\",\n      \"destination_id\": \"string\",\n      \"token_id\": \"string\",\n      \"token_status\": \"string\",\n      \"available_date\": \"string\",\n      \"expiry_date\": \"string\",\n      \"token_name\": \"string\",\n      \"token_reference\": \"string\",\n      \"email_token\": \"Boolean\",\n      \"email_settings\": \"Object\"\n   })\n\n};\nrequest(options, function (error, response) {\n   if (error) throw new Error(error);\n   console.log(response.body);\n});\n",
        "customLabel": ""
      },
      {
        "id": "AwQnl2RKMVcnFkKDx3xbL",
        "language": "javascript",
        "code": "var myHeaders = new Headers();\nmyHeaders.append(\"Accept\", \"application/json\");\nmyHeaders.append(\"Content-Type\", \"application/json\");\n\nvar raw = JSON.stringify({\n   \"share_secret\": \"string\",\n   \"token_event\": \"string\",\n   \"source_id\": \"string\",\n   \"destination_id\": \"string\",\n   \"token_id\": \"string\",\n   \"token_status\": \"string\",\n   \"available_date\": \"string\",\n   \"expiry_date\": \"string\",\n   \"token_name\": \"string\",\n   \"token_reference\": \"string\",\n   \"email_token\": \"Boolean\",\n   \"email_settings\": \"Object\"\n});\n\nvar requestOptions = {\n   method: 'PATCH',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://secure.paydocker.com/{version}/token/{partnerid}/{randomkey}/modify\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));",
        "customLabel": ""
      },
      {
        "id": "kMCtSuMVSa_sijSVt95xa",
        "language": "python",
        "code": "import requests\nimport json\n\nurl = \"https://secure.paydocker.com/{version}/token/{partnerid}/{randomkey}/modify\"\n\npayload = json.dumps({\n   \"share_secret\": \"string\",\n   \"token_event\": \"string\",\n   \"source_id\": \"string\",\n   \"destination_id\": \"string\",\n   \"token_id\": \"string\",\n   \"token_status\": \"string\",\n   \"available_date\": \"string\",\n   \"expiry_date\": \"string\",\n   \"token_name\": \"string\",\n   \"token_reference\": \"string\",\n   \"email_token\": \"Boolean\",\n   \"email_settings\": \"Object\"\n})\nheaders = {\n   'Accept': 'application/json',\n   'Content-Type': 'application/json'\n}\n\nresponse = requests.request(\"PATCH\", url, headers=headers, data=payload)\n\nprint(response.text)\n",
        "customLabel": ""
      },
      {
        "id": "Fz9rVhHa0J12_gaBYR0Gk",
        "language": "ruby",
        "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://secure.paydocker.com/{version}/token/{partnerid}/{randomkey}/modify\")\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.body = JSON.dump({\n   \"share_secret\": \"string\",\n   \"token_event\": \"string\",\n   \"source_id\": \"string\",\n   \"destination_id\": \"string\",\n   \"token_id\": \"string\",\n   \"token_status\": \"string\",\n   \"available_date\": \"string\",\n   \"expiry_date\": \"string\",\n   \"token_name\": \"string\",\n   \"token_reference\": \"string\",\n   \"email_token\": \"Boolean\",\n   \"email_settings\": \"Object\"\n})\n\nresponse = https.request(request)\nputs response.read_body\n",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "AwQnl2RKMVcnFkKDx3xbL"
  },
  "results": {
    "languages": [
      {
        "id": "SB4GKpmBkXSgTn2WHkUXI",
        "language": "200",
        "customLabel": "",
        "code": "{\n  \"success\": true,\n  \"message\": \"Token Modify Success\",\n  \"token_id\": \"34322345677898765\"\n}"
      },
      {
        "id": "DaK8E7eQePGiXDSsknHDn",
        "language": "403",
        "code": "{\n  \"success\": \"false\",\n  \"errors\": {\n    \"code\": \"403\",\n    \"message\": \"IP Not Allowed\"\n  }\n}",
        "customLabel": ""
      },
      {
        "id": "aeR18zVyfdtJfgmrsz0nP",
        "language": "405",
        "code": "{\n  \"success\": \"false\",\n  \"errors\": {\n    \"code\": \"405\",\n    \"message\": \"Method Not Allowed\"\n  }\n}",
        "customLabel": ""
      },
      {
        "id": "PvaIwnkGxhbTfdK5pr6rv",
        "language": "406",
        "code": "{\n  \"success\": \"false\",\n  \"errors\": {\n    \"code\": \"406\",\n    \"message\": \"Enpoint Bad Format\"\n  }\n}",
        "customLabel": ""
      },
      {
        "id": "e_CB_-DVYjIof85VL8Ie8",
        "language": "408",
        "code": "{\n  \"success\": \"false\",\n  \"errors\": {\n    \"code\": \"408\",\n    \"message\": \"Endpoint Suspended\"\n  }\n}",
        "customLabel": ""
      },
      {
        "id": "W6rfqPBgf8-BIOYtA49Eg",
        "language": "409",
        "code": "{\n  \"success\": \"false\",\n  \"errors\": {\n    \"code\": \"409\",\n    \"message\": \"Event Not Allowed\"\n  }\n}",
        "customLabel": ""
      },
      {
        "id": "-2kMckTCJ3-Nz5QA1SrRI",
        "language": "410",
        "code": "{\n  \"success\": \"false\",\n  \"errors\": {\n    \"code\": \"410\",\n    \"message\": \"Invalid Secret Key\"\n  }\n}",
        "customLabel": ""
      },
      {
        "id": "3z-piIxSt2A_YGbeuMmKL",
        "language": "416",
        "code": "",
        "customLabel": ""
      },
      {
        "id": "0cQkKQKQcxn1d2rTfOS4c",
        "language": "417",
        "code": "{\n  \"success\": \"false\",\n  \"errors\": {\n    \"code\": \"417\",\n    \"message\": \"Invalid Expiry Date\"\n  }\n}",
        "customLabel": ""
      },
      {
        "id": "2qlrBKLf57hWHhZ1MIsJD",
        "language": "421",
        "code": "{\n  \"success\": \"false\",\n  \"errors\": {\n    \"code\": \"421\",\n    \"message\": \"Reference Characters Exceeded\"\n  }\n}",
        "customLabel": ""
      },
      {
        "id": "P07G97s-Nps0uX_UBY8pc",
        "language": "426",
        "code": "{\n  \"success\": \"false\",\n  \"errors\": {\n    \"code\": \"426\",\n    \"message\": \"Invalid Email Format\"\n  }\n}",
        "customLabel": ""
      },
      {
        "id": "ekeCPTkJVeOBZibk3Sral",
        "language": "500",
        "code": "{\n  \"success\": \"false\",\n  \"errors\": {\n    \"code\": \"500\",\n    \"message\": \"Internal Server Error\"\n  }\n}",
        "customLabel": ""
      },
      {
        "id": "ziRNeGp24XCtzQCN4gctl",
        "language": "502",
        "code": "{\n  \"success\": \"false\",\n  \"errors\": {\n    \"code\": \"502\",\n    \"message\": \"Bad Gateway\"\n  }\n}",
        "customLabel": ""
      },
      {
        "id": "wEuEGf64FqQt2eaXoARNr",
        "language": "503",
        "code": "{\n  \"success\": \"false\",\n  \"errors\": {\n    \"code\": \"502\",\n    \"message\": \"Bad Gateway\"\n  }\n}",
        "customLabel": ""
      },
      {
        "id": "NUS2rM1TfhwOJVJKQKwcU",
        "language": "504",
        "code": "",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "DaK8E7eQePGiXDSsknHDn"
  },
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [],
    "bodyDataParameters": [
      {
        "name": "share_secret",
        "kind": "required",
        "type": "string",
        "description": "Test mode secret keys and live mode secret keys are available in your PayDocker account under Integration menu.\n\nDon't share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth.",
        "children": []
      },
      {
        "name": "token_event",
        "kind": "required",
        "type": "string",
        "description": "Used to identify the action connected to the token and the allowed action for this request would be \"modify\".",
        "children": []
      },
      {
        "name": "source_id",
        "kind": "required",
        "type": "string",
        "description": "Your PayDocker Account ID assigned upon account creation (e.g. PDR1). It is case sensitive.",
        "children": []
      },
      {
        "name": "destination_id",
        "kind": "required",
        "type": "string",
        "description": "Property ID (e.g. ID 001) generated in your platform. It represents the token recipient. ",
        "children": []
      },
      {
        "name": "token_id",
        "kind": "required",
        "type": "string",
        "description": "The unique identifier associated with the token that the user is requesting a modification for. (e.g. 2908926013012565)",
        "children": []
      },
      {
        "name": "token_status",
        "kind": "required",
        "type": "string",
        "description": "active or freezed (only one is applicable). It is case-sensitive.",
        "children": []
      },
      {
        "name": "available_date",
        "kind": "required",
        "type": "string",
        "description": "The date on which the token becomes active and ready for the recipient to collect. \n\nThe format is DD-MM-YYYY, e.g. 25-12-2023\n\nSelectable date range is 1 day before token creation day to up to 365 days in the future.",
        "children": []
      },
      {
        "name": "expiry_date",
        "kind": "required",
        "type": "string",
        "description": "The date on which the token becomes invalid, after which it cannot be used or collected by the recipient.\n\nThe format is DD-MM-YYYY, e.g. 25-12-2023\n\nSelectable date range is same or greater than available date, essentially until the last day of the month one year after the chosen available date.\n\nE.g. Available Date - 18 Oct 2023, Expiry Date - 31 Oct 2024.",
        "children": []
      },
      {
        "name": "check_in",
        "kind": "required",
        "type": "string",
        "description": "The format is DD-MM-YYYY, e.g. 25-12-2023\n\nSelectable date range up to 2 years before token creation day to up to 2 years  in the future. ",
        "children": []
      },
      {
        "name": "check_out",
        "kind": "required",
        "type": "string",
        "description": "The format is DD-MM-YYYY, e.g. 25-12-2023\n\nSelectable date range is same or greater than check-in date, up to 90 days in the future.\n",
        "children": []
      },
      {
        "name": "room_count",
        "kind": "required",
        "type": "Number",
        "description": "Accepted value from 1 to 999",
        "children": []
      },
      {
        "name": "customer_name",
        "kind": "required",
        "type": "string",
        "description": "Used to  identify the customer name associated within the booking . \nMaximum 80 characters allowed.",
        "children": []
      },
      {
        "name": "booking_reference",
        "kind": "required",
        "type": "string",
        "description": "Used to  identify the Booking ID. \nMaximum 200 characters allowed.",
        "children": []
      },
      {
        "name": "email_token",
        "kind": "required",
        "type": "Boolean",
        "description": "true or false (only one option is applicable). It is case-sensitive.",
        "children": []
      },
      {
        "name": "email_settings",
        "kind": "optional",
        "type": "Object",
        "description": "",
        "children": [
          {
            "name": "email_to",
            "kind": "optional",
            "type": "string",
            "description": "The email address for token sharing. Token details can be shared with a range of one to ten email addresses by using commas to separate them."
          },
          {
            "name": "email_encrypted",
            "kind": "optional",
            "type": "Boolean",
            "description": "true or false (only one option is applicable). It is case-sensitive.\n\nIf true, token will be encrypted when shared with the email addresses. "
          }
        ]
      }
    ],
    "formDataParameters": []
  },
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  }
}
```
:::

### Payload Format

