Companies House Integration
Overview
The GIAS back end service integrates with Companies House. This is to primarily to keep GIAS establishment group records, especially SATs and MATs, aligned with company data held by Companies House.
There are two Companies House integration paths in the codebase:
Primary scheduled integration
- Uses the Companies House REST API
- Reads Companies House numbers for relevant establishment groups
- Runs as a Quartz scheduled job
- Updates internal group records by creating group change requests
- Generates a MAT closure report and uploads it to blob storage
Older or alternate XML integration
- Uses
CompaniesHouseNumberProviderImpl - Fetches XML and parses it with SAX
- Present in the codebase, but the main operational trust/group sync appears to use the REST API path
- Uses
Main Classes
Scheduled job orchestration
CompaniesHouseUpdateJobapplicationContext-quartz.xmlapplicationContext-companiesHouseUpdate.xml
This job is triggered on a cron schedule from the companies.house.update.schedule property.
Core update manager
EdubaseCompaniesHouseUpdateManager
This class coordinates the end-to-end process:
- Selects which Companies House numbers need processing
- Calls the Companies House API
- Uses basic auth
- Compares returned company data with current GIAS group data
- Creates
GroupChangeRequestobjects for changed fields - Records processing outcomes
- Generates a MAT closure report
Companies House API client
CompaniesHouseApi_impl
This class:
- Calls
https://api.companieshouse.gov.uk/company/{number} - Sends an
Authorizationheader using the configured API key - Parses JSON into
SimplifiedCompanyProfile - Rate-limits requests to avoid Companies House throttling
- Records response status per company number
Persistence and tracking
CompaniesHouseDownloadHolderCompaniesHouseDownloadHolderManagerImplCompaniesHouseUpdatesManagerImpl
These classes track:
- Which company numbers have been processed
- Whether the last attempt succeeded, failed, or was not found
- Job history and retry cycles
- Closure metadata used in reporting
What Data Is Updated
The scheduled sync compares Companies House data to the current GIAS establishment group record and may update fields such as:
GroupNameOpenDateGroupPostcodeGroupStreetGroupTownGroupLocality
The manager does not update the group directly. Instead, it creates GroupChangeRequest records through GroupChangeRequestManager, which keeps the update aligned with the system’s existing change-management model.
Reporting and Blob Storage
When the job cycle resets or reaches its retry threshold, the system generates a MAT closure report.
This happens in:
EdubaseCompaniesHouseUpdateManagerThe report:Is written as CSV
Is associated with a callback record
Is uploaded to Azure Blob storage via
BlobStorageManager
This is used to report groups that are still open in GIAS but appear closed or inactive in Companies House.
Sequence Diagram
Older XML-Based Integration
There is also older Companies House code under:
CompaniesHouseNumberProviderImplThat implementation:builds a URL from configuration
downloads XML
parses it with a SAX handler into
CompaniesHouseData
This appears to be separate from the main scheduled SAT/MAT sync flow, which now uses the JSON REST API client in CompaniesHouseApi_impl.