---
title: Validate a BSB
slug: api/validate-a-bsb
createdAt: 2026-10-19T00:11:18.260Z
---

{
  "id": "wwwlSerDmFzvybd_M1TP7",
  "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.\nThe format is a string in the following format: <code>999-999</code>.</p>\n<p>If the resulting <code>status</code> property contains <code>Ok</code>, examine <code>closed</code> to determine whether the\nbranch is still open. When <code>closed</code> is true, the <code>address</code> field may contain a reference to\na replacement BSB number.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "bsbNumber",
          "type": "string",
          "example": "123-456",
          "description": "<p><strong>Required</strong>. The BSB (Bank-State-Branch) number to look up, in the format 999-999. The separating hyphen may be omitted.</p>",
          "default": "123-456",
          "minLength": 6,
          "maxLength": 7,
          "pattern": "^\\d{3}-?\\d{3}$"
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "basicAuth",
          "name": "basicAuth",
          "kind": "optional",
          "type": "http",
          "description": "<p>To authenticate using basic authentication, generate an API key and pass it as the username. No password is required.</p>",
          "scheme": "basic"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful validation. The BSB was found and the branch details are returned.",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "example": "{\"bsb\":\"123-456\",\"closed\":false,\"address\":\"123 Example Street\",\"city\":\"Sydney\",\"state\":\"NSW\",\"postCode\":\"2000\",\"bankCode\":\"CBA\",\"durationMs\":42,\"status\":\"Ok\",\"statusDescription\":\"Operation completed successfully\"}",
            "description": "<p>The branch details held by the platform for the BSB (Bank-State-Branch) number supplied.</p>",
            "customType": "toolsBsbValidateResponse_V1",
            "schema": [
              {
                "name": "bsb",
                "kind": "required",
                "type": "string",
                "description": "<p><strong>Required</strong>. The BSBNumber that was passed as a parameter, formatted as 999-999.</p>",
                "example": "123-456",
                "default": "123-456",
                "pattern": "^\\d{3}-\\d{3}$"
              },
              {
                "name": "closed",
                "kind": "required",
                "type": "boolean",
                "description": "<p><strong>Required</strong>. Indicates if the branch has been closed. If true, the <code>address</code> field may contain a reference to a replacement BSB number.</p>",
                "example": false,
                "default": false
              },
              {
                "name": "address",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": "<p><strong>Conditional</strong>. The branch address. Returned when the BSB is found. If <code>closed</code> is true, this may instead contain a reference to a replacement BSB number.</p>",
                "example": "123 Example Street",
                "default": "123 Example Street",
                "pattern": "^$|^[A-Za-z0-9 ,.\\-/']{1,200}$"
              },
              {
                "name": "city",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": "<p><strong>Conditional</strong>. The branch city. Returned when the BSB is found.</p>",
                "example": "Sydney",
                "default": "Sydney",
                "pattern": "^$|^[A-Za-z0-9 ,.\\-']{1,100}$"
              },
              {
                "name": "state",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": "<p><strong>Conditional</strong>. The branch state e.g. NSW etc. Returned when the BSB is found.</p>",
                "example": "NSW",
                "default": "NSW",
                "pattern": "^$|^(ACT|NSW|NT|QLD|SA|TAS|VIC|WA)$"
              },
              {
                "name": "postCode",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": "<p><strong>Conditional</strong>. The branch post code. Four numeric digits. Returned when the BSB is found.</p>",
                "example": "2000",
                "default": "2000",
                "pattern": "^$|^\\d{4}$"
              },
              {
                "name": "bankCode",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": "<p><strong>Conditional</strong>. The bank code e.g. ANZ, CBA, NAB, WBC. Returned when the BSB is found. Two to six uppercase letters.</p>",
                "example": "CBA",
                "default": "CBA",
                "pattern": "^$|^[A-Z]{2,6}$"
              },
              {
                "name": "durationMs",
                "kind": "required",
                "type": "integer<int64>",
                "description": "<p><strong>Required</strong>. This value represents the total time in milliseconds that the Platform took to process the request.</p>",
                "example": 42,
                "default": 42,
                "format": "int64",
                "minimum": 0
              },
              {
                "name": "status",
                "kind": "required",
                "type": "string",
                "description": "<p><strong>Required</strong>. This is the status of the request. A code of 'Ok' indicates no errors.</p>",
                "example": "Ok",
                "default": "Ok",
                "pattern": "^[A-Za-z]{1,50}$"
              },
              {
                "name": "statusDescription",
                "kind": "required",
                "type": "string",
                "description": "<p><strong>Required</strong>. This is a description of the status. If an 'Ok' status is returned, then this will be 'Operation completed successfully'.</p>",
                "example": "Operation completed successfully",
                "default": "Operation completed successfully",
                "pattern": "^.{1,500}$"
              }
            ],
            "modelRef": "#/components/schemas/toolsBsbValidateResponse_V1",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "<p>Bad request. The request was rejected because a supplied value failed validation — for example an ABN that is not eleven numeric digits, a BSB that is not in the format 999-999, or a missing email subject or body. Inspect <code>statusDescription</code> for the specific reason.</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "example": "{\"durationMs\":8,\"status\":\"Invalid\",\"statusDescription\":\"The supplied ABN must be eleven numeric digits.\"}",
            "description": "Returned with HTTP 400 when the request could not be processed because a supplied value failed validation.",
            "customType": "badRequestResponse_V1",
            "schema": [
              {
                "name": "durationMs",
                "kind": "required",
                "type": "integer<int64>",
                "description": "<p><strong>Required</strong>. This value represents the total time in milliseconds that the Platform took to process the request before it was rejected.</p>",
                "example": 8,
                "default": 8,
                "format": "int64",
                "minimum": 0
              },
              {
                "name": "status",
                "kind": "required",
                "type": "string",
                "description": "<p><strong>Required</strong>. The status code identifying why the request was rejected. Any value other than 'Ok' indicates the request was not processed.</p>",
                "example": "Invalid",
                "default": "Invalid",
                "pattern": "^[A-Za-z]{1,50}$"
              },
              {
                "name": "statusDescription",
                "kind": "required",
                "type": "string",
                "description": "<p><strong>Required</strong>. A plain-language description of the validation failure, naming the field that was rejected where possible.</p>",
                "example": "The supplied ABN must be eleven numeric digits.",
                "default": "The supplied ABN must be eleven numeric digits.",
                "pattern": "^.{1,500}$"
              }
            ],
            "modelRef": "#/components/schemas/badRequestResponse_V1",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "401",
        "description": "<p>Unauthorized. The API key was missing, malformed or not recognised. Confirm the key is passed as the basic authentication username and that no password is supplied.</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "example": "{\"durationMs\":5,\"status\":\"Unauthorized\",\"statusDescription\":\"Authentication failed. Supply a valid API key as the basic authentication username.\"}",
            "description": "<p>Returned with HTTP 401 when the API key was missing, malformed or not recognised.</p>",
            "customType": "unauthorizedResponse_V1",
            "schema": [
              {
                "name": "durationMs",
                "kind": "required",
                "type": "integer<int64>",
                "description": "<p><strong>Required</strong>. This value represents the total time in milliseconds that the Platform took to process the request before authentication failed.</p>",
                "example": 5,
                "default": 5,
                "format": "int64",
                "minimum": 0
              },
              {
                "name": "status",
                "kind": "required",
                "type": "string",
                "description": "<p><strong>Required</strong>. The status code identifying the authentication failure.</p>",
                "example": "Unauthorized",
                "default": "Unauthorized",
                "pattern": "^[A-Za-z]{1,50}$"
              },
              {
                "name": "statusDescription",
                "kind": "required",
                "type": "string",
                "description": "<p><strong>Required</strong>. A plain-language description of the authentication failure. Confirm the API key is passed as the basic authentication username and that no password is supplied.</p>",
                "example": "Authentication failed. Supply a valid API key as the basic authentication username.",
                "default": "Authentication failed. Supply a valid API key as the basic authentication username.",
                "pattern": "^.{1,500}$"
              }
            ],
            "modelRef": "#/components/schemas/unauthorizedResponse_V1",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "500",
        "description": "<p>Internal server error. An unexpected error occurred while the platform was processing the request, or an upstream service (such as the Australian Business Registry) was unavailable. The request may be retried.</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "example": "{\"durationMs\":2043,\"status\":\"Exception\",\"statusDescription\":\"An unexpected error occurred while processing the request. Please contact support if the problem persists.\"}",
            "description": "Returned with HTTP 500 when an unexpected error occurred on the platform or an upstream service was unavailable.",
            "customType": "internalServerErrorResponse_V1",
            "schema": [
              {
                "name": "durationMs",
                "kind": "required",
                "type": "integer<int64>",
                "description": "<p><strong>Required</strong>. This value represents the total time in milliseconds that the Platform took before the error was raised.</p>",
                "example": 2043,
                "default": 2043,
                "format": "int64",
                "minimum": 0
              },
              {
                "name": "status",
                "kind": "required",
                "type": "string",
                "description": "<p><strong>Required</strong>. The status code identifying the failure. Any value other than 'Ok' indicates the request was not completed.</p>",
                "example": "Exception",
                "default": "Exception",
                "pattern": "^[A-Za-z]{1,50}$"
              },
              {
                "name": "statusDescription",
                "kind": "required",
                "type": "string",
                "description": "<p><strong>Required</strong>. A plain-language description of the error. The request may be retried; contact support if the problem persists.</p>",
                "example": "An unexpected error occurred while processing the request. Please contact support if the problem persists.",
                "default": "An unexpected error occurred while processing the request. Please contact support if the problem persists.",
                "pattern": "^.{1,500}$"
              }
            ],
            "modelRef": "#/components/schemas/internalServerErrorResponse_V1",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "example-0-curl",
          "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": "example-1-javascript",
          "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": "example-2-ruby",
          "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": "example-3-python",
          "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": "example-0-curl"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// Successful validation. The BSB was found and the branch details are returned.\n{\n  \"bsb\": \"123-456\",\n  \"closed\": false,\n  \"address\": \"123 Example Street\",\n  \"city\": \"Sydney\",\n  \"state\": \"NSW\",\n  \"postCode\": \"2000\",\n  \"bankCode\": \"CBA\",\n  \"durationMs\": 42,\n  \"status\": \"Ok\",\n  \"statusDescription\": \"Operation completed successfully\"\n}"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// Bad request. The request was rejected because a supplied value failed validation — for example an ABN that is not eleven numeric digits, a BSB that is not in the format 999-999, or a missing email subject or body. Inspect statusDescription for the specific reason.\n{\n  \"durationMs\": 8,\n  \"status\": \"Invalid\",\n  \"statusDescription\": \"The supplied ABN must be eleven numeric digits.\"\n}"
        },
        {
          "id": "response-2-401",
          "language": "401",
          "code": "// Unauthorized. The API key was missing, malformed or not recognised. Confirm the key is passed as the basic authentication username and that no password is supplied.\n{\n  \"durationMs\": 5,\n  \"status\": \"Unauthorized\",\n  \"statusDescription\": \"Authentication failed. Supply a valid API key as the basic authentication username.\"\n}"
        },
        {
          "id": "response-3-500",
          "language": "500",
          "code": "// Internal server error. An unexpected error occurred while the platform was processing the request, or an upstream service (such as the Australian Business Registry) was unavailable. The request may be retried.\n{\n  \"durationMs\": 2043,\n  \"status\": \"Exception\",\n  \"statusDescription\": \"An unexpected error occurred while processing the request. Please contact support if the problem persists.\"\n}"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}