Skip links

Check IBAN online with FileMaker and the MBS plugin.

Apply for an authcode at iban-test.de

Check IBAN online with FileMakerFor some months now, the old account numbers and sort codes have been obsolete in banking - IBAN and BIC are the magic words in banking today. For FileMaker developers, this means implementing new functions relating to the IBAN and BIC in their FileMaker solutions. There are already a number of custom functions available on the Internet for calculating an IBAN from a bank code and account number. However, due to not insignificant special cases when calculating an IBAN, you cannot always be sure that the IBAN has actually been calculated correctly with a pure formula. For this reason, it can be useful to check the plausibility of the calculated IBAN online in order to avoid calculating and saving an incorrect IBAN. In this article, we show how an IBAN can be checked online directly in FileMaker using the iban-test.de service and the API provided. The sample file shown in the article can be downloaded at the end of the article in the fmp12 format can be downloaded. The sample file uses functions of the MBS FileMaker plugin for API access.

Step 1: Apply for an API key at iban-test.de

To be able to check an IBAN via the iban-test.de API, we first need a corresponding authorization code for the API. To do this, call up the following page in your web browser iban-test.com and click in the Navigation bar on the button [API].

Apply for an authcode at iban-test.de

Now enter your name, e-mail address, website and type of use in the left-hand column. After clicking on the button [Create API key] a new window opens containing your auth code for the API. It is best to copy the code into a text editor and save the file.

Step 2: Create subscript for IBAN check in FileMaker

The API of iban-test.de can be addressed via an ordinary HTTP GET/POST request. In this step, we create a partial script that is called Script-parameter accepts an IBAN and returns a 1 (valid) or a 0 (invalid) as the result. In our example file, a dialog is displayed at the end of the script that shows whether the entered IBAN is valid or invalid.

Script: ts.IBAN_check

Set error recording [On]
# Script parameter: IBAN
Set variable [$iban; Value:Get(ScriptParameter)]
Set variable [$authcode; value:ibancheck::Authcode]
Set variable [$type; value:ibancheck:type]
#
Set variable [$r; Value:MBS("Trace")]
# Prepare transfer
Set variable [$authcode; value:MBS("StringEncodeURLComponent"; $authcode; "utf8")]
Set variable [$type; value:MBS("StringEncodeURLComponent"; $type; "utf8")]
Set variable [$iban; value:MBS("StringEncodeURLComponent"; $iban; "utf8")]
Set variable [$curl; Value:MBS("CURL.New")]
Set variable [$result; value:MBS("CURL.SetOptionpost"; $curl; 1)]
Set variable [$result; Value:MBS("CURL.SetOptionVerbose"; $curl; 1)]
Set variable [$result; Value:MBS("CURL.SetOptionURL"; "http://www.iban-test.de/api.php")]
# Set input parameters
Set variable [$content; value: "authcode=" & $authcode & "&" & "type=" & $type & "&" & "iban=" & $iban]
Set variable [$content; value:MBS("String.ReplaceNewline"; $content; 2 )]
Set variable [$result; Value:MBS("CURL.SetOptionPostFields"; $curl; $content)]
# Start transfer
Set variable [$result; Value:MBS("CURL.Perform"; $curl)]
# Result check
Set variable [$debugText; value:MBS("String.ReplaceNewline"; MBS("CURL.GetDebugAsText"; $curl); 1)]
Set variable [$resultText; Value:MBS("String.ReplaceNewline"; MBS("GetResultAsText"; $curl); 1)]
Set variable [$r; value:MBS("CURL.Cleanup"; $curl); 1)]
Set variable [$result; Value:If(PatternNumber($resultText; "200") > 0; 1; 0)]
Set variable [$result text; Value:If($result=0; "invalid"; "valid")]
# Test dialog
Display own dialog box ["IBAN" & $result text; "The IBAN entered is " & $result text

The script initially accepts the IBAN as a script parameter. To prevent any spaces within the IBAN, it is recommended to add the command Replace($iban; " "; "") to add.

Enter authcode

Enter authcode in FileMakerThe fields Authcode and Type are taken from the layout of the sample file - before you test the function, you must first enter your Authcode in the corresponding field that you requested on the iban-test.de website. For the type, please leave the default value check are available. Another type is the function create which can also be used to calculate an IBAN by specifying the bank code (&blz=), the account number (&ktn=) and the country code ($cc=). The procedure is the same as in our example file, with the difference that the three parameters mentioned must be supplied instead of the IBAN.

Prepare transfer

In the program section Transfer the three parameters are set to the correct form and the query URL is set. In our example, the URL

http://www.iban-test.de/api.php

is permanently integrated into the script - it can of course also be obtained dynamically from a field.

Start transfer

In the parts Set input parameters and Start transfer the parameters are put together, the fields are transferred and the transfer is started. The result check checks whether the result code 200 is a valid IBAN or whether it is invalid.

In our sample database, we have added a test dialog that shows whether the IBAN entered is valid or invalid.

Dialog IBAN valid

Integration into your own FileMaker solutions

In our example script, the last line is the command

Exit current script [Result: $result]

This command is not required for our example file. However, if you integrate the included script into your solution, it is advisable to integrate it as a partial script that returns as a value whether the supplied IBAN is valid or not. Please do not forget to remove the example dialog during integration ;-)

