Introduction

The jQuery plugin for AFD Postcode Evolution (PCE) allows developers to easily harness the power of PCE in front-end applications.

When filling out address forms, users simply need to start typing their address in a single TypeAhead box that will drill down on the results until the user can select their address from the list.

The plugin also has powerful validation tools that allow validation of phone numbers, email addresses, credit/debit cards, and UK bank accounts. In addition to validation it is possible to extract further information from the fields (for example "card type"), restrict input to certain keys and format the fields automatically, independent of the actual keys pressed by the user.

Compatibility

jQuery Compatibility

The plugin is compatible with all versions of jQuery above version 1.6.

Bootstrap Compatibility

The plugin is ready, out of the box to work with both Bootstrap 3 and 4 form validation and the TypeAhead control is by default styled to look like a Bootstrap control. Developers simply need to create the form controls according to the Bootstrap documentation, and PCE will add its default behaviour and apply the correct validation styles.

Getting Started

Download the lastest version of the AFD jQuery plugin:

http://download.afd.co.uk/web/integrations/jquery/afd.jquery.1.3.1.zip

The zip file contains seperate module files for each feature as well as a single consolidated module that contains all of the features (afd.jquery.1.3.1.js). For pages that will have multiple features on a single page the consolidated module should be used.

Include jQuery, the afd plugin, the AFD TypeAhead css, and your AFD config in the head of the html document.

<head>
  <script type="text/javascript" src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
  <script type="text/javascript" src="afd.jquery.1.3.1.min.js"></script>
  <script>
    afdOptions = {
        id: "YOUR_ID",
        token: "YOUR_TOKEN",
		pceUrl: "https://apps.afd.co.uk/json"
    };
  </script>
  <link type="text/css" rel="stylesheet" href="jquery.typeahead.afd.1.3.1.css">
<head>

It is also possible to use a Serial/Password pair for authentication in this case the pceUrl should be set to https://pce.afd.co.uk/afddata.pce". Serial/Password authentication should not be used on public facing websites. If you require a ID/Token pair but don't yet have one, please contact AFD technical support on 01624 811 712.

afdOptions = {
	serial: "YOUR_SERIAL",
	password: "YOUR_PASSWORD"
	pceUrl: "https://pce.afd.co.uk/afddata.pce"
}

Address Lookup

The TypeAhead Control

In the body of the document add the following html for the TypeAhead control. This tag structure is required but custom CSS can be applied if needed.

<div class="afd-typeahead-container">
  <div class="afd-typeahead-field">
    <div class="afd-typeahead-query">
      <input
        type="search"
        autocomplete="off"
        data-afd-control="typeahead">
    </div>
  </div>
  <div class="afd-manual-input-button" style="display:none">Manual Input</div>
  <div class="afd-manual-input-search-button">Search for Address</div>
  <div class="afd-search-again" style="display:none">Search Again</div>
</div>

International Addresses

ZipAddress

For lookups using our ZipAddress product, the defaultCountry needs to be set to USA in afdOptions.

afdOptions.defaultCountry = "USA";

WorldAddress

For international lookups using our WorldAddress product, an additional country <select> control needs to be added to the form.

<select data-afd-control="country"></select>

This will populate with all of the available WorldAddress countries and automatically use the selected country in TypeAhead queries.

Results Fields

For each result field that you want to add to the page you need to add the data-afd-result attribute to the <input> and set the attribute as the PCE field that you would like it to display. The PCE fields are case sensitive.

<div class="form-control">
  <label for="Postcode">Postcode:</label>
  <input data-afd-result="Postcode" id="postcode">
</div>

A full list of PCE fields can be found in Appendix A.

Configuration Options

There are various options available to customise the functionality of the TypeAhead control and result fields. Defaults and explainations are shown below.

afdOptions.defaultCountry

default: null

type: string

Sets the default country for international lookups. Should be an ISO3 Value.

