Skip to content

Commit 1e940e1

Browse files
committed
Add support for the Individuals Insurance Policies Income API
Link: <https://developer.service.hmrc.gov.uk/api-documentation/docs/api/service/individuals-insurance-policies-income-api/2.0/oas/page> Signed-off-by: Andrew Clayton <ac@sigsegv.uk>
1 parent fe58a1c commit 1e940e1

File tree

4 files changed

+50
-1
lines changed

4 files changed

+50
-1
lines changed

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ It has a fairly straightforward interface, essentially
5555

5656
::
5757

58-
mtd-cli init|init-creds|init-oauth|init-nino|bd|biss|bsas|cisd|ical|id|ie|iei|ifi|ilos|ioi|ipi|isb|isi|ob|pb|saa|saass|said|seb|vat|test_cu|test_fph|test_sa
58+
mtd-cli init|init-creds|init-oauth|init-nino|bd|biss|bsas|cisd|ical|id|ie|iei|ifi|iipi|ilos|ioi|ipi|isb|isi|ob|pb|saa|saass|said|seb|vat|test_cu|test_fph|test_sa
5959

6060
The first argument specifies the API to interface with
6161

src/endpoints.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ extern const struct _endpoint id_endpoint;
1818
extern const struct _endpoint ie_endpoint;
1919
extern const struct _endpoint iei_endpoint;
2020
extern const struct _endpoint ifi_endpoint;
21+
extern const struct _endpoint iipi_endpoint;
2122
extern const struct _endpoint ilos_endpoint;
2223
extern const struct _endpoint ioi_endpoint;
2324
extern const struct _endpoint ipi_endpoint;

src/mtd-cli-iipi.c

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
3+
/*
4+
* mtd-cli-iipi.c - Make Tax Digital - Individuals Insurance Policies Income
5+
*
6+
* Copyright (C) 2025 Andrew Clayton <ac@sigsegv.uk>
7+
*/
8+
9+
#include <stdbool.h>
10+
11+
#include <libmtdac/mtd.h>
12+
13+
#include "mtd-cli.h"
14+
15+
#define API iipi
16+
17+
#define API_NAME "Individuals Insurance Policies Income"
18+
#define CMDS \
19+
"get amend delete"
20+
21+
static const struct endpoint endpoints[] = {
22+
{
23+
.name = "get",
24+
.api_ep = MTD_API_EP_IIPI_GET,
25+
.nr_req_args = 1,
26+
.args = "taxYear"
27+
}, {
28+
.name = "amend",
29+
.api_ep = MTD_API_EP_IIPI_AMEND,
30+
.nr_req_args = 2,
31+
.file_data = true,
32+
.args = "<file> taxYear"
33+
}, {
34+
.name = "delete",
35+
.api_ep = MTD_API_EP_IIPI_DELETE,
36+
.nr_req_args = 1,
37+
.args = "taxYear"
38+
},
39+
40+
{ }
41+
};
42+
43+
const struct _endpoint ENDPOINT = {
44+
.endpoints = endpoints,
45+
.api_name = API_NAME,
46+
.cmds = CMDS
47+
};

src/mtd-cli.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ static const struct api_ep {
4444
EP_MAP_ENT(ie),
4545
EP_MAP_ENT(iei),
4646
EP_MAP_ENT(ifi),
47+
EP_MAP_ENT(iipi),
4748
EP_MAP_ENT(ilos),
4849
EP_MAP_ENT(ioi),
4950
EP_MAP_ENT(ipi),

0 commit comments

Comments
 (0)