{"templateId":"markdown","versions":[{"version":"v3","label":"v3","link":"/products/tokens/create-a-token","default":true,"active":true,"folderId":"13618f6a"},{"version":"v2","label":"v2","link":"/products/tokens/v2/create-a-token","default":false,"active":false,"folderId":"13618f6a"},{"version":"v1","label":"v1","link":"/products/tokens/v1/create-a-token","default":false,"active":false,"folderId":"13618f6a"}],"sharedDataIds":{"sidebar":"sidebar-products/tokens/sidebars.yaml","current-catalog-info":"current-catalog-info-/products/tokens/openapi","api-docs-products/tokens/@v3/openapi.yaml":"api-docs-products/tokens/@v3/openapi.yaml"},"props":{"metadata":{"markdoc":{"tagList":["partial","admonition","tabs","tab","openapi-code-sample","cards","card","openapi-response-sample"]},"custom_product":"Tokens","type":"markdown"},"seo":{"title":"Create a token","description":"Worldpay for Developers - docs, code examples, resources and tools. Everything you need to build your omnichannel payment solution.","siteUrl":"https://docs.worldpay-bsh.securedataplatform.co.uk","image":"/access/assets/worldpay-logo-light.21b7daf79984773a9fcd7d4fbcb07ae5289dfffd6023c4c3dca720c7058e53dc.33f780a6.svg","keywords":"documentation, api, openapi, sdks, developer, payments, json, payouts, 3ds","jsonLd":{"@context":"https://schema.org","@type":"Organization","url":"https://docs.worldpay-bsh.securedataplatform.co.uk/access","name":"Worldpay"},"meta":[{"name":"google-site-verification","content":"zjziIKaP3ImsqsfhYnEBnq1R85UabiSwl7HTXuwtZuo"},{"name":"doc_product","content":"Access"},{"name":"doc_category","content":"Documentation"}],"llmstxt":{"hide":false,"sections":[{"title":"Payments API","description":"Payment orchestration API combining fraud assessment, 3ds authentication, SCA exemptions, Worldpay Token creation and a card or wallet based payment.","includeFiles":["products/payments/@20240601/**/*"]},{"title":"Payment Queries API","description":"Querying your payments data, based on a variety of parameters.","includeFiles":["products/payment-queries/@v1/**/*"]},{"title":"Card BIN Data API","description":"Provides detailed information about a card.","includeFiles":["products/card-bin/@v1/**/*"]},{"title":"3DS Authentication API","description":"Request 3DS authentication to protect against fraud, be SCA compliant and to shift liability using this standalone API.","includeFiles":["products/3ds/@v3/**/*"]},{"title":"FraudSight API","description":"Request a risk assessment and receive a response with an outcome (e.g. lowRisk) using this standalone API.","includeFiles":["products/fraudsight/@v1/**/*"]},{"title":"Checkout SDK","description":"Integrate using our clientside SDKs for both web and native devices. Benefit from SAQ-A/PCI-SSF compliance.","includeFiles":["products/checkout/web/@v2/**/*","products/checkout/ios/@v4/**/*","products/checkout/android/@v4/**/*","products/checkout/react-native/@v3/**/*","products/checkout/flutter/@v1/**/*"]},{"title":"Tokens API","description":"Minimizes the exposure of sensitive card details and increases the security of your customer's card details.","includeFiles":["products/tokens/@v3/**/*"]},{"title":"Card Payments API","description":"Request a card payment using this standalone API, requires separate requests for 3DS, Fraud assessment etc.","includeFiles":["products/card-payments/@v7/**/*"]},{"title":"Card Verifications API","description":"Verify your customer's card to maximize your authentication rates.","includeFiles":["products/card-verifications/@v6/**/*"]},{"title":"Account Payouts API","description":"Send funds to your customer's bank accounts and search for payouts using parameters.","includeFiles":["products/account-payouts/@20250101/**/*"]},{"title":"APMs","description":"Pay using eWallets, bank transfers, direct debits, local card schemes, Postpay and eInvoice/ Buy Now Pay Later.","includeFiles":["products/apms/@20240701/**/*"]},{"title":"Balance API","description":"Request your account details for a single account or all accounts under an entity.","includeFiles":["products/balance/@20250101/**/*"]},{"title":"Card Payouts API","description":"Send funds to your customer's cards.","includeFiles":["products/card-payouts/@v4/**/*"]},{"title":"Events (Webhooks)","description":"Receive status updates from Access Worldpay by setting up a webhook.","includeFiles":["products/events/@v1/**/*"]},{"title":"FX API","description":"Manage Foreign Exchange (FX) on your payments.","includeFiles":["products/fx/@v1/**/*"]},{"title":"Hosted Payment Pages (HPP) API","description":"Our low-code option to take payments securely at the lowest PCI compliance level - SAQ A.","includeFiles":["products/hosted-payment-pages/@v1/**/*"]},{"title":"Money Transfers API","description":"Money Transfer OCTs (Original Credit Transaction) allow funds to be pushed to an eligible card in 30 minutes or less.","includeFiles":["products/money-transfers/@v1/**/*"]},{"title":"Parties API","description":"Create parties, manage your payout instruments and beneficial owners and carry out identity verification checks.","includeFiles":["products/parties/@20250101/**/*"]},{"title":"SCA Exemptions API","description":"Maximize a frictionless checkout experience by using issuer data insights to apply exemptions.","includeFiles":["products/sca-exemptions/@v1/**/*"]},{"title":"Split Payments API","description":"Divide funds from a single payment amongst yourself and your parties/sellers.","includeFiles":["products/split-payments/@20250625/**/*"]},{"title":"Statements API","description":"Retrieve your account statement and see individual entries for all credits and debits.","includeFiles":["products/statements/@20250101/**/*"]},{"title":"Transfers API","description":"Transfer funds from source account to target account.","includeFiles":["products/transfers/@20250101/**/*"]},{"title":"Verified Tokens API","description":"Verified Tokens ensures that your customer's payment details are valid and CIT compliant when creating a token.","includeFiles":["products/verified-tokens/@v3/**/*"]}]}},"dynamicMarkdocComponents":["openapi"],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Last updated"]},": 28 August 2026 | ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/tokens/changelog/"},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Change log"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"create-a-token","__idx":0},"children":["Create a token"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Create a card token to secure your customer's card and billing information, which could help lower your PCI-DSS compliance costs."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"Note"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you have tokens from a previous provider you can ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://developerengine.fisglobal.com/apis/wpg/tokenisation/bulktokenmigration"},"children":["import the existing tokens"]}," to Access Worldpay."]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"create-a-card-token-request","__idx":1},"children":["Create a card token request"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To create a token, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST"]}," your request to the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tokens:tokens"]}," action link."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When you create a token, you can optionally include the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["namespace"]}," parameter in your request to group cards by customer. Click the ",{"$$mdtype":"Tag","name":"b","attributes":{},"children":["Full card token"]}," tab below to see an example request. It is also possible to store network and wallet tokens within a Worldpay token, to avoid any risk of PCI exposure and support repeat wallet payments respectively."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"create-a-token-example-request","__idx":2},"children":["Create a token example request"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST"]},"  ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens"]}]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Basic card token","disable":false},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Create a token with minimal details."]},{"$$mdtype":"Tag","name":"OpenApiCodeSample","attributes":{"descriptionFile":"api-docs-products/tokens/@v3/openapi.yaml","operationId":"createSecurityToken","exampleKey":"Create a token with minimal details","parameters":{},"environments":{},"codeSamplesResolved":[{"lang":"json","title":"Payload application/vnd.worldpay.tokens-v3.hal+json","source":"{\n  \"paymentInstrument\": {\n    \"type\": \"card/front\",\n    \"cardHolderName\": \"Sherlock Holmes\",\n    \"cardNumber\": \"4444333322221111\",\n    \"cardExpiryDate\": {\n      \"month\": 5,\n      \"year\": 2035\n    }\n  },\n  \"merchant\": {\n    \"entity\": \"default\"\n  }\n}"},{"lang":"shell","title":"curl","source":"curl -i -X POST \\\n  https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens \\\n  -H 'Content-Type: application/vnd.worldpay.tokens-v3.hal+json' \\\n  -d '{\n    \"paymentInstrument\": {\n      \"type\": \"card/front\",\n      \"cardHolderName\": \"Sherlock Holmes\",\n      \"cardNumber\": \"4444333322221111\",\n      \"cardExpiryDate\": {\n        \"month\": 5,\n        \"year\": 2035\n      }\n    },\n    \"merchant\": {\n      \"entity\": \"default\"\n    }\n  }'"},{"lang":"python","title":"Python","source":"import requests\n\nurl = \"https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens\"\n\npayload = '''\n  {\n    \"paymentInstrument\": {\n      \"type\": \"card/front\",\n      \"cardHolderName\": \"Sherlock Holmes\",\n      \"cardNumber\": \"4444333322221111\",\n      \"cardExpiryDate\": {\n        \"month\": 5,\n        \"year\": 2035\n      }\n    },\n    \"merchant\": {\n      \"entity\": \"default\"\n    }\n  }\n'''\n\nheaders = {\"Content-Type\": \"application/vnd.worldpay.tokens-v3.hal+json\"}\n\nresponse = requests.post(url, data=payload, headers=headers)\n\ndata = response.json()\nprint(data)"},{"lang":"java","title":"Java","source":"import java.net.*;\nimport java.net.http.*;\nimport java.util.*;\n\npublic class App {\n  public static void main(String[] args) throws Exception {\n    var httpClient = HttpClient.newBuilder().build();\n\n    var host = \"https://try.access.worldpay-bsh.securedataplatform.co.uk\";\n    var pathname = \"/tokens\";\n    var request = HttpRequest.newBuilder()\n      .POST(HttpRequest.BodyPublishers.ofString(payload))\n      .uri(URI.create(host + pathname ))\n      .header(\"Content-Type\", \"application/vnd.worldpay.tokens-v3.hal+json\")\n      .build();\n\n    var response = httpClient.send(request, HttpResponse.BodyHandlers.ofString());\n\n    System.out.println(response.body());\n  }\n}"},{"lang":"javascript","title":"Node.js","source":"import fetch from 'node-fetch';\n\nasync function run() {\n  const resp = await fetch(\n    `https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens`,\n    {\n      method: 'POST',\n      headers: {\n        'Content-Type': 'application/vnd.worldpay.tokens-v3.hal+json'\n      },\n      body: `{\n          \"paymentInstrument\": {\n            \"type\": \"card/front\",\n            \"cardHolderName\": \"Sherlock Holmes\",\n            \"cardNumber\": \"4444333322221111\",\n            \"cardExpiryDate\": {\n              \"month\": 5,\n              \"year\": 2035\n            }\n          },\n          \"merchant\": {\n            \"entity\": \"default\"\n          }\n        }`\n    }\n  );\n\n  const data = await resp.text();\n  console.log(data);\n}\n\nrun();"},{"lang":"go","title":"Go","source":"package main\n\nimport (\n  \"fmt\"\n  \"strings\"\n  \"net/http\"\n  \"io/ioutil\"\n)\n\nfunc main() {\n  reqUrl := \"https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens\"\n  payload := strings.NewReader(\"{\\n  \\\"paymentInstrument\\\": {\\n    \\\"type\\\": \\\"card/front\\\",\\n    \\\"cardHolderName\\\": \\\"Sherlock Holmes\\\",\\n    \\\"cardNumber\\\": \\\"4444333322221111\\\",\\n    \\\"cardExpiryDate\\\": {\\n      \\\"month\\\": 5,\\n      \\\"year\\\": 2035\\n    }\\n  },\\n  \\\"merchant\\\": {\\n    \\\"entity\\\": \\\"default\\\"\\n  }\\n}\")\n  req, err := http.NewRequest(\"POST\", reqUrl, payload)\n  if err != nil {\n    panic(err)\n  }\n  req.Header.Add(\"Content-Type\", \"application/vnd.worldpay.tokens-v3.hal+json\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil {\n    panic(err)\n  }\n  defer res.Body.Close()\n  body, err := ioutil.ReadAll(res.Body)\n  if err != nil {\n    panic(err)\n  }\n\n  fmt.Println(res)\n  fmt.Println(string(body))\n}"},{"lang":"php","title":"PHP","source":"/**\n * Requires libcurl\n */\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_HTTPHEADER => [\n    \"Content-Type: application/vnd.worldpay.tokens-v3.hal+json\"\n  ],\n  CURLOPT_POSTFIELDS => \"{\\n  \\\"paymentInstrument\\\": {\\n    \\\"type\\\": \\\"card/front\\\",\\n    \\\"cardHolderName\\\": \\\"Sherlock Holmes\\\",\\n    \\\"cardNumber\\\": \\\"4444333322221111\\\",\\n    \\\"cardExpiryDate\\\": {\\n      \\\"month\\\": 5,\\n      \\\"year\\\": 2035\\n    }\\n  },\\n  \\\"merchant\\\": {\\n    \\\"entity\\\": \\\"default\\\"\\n  }\\n}\",\n  CURLOPT_URL => \"https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_CUSTOMREQUEST => \"POST\",\n]);\n\n$response = curl_exec($curl);\n$error = curl_error($curl);\n\ncurl_close($curl);\n\nif ($error) {\n  echo \"cURL Error #:\" . $error;\n} else {\n  echo $response;\n}"},{"lang":"ruby","title":"Ruby","source":"require 'uri'\nrequire 'net/http'\nrequire 'openssl'\n\nurl = URI('https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens')\n\nhttp = Net::HTTP.new(url.host, url.port)\nhttp.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest['Content-Type'] = 'application/vnd.worldpay.tokens-v3.hal+json'\nrequest.body = \"{\\n  \\\"paymentInstrument\\\": {\\n    \\\"type\\\": \\\"card/front\\\",\\n    \\\"cardHolderName\\\": \\\"Sherlock Holmes\\\",\\n    \\\"cardNumber\\\": \\\"4444333322221111\\\",\\n    \\\"cardExpiryDate\\\": {\\n      \\\"month\\\": 5,\\n      \\\"year\\\": 2035\\n    }\\n  },\\n  \\\"merchant\\\": {\\n    \\\"entity\\\": \\\"default\\\"\\n  }\\n}\"\n\nresponse = http.request(request)\nputs response.read_body\n"},{"lang":"csharp","title":"C#","source":"using System;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\npublic class Program\n{\n  public static async Task Main()\n  {\n    System.Net.Http.HttpClient client = new();\n\n    using HttpResponseMessage request = await client.PostAsync(\"https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens\", postData);\n    string response = await request.Content.ReadAsStringAsync();\n\n    Console.WriteLine(response);\n  }\n}"}]},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Full card token","disable":false},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Create a token with full details."]},{"$$mdtype":"Tag","name":"OpenApiCodeSample","attributes":{"descriptionFile":"api-docs-products/tokens/@v3/openapi.yaml","operationId":"createSecurityToken","exampleKey":"Create a token with full details","parameters":{},"environments":{},"codeSamplesResolved":[{"lang":"json","title":"Payload application/vnd.worldpay.tokens-v3.hal+json","source":"{\n  \"description\": \"Test Description\",\n  \"namespace\": \"0005\",\n  \"paymentInstrument\": {\n    \"type\": \"card/front\",\n    \"cardHolderName\": \"Sherlock Holmes\",\n    \"cardNumber\": \"4444333322221111\",\n    \"cardExpiryDate\": {\n      \"month\": 5,\n      \"year\": 2037\n    },\n    \"billingAddress\": {\n      \"address1\": \"Apartment 4\",\n      \"address2\": \"3550 Lenox Road\",\n      \"address3\": \"Lindbergh\",\n      \"postalCode\": \"30326\",\n      \"city\": \"Atlanta\",\n      \"state\": \"GA\",\n      \"countryCode\": \"US\"\n    }\n  },\n  \"merchant\": {\n    \"entity\": \"default\"\n  },\n  \"schemeTransactionReference\": \"12345678901234567890123\"\n}"},{"lang":"shell","title":"curl","source":"curl -i -X POST \\\n  https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens \\\n  -H 'Content-Type: application/vnd.worldpay.tokens-v3.hal+json' \\\n  -d '{\n    \"description\": \"Test Description\",\n    \"namespace\": \"0005\",\n    \"paymentInstrument\": {\n      \"type\": \"card/front\",\n      \"cardHolderName\": \"Sherlock Holmes\",\n      \"cardNumber\": \"4444333322221111\",\n      \"cardExpiryDate\": {\n        \"month\": 5,\n        \"year\": 2037\n      },\n      \"billingAddress\": {\n        \"address1\": \"Apartment 4\",\n        \"address2\": \"3550 Lenox Road\",\n        \"address3\": \"Lindbergh\",\n        \"postalCode\": \"30326\",\n        \"city\": \"Atlanta\",\n        \"state\": \"GA\",\n        \"countryCode\": \"US\"\n      }\n    },\n    \"merchant\": {\n      \"entity\": \"default\"\n    },\n    \"schemeTransactionReference\": \"12345678901234567890123\"\n  }'"},{"lang":"python","title":"Python","source":"import requests\n\nurl = \"https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens\"\n\npayload = '''\n  {\n    \"description\": \"Test Description\",\n    \"namespace\": \"0005\",\n    \"paymentInstrument\": {\n      \"type\": \"card/front\",\n      \"cardHolderName\": \"Sherlock Holmes\",\n      \"cardNumber\": \"4444333322221111\",\n      \"cardExpiryDate\": {\n        \"month\": 5,\n        \"year\": 2037\n      },\n      \"billingAddress\": {\n        \"address1\": \"Apartment 4\",\n        \"address2\": \"3550 Lenox Road\",\n        \"address3\": \"Lindbergh\",\n        \"postalCode\": \"30326\",\n        \"city\": \"Atlanta\",\n        \"state\": \"GA\",\n        \"countryCode\": \"US\"\n      }\n    },\n    \"merchant\": {\n      \"entity\": \"default\"\n    },\n    \"schemeTransactionReference\": \"12345678901234567890123\"\n  }\n'''\n\nheaders = {\"Content-Type\": \"application/vnd.worldpay.tokens-v3.hal+json\"}\n\nresponse = requests.post(url, data=payload, headers=headers)\n\ndata = response.json()\nprint(data)"},{"lang":"java","title":"Java","source":"import java.net.*;\nimport java.net.http.*;\nimport java.util.*;\n\npublic class App {\n  public static void main(String[] args) throws Exception {\n    var httpClient = HttpClient.newBuilder().build();\n\n    var host = \"https://try.access.worldpay-bsh.securedataplatform.co.uk\";\n    var pathname = \"/tokens\";\n    var request = HttpRequest.newBuilder()\n      .POST(HttpRequest.BodyPublishers.ofString(payload))\n      .uri(URI.create(host + pathname ))\n      .header(\"Content-Type\", \"application/vnd.worldpay.tokens-v3.hal+json\")\n      .build();\n\n    var response = httpClient.send(request, HttpResponse.BodyHandlers.ofString());\n\n    System.out.println(response.body());\n  }\n}"},{"lang":"javascript","title":"Node.js","source":"import fetch from 'node-fetch';\n\nasync function run() {\n  const resp = await fetch(\n    `https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens`,\n    {\n      method: 'POST',\n      headers: {\n        'Content-Type': 'application/vnd.worldpay.tokens-v3.hal+json'\n      },\n      body: `{\n          \"description\": \"Test Description\",\n          \"namespace\": \"0005\",\n          \"paymentInstrument\": {\n            \"type\": \"card/front\",\n            \"cardHolderName\": \"Sherlock Holmes\",\n            \"cardNumber\": \"4444333322221111\",\n            \"cardExpiryDate\": {\n              \"month\": 5,\n              \"year\": 2037\n            },\n            \"billingAddress\": {\n              \"address1\": \"Apartment 4\",\n              \"address2\": \"3550 Lenox Road\",\n              \"address3\": \"Lindbergh\",\n              \"postalCode\": \"30326\",\n              \"city\": \"Atlanta\",\n              \"state\": \"GA\",\n              \"countryCode\": \"US\"\n            }\n          },\n          \"merchant\": {\n            \"entity\": \"default\"\n          },\n          \"schemeTransactionReference\": \"12345678901234567890123\"\n        }`\n    }\n  );\n\n  const data = await resp.text();\n  console.log(data);\n}\n\nrun();"},{"lang":"go","title":"Go","source":"package main\n\nimport (\n  \"fmt\"\n  \"strings\"\n  \"net/http\"\n  \"io/ioutil\"\n)\n\nfunc main() {\n  reqUrl := \"https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens\"\n  payload := strings.NewReader(\"{\\n  \\\"description\\\": \\\"Test Description\\\",\\n  \\\"namespace\\\": \\\"0005\\\",\\n  \\\"paymentInstrument\\\": {\\n    \\\"type\\\": \\\"card/front\\\",\\n    \\\"cardHolderName\\\": \\\"Sherlock Holmes\\\",\\n    \\\"cardNumber\\\": \\\"4444333322221111\\\",\\n    \\\"cardExpiryDate\\\": {\\n      \\\"month\\\": 5,\\n      \\\"year\\\": 2037\\n    },\\n    \\\"billingAddress\\\": {\\n      \\\"address1\\\": \\\"Apartment 4\\\",\\n      \\\"address2\\\": \\\"3550 Lenox Road\\\",\\n      \\\"address3\\\": \\\"Lindbergh\\\",\\n      \\\"postalCode\\\": \\\"30326\\\",\\n      \\\"city\\\": \\\"Atlanta\\\",\\n      \\\"state\\\": \\\"GA\\\",\\n      \\\"countryCode\\\": \\\"US\\\"\\n    }\\n  },\\n  \\\"merchant\\\": {\\n    \\\"entity\\\": \\\"default\\\"\\n  },\\n  \\\"schemeTransactionReference\\\": \\\"12345678901234567890123\\\"\\n}\")\n  req, err := http.NewRequest(\"POST\", reqUrl, payload)\n  if err != nil {\n    panic(err)\n  }\n  req.Header.Add(\"Content-Type\", \"application/vnd.worldpay.tokens-v3.hal+json\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil {\n    panic(err)\n  }\n  defer res.Body.Close()\n  body, err := ioutil.ReadAll(res.Body)\n  if err != nil {\n    panic(err)\n  }\n\n  fmt.Println(res)\n  fmt.Println(string(body))\n}"},{"lang":"php","title":"PHP","source":"/**\n * Requires libcurl\n */\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_HTTPHEADER => [\n    \"Content-Type: application/vnd.worldpay.tokens-v3.hal+json\"\n  ],\n  CURLOPT_POSTFIELDS => \"{\\n  \\\"description\\\": \\\"Test Description\\\",\\n  \\\"namespace\\\": \\\"0005\\\",\\n  \\\"paymentInstrument\\\": {\\n    \\\"type\\\": \\\"card/front\\\",\\n    \\\"cardHolderName\\\": \\\"Sherlock Holmes\\\",\\n    \\\"cardNumber\\\": \\\"4444333322221111\\\",\\n    \\\"cardExpiryDate\\\": {\\n      \\\"month\\\": 5,\\n      \\\"year\\\": 2037\\n    },\\n    \\\"billingAddress\\\": {\\n      \\\"address1\\\": \\\"Apartment 4\\\",\\n      \\\"address2\\\": \\\"3550 Lenox Road\\\",\\n      \\\"address3\\\": \\\"Lindbergh\\\",\\n      \\\"postalCode\\\": \\\"30326\\\",\\n      \\\"city\\\": \\\"Atlanta\\\",\\n      \\\"state\\\": \\\"GA\\\",\\n      \\\"countryCode\\\": \\\"US\\\"\\n    }\\n  },\\n  \\\"merchant\\\": {\\n    \\\"entity\\\": \\\"default\\\"\\n  },\\n  \\\"schemeTransactionReference\\\": \\\"12345678901234567890123\\\"\\n}\",\n  CURLOPT_URL => \"https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_CUSTOMREQUEST => \"POST\",\n]);\n\n$response = curl_exec($curl);\n$error = curl_error($curl);\n\ncurl_close($curl);\n\nif ($error) {\n  echo \"cURL Error #:\" . $error;\n} else {\n  echo $response;\n}"},{"lang":"ruby","title":"Ruby","source":"require 'uri'\nrequire 'net/http'\nrequire 'openssl'\n\nurl = URI('https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens')\n\nhttp = Net::HTTP.new(url.host, url.port)\nhttp.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest['Content-Type'] = 'application/vnd.worldpay.tokens-v3.hal+json'\nrequest.body = \"{\\n  \\\"description\\\": \\\"Test Description\\\",\\n  \\\"namespace\\\": \\\"0005\\\",\\n  \\\"paymentInstrument\\\": {\\n    \\\"type\\\": \\\"card/front\\\",\\n    \\\"cardHolderName\\\": \\\"Sherlock Holmes\\\",\\n    \\\"cardNumber\\\": \\\"4444333322221111\\\",\\n    \\\"cardExpiryDate\\\": {\\n      \\\"month\\\": 5,\\n      \\\"year\\\": 2037\\n    },\\n    \\\"billingAddress\\\": {\\n      \\\"address1\\\": \\\"Apartment 4\\\",\\n      \\\"address2\\\": \\\"3550 Lenox Road\\\",\\n      \\\"address3\\\": \\\"Lindbergh\\\",\\n      \\\"postalCode\\\": \\\"30326\\\",\\n      \\\"city\\\": \\\"Atlanta\\\",\\n      \\\"state\\\": \\\"GA\\\",\\n      \\\"countryCode\\\": \\\"US\\\"\\n    }\\n  },\\n  \\\"merchant\\\": {\\n    \\\"entity\\\": \\\"default\\\"\\n  },\\n  \\\"schemeTransactionReference\\\": \\\"12345678901234567890123\\\"\\n}\"\n\nresponse = http.request(request)\nputs response.read_body\n"},{"lang":"csharp","title":"C#","source":"using System;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\npublic class Program\n{\n  public static async Task Main()\n  {\n    System.Net.Http.HttpClient client = new();\n\n    using HttpResponseMessage request = await client.PostAsync(\"https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens\", postData);\n    string response = await request.Content.ReadAsStringAsync();\n\n    Console.WriteLine(response);\n  }\n}"}]},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Tokenized network token","disable":false},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Create a token using a pre-existing network token instrument."]},{"$$mdtype":"Tag","name":"OpenApiCodeSample","attributes":{"descriptionFile":"api-docs-products/tokens/@v3/openapi.yaml","operationId":"createSecurityToken","exampleKey":"Create a token using a network token instrument","parameters":{},"environments":{},"codeSamplesResolved":[{"lang":"json","title":"Payload application/vnd.worldpay.tokens-v3.hal+json","source":"{\n  \"paymentInstrument\": {\n    \"type\": \"card/networkToken\",\n    \"tokenNumber\": \"4444333322221111\",\n    \"expiryDate\": {\n      \"month\": 1,\n      \"year\": 2035\n    }\n  },\n  \"merchant\": {\n    \"entity\": \"default\"\n  }\n}"},{"lang":"shell","title":"curl","source":"curl -i -X POST \\\n  https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens \\\n  -H 'Content-Type: application/vnd.worldpay.tokens-v3.hal+json' \\\n  -d '{\n    \"paymentInstrument\": {\n      \"type\": \"card/networkToken\",\n      \"tokenNumber\": \"4444333322221111\",\n      \"expiryDate\": {\n        \"month\": 1,\n        \"year\": 2035\n      }\n    },\n    \"merchant\": {\n      \"entity\": \"default\"\n    }\n  }'"},{"lang":"python","title":"Python","source":"import requests\n\nurl = \"https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens\"\n\npayload = '''\n  {\n    \"paymentInstrument\": {\n      \"type\": \"card/networkToken\",\n      \"tokenNumber\": \"4444333322221111\",\n      \"expiryDate\": {\n        \"month\": 1,\n        \"year\": 2035\n      }\n    },\n    \"merchant\": {\n      \"entity\": \"default\"\n    }\n  }\n'''\n\nheaders = {\"Content-Type\": \"application/vnd.worldpay.tokens-v3.hal+json\"}\n\nresponse = requests.post(url, data=payload, headers=headers)\n\ndata = response.json()\nprint(data)"},{"lang":"java","title":"Java","source":"import java.net.*;\nimport java.net.http.*;\nimport java.util.*;\n\npublic class App {\n  public static void main(String[] args) throws Exception {\n    var httpClient = HttpClient.newBuilder().build();\n\n    var host = \"https://try.access.worldpay-bsh.securedataplatform.co.uk\";\n    var pathname = \"/tokens\";\n    var request = HttpRequest.newBuilder()\n      .POST(HttpRequest.BodyPublishers.ofString(payload))\n      .uri(URI.create(host + pathname ))\n      .header(\"Content-Type\", \"application/vnd.worldpay.tokens-v3.hal+json\")\n      .build();\n\n    var response = httpClient.send(request, HttpResponse.BodyHandlers.ofString());\n\n    System.out.println(response.body());\n  }\n}"},{"lang":"javascript","title":"Node.js","source":"import fetch from 'node-fetch';\n\nasync function run() {\n  const resp = await fetch(\n    `https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens`,\n    {\n      method: 'POST',\n      headers: {\n        'Content-Type': 'application/vnd.worldpay.tokens-v3.hal+json'\n      },\n      body: `{\n          \"paymentInstrument\": {\n            \"type\": \"card/networkToken\",\n            \"tokenNumber\": \"4444333322221111\",\n            \"expiryDate\": {\n              \"month\": 1,\n              \"year\": 2035\n            }\n          },\n          \"merchant\": {\n            \"entity\": \"default\"\n          }\n        }`\n    }\n  );\n\n  const data = await resp.text();\n  console.log(data);\n}\n\nrun();"},{"lang":"go","title":"Go","source":"package main\n\nimport (\n  \"fmt\"\n  \"strings\"\n  \"net/http\"\n  \"io/ioutil\"\n)\n\nfunc main() {\n  reqUrl := \"https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens\"\n  payload := strings.NewReader(\"{\\n  \\\"paymentInstrument\\\": {\\n    \\\"type\\\": \\\"card/networkToken\\\",\\n    \\\"tokenNumber\\\": \\\"4444333322221111\\\",\\n    \\\"expiryDate\\\": {\\n      \\\"month\\\": 1,\\n      \\\"year\\\": 2035\\n    }\\n  },\\n  \\\"merchant\\\": {\\n    \\\"entity\\\": \\\"default\\\"\\n  }\\n}\")\n  req, err := http.NewRequest(\"POST\", reqUrl, payload)\n  if err != nil {\n    panic(err)\n  }\n  req.Header.Add(\"Content-Type\", \"application/vnd.worldpay.tokens-v3.hal+json\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil {\n    panic(err)\n  }\n  defer res.Body.Close()\n  body, err := ioutil.ReadAll(res.Body)\n  if err != nil {\n    panic(err)\n  }\n\n  fmt.Println(res)\n  fmt.Println(string(body))\n}"},{"lang":"php","title":"PHP","source":"/**\n * Requires libcurl\n */\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_HTTPHEADER => [\n    \"Content-Type: application/vnd.worldpay.tokens-v3.hal+json\"\n  ],\n  CURLOPT_POSTFIELDS => \"{\\n  \\\"paymentInstrument\\\": {\\n    \\\"type\\\": \\\"card/networkToken\\\",\\n    \\\"tokenNumber\\\": \\\"4444333322221111\\\",\\n    \\\"expiryDate\\\": {\\n      \\\"month\\\": 1,\\n      \\\"year\\\": 2035\\n    }\\n  },\\n  \\\"merchant\\\": {\\n    \\\"entity\\\": \\\"default\\\"\\n  }\\n}\",\n  CURLOPT_URL => \"https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_CUSTOMREQUEST => \"POST\",\n]);\n\n$response = curl_exec($curl);\n$error = curl_error($curl);\n\ncurl_close($curl);\n\nif ($error) {\n  echo \"cURL Error #:\" . $error;\n} else {\n  echo $response;\n}"},{"lang":"ruby","title":"Ruby","source":"require 'uri'\nrequire 'net/http'\nrequire 'openssl'\n\nurl = URI('https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens')\n\nhttp = Net::HTTP.new(url.host, url.port)\nhttp.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest['Content-Type'] = 'application/vnd.worldpay.tokens-v3.hal+json'\nrequest.body = \"{\\n  \\\"paymentInstrument\\\": {\\n    \\\"type\\\": \\\"card/networkToken\\\",\\n    \\\"tokenNumber\\\": \\\"4444333322221111\\\",\\n    \\\"expiryDate\\\": {\\n      \\\"month\\\": 1,\\n      \\\"year\\\": 2035\\n    }\\n  },\\n  \\\"merchant\\\": {\\n    \\\"entity\\\": \\\"default\\\"\\n  }\\n}\"\n\nresponse = http.request(request)\nputs response.read_body\n"},{"lang":"csharp","title":"C#","source":"using System;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\npublic class Program\n{\n  public static async Task Main()\n  {\n    System.Net.Http.HttpClient client = new();\n\n    using HttpResponseMessage request = await client.PostAsync(\"https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens\", postData);\n    string response = await request.Content.ReadAsStringAsync();\n\n    Console.WriteLine(response);\n  }\n}"}]},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Apple Pay","disable":false},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Create a token using a pre-existing decrypted Apple Pay network token instrument."]},{"$$mdtype":"Tag","name":"OpenApiCodeSample","attributes":{"descriptionFile":"api-docs-products/tokens/@v3/openapi.yaml","operationId":"createSecurityToken","exampleKey":"Create a token using a network token instrument (decrypted Apple Pay)","parameters":{},"environments":{},"codeSamplesResolved":[{"lang":"json","title":"Payload application/vnd.worldpay.tokens-v3.hal+json","source":"{\n  \"paymentInstrument\": {\n    \"type\": \"card/networkToken+applepay\",\n    \"tokenNumber\": \"4444333322221111\",\n    \"expiryDate\": {\n      \"month\": 1,\n      \"year\": 2035\n    }\n  },\n  \"merchant\": {\n    \"entity\": \"default\"\n  }\n}"},{"lang":"shell","title":"curl","source":"curl -i -X POST \\\n  https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens \\\n  -H 'Content-Type: application/vnd.worldpay.tokens-v3.hal+json' \\\n  -d '{\n    \"paymentInstrument\": {\n      \"type\": \"card/networkToken+applepay\",\n      \"tokenNumber\": \"4444333322221111\",\n      \"expiryDate\": {\n        \"month\": 1,\n        \"year\": 2035\n      }\n    },\n    \"merchant\": {\n      \"entity\": \"default\"\n    }\n  }'"},{"lang":"python","title":"Python","source":"import requests\n\nurl = \"https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens\"\n\npayload = '''\n  {\n    \"paymentInstrument\": {\n      \"type\": \"card/networkToken+applepay\",\n      \"tokenNumber\": \"4444333322221111\",\n      \"expiryDate\": {\n        \"month\": 1,\n        \"year\": 2035\n      }\n    },\n    \"merchant\": {\n      \"entity\": \"default\"\n    }\n  }\n'''\n\nheaders = {\"Content-Type\": \"application/vnd.worldpay.tokens-v3.hal+json\"}\n\nresponse = requests.post(url, data=payload, headers=headers)\n\ndata = response.json()\nprint(data)"},{"lang":"java","title":"Java","source":"import java.net.*;\nimport java.net.http.*;\nimport java.util.*;\n\npublic class App {\n  public static void main(String[] args) throws Exception {\n    var httpClient = HttpClient.newBuilder().build();\n\n    var host = \"https://try.access.worldpay-bsh.securedataplatform.co.uk\";\n    var pathname = \"/tokens\";\n    var request = HttpRequest.newBuilder()\n      .POST(HttpRequest.BodyPublishers.ofString(payload))\n      .uri(URI.create(host + pathname ))\n      .header(\"Content-Type\", \"application/vnd.worldpay.tokens-v3.hal+json\")\n      .build();\n\n    var response = httpClient.send(request, HttpResponse.BodyHandlers.ofString());\n\n    System.out.println(response.body());\n  }\n}"},{"lang":"javascript","title":"Node.js","source":"import fetch from 'node-fetch';\n\nasync function run() {\n  const resp = await fetch(\n    `https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens`,\n    {\n      method: 'POST',\n      headers: {\n        'Content-Type': 'application/vnd.worldpay.tokens-v3.hal+json'\n      },\n      body: `{\n          \"paymentInstrument\": {\n            \"type\": \"card/networkToken+applepay\",\n            \"tokenNumber\": \"4444333322221111\",\n            \"expiryDate\": {\n              \"month\": 1,\n              \"year\": 2035\n            }\n          },\n          \"merchant\": {\n            \"entity\": \"default\"\n          }\n        }`\n    }\n  );\n\n  const data = await resp.text();\n  console.log(data);\n}\n\nrun();"},{"lang":"go","title":"Go","source":"package main\n\nimport (\n  \"fmt\"\n  \"strings\"\n  \"net/http\"\n  \"io/ioutil\"\n)\n\nfunc main() {\n  reqUrl := \"https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens\"\n  payload := strings.NewReader(\"{\\n  \\\"paymentInstrument\\\": {\\n    \\\"type\\\": \\\"card/networkToken+applepay\\\",\\n    \\\"tokenNumber\\\": \\\"4444333322221111\\\",\\n    \\\"expiryDate\\\": {\\n      \\\"month\\\": 1,\\n      \\\"year\\\": 2035\\n    }\\n  },\\n  \\\"merchant\\\": {\\n    \\\"entity\\\": \\\"default\\\"\\n  }\\n}\")\n  req, err := http.NewRequest(\"POST\", reqUrl, payload)\n  if err != nil {\n    panic(err)\n  }\n  req.Header.Add(\"Content-Type\", \"application/vnd.worldpay.tokens-v3.hal+json\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil {\n    panic(err)\n  }\n  defer res.Body.Close()\n  body, err := ioutil.ReadAll(res.Body)\n  if err != nil {\n    panic(err)\n  }\n\n  fmt.Println(res)\n  fmt.Println(string(body))\n}"},{"lang":"php","title":"PHP","source":"/**\n * Requires libcurl\n */\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_HTTPHEADER => [\n    \"Content-Type: application/vnd.worldpay.tokens-v3.hal+json\"\n  ],\n  CURLOPT_POSTFIELDS => \"{\\n  \\\"paymentInstrument\\\": {\\n    \\\"type\\\": \\\"card/networkToken+applepay\\\",\\n    \\\"tokenNumber\\\": \\\"4444333322221111\\\",\\n    \\\"expiryDate\\\": {\\n      \\\"month\\\": 1,\\n      \\\"year\\\": 2035\\n    }\\n  },\\n  \\\"merchant\\\": {\\n    \\\"entity\\\": \\\"default\\\"\\n  }\\n}\",\n  CURLOPT_URL => \"https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_CUSTOMREQUEST => \"POST\",\n]);\n\n$response = curl_exec($curl);\n$error = curl_error($curl);\n\ncurl_close($curl);\n\nif ($error) {\n  echo \"cURL Error #:\" . $error;\n} else {\n  echo $response;\n}"},{"lang":"ruby","title":"Ruby","source":"require 'uri'\nrequire 'net/http'\nrequire 'openssl'\n\nurl = URI('https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens')\n\nhttp = Net::HTTP.new(url.host, url.port)\nhttp.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest['Content-Type'] = 'application/vnd.worldpay.tokens-v3.hal+json'\nrequest.body = \"{\\n  \\\"paymentInstrument\\\": {\\n    \\\"type\\\": \\\"card/networkToken+applepay\\\",\\n    \\\"tokenNumber\\\": \\\"4444333322221111\\\",\\n    \\\"expiryDate\\\": {\\n      \\\"month\\\": 1,\\n      \\\"year\\\": 2035\\n    }\\n  },\\n  \\\"merchant\\\": {\\n    \\\"entity\\\": \\\"default\\\"\\n  }\\n}\"\n\nresponse = http.request(request)\nputs response.read_body\n"},{"lang":"csharp","title":"C#","source":"using System;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\npublic class Program\n{\n  public static async Task Main()\n  {\n    System.Net.Http.HttpClient client = new();\n\n    using HttpResponseMessage request = await client.PostAsync(\"https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens\", postData);\n    string response = await request.Content.ReadAsStringAsync();\n\n    Console.WriteLine(response);\n  }\n}"}]},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Google Pay","disable":false},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Create a token using a pre-existing decrypted Google Pay network token instrument."]},{"$$mdtype":"Tag","name":"OpenApiCodeSample","attributes":{"descriptionFile":"api-docs-products/tokens/@v3/openapi.yaml","operationId":"createSecurityToken","exampleKey":"Create a token using a network token instrument (decrypted Google Pay)","parameters":{},"environments":{},"codeSamplesResolved":[{"lang":"json","title":"Payload application/vnd.worldpay.tokens-v3.hal+json","source":"{\n  \"paymentInstrument\": {\n    \"type\": \"card/networkToken+googlepay\",\n    \"tokenNumber\": \"4444333322221111\",\n    \"expiryDate\": {\n      \"month\": 1,\n      \"year\": 2035\n    }\n  },\n  \"merchant\": {\n    \"entity\": \"default\"\n  }\n}"},{"lang":"shell","title":"curl","source":"curl -i -X POST \\\n  https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens \\\n  -H 'Content-Type: application/vnd.worldpay.tokens-v3.hal+json' \\\n  -d '{\n    \"paymentInstrument\": {\n      \"type\": \"card/networkToken+googlepay\",\n      \"tokenNumber\": \"4444333322221111\",\n      \"expiryDate\": {\n        \"month\": 1,\n        \"year\": 2035\n      }\n    },\n    \"merchant\": {\n      \"entity\": \"default\"\n    }\n  }'"},{"lang":"python","title":"Python","source":"import requests\n\nurl = \"https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens\"\n\npayload = '''\n  {\n    \"paymentInstrument\": {\n      \"type\": \"card/networkToken+googlepay\",\n      \"tokenNumber\": \"4444333322221111\",\n      \"expiryDate\": {\n        \"month\": 1,\n        \"year\": 2035\n      }\n    },\n    \"merchant\": {\n      \"entity\": \"default\"\n    }\n  }\n'''\n\nheaders = {\"Content-Type\": \"application/vnd.worldpay.tokens-v3.hal+json\"}\n\nresponse = requests.post(url, data=payload, headers=headers)\n\ndata = response.json()\nprint(data)"},{"lang":"java","title":"Java","source":"import java.net.*;\nimport java.net.http.*;\nimport java.util.*;\n\npublic class App {\n  public static void main(String[] args) throws Exception {\n    var httpClient = HttpClient.newBuilder().build();\n\n    var host = \"https://try.access.worldpay-bsh.securedataplatform.co.uk\";\n    var pathname = \"/tokens\";\n    var request = HttpRequest.newBuilder()\n      .POST(HttpRequest.BodyPublishers.ofString(payload))\n      .uri(URI.create(host + pathname ))\n      .header(\"Content-Type\", \"application/vnd.worldpay.tokens-v3.hal+json\")\n      .build();\n\n    var response = httpClient.send(request, HttpResponse.BodyHandlers.ofString());\n\n    System.out.println(response.body());\n  }\n}"},{"lang":"javascript","title":"Node.js","source":"import fetch from 'node-fetch';\n\nasync function run() {\n  const resp = await fetch(\n    `https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens`,\n    {\n      method: 'POST',\n      headers: {\n        'Content-Type': 'application/vnd.worldpay.tokens-v3.hal+json'\n      },\n      body: `{\n          \"paymentInstrument\": {\n            \"type\": \"card/networkToken+googlepay\",\n            \"tokenNumber\": \"4444333322221111\",\n            \"expiryDate\": {\n              \"month\": 1,\n              \"year\": 2035\n            }\n          },\n          \"merchant\": {\n            \"entity\": \"default\"\n          }\n        }`\n    }\n  );\n\n  const data = await resp.text();\n  console.log(data);\n}\n\nrun();"},{"lang":"go","title":"Go","source":"package main\n\nimport (\n  \"fmt\"\n  \"strings\"\n  \"net/http\"\n  \"io/ioutil\"\n)\n\nfunc main() {\n  reqUrl := \"https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens\"\n  payload := strings.NewReader(\"{\\n  \\\"paymentInstrument\\\": {\\n    \\\"type\\\": \\\"card/networkToken+googlepay\\\",\\n    \\\"tokenNumber\\\": \\\"4444333322221111\\\",\\n    \\\"expiryDate\\\": {\\n      \\\"month\\\": 1,\\n      \\\"year\\\": 2035\\n    }\\n  },\\n  \\\"merchant\\\": {\\n    \\\"entity\\\": \\\"default\\\"\\n  }\\n}\")\n  req, err := http.NewRequest(\"POST\", reqUrl, payload)\n  if err != nil {\n    panic(err)\n  }\n  req.Header.Add(\"Content-Type\", \"application/vnd.worldpay.tokens-v3.hal+json\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil {\n    panic(err)\n  }\n  defer res.Body.Close()\n  body, err := ioutil.ReadAll(res.Body)\n  if err != nil {\n    panic(err)\n  }\n\n  fmt.Println(res)\n  fmt.Println(string(body))\n}"},{"lang":"php","title":"PHP","source":"/**\n * Requires libcurl\n */\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_HTTPHEADER => [\n    \"Content-Type: application/vnd.worldpay.tokens-v3.hal+json\"\n  ],\n  CURLOPT_POSTFIELDS => \"{\\n  \\\"paymentInstrument\\\": {\\n    \\\"type\\\": \\\"card/networkToken+googlepay\\\",\\n    \\\"tokenNumber\\\": \\\"4444333322221111\\\",\\n    \\\"expiryDate\\\": {\\n      \\\"month\\\": 1,\\n      \\\"year\\\": 2035\\n    }\\n  },\\n  \\\"merchant\\\": {\\n    \\\"entity\\\": \\\"default\\\"\\n  }\\n}\",\n  CURLOPT_URL => \"https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_CUSTOMREQUEST => \"POST\",\n]);\n\n$response = curl_exec($curl);\n$error = curl_error($curl);\n\ncurl_close($curl);\n\nif ($error) {\n  echo \"cURL Error #:\" . $error;\n} else {\n  echo $response;\n}"},{"lang":"ruby","title":"Ruby","source":"require 'uri'\nrequire 'net/http'\nrequire 'openssl'\n\nurl = URI('https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens')\n\nhttp = Net::HTTP.new(url.host, url.port)\nhttp.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest['Content-Type'] = 'application/vnd.worldpay.tokens-v3.hal+json'\nrequest.body = \"{\\n  \\\"paymentInstrument\\\": {\\n    \\\"type\\\": \\\"card/networkToken+googlepay\\\",\\n    \\\"tokenNumber\\\": \\\"4444333322221111\\\",\\n    \\\"expiryDate\\\": {\\n      \\\"month\\\": 1,\\n      \\\"year\\\": 2035\\n    }\\n  },\\n  \\\"merchant\\\": {\\n    \\\"entity\\\": \\\"default\\\"\\n  }\\n}\"\n\nresponse = http.request(request)\nputs response.read_body\n"},{"lang":"csharp","title":"C#","source":"using System;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\npublic class Program\n{\n  public static async Task Main()\n  {\n    System.Net.Http.HttpClient client = new();\n\n    using HttpResponseMessage request = await client.PostAsync(\"https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens\", postData);\n    string response = await request.Content.ReadAsStringAsync();\n\n    Console.WriteLine(response);\n  }\n}"}]},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Samsung Pay","disable":false},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Create a token using a pre-existing decrypted Samsung Pay network token instrument."]},{"$$mdtype":"Tag","name":"OpenApiCodeSample","attributes":{"descriptionFile":"api-docs-products/tokens/@v3/openapi.yaml","operationId":"createSecurityToken","exampleKey":"Create a token using a network token instrument (decrypted Samsung Pay)","parameters":{},"environments":{},"codeSamplesResolved":[{"lang":"json","title":"Payload application/vnd.worldpay.tokens-v3.hal+json","source":"{\n  \"paymentInstrument\": {\n    \"type\": \"card/networkToken+samsungpay\",\n    \"tokenNumber\": \"4444333322221111\",\n    \"expiryDate\": {\n      \"month\": 1,\n      \"year\": 2035\n    }\n  },\n  \"merchant\": {\n    \"entity\": \"default\"\n  }\n}"},{"lang":"shell","title":"curl","source":"curl -i -X POST \\\n  https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens \\\n  -H 'Content-Type: application/vnd.worldpay.tokens-v3.hal+json' \\\n  -d '{\n    \"paymentInstrument\": {\n      \"type\": \"card/networkToken+samsungpay\",\n      \"tokenNumber\": \"4444333322221111\",\n      \"expiryDate\": {\n        \"month\": 1,\n        \"year\": 2035\n      }\n    },\n    \"merchant\": {\n      \"entity\": \"default\"\n    }\n  }'"},{"lang":"python","title":"Python","source":"import requests\n\nurl = \"https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens\"\n\npayload = '''\n  {\n    \"paymentInstrument\": {\n      \"type\": \"card/networkToken+samsungpay\",\n      \"tokenNumber\": \"4444333322221111\",\n      \"expiryDate\": {\n        \"month\": 1,\n        \"year\": 2035\n      }\n    },\n    \"merchant\": {\n      \"entity\": \"default\"\n    }\n  }\n'''\n\nheaders = {\"Content-Type\": \"application/vnd.worldpay.tokens-v3.hal+json\"}\n\nresponse = requests.post(url, data=payload, headers=headers)\n\ndata = response.json()\nprint(data)"},{"lang":"java","title":"Java","source":"import java.net.*;\nimport java.net.http.*;\nimport java.util.*;\n\npublic class App {\n  public static void main(String[] args) throws Exception {\n    var httpClient = HttpClient.newBuilder().build();\n\n    var host = \"https://try.access.worldpay-bsh.securedataplatform.co.uk\";\n    var pathname = \"/tokens\";\n    var request = HttpRequest.newBuilder()\n      .POST(HttpRequest.BodyPublishers.ofString(payload))\n      .uri(URI.create(host + pathname ))\n      .header(\"Content-Type\", \"application/vnd.worldpay.tokens-v3.hal+json\")\n      .build();\n\n    var response = httpClient.send(request, HttpResponse.BodyHandlers.ofString());\n\n    System.out.println(response.body());\n  }\n}"},{"lang":"javascript","title":"Node.js","source":"import fetch from 'node-fetch';\n\nasync function run() {\n  const resp = await fetch(\n    `https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens`,\n    {\n      method: 'POST',\n      headers: {\n        'Content-Type': 'application/vnd.worldpay.tokens-v3.hal+json'\n      },\n      body: `{\n          \"paymentInstrument\": {\n            \"type\": \"card/networkToken+samsungpay\",\n            \"tokenNumber\": \"4444333322221111\",\n            \"expiryDate\": {\n              \"month\": 1,\n              \"year\": 2035\n            }\n          },\n          \"merchant\": {\n            \"entity\": \"default\"\n          }\n        }`\n    }\n  );\n\n  const data = await resp.text();\n  console.log(data);\n}\n\nrun();"},{"lang":"go","title":"Go","source":"package main\n\nimport (\n  \"fmt\"\n  \"strings\"\n  \"net/http\"\n  \"io/ioutil\"\n)\n\nfunc main() {\n  reqUrl := \"https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens\"\n  payload := strings.NewReader(\"{\\n  \\\"paymentInstrument\\\": {\\n    \\\"type\\\": \\\"card/networkToken+samsungpay\\\",\\n    \\\"tokenNumber\\\": \\\"4444333322221111\\\",\\n    \\\"expiryDate\\\": {\\n      \\\"month\\\": 1,\\n      \\\"year\\\": 2035\\n    }\\n  },\\n  \\\"merchant\\\": {\\n    \\\"entity\\\": \\\"default\\\"\\n  }\\n}\")\n  req, err := http.NewRequest(\"POST\", reqUrl, payload)\n  if err != nil {\n    panic(err)\n  }\n  req.Header.Add(\"Content-Type\", \"application/vnd.worldpay.tokens-v3.hal+json\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil {\n    panic(err)\n  }\n  defer res.Body.Close()\n  body, err := ioutil.ReadAll(res.Body)\n  if err != nil {\n    panic(err)\n  }\n\n  fmt.Println(res)\n  fmt.Println(string(body))\n}"},{"lang":"php","title":"PHP","source":"/**\n * Requires libcurl\n */\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_HTTPHEADER => [\n    \"Content-Type: application/vnd.worldpay.tokens-v3.hal+json\"\n  ],\n  CURLOPT_POSTFIELDS => \"{\\n  \\\"paymentInstrument\\\": {\\n    \\\"type\\\": \\\"card/networkToken+samsungpay\\\",\\n    \\\"tokenNumber\\\": \\\"4444333322221111\\\",\\n    \\\"expiryDate\\\": {\\n      \\\"month\\\": 1,\\n      \\\"year\\\": 2035\\n    }\\n  },\\n  \\\"merchant\\\": {\\n    \\\"entity\\\": \\\"default\\\"\\n  }\\n}\",\n  CURLOPT_URL => \"https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_CUSTOMREQUEST => \"POST\",\n]);\n\n$response = curl_exec($curl);\n$error = curl_error($curl);\n\ncurl_close($curl);\n\nif ($error) {\n  echo \"cURL Error #:\" . $error;\n} else {\n  echo $response;\n}"},{"lang":"ruby","title":"Ruby","source":"require 'uri'\nrequire 'net/http'\nrequire 'openssl'\n\nurl = URI('https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens')\n\nhttp = Net::HTTP.new(url.host, url.port)\nhttp.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest['Content-Type'] = 'application/vnd.worldpay.tokens-v3.hal+json'\nrequest.body = \"{\\n  \\\"paymentInstrument\\\": {\\n    \\\"type\\\": \\\"card/networkToken+samsungpay\\\",\\n    \\\"tokenNumber\\\": \\\"4444333322221111\\\",\\n    \\\"expiryDate\\\": {\\n      \\\"month\\\": 1,\\n      \\\"year\\\": 2035\\n    }\\n  },\\n  \\\"merchant\\\": {\\n    \\\"entity\\\": \\\"default\\\"\\n  }\\n}\"\n\nresponse = http.request(request)\nputs response.read_body\n"},{"lang":"csharp","title":"C#","source":"using System;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\npublic class Program\n{\n  public static async Task Main()\n  {\n    System.Net.Http.HttpClient client = new();\n\n    using HttpResponseMessage request = await client.PostAsync(\"https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens\", postData);\n    string response = await request.Content.ReadAsStringAsync();\n\n    Console.WriteLine(response);\n  }\n}"}]},"children":[]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"Cards","attributes":{"columns":3,"cardMinWidth":180},"children":[" ",{"$$mdtype":"Tag","name":"Card","attributes":{"title":"View the full API Request schema","imagePosition":"start","iconPosition":"auto","layout":"vertical","align":"center","variant":"outlined","to":"/products/tokens/openapi/token/createsecuritytoken"},"children":[" "]}," "]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"responses","__idx":3},"children":["Responses"]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"Best practice"},"children":[{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Access Worldpay returns a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["WP-CorrelationId"]}," in the headers of service responses. We ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["highly recommend"]}," you log this. The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["WP-CorrelationId"]}," is used by us to examine individual service requests."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["If you must set a field length, we advise you allow up to 1024 bytes for each URI."]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Once you've sent your create a token request, one of the following example responses is returned:"]},{"$$mdtype":"Tag","name":"OpenApiResponseSample","attributes":{"descriptionFile":"api-docs-products/tokens/@v3/openapi.yaml","operationId":"createSecurityToken","exampleKey":"Token created","responseSamplesResolved":[{"lang":"json","title":"200 application/vnd.worldpay.tokens-v3.hal+json","source":"{\n  \"tokenPaymentInstrument\": {\n    \"type\": \"card/tokenized\",\n    \"href\": \"https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens/eyJrIjoxLCJkIjoialRBL0FFelBzcnZpNCtzRGNRemh0NzI0NE1rdUtjMUFJdjYxVnlibWZuUT0ifQ\"\n  },\n  \"tokenId\": \"9902480679618049603\",\n  \"description\": \"Test Token Description\",\n  \"tokenExpiryDateTime\": \"2030-06-24T09:19:35Z\",\n  \"paymentInstrument\": {\n    \"type\": \"card/masked\",\n    \"cardNumber\": \"4444********1111\",\n    \"cardHolderName\": \"Sherlock Holmes\",\n    \"cardExpiryDate\": {\n      \"month\": 5,\n      \"year\": 2035\n    },\n    \"billingAddress\": {\n      \"address1\": \"221B Baker Street\",\n      \"address2\": \"Marylebone\",\n      \"address3\": \"Westminster\",\n      \"postalCode\": \"NW1 6XE\",\n      \"city\": \"London\",\n      \"state\": \"Greater London\",\n      \"countryCode\": \"GB\"\n    },\n    \"bin\": \"444433\",\n    \"brand\": \"VISA\",\n    \"fundingType\": \"credit\"\n  },\n  \"_links\": {\n    \"tokens:token\": {\n      \"href\": \"https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens/eyJrIjoxLCJkIjoialRBL0FFelBzcnZpNCtzRGNRemh0NzI0NE1rdUtjMUFJdjYxVnlibWZuUT0ifQ\"\n    },\n    \"tokens:description\": {\n      \"href\": \"https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens/eyJrIjoxLCJkIjoialRBL0FFelBzcnZpNCtzRGNRemh0MWJVbkh1WTFGZExUNXJxc04va1ZoTFVzYW1OU1lxSFE2NHI1c2JkY1pWaSJ9\"\n    },\n    \"tokens:cardHolderName\": {\n      \"href\": \"https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens/eyJrIjoxLCJkIjoialRBL0FFelBzcnZpNCtzRGNRemh0d3ltd21ieGo3TlZLYzRYSkExOUhSdUpLN2N3VVc5WUk3czRUTW1RQ2JLdjFnVXlzakdPSXdWWkRhZkZyUmlMd3c9PSJ9\"\n    },\n    \"tokens:cardExpiryDate\": {\n      \"href\": \"https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens/eyJrIjoxLCJkIjoialRBL0FFelBzcnZpNCtzRGNRemh0d3ltd21ieGo3TlZLYzRYSkExOUhSdUpLN2N3VVc5WUk3czRUTW1RQ2JLdkVpVW5GNnBsZThNTXNQWTRGbzFzTXc9PSJ9\"\n    },\n    \"tokens:billingAddress\": {\n      \"href\": \"https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens/eyJrIjoxLCJkIjoialRBL0FFelBzcnZpNCtzRGNRemh0d3ltd21ieGo3TlZLYzRYSkExOUhSdFpSdXFxbWZlNVl1TkpHZEVvZXN3MTlCU0lmdCtxSTUyVDJSdXlmSTIwM3c9PSJ9\"\n    },\n    \"tokens:schemeTransactionReference\": {\n      \"href\": \"https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens/eyJrIjoxLCJkIjoiSENXWFZQZjNIZ1V3dnpDMElJZS9Zdmc4M0pYM3dDWEJTVnQrWVlacXdDUXFFKzhzaC8xNSs2d3NkTTdFWUFNVU9tdXBmUlZGeVNDY2dPMkhKV2NIcGc9PSJ9\"\n    },\n    \"curies\": [\n      {\n        \"href\": \"https://try.access.worldpay-bsh.securedataplatform.co.uk/rels/tokens/{rel}.json\",\n        \"name\": \"tokens\",\n        \"templated\": true\n      }\n    ]\n  }\n}"},{"lang":"json","title":"201 application/vnd.worldpay.tokens-v3.hal+json","source":"{\n  \"tokenPaymentInstrument\": {\n    \"type\": \"card/tokenized\",\n    \"href\": \"https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens/eyJrIjoxLCJkIjoialRBL0FFelBzcnZpNCtzRGNRemh0NzI0NE1rdUtjMUFJdjYxVnlibWZuUT0ifQ\"\n  },\n  \"tokenId\": \"9902480679618049603\",\n  \"description\": \"Test Token Description\",\n  \"tokenExpiryDateTime\": \"2030-06-24T09:19:35Z\",\n  \"paymentInstrument\": {\n    \"type\": \"card/masked\",\n    \"cardNumber\": \"4444********1111\",\n    \"cardHolderName\": \"Sherlock Holmes\",\n    \"cardExpiryDate\": {\n      \"month\": 5,\n      \"year\": 2035\n    },\n    \"billingAddress\": {\n      \"address1\": \"221B Baker Street\",\n      \"address2\": \"Marylebone\",\n      \"address3\": \"Westminster\",\n      \"postalCode\": \"NW1 6XE\",\n      \"city\": \"London\",\n      \"state\": \"Greater London\",\n      \"countryCode\": \"GB\"\n    },\n    \"bin\": \"444433\",\n    \"brand\": \"VISA\",\n    \"fundingType\": \"credit\"\n  },\n  \"_links\": {\n    \"tokens:token\": {\n      \"href\": \"https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens/eyJrIjoxLCJkIjoialRBL0FFelBzcnZpNCtzRGNRemh0NzI0NE1rdUtjMUFJdjYxVnlibWZuUT0ifQ\"\n    },\n    \"tokens:description\": {\n      \"href\": \"https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens/eyJrIjoxLCJkIjoialRBL0FFelBzcnZpNCtzRGNRemh0MWJVbkh1WTFGZExUNXJxc04va1ZoTFVzYW1OU1lxSFE2NHI1c2JkY1pWaSJ9\"\n    },\n    \"tokens:cardHolderName\": {\n      \"href\": \"https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens/eyJrIjoxLCJkIjoialRBL0FFelBzcnZpNCtzRGNRemh0d3ltd21ieGo3TlZLYzRYSkExOUhSdUpLN2N3VVc5WUk3czRUTW1RQ2JLdjFnVXlzakdPSXdWWkRhZkZyUmlMd3c9PSJ9\"\n    },\n    \"tokens:cardExpiryDate\": {\n      \"href\": \"https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens/eyJrIjoxLCJkIjoialRBL0FFelBzcnZpNCtzRGNRemh0d3ltd21ieGo3TlZLYzRYSkExOUhSdUpLN2N3VVc5WUk3czRUTW1RQ2JLdkVpVW5GNnBsZThNTXNQWTRGbzFzTXc9PSJ9\"\n    },\n    \"tokens:billingAddress\": {\n      \"href\": \"https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens/eyJrIjoxLCJkIjoialRBL0FFelBzcnZpNCtzRGNRemh0d3ltd21ieGo3TlZLYzRYSkExOUhSdFpSdXFxbWZlNVl1TkpHZEVvZXN3MTlCU0lmdCtxSTUyVDJSdXlmSTIwM3c9PSJ9\"\n    },\n    \"tokens:schemeTransactionReference\": {\n      \"href\": \"https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens/eyJrIjoxLCJkIjoiSENXWFZQZjNIZ1V3dnpDMElJZS9Zdmc4M0pYM3dDWEJTVnQrWVlacXdDUXFFKzhzaC8xNSs2d3NkTTdFWUFNVU9tdXBmUlZGeVNDY2dPMkhKV2NIcGc9PSJ9\"\n    },\n    \"curies\": [\n      {\n        \"href\": \"https://try.access.worldpay-bsh.securedataplatform.co.uk/rels/tokens/{rel}.json\",\n        \"name\": \"tokens\",\n        \"templated\": true\n      }\n    ]\n  }\n}"},{"lang":"json","title":"400 application/vnd.worldpay.tokens-v3.hal+json","source":"{\n  \"errorName\": \"bodyDoesNotMatchSchema\",\n  \"message\": \"The json body provided does not match the expected schema\",\n  \"validationErrors\": [\n    {\n      \"errorName\": \"stringIsTooShort\",\n      \"message\": \"Token description too short - must be between 1 & 255 characters\",\n      \"jsonPath\": \"$.description\"\n    },\n    {\n      \"errorName\": \"fieldHasInvalidValue\",\n      \"message\": \"Card expiry month too small - must be between 1 & 12\",\n      \"jsonPath\": \"$.paymentInstrument.cardExpiryDate.month\"\n    },\n    {\n      \"errorName\": \"billingAddressMightContainCardNumber\",\n      \"message\": \"Address might contain a card number\",\n      \"jsonPath\": \"$.paymentInstrument.billingAddress.address2\"\n    }\n  ]\n}"},{"lang":"json","title":"403 application/vnd.worldpay.tokens-v3.hal+json","source":"{\n  \"errorName\": \"tooManyTokensForNamespace\",\n  \"message\": \"Too many tokens created for this namespace\"\n}"},{"lang":"json","title":"409 application/vnd.worldpay.tokens-v3.hal+json","source":"{\n  \"tokenPaymentInstrument\": {\n    \"type\": \"card/tokenized\",\n    \"href\": \"https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens/eyJrIjoxLCJkIjoialRBL0FFelBzcnZpNCtzRGNRemh0NzI0NE1rdUtjMUFJdjYxVnlibWZuUT0ifQ\"\n  },\n  \"tokenId\": \"9902480679618049603\",\n  \"description\": \"Test Token Description\",\n  \"tokenExpiryDateTime\": \"2030-06-24T09:19:35Z\",\n  \"paymentInstrument\": {\n    \"type\": \"card/masked\",\n    \"cardNumber\": \"4444********1111\",\n    \"cardHolderName\": \"Sherlock Holmes\",\n    \"cardExpiryDate\": {\n      \"month\": 5,\n      \"year\": 2035\n    },\n    \"billingAddress\": {\n      \"address1\": \"221B Baker Street\",\n      \"address2\": \"Marylebone\",\n      \"address3\": \"Westminster\",\n      \"postalCode\": \"NW1 6XE\",\n      \"city\": \"London\",\n      \"state\": \"Greater London\",\n      \"countryCode\": \"GB\"\n    },\n    \"bin\": \"444433\",\n    \"brand\": \"VISA\",\n    \"fundingType\": \"credit\"\n  },\n  \"conflicts\": {\n    \"paymentInstrument\": {\n      \"cardHolderName\": \"Sherlock Holmes\"\n    },\n    \"conflictsExpiryDateTime\": \"2030-06-24T09:49:35Z\"\n  },\n  \"_links\": {\n    \"tokens:token\": {\n      \"href\": \"https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens/eyJrIjoxLCJkIjoialRBL0FFelBzcnZpNCtzRGNRemh0NzI0NE1rdUtjMUFJdjYxVnlibWZuUT0ifQ\"\n    },\n    \"tokens:description\": {\n      \"href\": \"https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens/eyJrIjoxLCJkIjoialRBL0FFelBzcnZpNCtzRGNRemh0MWJVbkh1WTFGZExUNXJxc04va1ZoTFVzYW1OU1lxSFE2NHI1c2JkY1pWaSJ9\"\n    },\n    \"tokens:cardHolderName\": {\n      \"href\": \"https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens/eyJrIjoxLCJkIjoialRBL0FFelBzcnZpNCtzRGNRemh0d3ltd21ieGo3TlZLYzRYSkExOUhSdUpLN2N3VVc5WUk3czRUTW1RQ2JLdjFnVXlzakdPSXdWWkRhZkZyUmlMd3c9PSJ9\"\n    },\n    \"tokens:cardExpiryDate\": {\n      \"href\": \"https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens/eyJrIjoxLCJkIjoialRBL0FFelBzcnZpNCtzRGNRemh0d3ltd21ieGo3TlZLYzRYSkExOUhSdUpLN2N3VVc5WUk3czRUTW1RQ2JLdkVpVW5GNnBsZThNTXNQWTRGbzFzTXc9PSJ9\"\n    },\n    \"tokens:billingAddress\": {\n      \"href\": \"https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens/eyJrIjoxLCJkIjoialRBL0FFelBzcnZpNCtzRGNRemh0d3ltd21ieGo3TlZLYzRYSkExOUhSdFpSdXFxbWZlNVl1TkpHZEVvZXN3MTlCU0lmdCtxSTUyVDJSdXlmSTIwM3c9PSJ9\"\n    },\n    \"tokens:schemeTransactionReference\": {\n      \"href\": \"https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens/eyJrIjoxLCJkIjoiSENXWFZQZjNIZ1V3dnpDMElJZS9Zdmc4M0pYM3dDWEJTVnQrWVlacXdDUXFFKzhzaC8xNSs2d3NkTTdFWUFNVU9tdXBmUlZGeVNDY2dPMkhKV2NIcGc9PSJ9\"\n    },\n    \"tokens:conflicts\": {\n      \"href\": \"https://try.access.worldpay-bsh.securedataplatform.co.uk/tokens/eyJrIjoxLCJkIjoialRBL0FFelBzcnZpNCtzRGNRemh0ODUrN2hvZ0cyK1JvQ3JKdUtFZnU5UTFsdTdwODVHTUcwYy92VW02MDlJd2pHQllvcW0zanhWQ3p3Zk9OUW9CYUZtQ1hNbFhwM3lhSXlkYVlNYWJnQUdQUHFpRVAxVXVpZHM2Y2tvTjEvOGNJdFQ0WkVlVEJIVWF6T1dlWTlQMkpnPT0ifQ\"\n    },\n    \"curies\": [\n      {\n        \"href\": \"https://try.access.worldpay-bsh.securedataplatform.co.uk/rels/tokens/{rel}.json\",\n        \"name\": \"tokens\",\n        \"templated\": true\n      }\n    ]\n  }\n}"},{"lang":"json","title":"422 application/vnd.worldpay.tokens-v3.hal+json","source":"{\n  \"errorName\": \"unrecognizedCardBrand\",\n  \"message\": \"The card brand is not recognized\"\n}"},{"lang":"json","title":"500 application/vnd.worldpay.tokens-v3.hal+json","source":"{\n  \"errorName\": \"tokenizationNotEnabled\",\n  \"message\": \"Tokenization not enabled\"\n}"}]},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"Cards","attributes":{"columns":3,"cardMinWidth":180},"children":[" ",{"$$mdtype":"Tag","name":"Card","attributes":{"title":"View the full API Response schema","imagePosition":"start","iconPosition":"auto","layout":"vertical","align":"center","variant":"outlined","to":"/products/tokens/openapi/token/createsecuritytoken#token/createsecuritytoken/response&c=200"},"children":[" "]}," "]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Next steps"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/tokens/query-and-update-tokens#update-token-details"},"children":["Update token details"]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]}," ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/tokens/query-and-update-tokens#delete-tokens"},"children":["Delete the token"]}]}]},"headings":[{"value":"Create a token","id":"create-a-token","depth":1},{"value":"Create a card token request","id":"create-a-card-token-request","depth":2},{"value":"Create a token example request","id":"create-a-token-example-request","depth":3},{"value":"Responses","id":"responses","depth":3}],"frontmatter":{"seo":{"title":"Create a token"}},"lastModified":"2026-09-10T09:45:33.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/products/tokens/create-a-token","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}