---
title: Create Token
slug: create-token
docTags: 
createdAt: 2023-09-22T04:41:58.192Z
---

:::ApiMethodV2
```json
{
  "name": "Create Token",
  "method": "POST",
  "url": "https://secure.paydocker.com/{version}/token/{partnerid}/{randomkey}",
  "description": "",
  "tab": "examples",
  "examples": {
    "languages": [
      {
        "id": "Yn8GvE8KwODB4frusWWKt",
        "language": "json",
        "code": "{\n    \"share_secret\": \"string\",\n    \"token_event\": \"create\",\n    \"source_id\": \"string\",\n    \"destination_id\": \"string\",\n    \"destination_currency\": \"string\",\n    \"founding_balance\": \"string\",\n    \"load_amount\": \"string\",\n    \"available_date\": \"string\",\n    \"expiry_date\": \"string\",\n    \"check_in\": \"string\",\n    \"check_out\": \"string\",\n    \"room_count\": \"number\",\n    \"blockchain_processing\": \"Boolean\",\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": "aVjJLFJqpW0DM_5VcD7Sy",
        "language": "curl",
        "code": "curl --location -g --request POST 'https://secure.paydocker.com/{version}/token/{partnerid}/{randomkey}' \\\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\",\"destination_currency\":\"string\",\"founding_balance\":\"string\",\"load_amount\":\"string\",\"available_date\":\"string\",\"expiry_date\":\"string\",\"token_category\":\"string\",\"blockchain_processing\":\"Boolean\",\"token_name\":\"string\",\"token_reference\":\"string\",\"email_token\":\"Boolean\",\"email_settings\":\"Object\"}'",
        "customLabel": ""
      },
      {
        "id": "WfbDwakalksFWa5TzbC1W",
        "language": "nodejs",
        "code": "var request = require('request');\nvar options = {\n   'method': 'POST',\n   'url': 'https://secure.paydocker.com/{version}/token/{partnerid}/{randomkey}',\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      \"destination_currency\": \"string\",\n      \"founding_balance\": \"string\",\n      \"load_amount\": \"string\",\n      \"available_date\": \"string\",\n      \"expiry_date\": \"string\",\n      \"token_category\": \"string\",\n      \"blockchain_processing\": \"Boolean\",\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": "WMFgChfv1AHj4zGTBx8l2",
        "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   \"destination_currency\": \"string\",\n   \"founding_balance\": \"string\",\n   \"load_amount\": \"string\",\n   \"available_date\": \"string\",\n   \"expiry_date\": \"string\",\n   \"token_category\": \"string\",\n   \"blockchain_processing\": \"Boolean\",\n   \"token_name\": \"string\",\n   \"token_reference\": \"string\",\n   \"email_token\": \"Boolean\",\n   \"email_settings\": \"Object\"\n});\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://secure.paydocker.com/{version}/token/{partnerid}/{randomkey}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));",
        "customLabel": ""
      },
      {
        "id": "vjfh90_KKrBcf1YLGGonl",
        "language": "python",
        "code": "import requests\nimport json\n\nurl = \"https://secure.paydocker.com/{version}/token/{partnerid}/{randomkey}\"\n\npayload = json.dumps({\n   \"share_secret\": \"string\",\n   \"token_event\": \"string\",\n   \"source_id\": \"string\",\n   \"destination_id\": \"string\",\n   \"destination_currency\": \"string\",\n   \"founding_balance\": \"string\",\n   \"load_amount\": \"string\",\n   \"available_date\": \"string\",\n   \"expiry_date\": \"string\",\n   \"token_category\": \"string\",\n   \"blockchain_processing\": \"Boolean\",\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(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n",
        "customLabel": ""
      },
      {
        "id": "fZZ6zgVNw51FS0fb4ULKq",
        "language": "ruby",
        "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://secure.paydocker.com/{version}/token/{partnerid}/{randomkey}\")\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   \"share_secret\": \"string\",\n   \"token_event\": \"string\",\n   \"source_id\": \"string\",\n   \"destination_id\": \"string\",\n   \"destination_currency\": \"string\",\n   \"founding_balance\": \"string\",\n   \"load_amount\": \"string\",\n   \"available_date\": \"string\",\n   \"expiry_date\": \"string\",\n   \"token_category\": \"string\",\n   \"blockchain_processing\": \"Boolean\",\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": "aVjJLFJqpW0DM_5VcD7Sy"
  },
  "results": {
    "languages": [
      {
        "id": "EUCJSGyGEN2hixnEJt-VO",
        "language": "200",
        "code": "{\n  \"fee_amount\": 1.05,\n  \"message\": \"Success\",\n  \"success\": true,\n  \"token_id\": 528991181481\n  \"token_multimedia\": https://rb.gy/gtpb9h\n}",
        "customLabel": ""
      },
      {
        "id": "GC6SfSkvl0Q-AWPZoq1HG",
        "language": "403",
        "code": "{\n  \"success\": \"false\",\n  \"errors\": {\n    \"code\": \"403\",\n    \"message\": \"IP Not Allowed\"\n  }\n}",
        "customLabel": ""
      },
      {
        "id": "_vdGnDcW0RiX6eWZ-ksdK",
        "language": "405",
        "customLabel": "",
        "code": "{\n  \"success\": \"false\",\n  \"errors\": {\n    \"code\": \"405\",\n    \"message\": \"Method Not Allowed\"\n  }\n}"
      },
      {
        "id": "m7fGcepSsYcUEntH-ksof",
        "language": "406",
        "code": "{\n  \"success\": \"false\",\n  \"errors\": {\n    \"code\": \"406\",\n    \"message\": \"Enpoint Bad Format\"\n  }\n}",
        "customLabel": ""
      },
      {
        "id": "L5EWi8WCaOMP907FGcfFe",
        "language": "408",
        "code": "{\n  \"success\": \"false\",\n  \"errors\": {\n    \"code\": \"408\",\n    \"message\": \"Endpoint Suspended\"\n  }\n}",
        "customLabel": ""
      },
      {
        "id": "H5O8qBnvQ6qWNEuXRTMua",
        "language": "409",
        "code": "{\n  \"success\": \"false\",\n  \"errors\": {\n    \"code\": \"409\",\n    \"message\": \"Event Not Allowed\"\n  }\n}",
        "customLabel": ""
      },
      {
        "id": "hskxymAPREs2vJbaDXzam",
        "language": "410",
        "code": "{\n  \"success\": \"false\",\n  \"errors\": {\n    \"code\": \"410\",\n    \"message\": \"Invalid Secret Key\"\n  }\n}",
        "customLabel": ""
      },
      {
        "id": "wyPc3mNc8mboRfcAcOWbz",
        "language": "411",
        "code": "{\n  \"success\": \"false\",\n  \"errors\": {\n    \"code\": \"411\",\n    \"message\": \"Invalid Balance ID \"\n  }\n}",
        "customLabel": ""
      },
      {
        "id": "kIJ6W7yPr2Q0vD0Qlzi-5",
        "language": "412",
        "code": "{\n  \"success\": \"false\",\n  \"errors\": {\n    \"code\": \"412\",\n    \"message\": \"Balance ID is Inactive\"\n  }\n}",
        "customLabel": ""
      },
      {
        "id": "8ykaEoj5489a32vm9zVzh",
        "language": "415",
        "code": "{\n  \"success\": \"false\",\n  \"errors\": {\n    \"code\": \"415\",\n    \"message\": \"Invalid Load Amount\"\n  }\n}",
        "customLabel": ""
      },
      {
        "id": "PSMBk0hAOcxlR2Hoojf3o",
        "language": "417",
        "code": "{\n  \"success\": \"false\",\n  \"errors\": {\n    \"code\": \"417\",\n    \"message\": \"Invalid Expiry Date\"\n  }\n}",
        "customLabel": ""
      },
      {
        "id": "lwn6xA3A4p42Y_0InyYNw",
        "language": "418",
        "code": "{\n  \"success\": \"false\",\n  \"errors\": {\n    \"code\": \"417\",\n    \"message\": \"Invalid Expiry Date\"\n  }\n}",
        "customLabel": ""
      },
      {
        "id": "6qO7UZZtc70hGPmvAUmQI",
        "language": "421",
        "code": "{\n  \"success\": \"false\",\n  \"errors\": {\n    \"code\": \"421\",\n    \"message\": \"Reference Characters Exceeded\"\n  }\n}",
        "customLabel": ""
      },
      {
        "id": "KalCcev0g0Sh3zosOQkzk",
        "language": "422",
        "code": "{\n  \"success\": \"false\",\n  \"errors\": {\n    \"code\": \"422\",\n    \"message\": \"Partnership Status Fail\"\n  }\n}",
        "customLabel": ""
      },
      {
        "id": "QcDO5eiOpEywibvyBCdsR",
        "language": "423",
        "code": "{\n  \"success\": \"false\",\n  \"errors\": {\n    \"code\": \"423\",\n    \"message\": \"Setup Status Fail\"\n  }\n}",
        "customLabel": ""
      },
      {
        "id": "_2_6-a0TvsawevQm2V4eX",
        "language": "424",
        "code": "{\n  \"success\": \"false\",\n  \"errors\": {\n    \"code\": \"424\",\n    \"message\": \"Account Status Fail\"\n  }\n}",
        "customLabel": ""
      },
      {
        "id": "oPUh8gZy-jeVhPjZqaXfd",
        "language": "426",
        "code": "{\n  \"success\": \"false\",\n  \"errors\": {\n    \"code\": \"426\",\n    \"message\": \"Invalid Email Format\"\n  }\n}",
        "customLabel": ""
      },
      {
        "id": "oXvXxc1A69b9njzJO-1Ik",
        "language": "100",
        "code": "",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "_2_6-a0TvsawevQm2V4eX"
  },
  "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 \"create\".",
        "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": "destination_currency",
        "kind": "required",
        "type": "string",
        "description": "Currency ID ISO 4217 standard format associated within the token value.\nSupported currency and ISO code are available in API Reference --> Standard Codes --> Currency Code ",
        "children": []
      },
      {
        "name": "founding_balance",
        "kind": "required",
        "type": "string",
        "description": "Partner balance ID uniquely associated with the currency of the token and where the token amount will be unloaded from (e.g. PD74INR1385809982156467).",
        "children": []
      },
      {
        "name": "load_amount",
        "kind": "required",
        "type": "string",
        "description": "The sum added by the partner to the token, which the recipient can then collect. \n\nThe amount value supports up to twelve digits (e.g. a value of 9,999,999,999.99) divided by decimal. ",
        "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. \n",
        "children": []
      },
      {
        "name": "check_out",
        "kind": "required",
        "type": "string",
        "description": "The format is YYYY-MM-DD, e.g. 2023-12-21\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": []
      },
      {
        "name": "blockchain_processing",
        "kind": "required",
        "type": "Boolean",
        "description": "true or false (only one option is applicable). It is case-sensitive.",
        "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": "required",
        "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"
  }
}
```
:::

