Get bank details by sort code
GET /api/configuration/bank-details/{sortCode}
Success: 200 OK
- Products: Operator (
FOH) - Features: Front of House Generic Access (
FOHGENERIC)
Overview
Retrieves one bank record — its name, branch and postal address — from your tenant's own bank list.
The first thing to understand is what this endpoint is not. It is not a national sort code directory and it does not call any third-party bank data service. It reads a list that the operator maintains by hand, through Create bank details, Update bank details and Delete bank details. On a new tenant it is empty, and every lookup returns 404. A perfectly valid sort code that the operator has never entered is indistinguishable from an invalid one.
It is also not a validation service. Nothing else references this list — member and site bank accounts hold their own sort code independently, and are neither checked against these records nor kept in step with them. Treat this as an address book for display, not as a way of proving a sort code is real.
Matching is exact, with no normalisation: nothing is trimmed, and separators are not stripped or inserted. Writes cap the sort code at six characters, so records created through the API hold six unseparated digits. Ask for 123456; 12-34-56 and 12 34 56 will not match.
Every field other than sortCode can be null, so expect null in the response for anything the operator left blank. Only name is compulsory when the record is written.
There is no empty-result case: either the record exists and you get 200 with the object, or you get 404 with a plain-text message. Bank records have no active or status flag and nothing is filtered, so a record is visible until it is deleted.
To discover which sort codes exist rather than probing for one, call Get all bank details. Creating, updating or deleting a bank record is reflected here immediately.
Endpoint
GET {base_url}/api/configuration/bank-details/{sortCode}
{base_url} is the environment URL issued to your integration. See Authenticating with Gladstone APIs.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
sortCode | string | Yes | The sort code identifying the bank record, matched exactly — it has nothing to do with ordering results. Take the value from the sortCode field of Get all bank details. Up to 25 characters are accepted, but create and update reject anything longer than 6, so in practice this is six digits with no dashes or spaces. No trimming or reformatting is applied before the lookup, so a separator or a stray space produces 404 rather than a match. |
Sample request
curl -X GET '{base_url}/api/configuration/bank-details/{sortCode}' \
-H 'Authorization: Bearer {accessToken}' \
-H 'X-Use-SSO: true'Response fields
| Field | Type | Description |
|---|---|---|
sortCode | string | Echoes the sort code you asked for, exactly as held. It is unique within your tenant and always populated. Up to 25 characters, though writes are capped at 6 characters. |
name | string | The bank the sort code belongs to, as the operator typed it — this is a local label, not a value checked against any banking register. Compulsory on create and update, so records written through the API always have one, and at most 25 characters, which is short enough that operators abbreviate longer institution names. Records loaded by other means may return null. |
branchName | string | The branch this sort code identifies, as free text. Optional when created or updated, so null when the operator did not supply it. At most 25 characters. |
propertyName | string | The first line of the branch's postal address — a building name or number. Optional, so null when not supplied, and at most 25 characters. The address is split across propertyName, street, locality, town, region, country and postcode; none is derived from any other, and any of them may be blank, so build a display address by skipping the empty ones rather than assuming a fixed shape. |
street | string | The street part of the branch address. Optional, null when not supplied, at most 25 characters. Classed as contact information, so treat it accordingly when logging. |
locality | string | The district or locality within the town, where the operator has recorded one. Optional, null when not supplied, at most 25 characters. |
town | string | The town or city of the branch address. Optional, null when not supplied, at most 25 characters. |
region | string | The county, state or region of the branch address. Optional, null when not supplied, at most 25 characters. Free text, not drawn from any controlled list. |
country | string | The country of the branch address, as free text — not an ISO country code and not validated, so expect inconsistent spellings such as UK and United Kingdom within the same tenant. Optional, null when not supplied, at most 25 characters. |
postcode | string | The branch postcode, as free text with no format enforced — spacing and case are whatever the operator typed. Optional, null when not supplied, and at most 10 characters, which is the tightest limit on the record. |
telephone | string | A contact number for the branch, as free text — no format, dialling code or length is enforced, so do not assume it is dialable without cleaning. Optional, null when not supplied, at most 25 characters. Classed as contact information. |
Sample response
{
"sortCode": "123456",
"name": "Example Bank plc",
"branchName": "High Street",
"propertyName": "Bank House",
"street": "12 High Street",
"locality": null,
"town": "Cambridge",
"region": "Cambridgeshire",
"country": "United Kingdom",
"postcode": "CB2 1AB",
"telephone": "01223 000000"
}Errors
| Status | Meaning | When |
|---|---|---|
404 | Not found | No bank record exists under that exact sort code. The body is the plain-text message Bank details with sortCode {sortCode} doesn't exist, not JSON. In practice this most often means either the operator has never entered the bank, or you sent the sort code with separators or padding — the value is not normalised before the lookup. |
500 | Internal server error | Any unexpected server-side failure while reading the record. The response is a bare status code with no body, so the response carries nothing that identifies the cause. |