apyhub
Back
▣ DATA VALIDATION · FINANCE

Validate SWIFT/BIC API

Hosted on ApyHub

What it does

The SWIFT code validation API checks whether a BIC/SWIFT code is structurally valid and splits it into its parts. Send an 8 or 11 character code as bic in the request body. A valid code returns an object with valid, bank_code, country_code, location_code and branch_code. An invalid code returns data: false.

Use the SWIFT code validation API as a BIC validator in payment and payout forms, supplier onboarding, and payroll setup for international employees. Catching a mistyped SWIFT code at input is cheaper than a returned wire transfer, and the parsed country_code lets you confirm the bank country matches the rest of the record.

The parsed fields are useful beyond a yes or no check. Store bank_code and country_code as separate columns, normalize 8 character codes against their 11 character branch form, or flag records where the BIC country differs from the IBAN country in bulk cleanup of existing bank data.

This SWIFT code validator checks format and structure. It does not look up the bank name or address in the SWIFT directory. A valid result confirms a well-formed code, and your payment provider confirms that the account exists.

International payment details rarely arrive alone. Validate the account number with the IBAN Validation API, US bank codes with the Routing Number Validation API, and the business itself with the VAT Lookup API.

POST
Validate a BIC / SWIFT code
https://api.eu.apyhub.com/apyhub/validate-swift-bic-code

QUICKSTART

GUIDE

Quickstart

Validate a BIC/SWIFT code by sending it in a JSON body.

curl -X POST "https://api.eu.apyhub.com/apyhub/validate-swift-bic-code" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"bic":"ABNANL2A"}'

What you'll get back

Returns a JSON object with a data field. data can be either a boolean false when the BIC is invalid, or an object with validation details: valid, bank_code, branch_code, country_code, and location_code.

{
  "data": {
    "valid": true,
    "bank_code": "ABNA",
    "branch_code": "XXX",
    "country_code": "NL",
    "location_code": "2A"
  }
}
TRY ITLIVE · 5 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
BIC/SWIFT code to validate (8 or 11 characters).

About this endpoint

What it does

Validates a BIC/SWIFT code submitted in the request body. The response returns a data field whose shape depends on the validation result: either a boolean false for an invalid code, or an object with parsed BIC details and a valid flag.

Request Body

ParameterTypeMandatoryDescription
bicStringYesBIC/SWIFT code to validate. Must be 8 or 11 characters.

Response

Returns a JSON object with a required data field. data is either a boolean false when the BIC is invalid, or an object containing valid, bank_code, branch_code, country_code, and location_code fields.

ParameterTypeMandatoryDescription
dataBoolean or ObjectYesfalse when the BIC is invalid. When the BIC is valid, an object with the fields below.
data.validBooleanNotrue when the BIC is valid. Present only on the object form.
data.bank_codeStringNoFour-character institution code.
data.country_codeStringNoTwo-letter ISO country code.
data.location_codeStringNoTwo-character location code.
data.branch_codeStringNoThree-character branch code. Present on 11-character BICs.
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.