---
title: Validate Token
slug: api/validate-token
docTags: 
createdAt: 2025-06-24T08:28:24.373Z
---

{
  "id": "TfVmVqGhM9h7KjbR3MYtD",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "https://api.mpay.com.au/token/v1/validate/{token}",
    "servers": [
      {
        "url": "https://api.mpay.com.au/token/v1/validate/{token}",
        "description": "Production URL"
      },
      {
        "url": "https://api.m-pay.com.au/token/v1/validate/{token}",
        "description": "Sandbox URL"
      }
    ],
    "name": "Validate Token",
    "description": "This API validates a token by passing a Token in the body.",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "token",
          "type": "string",
          "description": "<p>The text (GUID) that identifies the token.</p>"
        }
      ],
      "headerParameters": [],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "basicAuth",
          "name": "basicAuth",
          "kind": "optional",
          "type": "http",
          "scheme": "basic"
        }
      ]
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "successful validation",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "tokenValidateResponse_V1",
            "schema": [
              {
                "name": "status",
                "kind": "optional",
                "type": "string",
                "description": "This is the status of the request. A code of 'Ok' indicates no errors.",
                "example": ""
              },
              {
                "name": "statusDescription",
                "kind": "optional",
                "type": "string",
                "description": "This is a description of the status. If an 'Ok' status is returned, then this will be 'Operation completed successfully'.",
                "example": ""
              },
              {
                "name": "durationMs",
                "kind": "optional",
                "type": "integer<int64>",
                "description": "This value represents the total time in milliseconds that the Platform took to process the request.",
                "example": 0
              }
            ],
            "modelRef": "#/components/schemas/tokenValidateResponse_V1",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "MMu8JHY18063Tflt9rRvs",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url https://api.mpay.com.au/token/v1/validate/{token} \\\n     --header 'accept: application/json'"
        },
        {
          "id": "hJUmCB8Kt7PWTfOP6jnuz",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar requestOptions = {\n   method: 'GET',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.mpay.com.au/token/v1/validate/{token}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "tBLEy1JjuUqMZFQgnykeZ",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.mpay.com.au/token/v1/validate/{token}\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Get.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "FEYI4hhtGCP0QtNWHkl7J",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.mpay.com.au/token/v1/validate/{token}\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "MMu8JHY18063Tflt9rRvs"
    },
    "results": {
      "languages": [
        {
          "id": "oKQAsf18xB13IocXBsTd5",
          "language": "200",
          "code": "// successful validation\n{\n  \"status\": \"\",\n  \"statusDescription\": \"\",\n  \"durationMs\": \"\"\n}"
        }
      ],
      "selectedLanguageId": "oKQAsf18xB13IocXBsTd5"
    }
  },
  "children": [
    {
      "id": "WGdIdz10jVoIQZvLT9E24",
      "type": "paragraph",
      "children": [
        {
          "text": "This API validates a token by passing a Token in the body."
        }
      ]
    }
  ]
}