afdOptions.typeahead.maxItems

default: 5

type: number

The maximum number of items that will show in the search results.

afdOptions.typeahead.pushUp

default: false

type: boolean

If propery field is empty, street and locality will be moved up. This is helpful in forms which have the three fields for property, street and locality grouped together in a single field.

afdOptions.typeahead.afterHideTypeahead

default: false

type: boolean

Hide the TypeAhead field after a search result has been selected.

afdOptions.typeahead.searchAgain

default: true

type: boolean

If afterHideTypeahead is true (see above), this will show a search again button that when clicked will show the TypeAhead field again. The content of this button is set in the original TypeAhead markup in the div .afd-search-again.

afdOptions.typeahead.afterClearTypeahead

default: true

type: boolean

Empty the contents of the TypeAhead field after a result has been selected.

afdOptions.typeahead.beforeHideResults

default: false

type: boolean

Intitally hide the results fields, they will show once address has been selected.

afdOptions.typeahead.parentClass

default: null

type: string

Class of parent of result field, when hiding results fields this will hide the parent instead of only the input. This is useful when forms have the input and the label in a single container.

<div class="form-group>
	<label for="postcode">Postcode</label>
	<input id="postcode" data-afd-result="Postcode">
</div>
<script>
	afdOptions.typeahead.parentClass = "form-group"
</script>

afdOptions.typeahead.manualInputButton

default: false

type: boolean

Shows a manual input button that will hide the TypeAhead field and show all results fields when clicked. The content of this button is set in the original TypeAhead markup in the div .afd-manual-input.

afdoptions.typeahead.fewResultsManualInput

default: true

type: boolean

When the number of results returned from Postcode Evolution are less than the maxResults, an additional "result" will be added that gives the user the option to manually input the result.

afdOptions.typeahead.fewResultsManualInputText

default: "Can't see your address? Enter it manually"

type: string

The text that should be displayed when fewResultsManualInput is set to true.

afdOptions.typeahead.notEmptyShowResults

default false

type: boolean

When beforeHideResults is true, this prevents fields that are already populated at the point of the page loading from being hidden. This is useful in the case of editing an address in which it may not be desirable to hide fields that are alread populated.

afdOptions.typeahead.hideEmpties

default: false

type: boolean

When an address is retrieved from Postcode Evolution, this will hide any empty results fields.

afdOptions.typeahead.retrieveFields

default: standard

type: string

Specifies the fields that are returned from Postcode Evolution.

Options

  • standard: Standard UK fields
  • international: International Fields
  • usa: USA Fields

afdOptions.typeahead.availableCountries

default: []

type: string[]

Setting this options allows the country field to be filtered to only contain matching countries. Use ISO3 country codes. e.g.

['CAN', 'FRA', 'BEL']

afdOptions.typeahead.minLength

default: 2

type: number

The minimum number of characters in the typeahead box before triggering a search.

afdOptions.typeahead.containers

default: []

type: string[]

When there are multiple forms on a single page, add selectors for each of the forms to this array so that only the results from searches in that form are populated.

Card Validation

Card Number and Expiry Date Controls

In the body add <input> elements for card and expiry date with the corresponding attributes data-afd-control="card" and data-afd-control="expiry" set.

<div class="form-control">
  <label for="card">Card Number:</label>
  <input data-afd-control="card" id="card">
</div>
<div class="form-control">
  <label for="expiry">Expiry Date:</label>
  <input data-afd-control="expiry" id="expiry">
</div>

Checking Validation

When a number or date is input validation will begin.

There is no point in validating against PCE until the structure of the card number and the date are known to be valid. This being the case, as the user types both fields will be checked for validity and only once both are valid and the control loses focus will PCE be queried.

Once PCE returns a valid outcome both fields will have the afd-valid class added. If the input loses focus and the fields are not valid the input will have the afd-invalid class added. If the user begins to type either with the valid or the invalid class set, both will be removed until either the number and date are both valid or the control loses focus again.

