Person Verification Using Financial Data
Verify your data against our comprehensive dataset, including financial records
Know Your Customer (KYC) and Anti-Money Laundering (AML) checks are critical for compliance and fraud prevention, requiring businesses to verify customer identities before engagement.
Our advanced verification process cross-references names and addresses against a comprehensive dataset, including financial records, bank details, credit bureau data, and official sources like the Electoral Register. This robust approach ensures fast, accurate, and reliable identity verification, protecting businesses from financial crime.
We also offer bulk person verification checks using the person_verify_bulk method.
Verify your data against our UK financial data sources.
If you can provide a name and address, we can search our dataset of financial records and provide you with a match.
Your data MUST contain:-
- Surname
- Forename / first initial
- UK Postcode
- UK Address
Mandatory Parameters
None of the parameters are case sensitive apart from the api key or javascript key.
Name | Description |
---|---|
api_key or javascript_key |
Use your API key if invoking server-side. If invoking from the browser via JavaScript, generate a JavaScript key using the javascript_key method. |
surname | The surname of the subject. The case is irrelevant. |
forename | The forename of the subject. If initial_match is set to true, this can be also be just the first letter. |
postcode | The postcode of the subject.
This can be in any case and any format (such as YO98 9HZ or yo989HZ) |
addr1 | The first line of the address |
Optional Parameters
Name | Description |
---|---|
client | You can optionally include an identifier for your final client or user. This is logged in your usage log and you will be able to view your usage statistics by client. |
output | Set to json for a JSON response; the default response is XML. Not applicable to the SOAP API. |
callback | When using JSON, specify a JSONP wrapper in which the JSON response is to be wrapped. |
addr2 | The second line of the address |
addr3 | The third line of the address |
place | The locality |
town | The postal town |
dob_y | Enter a year element for a date of birth in the format yyyy to filter records by age |
dob_m | Enter a month element for a date of birth in the format mm to filter records by age. Range of values is: 01 - 12 |
dob_d | Enter a day element for a date of birth in the format dd to filter records by age. Range of values: 01 - 31 |
surname_fuzzy | Set to true (default) to allow a slight fuzzy match. |
forename_fuzzy | Set to true (default) to allow a slight fuzzy match. |
use_current_data | Set to true (default) to search against current occupants. |
use_historic_data | Set to true to search against historic data. By default the selection is false. |
postcode_fix | Set to true or y to enable postcode correction, the default is false. Further information on postcode corrector |
data_source | Set to true or y to show the data sources from which we found a match. |
always_use_financial | From t2a_version 3.7.5.6, this forces the method to always check against the financial data, even if the record has already been matched in the regular data sources. Set to true or y to enable always_use_financial, the default is false. |
Returned Values
The XML response is contained within a <person_verify_financial_res>
element.
Name | Description |
---|---|
status | Returns ok if the operation has succeeded, or error if an
error has occurred; Returns the error_code for error details. |
error_code | Returns the error code when the status is error . See below for error codes. |
t2a_version_number | The current API version number. |
credit_used | The number of credits used in order to execute the request. |
validation_status |
Set to:-
NOT_FOUND when the person could not be validated. FOUND when a person has been validated. FOUND_HISTORIC when a person has been validated against historic data (requires 'use_historic_data' setting to true), an example response can be seen below. TOO_MANY when the search parameters indicates more than one person sharing the full name. |
match_code_surname | Describes how we matched the surname. Possible values:-
|
match_code_forename | Describes how we matched the forename. Possible values:-
|
match_code_address |
Describes how we matched the address. Possible values:-
|
end_date | If historic data is used (requires 'use_historic_data' setting to true), and an historic record is found, an end_date in a date_details structure, is supplied. The end_date is the last recorded date of the individual at the searched address. |
fixed_postcode | Returns a corrected postcode, where the API has found that the supplied postcode was incorrect, within the conditions described above.
The postcode will be formatted with a space, e.g: - <fixed_postcode>YO23 3XP</fixed_postcode> |
Additional Returned Values
The XML response is contained within a <person_verify_financial_res>
element.
Name | Description |
---|---|
data_source_match_list | An array of data_source_match elements, only supplied if the parameter data_source is set to true or y. |
Data_Source_Match Structure
This structure is always used in a list. It describes the match made, for each data source that returned a match.
Name | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
name | The data source for which this instance describes the match. Possible values:-
|
||||||||||
match_code_surname | The surname match information, for this data source. |
||||||||||
match_code_forename | The forename match information, for this data source. |
||||||||||
match_code_address | The address match information, for this data source. |
||||||||||
match_code_postcode | The postcode match information, for this data source. |
||||||||||
match_code_dob | The date of birth match information, for this data source. |
||||||||||
match_code_tel | The telephone match information, for this data source. |
||||||||||
created | The date that this data source was inserted into our data. This may not be available. |
||||||||||
deleted | The date that this data source was deleted from our data (if applicable). This may not be available. |
||||||||||
extra_match | A financial_extra_match instance. Only used when the name is "FINANCIAL" |
Financial Extra
Introduced in January 2025, we now provide additional information with the data source information, where hat data source is a FINANCIAL type.
The extra data is delivered in an instance of the financial_extra_match structure, and children thereof. The instance is named extra_match.
Financial_Extra_Match Structure
Our service provider sends us a complex data structure, of information about the person verification match. We have supplied the key portions of the data, giving our clients more information regarding a successful match against the financial data.
Name | Description | ||||
---|---|---|---|---|---|
decision |
The overall match decision recommendation, based on the list of decisions. Possible values are:-
|
||||
decision_list |
A list of financial_decision instances. Each instance represents a decision service, against which the person's identity has been checked. The structure will show key information, including:-
|
Financial_Decision Structure
Name | Description | ||||
---|---|---|---|---|---|
service_name |
The code of the verification service. The uk-idv service has the most information; the match_list and rule_list elements are normally present for that service. The contra indicators service is executed at the end. This checks for any reasons why a match by the earlier services, should still fail; the main reason would be that the person is deceased. |
||||
reason |
A brief description of the reason for the decision. |
||||
decision |
The match decision of this verification service.
|
||||
match_list |
A list of financial_match_decision_element_match instances, describing the data sources for which this service matched the input data. |
||||
rule_list |
A list of financial_match_decision_element_rule instances, a list of the rules that were executed when checking the input data. |
Financial_Match_Decision_Element_Match Structure
Name | Description |
---|---|
code |
The data source that has been matched, see this list |
value |
The reporting value of the associated data source, where oldest_date is not set. |
oldest_date |
A date_details containing the oldest date found, in this match type. |
Financial_Match_Decision_Element Match Codes
These are the most commonly seen codes; some of the acronyms are explained.
Code | Notes |
---|---|
OldestItemsCurrentAddressVotersRollPerson | |
OldestItemsCurrentAddressCAIS | CAIS is Credit Account Information Sharing |
OldestDataSourcesAllEIdCurrentAddress | Eid is E-IdentityCheck |
OldestDataSourcesPrimaryCurrentAddress | |
OldestDataSourcesSecondaryCurrentAddress | |
OldestItemsAllEIdCurrentAddress | |
OldestItemsAllEIdNameAddress | |
OldestItemsAllEIdNameAddressDoB | |
OldestItemsCurrentAddressAssociations | |
OldestItemsCurrentAddressAssociationsCAPS | CAPS is Credit Application |
Previous Searches | |
OldestItemsCurrentAddressCAISCreditStoreCard | |
OldestItemsCurrentAddressCAISCurrentAccounts | |
OldestItemsCurrentAddressCAISFinance | |
OldestItemsCurrentAddressCAISInsuranceServices | |
OldestItemsCurrentAddressCAISMediaServicesAndCommunications | |
OldestItemsCurrentAddressCAISMortgage | |
OldestItemsCurrentAddressCAISRentalLeasing | |
OldestItemsCurrentAddressCAISUnsecuredLoan | |
OldestItemsCurrentAddressCAISUtilities | |
OldestItemsCurrentAddressCAPS | |
OldestItemsPrimaryCurrentAddress | |
OldestItemsPrimaryNameAddress | |
OldestItemsPrimaryNameAddressDoB | |
OldestItemsSecondaryCurrentAddress | |
OldestItemsSecondaryNameAddressDoB |
Financial_Match_Decision_Element_Rule Structure
This structure shows a rule that has been implemented, when trying to match the input data to a person.
Element |
Description |
Text |
A description of the rule, for example:- |
Score |
Integer score. 0 means the rule failed to match. |
Example Response with Financial Extra Match
{ "data_source_match_list":[ { "name":"ER", "match_code_forename":"FULL", "match_code_surname":"FULL", "match_code_address":"PARTIAL", "match_code_tel":"", "match_code_dob":"", "match_code_postcode":"FULL", "created":{ "y":"2023", "m":"4", "d":"2", "en":"2 Apr 2023" } }, { "name":"FINANCIAL", "match_code_forename":"FULL", "match_code_surname":"FULL", "match_code_address":"FULL", "match_code_tel":"", "match_code_dob":"", "match_code_postcode":"FULL", "extra_match":{ "response_type":"INFO", "request_type":"CCIS-Full", "decision":"CONTINUE", "decision_list":[ { "service_name":"uk-crpverify", "reason":"Processing completed successfully", "next_action":"Continue", "decision":"CONTINUE", "decision_source":"uk-crpverify", "decision_text":"Continue", "decision_time":"2025-01-20T08:31:43Z" }, { "service_name":"uk-idv", "reason":"Identity verified", "next_action":"Continue", "decision":"CONTINUE", "decision_source":"uk-idverify", "decision_text":"CONTINUE", "decision_time":"2025-01-20T08:31:43Z", "match_list":[ { "code":"OldestItemsCurrentAddressCAIS", "oldest_date":{ "y":"2023", "m":"2", "d":"3", "en":"3 Feb 2023" } }, { "code":"OldestItemsCurrentAddressCAISUnsecuredLoan", "oldest_date":{ "y":"2023", "m":"12", "d":"11", "en":"11 Dec 2023" } }, { "code":"OldestItemsCurrentAddressCAISMediaServicesAndCommunications", "oldest_date":{ "y":"2023", "m":"12", "d":"3", "en":"3 Dec 2023" } }, { "code":"OldestItemsCurrentAddressCAISCreditStoreCard", "oldest_date":{ "y":"2023", "m":"3", "d":"1", "en":"1 Mar 2023" } }, { "code":"OldestItemsCurrentAddressCAISCurrentAccounts", 14 ©Simunix Ltd 2025 "oldest_date":{ "y":"2023", "m":"3", "d":"1", "en":"1 Mar 2023" } }, { "code":"OldestItemsCurrentAddressCAISUtilities", "oldest_date":{ "y":"2023", "m":"2", "d":"3", "en":"3 Feb 2023" } }, { "code":"OldestItemsCurrentAddressCAISFinance", "oldest_date":{ "y":"2024", "m":"6", "d":"8", "en":"8 Jun 2024" } }, { "code":"OldestItemsPrimaryCurrentAddress", "oldest_date":{ "y":"2023", "m":"2", "d":"3", "en":"3 Feb 2023" } }, { "code":"OldestItemsAllEIdCurrentAddress", "oldest_date":{ "y":"2023", "m":"2", "d":"3", "en":"3 Feb 2023" } }, { "code":"OldestItemsAllEIdNameAddressDoB", "oldest_date":{ "y":"2023", "m":"2", "d":"3", "en":"3 Feb 2023" } }, { 15 ©Simunix Ltd 2025 "code":"OldestItemsPrimaryNameAddressDoB", "oldest_date":{ "y":"2023", "m":"2", "d":"3", "en":"3 Feb 2023" } }, { "code":"OldestDataSourcesPrimaryCurrentAddress", "oldest_date":{ "y":"2023", "m":"2", "d":"3", "en":"3 Feb 2023" } }, { "code":"OldestDataSourcesAllEIdCurrentAddress", "oldest_date":{ "y":"2023", "m":"2", "d":"3", "en":"3 Feb 2023" } } ], "rule_list":[ { "text":"Two or more Primary Data Sources, each with a name and address and DoB", "score":"1" }, { "text":"2 or more Primary Sources with a name & add, incl. at least one Primary w/ name, add, DoB", "score":"1" }, { "text":"Two or more Primary Data Sources, with a name and address but no DoB", "score":"0" }, { "text":"1 or more Primary and one or more Secondary, each with name, add, DoB", "score":"0" }, { "text":"2 or more Primary or Secondary w/ name & add incl. at least 1 Primary w/ name, add, DoB", "score":"0" }, { "text":"2+ Prim w/name,add,DoB, or 1 Prim. & 2nd w/name,add w/ 1+ of Prim or 2nd incl name,add,DoB", "score":"1" }, { "text":"2 or more Prim. or Second. w/ name & add, incl. at least 1 Secondary w/ name, add, DoB", "score":"0" }, { "text":"At least one Primary Data Source, with a name and address and DoB", "score":"1" }, { "text":"At least one Primary Data Source, with a name and address", "score":"1" }, { "text":"At least one Data Source, with a name and address", "score":"1" }, { "text":"This rule is always true", "score":"1" }, { "text":"No other rule has fired", "score":"0" } ] }, { "service_name":"uk-contras", "reason":"No Contra-indicator alerts", "next_action":"Continue", "decision":"CONTINUE", "decision_source":"uk-contras", "decision_text":"CONTINUE", "decision_time":"2025-01-20T08:31:43Z", "rule_list":[ { "text":"Existence of a Mortality Record from the Halo/Millennium data source", "score":"0" }, { "text":"No other rule has fired", "score":"1" } ] } ] } } ], "match_code_tel":"NO_DATA", "validation_status":"FOUND", "match_code_forename":"FULL", "match_code_surname":"FULL", "match_code_address":"FULL", "financial_data_used":"true", "transaction_id":"3cd0431bde643e0200b34c96c2e5f8d1", "match_code_dob":"NO_DATA", "match_code_postcode":"FULL", "searched_name":"", "mode":"normal", "chargeable":"false", "t2a_version_number":"3.7.5.6", "status":"ok", "credit_used":"0" }
Error Codes
Name |
Description |
missing_surname |
Mandatory parameter |
missing_forename |
Mandatory parameter |
missing_addr1 |
Mandatory parameter |
missing_postcode |
Mandatory parameter |
invalid_postcode |
The postcode is not a valid UK postcode.
|
See the common error codes.
Perfect Match Example
Note that the match codes are all FULL for the name and address values.
<?xml version="1.0"?> <person_verify_financial_res> <status>ok</status> <credit_used>40</credit_used> <mode>normal</mode> <chargeable>true</chargeable> <t2a_version_number>3.7.5.6</t2a_version_number> <validation_status>FOUND</validation_status> <match_code_forename>FULL</match_code_forename> <match_code_surname>FULL</match_code_surname> <match_code_address>FULL</match_code_address> <financial_data_used>false</financial_data_used> <transaction_id>abc123456</transaction_id> <match_code_dob>NO_DATA</match_code_dob> <match_code_postcode>FULL</match_code_postcode> <searched_name>John Smith</searched_name> <match_code_tel>NO_DATA</match_code_tel> </person_verify_financial_res>
Successful Fuzzy Match Example
<?xml version="1.0"?> <person_verify_financial_res> <status>ok</status> <credit_used>40</credit_used> <mode>normal</mode> <chargeable>true</chargeable> <t2a_version_number>3.7.5.6</t2a_version_number> <validation_status>FOUND</validation_status> <match_code_forename>FUZZY</match_code_forename> <match_code_surname>FULL</match_code_surname> <match_code_address>FULL</match_code_address> <financial_data_used>false</financial_data_used> <transaction_id>abc123456</transaction_id> <match_code_dob>NO_DATA</match_code_dob> <match_code_postcode>FULL</match_code_postcode> <searched_name>Jon Smith</searched_name> <match_code_tel>NO_DATA</match_code_tel> </person_verify_financial_res>
Exact Match Failure Example
The forename has been mis-spelt but forename_fuzzy and surname_fuzzy are both set to false.
<?xml version="1.0"?> <person_verify_financial_res> <status>ok</status> <credit_used>40</credit_used> <mode>normal</mode> <chargeable>true</chargeable> <t2a_version_number>3.7.5.6</t2a_version_number> <validation_status>NOT_FOUND</validation_status> <match_code_forename>NO_MATCH</match_code_forename> <match_code_surname>NO_MATCH</match_code_surname> <match_code_address>NO_MATCH</match_code_address> <financial_data_used>false</financial_data_used> <transaction_id>abc123456</transaction_id> <match_code_dob>NO_DATA</match_code_dob> <match_code_postcode>NO_MATCH</match_code_postcode> <searched_name>Jon Smith</searched_name> <match_code_tel>NO_DATA</match_code_tel> </person_verify_financial_res>
Example Of Historic Match Response
In this example we have set use_historic_data to true, to return a match against historic records.
<?xml version="1.0"?> <person_verify_financial_res> <status>ok</status> <credit_used>40</credit_used> <mode>normal</mode> <chargeable>true</chargeable> <t2a_version_number>3.7.5.6</t2a_version_number> <validation_status>FOUND_HISTORIC</validation_status> <match_code_forename>FULL</match_code_forename> <match_code_surname>FULL</match_code_surname> <match_code_address>FULL</match_code_address> <financial_data_used>false</financial_data_used> <transaction_id>abc123456</transaction_id> <match_code_dob>NO_DATA</match_code_dob> <match_code_postcode>FULL</match_code_postcode> <searched_name>John Smith</searched_name> <match_code_tel>NO_DATA</match_code_tel> <end_date> <y>2017</y> <m>12</m> <d>1</d> <en>1 Dec 2017</en> </end_date> </person_verify_financial_res>
Example Of Data Source Match List
In this example we have set data_source to true, to view the list of data sources matched.
<?xml version="1.0"?> <person_verify_financial_res> <status>ok</status> <credit_used>40</credit_used> <mode>normal</mode> <chargeable>true</chargeable> <t2a_version_number>3.7.5.6</t2a_version_number> <validation_status>FOUND</validation_status> <match_code_forename>FUZZY</match_code_forename> <match_code_surname>FULL</match_code_surname> <match_code_address>PARTIAL</match_code_address> <financial_data_used>false</financial_data_used> <transaction_id>abc123456</transaction_id> <match_code_dob>NO_DATA</match_code_dob> <match_code_postcode>FULL</match_code_postcode> <searched_name>Jon Smith</searched_name> <data_source_match_list> <data_source_match> <name>ER</name> <match_code_forename>FUZZY</match_code_forename> <match_code_surname>FULL</match_code_surname> <match_code_address>PARTIAL</match_code_address> <match_code_tel/> <match_code_dob/> <match_code_postcode>FULL</match_code_postcode> <created> <y>2017</y> <m>12</m> <d>15</d> <en>15 Dec 2017</en> </created> </data_source_match> </data_source_match_list> <match_code_tel>NO_DATA</match_code_tel> </person_verify_financial_res>
What is the Postcode Corrector?
Our research, on several years usage of our verification methods suggests that there is a small number of slightly incorrect postcodes in submitted data, where every other parameter matches.
We have now added an additional optional facility to correct a UK postcode.
There is no additional charge for this facility.
A UK Postcode is formed of two parts, for example: -
YO23 3XP
In a UK postcode, the first part (the postcode outer) represents an area; when used with the first letter of the second part ("YO23 3" in the above example) represents a sector within that area.
The postcode will only be corrected, if that correction only changes one or both of the final 2 characters.
Our API will only attempt to correct a postcode, when enough street information has been supplied in the address line 1.
For example, in the example below, the incorrect postcode can be corrected, because the address line 1 contains enough information for the API to locate the correct address, in the YO23 3 postcode sector: -
Address Line 1 | Incorrect Postcode | Corrected Postcode |
---|---|---|
3 Ropers Court | YO23 3AD | YO23 3XP |
If the postcode is corrected, our API then uses that postcode to attempt to validate the person, and it also informs you of the corrected postcode, so that you may correct your own records.
There are two ways to authenticate your application with the T2A API. The two implementation examples on this page cover each type of authentication
We recommend using an API key for internal applications and the javascript key for public facing applications where you would want to protect your API key.
Please note: The examples below run on a sandbox environment which return sample data. To quality check the data we provide, up to 3 free searches are available in the demo tab with results showing live [REDACTED] data.
API key
<div class="person-verify-financial-example"> <form class="person-verify-financial-form"> <div class="form-group"> <label for="surname">Surname</label> <input type="text" class="form-control" id="surname" placeholder="Person's surname e.g Fawcett"> </div> <div class="form-group"> <label for="surname">Forename</label> <input type="text" class="form-control" id="forename" placeholder="Person's forename e.g John"> </div> <div class="form-group"> <label for="surname">Postcode</label> <input type="text" class="form-control" id="postcode" placeholder="UK Postcode"> </div> <div class="form-group"> <label for="surname">Address</label> <input type="text" class="form-control" id="addr1" placeholder="UK Address (First line)"> </div> <button type="submit" class="btn example-submit">Submit</button> </form> </div> <div class="results"> <div id="results-output"></div> <a class="results-return" href="#">Back to search</a> </div>
.person-verify-financial-example, .results { margin: 20px auto; width: 400px; } form.person-verify-financial-form, .results { background-color: #F6F6F6; border: 1px solid #CBCBCB; padding: 15px; } .example-submit { background-color: #F0614C; border-radius: 2px; font-size: 11px; font-weight: 400; color: #fff; text-transform: uppercase; letter-spacing: 0.193em; width: 138px; height: 41px; margin-top: 10px; } .results { display: none; } .results-return { font-weight: 600; color: #F0614C; } #results-output span { font-weight: bold; text-transform: capitalize; } #results-output hr { border-top: 1px solid #000; } .error { font-size: 11px; color: #f00; } p.not_found { font-weight: bold; color: red; } p.found { font-weight: bold; color: green; }
$(document).ready(function(){ $(".person-verify-financial-form").submit(function(e) { e.preventDefault(); $('.error', $(this)).remove(); var surname = $("#surname"); if(!surname.val()) { errorBefore("Please enter a surname.", surname); } var forename = $("#forename"); if(!forename.val()) { errorBefore("Please enter a forename.", forename); } var postcode = $("#postcode"); if(!postcode.val()) { errorBefore("Please enter a postcode.", postcode); } var addr1 = $("#addr1"); if(!addr1.val()) { errorBefore("Please enter an address.", addr1); } if($('.error', $(this)).length) { $('.error', $(this)).first().next('input').focus(); } else { $.ajax({ url: 'https://api.t2a.io/rest/rest.aspx', dataType: 'json', data: { 'method' : "person_verify_financial", 'api_key' : 'sandbox', 'surname' : surname.val(), 'forename' : forename.val(), 'postcode' : postcode.val(), 'addr1' : addr1.val(), 'output' : 'json' }, success: function(result){ if(result.validation_status == "NOT_FOUND") { $('#results-output').append('<p class="output not_found">'+forename.val()+' '+surname.val()+' was not found at the specificed address') }; if(result.validation_status == "FOUND") { $('#results-output').append('<p class="output found">'+forename.val()+' '+surname.val()+' was found at the specified address') }; $('.person-verify-financial-example').hide(); $('.results').show(); } }); } }); $('.results-return').on('click', function(e){ e.preventDefault(); $('#results-output').empty(); $('.person-verify-financial-example').show(); $('.results').hide(); }); }); function errorBefore(msg, insertBefore) { $('<p class="error">' + msg + '</p>').insertBefore(insertBefore); }
Javascript key
<div class="person-verify-financial-example"> <form class="person-verify-financial-form"> <div class="form-group"> <label for="surname">Surname</label> <input type="text" class="form-control" id="surname" placeholder="Person's surname e.g Fawcett"> </div> <div class="form-group"> <label for="surname">Forename</label> <input type="text" class="form-control" id="forename" placeholder="Person's forename e.g John"> </div> <div class="form-group"> <label for="surname">Postcode</label> <input type="text" class="form-control" id="postcode" placeholder="UK Postcode"> </div> <div class="form-group"> <label for="surname">Address</label> <input type="text" class="form-control" id="addr1" placeholder="UK Address (First line)"> </div> <button type="submit" class="btn example-submit">Submit</button> </form> </div> <div class="results"> <div id="results-output"></div> <a class="results-return" href="#">Back to search</a> </div>
.person-verify-financial-example, .results { margin: 20px auto; width: 400px; } form.person-verify-financial-form, .results { background-color: #F6F6F6; border: 1px solid #CBCBCB; padding: 15px; } .example-submit { background-color: #F0614C; border-radius: 2px; font-size: 11px; font-weight: 400; color: #fff; text-transform: uppercase; letter-spacing: 0.193em; width: 138px; height: 41px; margin-top: 10px; } .results { display: none; } .results-return { font-weight: 600; color: #F0614C; } #results-output span { font-weight: bold; text-transform: capitalize; } #results-output hr { border-top: 1px solid #000; } .error { font-size: 11px; color: #f00; } p.not_found { font-weight: bold; color: red; } p.found { font-weight: bold; color: green; }
$(document).ready(function(){ $(".person-verify-financial-form").submit(function(e) { e.preventDefault(); $('.error', $(this)).remove(); var surname = $("#surname"); if(!surname.val()) { errorBefore("Please enter a surname.", surname); } var forename = $("#forename"); if(!forename.val()) { errorBefore("Please enter a forename.", forename); } var postcode = $("#postcode"); if(!postcode.val()) { errorBefore("Please enter a postcode.", postcode); } var addr1 = $("#addr1"); if(!addr1.val()) { errorBefore("Please enter an address.", addr1); } if($('.error', $(this)).length) { $('.error', $(this)).first().next('input').focus(); } else { $.ajax({ url: 'https://t2a.io/ajax/getExampleJSKey', dataType: 'json', success: function (result) { if (result.status) { $.ajax({ url: 'https://api.t2a.io/rest/rest.aspx', dataType: 'json', data: { 'method' : "person_verify_financial", 'javascript_key' : result.javascript_key, 'domain' : "t2a.io", 'surname' : surname.val(), 'forename' : forename.val(), 'postcode' : postcode.val(), 'addr1' : addr1.val(), 'output' : 'json' }, success: function(result){ if(result.validation_status == "NOT_FOUND") { $('#results-output').append('<p class="output not_found">'+forename.val()+' '+surname.val()+' was not found at the specificed address') }; if(result.validation_status == "FOUND") { $('#results-output').append('<p class="output found">'+forename.val()+' '+surname.val()+' was found at the specified address') }; $('.person-verify-financial-example').hide(); $('.results').show(); } }); } } }); } }); $('.results-return').on('click', function(e){ e.preventDefault(); $('#results-output').empty(); $('.person-verify-financial-example').show(); $('.results').hide(); }); }); function errorBefore(msg, insertBefore) { $('<p class="error">' + msg + '</p>').insertBefore(insertBefore); }
This example first needs to call to a file on your server, which will provide the user with an API key from your javascript key.
In our example above we have used a PHP file located at ajax/getExampleJSKey
which looks like the example below
<?php $url = 'https://api.t2a.io/rest/rest.aspx' . "?method=javascript_key" . "&api_key=sandbox" . . "&domain=" . $_SERVER['HTTP_HOST']; . '&ip_address=' . get_user_ip() . "&lifetime_minutes=10"; $result = simplexml_load_file($url); if ($result->javascript_key) { echo (string)$result->javascript_key; }