MBS FileMaker Plugin

This solution uses CURL functions of the MBS FileMaker Plugin. Tip: Until April 30, the MBS FileMaker plugin is available as part of the 20th anniversary at the K&K Verlag (FileMaker Magazine) in Hamburg at reduced prices. Further information on the MBS FileMaker Plugin can be found on the Website of the manufacturer.

Download sample file for FileMaker 12/13

Download FileMaker sample file

How to transfer scripts from the sample file to your solution

Scripts can be easily transferred from one FileMaker solution to another via the clipboard. Simply open the dialog Manage scriptsSelect the desired script with the mouse and copy the script to the clipboard using the [Edit - Copy] menu or [Ctrl/Cmd-C] key combination. Then open the same dialog in the target solution and simply paste the previously copied script using the [Edit - Paste] menu command.

To transfer tables from the example file to your solution

Tables can be inserted into an existing solution in several ways. The easiest way is to import the Table via the [Import...] button in the dialog Database Manage. All tables to be imported from the source solution can then be selected in a subsequent dialog. This method is therefore particularly suitable if several tables are to be imported at the same time. If only one table is to be imported, this can also be done via the clipboard like a script. If a table is to be imported together with its data, this can be done with the command [File > Import records > File]. In the import dialog, the target table New table must be specified.

How to transfer value lists from the example file to your solution

Value lists can be easily imported from one FileMaker solution to another via the clipboard. Simply open the dialog under [File/File > Manage > Value lists], select the desired value list and click on [Import]. Value list with the mouse and copy the value list to the clipboard using the [Edit - Copy] menu or the [Ctrl/Cmd-C] key combination. Then open the same dialog in the target solution and paste the previously copied value list using the [Edit - Paste] menu command.

How to transfer your own functions from the example file to your solution

In the [File > Manage > Custom functions...] dialog, click on the [Import] button and select the sample file. Select the desired custom functions in the following dialog and confirm the dialog. Please note that this function is only available in FileMaker Pro Advanced, but not in FileMaker Pro.

Leave a comment

  1. This reminds me of the good old days when we used to type listings for the C=64. Many thanks for the article and the sample file :-)

  2. Hello and good day,

    I am currently testing this script and get an "invalid" for every IBAN. Is the script still up to date?

    1. Here you may have to check whether the provider's interface is still up to date or whether it has been changed in the meantime.

Share this page:

ERP software as flexible as your company.
We will be happy to advise you.

Customizable ERP software for Mac, Windows and iOS.

You are here: Instructions: Check IBAN with FileMaker and the MBS Plugin online