In addition to classes the validation fields also make use of the constraint validation API which is supported by all major browsers. This allows the use of the :valid and invalid pseudo classes and the validation JavaScript objects attached to input elements. An example of how you might display validation messages is shown in the section afd:cardValidationUpdated.

Advanced Usage

The card module emits events on the document on validation update and validation complete.

  • afd:cardValidationUpdated // event, validationObject
  • afd:validateComplete // event, [ cardElement, expiryElement]

afd:cardValidationUpdated

This event is emitted after a regex check on the card number or the expiry date after each key-up event, and is also emitted after a full AFD check which is triggered when either of the controls the input loses focus while both are structurally valid. The callback contains the event object and the elements themselves.

Additional Information

We only check against AFD once the patterns in the fields are known to be valid. However, it is possible to get some information from the card number before it is complete and so these are available via the data API. For example:

$(document).on("afd:cardValidationUpdated", function(e, element){
  var cardInfo = {
    cardType: $(element).data("card-type");
    cardTypeNice: $(element).data("card-type-nice");
    isCardRegexValid: $(element).data("card-is-regex-valid");
    isExpiryRegexValid: $(element).data("expiry-is-regex-valid");
    isAfdValid: $(element).data("card-is-afd-valid");
  }
  console.log(cardInfo);
});

This can be used to display information in accompanying fields.

Displaying Validation Messages

As mentioned previously, the constraint validation API used in combination with event can be used to get the validation message set on the element. An example is as follows:


<div class="form-control">
  <label for="card">Card Number:</label>
  <input data-afd-result="card" id="car">
  <p id="card-error-message"></p>
</div>
<div class="form-control">
  <label for="expiry">Expiry Date:</label>
  <input data-afd-result="expiry" id="expiry">
  <p id="expiry-error-message"></p>
</div>
<script>
  $(document).on("afd:cardValidationUpdated", function(e, cardElement, expiryElement){
    if(!cardElement.validity.valid){
      $("#card-error-message").html(element.validationMessage);
    }else{
      $("#card-error-message").html("");
    };
  if(!expiryElement.validity.valid){
      $("#expiry-error-message").html(expiryElement.validationMessage);
    }else{
      $("#expiry-error-message").html("");
    };
  });
</script>

afd:validateComplete

After an AFD validation is complete this event emits the event object and an object that contains the validity of the control and the validation message. Example:


$(document).on(afd:validateComplete, function(e, error){
  console.log(error);
});

Account Validation

Account and Sort Code Controls

In the body add <input> elements for account number and sort code with the corresponding attributes data-afd-control="account" and data-afd-control="sort" set.

<div class="form-control">
  <label for="account">Account Number:</label>
  <input data-afd-control="account" id="account">
</div>
<div class="form-control">
  <label for="sort">Sort Code:</label>
  <input data-afd-control="sort" id="sort">
</div>

Checking Validation

When an account number or sort code is input validation will begin.

There is no point in validating against PCE until the structure of the card number and the date are known to be valid. This being the case, as the user types both fields will be checked for validity and only once both are valid and the control loses focus will PCE be queried.

Once PCE returns a valid outcome both fields will have the afd-valid class added. If the input loses focus and the fields are not valid the input will have the afd-invalid class added. If the user begins to type either with the valid or the invalid class set, both will be removed until either the number is valid or the control loses focus again.

In addition to classes the validation fields also make use of the constraint validation API which is supported by all major browsers. This allows the use of the :valid and invalid pseudo classes and the validation JavaScript objects attached to input elements. An example of how you might display validation messages is shown in the section afd:accountValidationUpdated.

Advanced Usage

The account module emits events on the document on validation update and validation complete.

  • afd:accountValidationUpdated // event, validationObject
  • afd:validateComplete // event, [ accountElement, accountElement]

afd:accountValidationUpdated

