An Agent acts on behalf of one or more clients. To do so they require a valid relationship to be in place. As Agents move to MDTP, our intention where possible is that their Agent/Client relationships that exist in HoDs are honoured.
The Mapping journey has arisen due to the need to honour SA relationships that are stored within CESA. The relationships are not stored in a normalised data store that can be queried. In order to understand if an Agent has a relationship with a client, we have to retrieve the client record and check if the CESA Agent Ref is present. A prerequisite for this check is knowing the CESA Agent Ref, this is captured and linked to the Agents ARN via the Mapping journey.
GET /agent-mapping/mappings/eligibility
responses:
200 OK
{
"hasEligibleEnrolments" : true | false
}
401 UNAUTHORIZED if user is not authenticated (missing bearer token or no active session) or does not have agent affinity
PUT /agent-mapping/mappings/arn/:arn
path parameters:
:arn - AgentReferenceNumber
examples:
PUT /agent-mapping/mappings/arn/AARN0000002
responses:
201 CREATED if successfully captured and mapped one or more identifiers to the ARN
401 UNAUTHORIZED if user is not authenticated (missing bearer token or no active session)
403 FORBIDDEN if user is not authorised to use the endpoint (either has no identifiers eligible for mapping, not logged in with GG auth provider, or does not have agent affinity)
409 CONFLICT if all available identifiers has been already mapped
PUT /agent-mapping/mappings/pre-subscription/utr/:utr
path parameters:
:utr - SA UTR
examples:
PUT /agent-mapping/mappings/pre-subscription/utr/2000000000
responses:
201 CREATED if successfully captured and mapped one or more identifiers to the UTR
401 UNAUTHORIZED if user is not authenticated (missing bearer token or no active session)
403 FORBIDDEN if user is not authorised to use the endpoint (either has no identifiers eligible for mapping, not logged in with GG auth provider, or does not have agent affinity)
409 CONFLICT if all available identifiers has been already mapped
PUT /agent-mapping/mappings/post-subscription/utr/:utr
path parameters:
:utr - SA UTR
examples:
PUT /agent-mapping/mappings/post-subscription/utr/2000000000
responses:
200 OK
401 UNAUTHORIZED if user is not authenticated (missing bearer token or no active session)
403 FORBIDDEN if user is not authorised to use the endpoint (eg: insufficient enrolments)
DELETE /agent-mapping/mappings/pre-subscription/utr/:utr
path parameters:
:utr - SA UTR
examples:
DELETE /agent-mapping/mappings/pre-subscription/utr/2000000000
responses:
204 NO_CONTENT
401 UNAUTHORIZED if user is not authenticated (missing bearer token or no active session)
GET /agent-mapping/mappings/sa/:arn
responses:
200 OK
{
"mappings":[
{ "arn" : "AARN0000002", "saAgentReference" : "A1111A" },
{ "arn" : "AARN0000002", "saAgentReference" : "A1111B" }
]
}
404 NOT FOUND
GET /agent-mapping/mappings/vat/:arn
responses:
200 OK
{
"mappings":[
{ "arn" : "AARN0000002", "vrn" : "101747696" },
{ "arn" : "AARN0000002", "vrn" : "101747641" }
]
}
404 NOT FOUND
GET /agent-mapping/mappings/agentcode/:arn
responses:
200 OK
{
"mappings":[
{ "arn" : "AARN0000002", "agentCode" : "101747696" },
{ "arn" : "AARN0000002", "agentCode" : "101747641" }
]
}
404 NOT FOUND
GET /agent-mapping/mappings/key/:key/arn/:arn
supported keys: char
,gts
,mgd
,novrn
,ct
,paye
,sdlt
responses:
200 OK
{
"mappings":[
{ "arn" : "AARN0000002", "identifier" : "XYZ00000" },
{ "arn" : "AARN0000002", "identifier" : "ABCD9999" }
]
}
404 NOT FOUND
This code is open source software licensed under the Apache 2.0 License