API Specification
This chapter contains information on the header, request and response body required to make a successful request with the IBAN-Name Check API for EU banks. At the bottom of the page, also information about the error scenario’s are described.
Click one of the buttons below to download the Yaml with the technical description and model of the API, the postman collection or a set of testcases which can be used on the sandbox environment.
Endpoints
Environment | Endpoint URL |
---|---|
Sandbox | Provided via MSafe after being requested |
Production | Provided via MSafe after being requested |
Headers
X-Correlation-Id
stringMandatoryContent-Type
application/jsonMandatoryAuthorization
BearerMandatoryX-End-User
string
Request body
accountId
objectMandatoryfinancialInstitutionId
objectname
string
Response body
The response has a different structure depending on the API call results.
- Successful response (HTTP 200 - described below)
- Error response (HTTPXXX - described in Errors)
result
objectAlways returned
Request
{
"accountId": {
"value": "NL72SRPY0000000001",
"type": "IBAN"
},
"name": "David Alex Miller"
}
Response
{
"result": {
"account": {
"accountHolderType": "NP",
"status": "ACTIVE"
},
"resultType": "MATCHING"
}
}
Status and error codes
V2 of the IBAN-Name Check API for EU banks, offered by Surepay, follows the industry standard of using HTTP response codes to provide feedback on the success or failure of an API request. Responses in the 2xx range are indicative of successful transactions, while responses in the 4xx range signify an error related to the provided data, such as a missing parameter or failed charge. In rare cases, responses in the 5xx range indicate an issue with SurePay's servers.
Error response body
errors
Array of objects
Error response
[
{
"errorCode": "INVALID_ACCOUNT_ID"
}
]
Technical Errors
HTTP Status Code | Description |
---|---|
400 - Bad request | The server could not understand the request due to invalid syntax. This may occur if the request contains malformed JSON, missing required parameters, or incorrect URL parameters. Please review your request format and try again. |
401 - Unauthorised | The request lacks valid authentication credentials. This may happen if the authorization header is missing or contains an invalid token. Ensure you are providing a valid token in the request header. |
403 - Forbidden | The server understood the request but refuses to authorize it. This can occur if the provided token has insufficient permissions or violates a security policy. Verify that your token has the correct scope and necessary permissions. |
500 - Internal server error | The server encountered an unexpected condition that prevented it from fulfilling the request. This may be due to an issue with the API gateway or an internal service. The response body might contain additional details based on the connected schema. Please try again later. |
429 - Too many requests | The client has sent too many requests in a given time frame, as indicated by the rate-limiting policy. To avoid this error, reduce the frequency of your requests and try again after some time. |
404 - Not Found | The server could not find the requested resource. This could be due to an incorrect URL or the resource being unavailable in the current data sources. Double-check the URL and ensure the resource exists. |
Functional errors
HTTP 400 - Bad Request
If the client's submitted request does not pass the validations, the service will return an Error Response object with the details of the issue. The possible ‘errorCodes’ are gathered in the following table:
HTTP 400 - Bad Request
[
{
"errorCode": "INVALID_IBAN"
}
]
Functional error | Description |
---|---|
INVALID_IBAN | The IBAN provided ‘accountId.value’ exceeds the maximum length (140 characters) or contains spaces or any of the following special characters !"#$%&' |
INVALID_BANKCODE | The provided bank code in the requested IBAN is not supported anymore or does not follow the expected format |
ID_OR_NAME_NOT_PROVIDED | The provided bank code in the requested IBAN is supported anymore or does not follow the expected format |
INVALID_CORRELATION_ID | A correlation ID is invalid if it does not match the regular expression, if its length is shorter than 1 or its length is longer than 70 characters |
INVALID_ID_TYPE | The provided ‘accountId.type’ is different than those supported by SurePay: IBAN, EMAIL, PHONE, SHORTENED_ACCOUNT, SORT_CODE_ACCOUNT_NUMBER |
INVALID_EMAIL | The value provided for any of the ‘accountId.type’ fields exceeds the maximum length (140 characters) or contains spaces or any unallowed special characters |
INVALID_SHORTENED_ACCOUNT | The value provided for any of the ‘accountId.type’ fields exceeds the maximum length (140 characters) or contains spaces or any unallowed special characters |
INVALID_SORT_CODE | The value provided for any of the ‘accountId.type’ fields exceeds the maximum length (140 characters) or contains spaces or any unallowed special characters |
HTTP 404 - Not found
If the client's submitted request cannot be found, the service will return an Error Response object with the details of the issue. The possible ‘errorCodes’ are gathered in the following table:
HTTP 404 - Not found
[
{
"errorCode": "PAYID_UNKNOWN"
}
]
Functional error | Description |
---|---|
PAYID_UNKNOWN | The requested PayID cannot be found |
IBAN_UNKNOWN | The requested IBAN cannot be found |
SHORTENED_ACCOUNT_NUMBER_NOT_FOUND | The requested shortened account number cannot be found |
IBAN_IGNORED_FOR_MATCHING | The requested IBAN was not considered for matching because it was identified in SurePay’s derived dataset. |