---
title: Unload Token
slug: unload-token
createdAt: 2023-09-22T04:41:57.775Z
---

:::ApiMethodV2
```json
{
  "name": "Unload",
  "method": "PATCH",
  "url": "https://secure.paydocker.com/{version}/token/{partnerid}/{randomkey}/unload",
  "description": "",
  "tab": "examples",
  "examples": {
    "languages": [
      {
        "id": "2m5h6awBSJa4m1t6HxQkp",
        "language": "json",
        "code": "{\n    \"share_secret\":\"string\",\n    \"token_event\": \"unload\",\n    \"source_id\": \"string\",\n    \"unload_amount\": \"string\",\n    \"token_id\": \"string\",\n    \"check_in\": \"string\",\n    \"check_out\": \"string\",\n    \"room_count\": \"number\"\n}",
        "customLabel": ""
      },
      {
        "id": "didFYOlGJI8vHTpv31_41",
        "language": "curl",
        "code": "curl --location -g --request PATCH 'https://secure.paydocker.com/{version}/token/{partnerid}/{randomkey}/unload' \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\"share_secret\":\"string\",\"token_event\":\"string\",\"source_id\":\"string\",\"unload_amount\":\"string\",\"token_id\":\"string\"}'",
        "customLabel": ""
      },
      {
        "id": "2NeiXyIVIdGUl5Q4iq9GM",
        "language": "nodejs",
        "code": "var request = require('request');\nvar options = {\n   'method': 'PATCH',\n   'url': 'https://secure.paydocker.com/{version}/token/{partnerid}/{randomkey}/unload',\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      \"unload_amount\": \"string\",\n      \"token_id\": \"string\"\n   })\n\n};\nrequest(options, function (error, response) {\n   if (error) throw new Error(error);\n   console.log(response.body);\n});\n",
        "customLabel": ""
      },
      {
        "id": "DLNVCHgEJF_F9_jjx6LOx",
        "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   \"unload_amount\": \"string\",\n   \"token_id\": \"string\"\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}/unload\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));",
        "customLabel": ""
      },
      {
        "id": "29n_pUAoe3ALl9D3ZEAA-",
        "language": "python",
        "code": "import requests\nimport json\n\nurl = \"https://secure.paydocker.com/{version}/token/{partnerid}/{randomkey}/unload\"\n\npayload = json.dumps({\n   \"share_secret\": \"string\",\n   \"token_event\": \"string\",\n   \"source_id\": \"string\",\n   \"unload_amount\": \"string\",\n   \"token_id\": \"string\"\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": "mW5qC5cng6p6CWPZpaE53",
        "language": "ruby",
        "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://secure.paydocker.com/{version}/token/{partnerid}/{randomkey}/unload\")\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   \"unload_amount\": \"string\",\n   \"token_id\": \"string\"\n})\n\nresponse = https.request(request)\nputs response.read_body\n",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "2m5h6awBSJa4m1t6HxQkp"
  },
  "results": {
    "languages": [
      {
        "id": "SB4GKpmBkXSgTn2WHkUXI",
        "language": "200",
        "customLabel": "",
        "code": "{\n   \"success\": true,\n   \"message\": \"Token Unload Success\",\n   \"token_id\": \"34322345677898765\",\n   \"transaction_id\": \"34322345677898765\",\n   \"fees_amount\": \"100.50\"\n\n}"
      },
      {
        "id": "o-fyLruWgSQx-NXmcFyyr",
        "language": "405",
        "customLabel": "",
        "code": "{\n  \"success\": \"false\",\n  \"errors\": {\n    \"code\": \"405\",\n    \"message\": \"Method Not Allowed\"\n  }\n}"
      },
      {
        "id": "XZsAtH0nQiImn9VSCK3iC",
        "language": "428",
        "code": "{\n  \"success\": \"false\",\n  \"errors\": {\n    \"code\": \"428\",\n    \"message\": \"Token ID doesn't match\"\n  }\n}",
        "customLabel": ""
      },
      {
        "id": "YtstgNeGNxXTr8LuZByh6",
        "language": "429",
        "code": "{\n  \"success\": \"false\",\n  \"errors\": {\n    \"code\": \"429\",\n    \"message\": \"Token ID already deleted\"\n  }\n}",
        "customLabel": ""
      },
      {
        "id": "XMaZkTmt0zI2LDU1VI88L",
        "language": "403",
        "code": "{\n  \"success\": \"false\",\n  \"errors\": {\n    \"code\": \"403\",\n    \"message\": \"IP Not Allowed\"\n  }\n}",
        "customLabel": ""
      },
      {
        "id": "VW6cV6tZtcycwpD6LSUhB",
        "language": "406",
        "code": "{\n  \"success\": \"false\",\n  \"errors\": {\n    \"code\": \"406\",\n    \"message\": \"Enpoint Bad Format\"\n  }\n}",
        "customLabel": ""
      },
      {
        "id": "Xm1JRNZ7IW9JJBx4dXFYY",
        "language": "408",
        "code": "{\n  \"success\": \"false\",\n  \"errors\": {\n    \"code\": \"408\",\n    \"message\": \"Endpoint Suspended\"\n  }\n}",
        "customLabel": ""
      },
      {
        "id": "BehiQ6qbKDTtuMtcJcbtk",
        "language": "409",
        "code": "{\n  \"success\": \"false\",\n  \"errors\": {\n    \"code\": \"409\",\n    \"message\": \"Event Not Allowed\"\n  }\n}",
        "customLabel": ""
      },
      {
        "id": "xZYG2I5cxcvGJwPWs9Nmn",
        "language": "410",
        "code": "{\n  \"success\": \"false\",\n  \"errors\": {\n    \"code\": \"410\",\n    \"message\": \"Invalid Secret Key\"\n  }\n}",
        "customLabel": ""
      },
      {
        "id": "nKBKWNmSfqMVJGqDvuqA0",
        "language": "412",
        "code": "{\n  \"success\": \"false\",\n  \"errors\": {\n    \"code\": \"412\",\n    \"message\": \"Balance ID is Inactive\"\n  }\n}",
        "customLabel": ""
      },
      {
        "id": "TKlsBwcH2lT09rlRW5kvN",
        "language": "415",
        "code": "{\n  \"success\": \"false\",\n  \"errors\": {\n    \"code\": \"415\",\n    \"message\": \"Invalid Load Amount\"\n  }\n}",
        "customLabel": ""
      },
      {
        "id": "17J65Z5QWheS2z0LntQVn",
        "language": "431",
        "code": "{\n  \"success\": \"false\",\n  \"errors\": {\n    \"code\": \"431\",\n    \"message\": \"Unload amount exceeded\"\n  }\n}",
        "customLabel": ""
      },
      {
        "id": "wO_MTwD468S5NkXISeW3A",
        "language": "500",
        "code": "{\n  \"success\": \"false\",\n  \"errors\": {\n    \"code\": \"500\",\n    \"message\": \"internal Server Error\"\n  }\n}",
        "customLabel": ""
      },
      {
        "id": "4PL3iNh6Uipe2vjwryQXy",
        "language": "502",
        "code": "{\n  \"success\": \"false\",\n  \"errors\": {\n    \"code\": \"502\",\n    \"message\": \"Bad Gateway\"\n  }\n}",
        "customLabel": ""
      },
      {
        "id": "cSOl7Oros9Tqmj9R8Hbc8",
        "language": "503",
        "code": "{\n  \"success\": \"false\",\n  \"errors\": {\n    \"code\": \"503\",\n    \"message\": \"Service Unavailable\"\n  }\n}",
        "customLabel": ""
      },
      {
        "id": "zAik3a858YtGN05o0gFbU",
        "language": "504",
        "code": "{\n  \"success\": \"false\",\n  \"errors\": {\n    \"code\": \"504\",\n    \"message\": \"Gateway Timeout\"\n  }\n}",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "zAik3a858YtGN05o0gFbU"
  },
  "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 \"unload\".",
        "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": "unload_amount",
        "kind": "required",
        "type": "string",
        "description": "The sum subtracted by the partner from the token, subjected to the maximum balance amount in the token. \n\nThe amount value supports up to twelve digits (e.g. a value of 9,999,999,999.99) divided by decimal.",
        "children": []
      },
      {
        "name": "token_id",
        "kind": "required",
        "type": "string",
        "description": "The unique identifier associated with the token that the user is requesting unloading for. (e.g. 2908926013012565)",
        "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.",
        "children": []
      },
      {
        "name": "room_count",
        "kind": "required",
        "type": "Number",
        "description": "Accepted value from 1 to 999",
        "children": []
      }
    ],
    "formDataParameters": []
  },
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  }
}
```
:::