This event is emitted after a regex check on the card number or the expiry date after each keyup event and also after a full AFD check which is triggered when the input loses focus. The callback contains the event object and the element itself.

Additional Information

We only check against AFD once we are sure that the pattern is valid, after that we will be able to get some information about the account number in addition to its validation status via the data API. For example:

$(document).on("afd:cardValidationUpdated", function(e, element){
  var accountInfo = {
    cardType: $(element).data("card-type");
    cardTypeNice: $(element).data("card-type-nice");
    isCardRegexValid: $(element).data("card-is-regex-valid");
    isExpiryRegexValid: $(element).data("expiry-is-regex-valid");
    isAfdValid: $(element).data("card-is-afd-valid");
  }
  console.log(accountInfo);
});

This can be used to display information in accompanying fields.

Displaying Validation Messages

As mentioned previously the constraint validation API used in combination with event can be used to get the validation message set on the element. An example is as follows:


<div class="form-control">
  <label for="account">Account Number:</label>
  <input data-afd-result="account" id="account">
  <p id="account-error-message"></p>
</div>
<div class="form-control">
  <label for="sort">Sort Code:</label>
  <input data-afd-result="sort" id="sort">
  <p id="sort-error-message"></p>
</div>
<script>
  $(document).on("afd:accountValidationUpdated", function(e, accountElement, sortElement){
    if(!accountElement.validity.valid){
      $("#account-error-message").html(accountElement.validationMessage);
    }else{
      $("#account-error-message").html("");
    };
  if(!expiryElement.validity.valid){
      $("#sort-error-message").html(sortElement.validationMessage);
    }else{
      $("#sort-error-message").html("");
    };
  });
</script>

afd:validateComplete

After an AFD validation is complete this event emits the event object and an object that contains the validity of the control and the validation message. Example:


$(document).on(afd:validateComplete, function(e, error){
  console.log(error);
});

Phone Number Validation

The Phone Number Control

In the body add an <input> element with the attribute data-afd-control="phone" set.

<div class="form-control">
  <label for="phone">Phone Number:</label>
  <input data-afd-control="phone" id="phone">
</div>

Checking Validation

When a number is input validation will begin. If the number is valid the input will have the afd-valid class added. If the input loses focus and the number is not valid the input will have the afd-invalid class added. If the user begins to type either with the valid or the invalid class set, both will be removed until either the number is valid or the control loses focus again.

In addition to classes the validation fields also make use of the constraint validation API which is supported by all major browsers. This allows the use of the :valid and invalid pseudo classes and the validation JavaScript objects attached to input elements. An example of how you might display validation messages is shown in the section afd:phoneValidationUpdated.

Dealing with Country Codes

The control assumes that the country code is UK (+44) unless set otherwise in the options (see below). However it can be overridden by specifying a country code either using + notation (e.g. +86) or double zero notation (e.g. 0086).

Configuration Options

In addition to setting the id and token it is also possible to set the default country code. This must be done using plus notation.

afdOptions = {
  id: "YOUR_ID",
  token: "YOUR_TOKEN",
  defaultCountryDialingCode: "+1"
};

Advanced Usage

The phone module emits events on the document on validation update and validation complete.

  • afd:phoneValidationUpdated // event, validationObject
  • afd:validateComplete // event, phoneElement

afd:phoneValidationUpdated

This event is emitted after a regex check on the phone number after each keyup event and also after a full AFD check which is triggered when the input loses focus. The callback contains the event object and the element itself.

Additional Information

We only check against AFD once the pattern is known to be valid. However, it is possible to get some information from the number before it is complete and so these are available via the data API. For example:

$(document).on("afd:phoneValidationUpdated", function(e, element){
  var phoneInfo = {
    phoneRegion: $(element).data("phone-region");
    isMobile: $(element).data("phone-is-mobile");
    isLandLine: $(element).data("phone-is-landline");
    isRegexValid: $(element).data("phone-is-regex-valid");
    isAfdValid: $(element).data("phone-is-afd-valid");
  }
  console.log(phoneInfo);
});

