GitHunt
SK

SkillsFundingAgency/hmrc-apprenticeship-levy-api-client

:cloud::pound: API Client to get apprenticeship levy information

HMRC apprenticeship levy client

crest
Build Build status
.Net Client

An API client for HMRC Apprenticeship Levy

Usage

Authentication

You'll need to talk to the ESFA

Find all the apprenticeship levy declarations

var tokenServiceConfig = new TokenServiceApiClientConfiguration
{
    ClientSecret = "<something>",
    ApiBaseUrl = "https://sfa-token-api/",
    ClientId = "<client-guid>",
    IdentifierUri = "<url service identifier for AD>",
    Tenant = "<SFA Azure AD>",
    TokenCertificate = null // used in prod
};

var tokenService = new SFA.DAS.TokenService.Api.Client.TokenServiceApiClient(tokenServiceConfig);
var tokenResult = await tokenService.GetPrivilegedAccessTokenAsync();
var httpClient = HmrcLevyApiClient.CreateHttpClient(tokenResult.AccessCode, "https://hmrc-api-url/");
var client = new HmrcLevyApiClient(httpClient);
var result = await _sut.GetEmployerLevyDeclarations("000/000000");

Languages

C#100.0%

Contributors

GNU General Public License v3.0
Created July 10, 2017
Updated February 22, 2024