bank
This endpoint validates a UK sort code and account number, and provides details about the bank and branch. Use it to instantly verify UK bank account details before setting up direct debits and payments.
Bank validation: Enable access on your API key using the Features page or by contacting us.
Request URL and body
https://ws.postcoder.com/pcw/{apikey}/bank
{
"sortcode": "{sortcode}",
"accountnumber": "{accountnumber}"
}
Path and body parameters
Parameter | Description | Example |
---|---|---|
apikey | Your API key | PCW45-12345-12345-1234X |
sortcode | The URL-encoded sortcode you wish to validate | 100000 |
accountnumber | The URL-encoded account number you wish to validate | 31510604 |
Querystring parameters
Parameter | Description | Example |
---|---|---|
format | Sets the format of the response, xml or json (default unless "application/xml" header is detected) | format=json |
identifier | Specifies your own meaningful identifier for the request such as "websiteA" or "client123"; you can view usage for each identifier on the Identifier Usage page, which may be helpful when using your API key across multiple websites, apps or clients | identifier=websiteA |
Example request and response
https://ws.postcoder.com/pcw/PCW45-12345-12345-1234X/bank?format=json
{
"sortcode": "100000",
"accountnumber": "31510604"
}
HTTP response body
{
"valid": true,
"stateid": 0,
"sortcode": "100000",
"accountnumber": "31510604",
"directdebits": true,
"fasterpayments": true,
"chaps": true,
"bacs": true,
"bankbic": "BKENGB33",
"branchbic": "XXX",
"bankname": "BANK OF ENGLAND",
"branchname": "HEAD OFFICE",
"addressline1": "Threadneedle Street",
"addressline2": "",
"addressline3": "",
"addressline4": "",
"posttown": "London",
"postcode": "EC2R 8AH",
"phone1": "020 34614717",
"phone2": ""
}
Response fields
Field | Description | Example |
---|---|---|
valid | A true / false indicating whether the sort code and account number are valid | true |
stateid | 0: This is a valid sortcode and account number combination -1: This is not a valid sortcode -2: This is not a valid sortcode and account number combination | 0 |
sortcode | The standardised version of the sort code; 6 digits long with no spaces or hyphens | 100000 |
accountnumber | The standardised version of the account number in the form expected for the Bankers' Automated Clearing System (BACS) | 31510604 |
directdebits | A true / false indicating whether the bank account can accept Direct Debits; note that not all accounts (such as savings accounts) can accept Direct Debits | true |
fasterpayments | A true / false indicating whether the bank account supports the Faster Payments Service (FPS) | true |
chaps | A true / false indicating whether the bank account supports sterling payments using the Clearing House Automated Payment System (CHAPS) | true |
bacs | A true / false indicating whether the bank account supports BACS | true |
bankbic | The Bank Identification Code (also known as the Swift Code) for the bank; an 8 to 11-character code that is used to identify the bank when you make an international transaction | BKENGB33 |
branchbic | The Bank Identification Code (also known as the Swift Code) for the branch; an 8 to 11-character code that is used to identify the branch when you make an international transaction | 339 |
bankname | The full name of the bank which is formally approved by the Payment Systems Regulator | BANK OF ENGLAND |
branchname | The full name of the branch which is formally approved by the Payment Systems Regulator | HEAD OFFICE |
addressline1 | The contact address for the branch to be used for BACs enquiries; usually a contact centre rather than the branch's physical address | Threadneedle Street |
addressline2 | ||
addressline3 | ||
addressline4 | ||
posttown | London | |
postcode | EC2R 8AH | |
phone1 | The primary telephone number for BACs enquiries including the country code (where international) and the area code | 020 76014717 |
phone2 | The secondary telephone number for BACs enquiries including the country code (where international) and the area code |
Integration advice
- URL encode all special characters (including /) in your request parameters with %xx encoding
- Verify your request was successful by checking for an HTTP status code of 200; see all HTTP status codes with descriptions
- No need to remove spaces, dashes, brackets or other non-numeric characters from the sort code and account number
- When using your API key across multiple websites, apps or clients, set the
identifier
querystring parameter to a meaningful value such as "websiteA" or "client123"; you'll then be able to view these identifiers and the number of requests made by each one on the Identifier Usage page - Requests will usually return within a second but could take up to 5 seconds
- The
valid
andstateid
response fields are always returned; treat all other response fields as optional
Credit cost
Each request costs 1.2 credits.
Buy a credit pack or set up a monthly plan to use with all Postcoder endpoints.