This can be used to display information in accompanying fields.

Displaying Validation Messages

As mentioned previously the constraint validation API used in combination with event can be used to get the validation message set on the element. An example is as follows:


<div class="form-control">
  <label for="phone">Phone Number:</label>
  <input data-afd-result="phone" id="phone">
  <p id="error-message"></p>
</div>
<script>
  $(document).on("afd:phoneValidationUpdated", function(e, element){
    if(!element.validity.valid){
      $("#error-message").html(element.validationMessage);
    }else{
      $("#error-message").html("");
    };
  });
</script>

afd:validateComplete

After an AFD validation is complete this event emits the event object and an object that contains the validity of the control and the validation message. Example:


$(document).on(afd:validateComplete, function(e, error){
  console.log(error);
});

Email Address Validation

Email Control

In the body add an <input> element with the attribute data-afd-control="email" set.

<div class="form-control">
  <label for="email">Email Address:</label>
  <input data-afd-control="email" id="email">
</div>

Checking Validation

When an email address is input validation will begin. If the address is valid the input will have the afd-valid class added. If the input loses focus and the address is not valid the input will have the afd-invalid class added. If the user begins to type either with the valid or the invalid class set, both will be removed until either the address is valid or the control loses focus again.

In addition to classes the validation fields also make use of the constraint validation API which is supported by all major browsers. This allows the use of the :valid and invalid pseudo classes and the validation JavaScript objects attached to input elements. An example of how you might display validation messages is shown in the section afd:emailValidationUpdated.

Advanced Usage

The email module emits events on the document on validation update and validation complete.

  • afd:emailValidationUpdated // event, validationObject
  • afd:validateComplete // event, emailElement

afd:emailValidationUpdated

This event is emitted after a regex check on the email address after each keyup event and also after a full AFD check which is triggered when the input loses focus. The callback contains the event object and the element itself.

Additional Information

We only check against AFD once the pattern is known to be valid, however we do supply an object that contains validation information on each key-press.

$(document).on("afd:emailValidationUpdated", function(e, element){
  var emailInfo = {
    pceMessage: $(element).data("email-pce-message");
    isRegexValid: $(element).data("email-is-regex-valid");
    isAfdValid: $(element).data("email-is-afd-valid");
  }
  console.log(emailInfo);
});

This can be used to display information in accompanying fields.

Displaying Validation Messages

As mentioned previously the constraint validation API used in combination with event can be used to get the validation message set on the element. An example is as follows:


<div class="form-control">
  <label for="email">Email Address:</label>
  <input data-afd-result="email" id="email">
  <p id="error-message"></p>
</div>
<script>
  $(document).on("afd:emailValidationUpdated", function(e, element){
    if(!element.validity.valid){
      $("#error-message").html(element.validationMessage);
    }else{
      $("#error-message").html("");
    };
  });
</script>

afd:validateComplete

After an AFD validation is complete this event emits the event object and an object that contains the validity of the control and the validation message. Example:


$(document).on(afd:validateComplete, function(e, error){
  console.log(error);
});

Appendices

Appendix A PCE Fields

