Periods & Settings

API reference for assessment periods, user settings, and application configuration.

Periods

Assessment periods are monthly time windows used for UC reporting and tax calculations.

List Periods

JavaScript
const periods = await $fetch('https://taxmtd.uk/api/periods')
// Returns: Array<{ id, label, startDate, endDate, createdAt }>
Python
res = requests.get(
    "https://taxmtd.uk/api/periods",
    cookies=session_cookies,
)
periods = res.json()["data"]
PHP
$periods = Http::withCookies($session)
    ->get('https://taxmtd.uk/api/periods')
    ->json()['data'];
Rust
#[derive(Deserialize)]
struct Period {
    id: i64,
    label: String,
    #[serde(rename = "startDate")]
    start_date: String,
    #[serde(rename = "endDate")]
    end_date: String,
}

#[derive(Deserialize)]
struct ApiResponse { data: Vec<Period> }

let res: ApiResponse = client
    .get("https://taxmtd.uk/api/periods")
    .send().await?
    .json().await?;
cURL
curl https://taxmtd.uk/api/periods

Create Period

JavaScript
const period = await $fetch('https://taxmtd.uk/api/periods', {
  method: 'POST',
  body: {
    label: 'March 2026',
    startDate: '2026-02-28',
    endDate: '2026-03-27'
  }
})
Python
res = requests.post(
    "https://taxmtd.uk/api/periods",
    json={
        "label": "March 2026",
        "startDate": "2026-02-28",
        "endDate": "2026-03-27",
    },
    cookies=session_cookies,
)
period = res.json()["data"]
PHP
$period = Http::withCookies($session)->post(
    'https://taxmtd.uk/api/periods',
    [
        'label' => 'March 2026',
        'startDate' => '2026-02-28',
        'endDate' => '2026-03-27',
    ]
)->json()['data'];
Rust
let period: serde_json::Value = client
    .post("https://taxmtd.uk/api/periods")
    .json(&serde_json::json!({
        "label": "March 2026",
        "startDate": "2026-02-28",
        "endDate": "2026-03-27"
    }))
    .send().await?
    .json().await?;
cURL
curl -X POST https://taxmtd.uk/api/periods \
  -H "Content-Type: application/json" \
  -d '{"label":"March 2026","startDate":"2026-02-28","endDate":"2026-03-27"}'

Update Period

JavaScript
await $fetch('https://taxmtd.uk/api/periods', {
  method: 'PUT',
  body: { id: 1, label: 'March 2026 (updated)' }
})
Python
requests.put(
    "https://taxmtd.uk/api/periods",
    json={"id": 1, "label": "March 2026 (updated)"},
    cookies=session_cookies,
)
PHP
Http::withCookies($session)->put(
    'https://taxmtd.uk/api/periods',
    ['id' => 1, 'label' => 'March 2026 (updated)']
);
Rust
client.put("https://taxmtd.uk/api/periods")
    .json(&serde_json::json!({
        "id": 1,
        "label": "March 2026 (updated)"
    }))
    .send().await?;
cURL
curl -X PUT https://taxmtd.uk/api/periods \
  -H "Content-Type: application/json" \
  -d '{"id":1,"label":"March 2026 (updated)"}'

Delete Period

JavaScript
await $fetch('https://taxmtd.uk/api/periods', {
  method: 'DELETE',
  body: { id: 1 }
})
Python
requests.delete(
    "https://taxmtd.uk/api/periods",
    json={"id": 1},
    cookies=session_cookies,
)
PHP
Http::withCookies($session)->delete(
    'https://taxmtd.uk/api/periods',
    ['id' => 1]
);
Rust
client.delete("https://taxmtd.uk/api/periods")
    .json(&serde_json::json!({ "id": 1 }))
    .send().await?;
cURL
curl -X DELETE https://taxmtd.uk/api/periods \
  -H "Content-Type: application/json" \
  -d '{"id":1}'

Settings

User-level configuration for the application.

Get Settings

JavaScript
const settings = await $fetch('https://taxmtd.uk/api/settings')
// Returns: { businessName, businessAddress, vatNumber, nino, ... }
Python
res = requests.get(
    "https://taxmtd.uk/api/settings",
    cookies=session_cookies,
)
settings = res.json()["data"]
PHP
$settings = Http::withCookies($session)
    ->get('https://taxmtd.uk/api/settings')
    ->json()['data'];
Rust
let settings: serde_json::Value = client
    .get("https://taxmtd.uk/api/settings")
    .send().await?
    .json().await?;

let data = &settings["data"];
cURL
curl https://taxmtd.uk/api/settings

Update Settings

JavaScript
await $fetch('https://taxmtd.uk/api/settings', {
  method: 'POST',
  body: {
    businessName: 'John Doe Consulting',
    businessAddress: '123 High Street, London',
    vatNumber: 'GB123456789',
    defaultVatRate: 20
  }
})
Python
requests.post(
    "https://taxmtd.uk/api/settings",
    json={
        "businessName": "John Doe Consulting",
        "businessAddress": "123 High Street, London",
        "vatNumber": "GB123456789",
        "defaultVatRate": 20,
    },
    cookies=session_cookies,
)
PHP
Http::withCookies($session)->post(
    'https://taxmtd.uk/api/settings',
    [
        'businessName' => 'John Doe Consulting',
        'businessAddress' => '123 High Street, London',
        'vatNumber' => 'GB123456789',
    ]
);
Rust
client.post("https://taxmtd.uk/api/settings")
    .json(&serde_json::json!({
        "businessName": "John Doe Consulting",
        "businessAddress": "123 High Street, London",
        "vatNumber": "GB123456789",
        "defaultVatRate": 20
    }))
    .send().await?;
cURL
curl -X POST https://taxmtd.uk/api/settings \
  -H "Content-Type: application/json" \
  -d '{"businessName":"John Doe Consulting","vatNumber":"GB123456789"}'