Universal.AustralianBusinessRegister
1.6.1
dotnet add package Universal.AustralianBusinessRegister --version 1.6.1
NuGet\Install-Package Universal.AustralianBusinessRegister -Version 1.6.1
<PackageReference Include="Universal.AustralianBusinessRegister" Version="1.6.1" />
<PackageVersion Include="Universal.AustralianBusinessRegister" Version="1.6.1" />
<PackageReference Include="Universal.AustralianBusinessRegister" />
paket add Universal.AustralianBusinessRegister --version 1.6.1
#r "nuget: Universal.AustralianBusinessRegister, 1.6.1"
#:package Universal.AustralianBusinessRegister@1.6.1
#addin nuget:?package=Universal.AustralianBusinessRegister&version=1.6.1
#tool nuget:?package=Universal.AustralianBusinessRegister&version=1.6.1
Universal.AustralianBusinessRegister
A .NET client library for interacting with the Australian Business Register (ABR) web services to search for Australian Business Numbers (ABN) and Australian Company Numbers (ACN).
Getting Started
Authentication
Register for free access at the ABN Lookup web services registration page. Accept the web services agreement and complete the registration form. ABN Lookup will email your authentication GUID after processing your application. Pass that GUID to AustralianBusinessRegisterClient.
Search by ABN
using Universal.AustralianBusinessRegister;
// Using default authentication GUID
using (var client = new AustralianBusinessRegisterClient())
{
var results = await client.SearchABNAsync("50616294781");
Console.WriteLine($"ABN: {results.Response.BusinessEntity.ABN.IdentifierValue}");
Console.WriteLine($"Name: {results.Response.BusinessEntity.MainNames[0].OrganisationName}");
}
// Using custom authentication GUID
using (var client = new AustralianBusinessRegisterClient("your-auth-guid-here"))
{
var results = await client.SearchABNAsync("50616294781");
// Process results...
}
Search by ACN
using (var client = new AustralianBusinessRegisterClient())
{
var results = await client.SearchACNAsync("010249966");
Console.WriteLine($"ACN: {results.Response.BusinessEntity.ASICNumber}");
Console.WriteLine($"Name: {results.Response.BusinessEntity.MainNames[0].OrganisationName}");
}
Search by Name
using (var client = new AustralianBusinessRegisterClient())
{
// Basic name search
var results = await client.SearchNameAsync("Commonwealth Bank");
// Advanced name search with options
var options = new NameSearchOptions
{
Postcode = "2000",
LegalName = true,
TradingName = true,
BusinessName = true,
ActiveABNsOnly = true,
NewSouthWales = true,
SearchWidth = NameSearchOptions.SearchWidths.Typical,
MinimumScore = 50,
MaximumSearchResults = 100
};
var results = await client.SearchNameAsync("Commonwealth Bank", options);
foreach (var entity in results.Response.BusinessEntity)
{
Console.WriteLine($"ABN: {entity.ABN.IdentifierValue}");
Console.WriteLine($"Name: {entity.MainNames[0].OrganisationName}");
}
}
Include Historical Details
// Include historical details (default: true)
var results = await client.SearchABNAsync("50616294781", includeHistoricalDetails: true);
// Exclude historical details
var results = await client.SearchABNAsync("50616294781", includeHistoricalDetails: false);
When history is included, use BusinessEntity.ABNs, EntityStatuses, and GoodsAndServicesTaxes to access all returned entries. The existing singular properties (ABN, EntityStatus, and GoodsAndServicesTax) return the first entry for compatibility.
Name-search results expose the matching name through MainName, LegalName, BusinessName, MainTradingName, or OtherTradingName, depending on the name type ABR matched. Individual legal names expose FullName, GivenName, OtherGivenName, and FamilyName; organisation names expose OrganisationName. Plural properties retain multiple entries where the service returns them. A result does not necessarily contain a business name or trading name.
ABR returns "No records found" as an application exception with code Search, even when HTTP succeeds. Search methods preserve this as HttpException<ABRPayloadSearchResults.ExceptionSection>; inspect Content.ExceptionCode and Content.ExceptionDescription when handling it. Other errors, such as invalid authentication, use the same exception type with different payload details.
Working with ABN Bulk Extracts
Download Bulk Extract ZIP Archives
using (var client = new AustralianBusinessRegisterClient())
{
// Download as streams
await foreach (Stream zipStream in client.DownloadABNBulkExtractsAsync())
{
// Process each ZIP archive stream
}
// Save ZIP archives to disk
await client.SaveABNBulkExtractsAsync("C:\\ABN\\Downloads");
}
Download and Extract Individual Files
using (var client = new AustralianBusinessRegisterClient())
{
// Download and extract files as streams
await foreach (Stream fileStream in client.DownloadABNBulkExtractFilesAsync())
{
// Process each extracted XML file stream
}
// Save extracted files to disk
await client.SaveABNBulkExtractFilesAsync("C:\\ABN\\Extracts");
}
Parse Bulk Extract Files
using (var client = new AustralianBusinessRegisterClient())
{
// Parse a ZIP archive
using (FileStream zipStream = File.OpenRead("abn-bulk-extract.zip"))
{
foreach (Transfer transfer in client.ParseABNBulkExtractArchive(zipStream))
{
// Process transfer data
foreach (var abn in transfer.ABR)
{
Console.WriteLine($"ABN: {abn.ABN}");
}
}
}
// Parse an individual XML file
using (FileStream xmlStream = File.OpenRead("abn-extract.xml"))
{
Transfer transfer = client.ParseABNBulkExtractFile(xmlStream);
// Process transfer data
}
}
Exception Handling
using Universal.Common.Net.Http;
try
{
var results = await client.SearchABNAsync("50616294781");
}
catch (HttpException<ABRPayloadSearchResults.ExceptionSection> ex)
{
Console.WriteLine($"Error: {ex.Content.ExceptionDescription}");
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.Bcl.AsyncInterfaces (>= 10.0.14)
- Universal.Ckan.Client (>= 2.0.0)
- Universal.Common.Net.Http (>= 5.2.0)
- Universal.Common.Serialization (>= 2.4.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Fixed the historical-details flag in ABN and ACN searches. Completed payload mappings for name-search results, individual names, historical records, charity and DGR details, registrations, and request filters while preserving existing singular properties.