# Update bank details

`PUT /api/configuration/bank-details/{sortCode}`

- **Products:** Operator (`FOH`)
- **Features:** Front of House Generic Access (`FOHGENERIC`)

HTML version: [Update bank details](https://support.gladstonesoftware.cloud/reference/configuration/update-bank-details)

## Overview

Rewrites a stored bank record — the name, branch and postal address held against a UK sort code.
These records are reference data used when direct debit details are captured, not a member's own
bank account. Records are identified by sort code, so one record exists per sort code per tenant.

**This is a full replacement, not a partial update.** Every field in the table below is written on every
call.
Any field you leave out is written as null, wiping the stored value. To change one line of an
address you must send the whole record back — read it first with
`GET /api/configuration/bank-details/{sortCode}` and re-send every field you want to keep.

The sort code identifies the record and cannot be changed here: the value in the path and the value in
the body must be identical, and the record is looked up by that value. To move details to a
different sort code, create a new record and delete the old one.

The record must already exist. Unlike some configuration endpoints, an unknown sort code is reported
properly, with `404`. On success the response is `204 No Content` and the change is visible on
the next read.

## Endpoint

`PUT {base_url}/api/configuration/bank-details/{sortCode}`

`{base_url}` is the environment URL issued to your integration. See [Authenticating with Gladstone APIs](../../guides/authenticating-with-gladstone-apis.md).

## Path parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `sortCode` | string | Yes | Sort code of the bank record to rewrite — it has nothing to do with sorting results. It must match the `sortCode` in the body exactly, character for character, or the request fails with `400`. If no record exists for it the request fails with `404`. |

## Request body

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `sortCode` | string | Yes | The record's identifier, and the value used to find the record to update — so it identifies the record rather than changing it. Mandatory (`The Sort Code must not be empty`) and limited to 6 characters (`The Sort Code cannot be more than 6 characters`), so send the six digits without separators. Must equal the path value or the request fails with `SortCode {sortCode} does not match sortCode from object`. |
| `name` | string | Yes | The bank's name, as it should appear wherever the sort code is shown. Mandatory (`The Name must not be empty`), maximum 25 characters (`The Name cannot be more than 25 characters`) — a hard limit, with no leeway. |
| `branchName` | string | No | The branch this sort code belongs to. Maximum 25 characters (`The Branch Name cannot be more than 25 characters`). Written on every call: omit it and the stored branch name is cleared. |
| `propertyName` | string | No | First line of the branch address — the building name or number. Maximum 25 characters (`The Property Name cannot be more than 25 characters`). Omitting it clears the stored value. |
| `street` | string | No | Street of the branch address. Maximum 25 characters (`The Street cannot be more than 25 characters`). Omitting it clears the stored value. |
| `locality` | string | No | District or locality within the town, for addresses that need a line between street and town. Maximum 25 characters (`The Locality cannot be more than 25 characters`). Omitting it clears the stored value. |
| `town` | string | No | Town or city of the branch address. Maximum 25 characters (`The Town cannot be more than 25 characters`). Omitting it clears the stored value. |
| `region` | string | No | County, state or region of the branch address. Maximum 25 characters (`The Region cannot be more than 25 characters`). Omitting it clears the stored value. |
| `country` | string | No | Country of the branch address, as free text — there is no country code list behind this field. Maximum 25 characters (`The Country cannot be more than 25 characters`). Omitting it clears the stored value. |
| `postcode` | string | No | Postcode of the branch address. Maximum 10 characters (`The Postcode cannot be more than 10 characters`), which is the tightest limit on the record. No format validation is applied, so any 10-character string is accepted. Omitting it clears the stored value. |
| `telephone` | string | No | Contact telephone number for the branch, as free text with no format validation. Maximum 25 characters (`The Telephone cannot be more than 25 characters`). Omitting it clears the stored value. |

## Sample request

```bash title="cURL"
curl -X PUT '{base_url}/api/configuration/bank-details/{sortCode}' \
  -H 'Authorization: Bearer {accessToken}' \
  -H 'X-Use-SSO: true' \
  -H 'Content-Type: application/json' \
  -d '{
  "sortCode": "string",
  "name": "string",
  "branchName": "string",
  "propertyName": "string",
  "street": "string",
  "locality": "string",
  "town": "string",
  "region": "string",
  "country": "string",
  "postcode": "string",
  "telephone": "string"
}'
```

## Errors

| Status | Meaning | When |
|--------|---------|------|
| `400` | Bad request | The `sortCode` in the body differs from the one in the path — body is `SortCode {sortCode} does not match sortCode from object`. Checked first, before the record is looked up. |
| `400` | Bad request | Body validation failed: `sortCode` or `name` missing or blank, or any field over its maximum length. The response body is a validation problem document keyed by field name. |
| `404` | Not found | No bank record exists for that sort code — body is `Bank details with sortCode {sortCode} doesn't exist`. |
| `500` | Internal server error | An unexpected server-side failure, including a failure saving the record. No detail is returned. |