Field Name Default Size Description Postcode Plotter Postcode Plus Names and Numbers
Lookup 255 Specify postcode (or zipcode) and fast-find lookup string’s here for lookup operations
Key 255 Provides a key which can be used to easily retrieve the record again, e.g. when a user clicks on an item in the list box.
List 512 Provides a list item formatted to be added to a list box for this record.
Product 40 Indicates the product name used [10]
Name 120 Full name (includes title, first name, middle initial and surname).
Gender 6 The gender (M or F) of the resident if known.
Forename 30 The first name of the resident
MiddleInitial 6 The middle initiate of the resident.
Surname 30 The surname/last name of the resident.
OnEditedRoll 6 Indicates if the resident is on the edited electoral roll (i.e. they have not opted out). Set to Y if they are on he Edited Roll, N if not, blank for Organisation and other records). To search set to #Y to return only records on the electoral roll, #N only for those not on the electoral roll or !N for all records including Organisations but excluding those not on the Edited Roll.
DateOfBirth 10 The residents date of birth if known (electoral roll attainers in the last 10 years only).
Residency 6 Gives time in years that the occupant has lived at this address.
HouseholdComposition 106 Describes the household composition of the selected address
Organisation 120 Full business name (includes any department)
Property 120 Property (building-includes any sub-building).
Street 120 Delivery Street (includes any sub-street)
Locality 70 Locality (sometimes a village name – in ZipAddress used for Urbanization)
Town 30 Postal Delivery Town (or City)
Postcode 10 The Royal Mail Postcode for this address (or ZipCode)
OrganisationName 60 Business Name
Department 60 Department Name
Sub Building 60 Sub Building Name
Building 60 Building Name
Number 10 House Number
DependentThoroughfare 60 Sub-Street Name
Thoroughfare 60 Street Name
DoubleDependentLocality 35 Sub-Locality Name
DependentLocality 35 Locality Name (Urbanization in ZipAddress)
Town 30 Postal Delivery Town (City)
Postcode 10 The Royal Mail Postcode for this address (or Zipcode)
Identifier 8 Provides a unique identifier for the address (the Royal Mail UDPRN)
BuildDate 10 Provides the build date, which can be used as the start date, entry date, and update date fields for BS7666.
Administrator 20 Provides the administrator of the gazetteer (AFD).
Language 5 Provides the language (ENG)
Department 60 The name of a department within an organization where required.
Organization 60 The Organization Name
SubUnit 60 Sub-Unit of a building where needed
BuildingName 60 Building Name where present
BuildingNumber 10 Building Number, including 17A, 17-19, etc
SubStreet 60 Sub-Street where needed
DeliveryStreet 60 Designated Street Name
SubLocality 60 Sub-Locality where required
DeliveryLocality 60 Locality name (or Urbanization)
DeliveryTown 30 Postal Town name (or City)
Code 10 The Postcode (or ZipCode)
PostalCounty 30 Royal Mail supplied postal county
AbbreviatedPostalCounty 30 Royal Mail approved abbreviation is used where available for the postal county
OptionalCounty 30 Postal counties including optional ones for most addresses which would otherwise not have a county name.
AbbreviatedOptionalCounty 30 Royal Mail approved abbreviation is used where available for the optional county
TraditionalCounty 30 The traditional county name for this postcode
AdministrativeCounty 30 The administrative county name for this postcode
Outcode 4 The Outcode porton of the Postcode (the portion before the space)
Incode 3 The Incode portion of the Postcode (the portion after the space).
DPS 2 The Delivery Point Suffix which along with the postcode uniquely identifies the letterbox.
PostcodeFrom 8 Used with Postcode field to provide a range for searching. Also returns any changed postcode from a lookup.
PostcodeType 6 L for Large User Postcode, S for Small User.
MailsortCode 5 Used for obtaining bulk mail discounts.
UDPRN 8 Royal Mail Unique Delivery Point Reference Number assigned to this letter box
JustBuilt 10 AFDJustBuilt - Contains the date of inclusion on PAF for properties thought to be recently built. The date is tored numerically in descending format in the form YYYYMMDD. YYYY is the year, MM is the month and DD is the day. For example 20080304 is 04/03/2008.
Phone 20 STD Code or Phone Number
GridE 10 Grid Easting as a 6 digit reference
GridN 10 Grid Northing as a 6/7 digit reference
Latitude 10 Latitude representation of Grid Reference in Decimal Format (WGS84)
GBGridE 10 UK Based Grid Easting as a 6 digit reference. Always returns the UK based grid even for Northern Ireland addresses.
GBGridN 10 UK Based Grid Northing as a 6/7 digit reference
NIGridE 10 Irish Grid Based Grid Easting as a 6 digit reference. Always returns the Irish base grid even for mainland UK addresses
NIGridN 10 Irish Grid Based Grid Northing as a 6/7 digit reference
Longitude 10 Longitude representation of Grid Reference in Decimal Format (WGS84)
Miles 6 Distance from supplied grid reference
Km 6 Distance from supplied grid reference
UrbanRuralCode 2 Provides a code which indicates if an area is mainly urban or rural and how sparsely populated those areas are
UrbanRuralName 60 Provides a description which goes along with the UrbanRuralCode.
SOALower 9 Lower level Super Output Area (Data Zone in Scotland, Super Output Area in Northern Ireland)
SOAMiddle 9 Middle level Super Output Area (Intermediate Geography in Scotland, not applicable for Northern Ireland).
SubCountryName 20 Provides the devolved or non-UK country name (e.g. England, Scotland, Wales etc.)
WardCode 9 Code identifying the electoral ward for this postcode
WardName 50 Name identifying the electoral ward for this postcode
AuthorityCode 9 Local/Unitary Authority for this Postcode (same as the start of the ward code).
Authority 50 Local / Unitary Authority for this postcode
ConstituencyCode 9 Parliamentary Constituency Code for this postcode
Constituency 50 Parliamentary Constituency for this postcode
DevolvedConstituencyCode 9 Devolved Constituency Code for this postcode (currently covers Scotland)
DevolvedConstituencyName 50 Devolved Constituency Name for this postcode (currently covers Scotland)
EERCode 9 Code identifying the European Electoral Region for this postcode
EERName 40 Name identifying the European Electoral Region for this postcode
LEACode 3 Code identifying the Local Education Authority for this postcode
LEAName 50 Name identifying the Local Education Authority for this postcode
TVRegion 30 ISBA TV Region (not TV Company)
Occupancy 6 Indication of the type of occupants of properties found on the selected postcode
OccupancyDescription 30 Description matching the Occupancy
AddressType 6 Indication of the type of property level data to capture to have the full address for a property on the selected postcode
AddressTypeDescription 55 Description matching the Address Type
NHSCode 6 National Health Service Area Code
NHSName 50 National Health Service Area Name
PCTCode 9 National Health Service Clinical Commissioning Group Code for England (Local Health Board Code in Wales, Community Health Partnership in Scotland, Local Commissioning Group in Northern Ireland, Primary Healthcare Directorate in the Isle of Man)
PCTName 50 Name matching the PCT Code field
CensationCode 10 Censation Code assigned to this Postcode
CensationLabel 50 Provides a handle for the Censation Code
Affluence 30 Affluence description
Lifestage 100 LifeStage description
AdditionalCensusInfo 200 Additional information from the Census.
Business 100 Provides a description of the type of business
SICCode 10 Standard Industry Classification Code for an organisation record
Size 6 Gives an indication of the number of employees of an organisation at this particular office.
LocationType 6 The type of Business Location, e.g. Head Office or Branch Office
BranchCount 6 The number of branches for this business
GroupID 6 An ID of the Group were a business is part of a wider group
ModelledTurnover 15 The modelled annual turnover for the business
NationalSize 6 Gives an indication of the number of employees of an organisation covering all sites.
AliasLocalities 4 Returns the number of alias records present for the postcode sector in which this result resides
AliasLocality 35 Returns an alias (non-postal) locality that resides in the postcode sector that this address is contained in. Note that many postcode sectors have multiple alias localities and as such you can include this field multiple times to return multiple localities.
DataSet 10 With Postcode Plus and Welsh data can be set to ‘Welsh” to obtain the Welsh language version of an address in Wales where available. If not set then the English language version will be returned.
CouncilTaxBand 6 Provides the Council Tax Band for the selected property.