---
title: Validate a BSB
slug: api/validate-a-bsb
docTags: 
createdAt: 2025-06-24T08:27:01.570Z
---

{
  "id": "nFZ7K874EPSy82Twi9zQd",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "https://api.mpay.com.au/tools/v1/bsbValidate/{bsbNumber}",
    "servers": [
      {
        "url": "https://api.mpay.com.au/tools/v1/bsbValidate/{bsbNumber}",
        "description": "Production URL"
      },
      {
        "url": "https://api.m-pay.com.au/tools/v1/bsbValidate/{bsbNumber}",
        "description": "Sandbox URL"
      }
    ],
    "name": "Validate a BSB",
    "description": "<p>The purpose of this API is to return details about a BSB (Bank-State-Branch) number. The format is a string in the following format: '999-999'.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "bsbNumber",
          "type": "string",
          "description": "<p>BSB (Bank-State-Branch) number. The format is a string in the following format: '999-999'.</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": "toolsBsbValidateResponse_V1",
            "schema": [
              {
                "name": "bankCode",
                "kind": "optional",
                "type": "string",
                "description": "The bank code e.g. ANZ, CBA, NAB, WBC.",
                "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
              },
              {
                "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": "city",
                "kind": "optional",
                "type": "string",
                "description": "The branch city.",
                "example": ""
              },
              {
                "name": "address",
                "kind": "optional",
                "type": "string",
                "description": "The branch address.",
                "example": ""
              },
              {
                "name": "state",
                "kind": "optional",
                "type": "string",
                "description": "The branch state e.g. NSW etc.",
                "example": ""
              },
              {
                "name": "bsb",
                "kind": "optional",
                "type": "string",
                "description": "The BSBNumber that was passed as a parameter.",
                "example": ""
              },
              {
                "name": "status",
                "kind": "optional",
                "type": "string",
                "description": "This is the status of the request. A code of 'Ok' indicates no errors.",
                "example": ""
              },
              {
                "name": "postCode",
                "kind": "optional",
                "type": "string",
                "description": "The branch post code.",
                "example": ""
              },
              {
                "name": "closed",
                "kind": "optional",
                "type": "boolean",
                "description": "Indicates if the branch has been closed. If true, the address field may contain a reference to a replacement BSB number.",
                "example": ""
              }
            ],
            "modelRef": "#/components/schemas/toolsBsbValidateResponse_V1",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "kO2ra0BuBrL16SJnIk1hD",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url https://api.mpay.com.au/tools/v1/bsbValidate/{bsbNumber} \\\n     --header 'accept: application/json'"
        },
        {
          "id": "FvrJ2YsH8M3LF2urjNcz_",
          "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/tools/v1/bsbValidate/{bsbNumber}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "kmAlA-v5khF8qMEU_HeZT",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.mpay.com.au/tools/v1/bsbValidate/{bsbNumber}\")\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": "NkTqdllJ2qvwwSt0HtPV_",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.mpay.com.au/tools/v1/bsbValidate/{bsbNumber}\"\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": "kO2ra0BuBrL16SJnIk1hD"
    },
    "results": {
      "languages": [
        {
          "id": "asJVotbFy7g_Z-Nk91dZO",
          "language": "200",
          "code": "// successful validation\n{\n  \"bankCode\": \"\",\n  \"durationMs\": \"\",\n  \"statusDescription\": \"\",\n  \"city\": \"\",\n  \"address\": \"\",\n  \"state\": \"\",\n  \"bsb\": \"\",\n  \"status\": \"\",\n  \"postCode\": \"\",\n  \"closed\": false\n}"
        }
      ],
      "selectedLanguageId": "asJVotbFy7g_Z-Nk91dZO"
    }
  },
  "children": [
    {
      "id": "2h-FyJDERB567mimDuZ_Q",
      "type": "paragraph",
      "children": [
        {
          "text": "The purpose of this API is to return details about a BSB (Bank-State-Branch) number. The format is a string in the following format: '999-999'."
        }
      ]
    }
  ]
}