Budgets
curl --request GET \
--url https://api.sortx.co.uk/planned-maintenance/budgets \
--header 'x-api-key: <api-key>'const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.sortx.co.uk/planned-maintenance/budgets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.sortx.co.uk/planned-maintenance/budgets"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text){
"today": "<string>",
"period": {
"id": "<string>",
"startYear": 123,
"label": "<string>",
"startsOn": "<string>",
"endsOn": "<string>",
"current": true,
"revision": 123
},
"periods": [
{
"id": "<string>",
"startYear": 123,
"label": "<string>",
"startsOn": "<string>",
"endsOn": "<string>",
"current": true,
"revision": 123
}
],
"kpis": {
"budgetMinor": 123,
"lineCount": 123,
"spentMinor": 123,
"spentPercent": 123,
"monthsGone": 123,
"months": 123,
"committedMinor": 123,
"remainingMinor": 123,
"remainingPercent": 123
},
"monthly": [
{
"month": "<string>",
"label": "<string>",
"spentMinor": 123,
"committedMinor": 123,
"current": true
}
],
"peak": {
"month": "<string>",
"label": "<string>",
"totalMinor": 123,
"sources": [
"<string>"
]
},
"approvals": {
"totalMinor": 123,
"items": [
{
"source": "cycle",
"id": "<string>",
"title": "<string>",
"addressLine": "<string>",
"contextLabel": "<string>",
"amountMinor": 123,
"state": "required",
"sentAt": "<string>",
"dueOn": "<string>",
"revision": 123
}
]
},
"lines": [
{
"id": "<string>",
"kind": "programmes",
"name": "<string>",
"description": "<string>",
"position": 123,
"countLabel": "<string>",
"budgetMinor": 123,
"spentMinor": 123,
"committedMinor": 123,
"pendingMinor": 123,
"remainingMinor": 123,
"usedPercent": 123
}
],
"total": {
"budgetMinor": 123,
"spentMinor": 123,
"committedMinor": 123,
"pendingMinor": 123,
"remainingMinor": 123,
"usedPercent": 123
},
"unallocated": {
"budgetMinor": 123,
"spentMinor": 123,
"committedMinor": 123,
"pendingMinor": 123,
"remainingMinor": 123,
"usedPercent": 123
}
}{
"_tag": "TenantCreateRejected",
"reason": "<string>",
"field": "<string>"
}{
"_tag": "Unauthenticated"
}{
"_tag": "TenantSuspended",
"tenantId": "<string>",
"reason": "<string>"
}{
"_tag": "EntitlementMissing",
"tenantId": "<string>",
"moduleId": "<string>"
}{
"_tag": "TenantNotFound",
"slug": "<string>"
}{
"_tag": "WebhookDuplicate",
"integration": "<string>",
"externalId": "<string>"
}{
"_tag": "RateLimited",
"key": "<string>",
"retryAfterSeconds": 123,
"message": "<string>"
}{
"_tag": "IntegrationUnavailable",
"integration": "<string>",
"detail": "<string>"
}planned-maintenance
Budgets
Budgets for one financial year: KPIs, monthly spent vs committed, approvals and lines with spend roll-ups
GET
/
planned-maintenance
/
budgets
Budgets
curl --request GET \
--url https://api.sortx.co.uk/planned-maintenance/budgets \
--header 'x-api-key: <api-key>'const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.sortx.co.uk/planned-maintenance/budgets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.sortx.co.uk/planned-maintenance/budgets"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text){
"today": "<string>",
"period": {
"id": "<string>",
"startYear": 123,
"label": "<string>",
"startsOn": "<string>",
"endsOn": "<string>",
"current": true,
"revision": 123
},
"periods": [
{
"id": "<string>",
"startYear": 123,
"label": "<string>",
"startsOn": "<string>",
"endsOn": "<string>",
"current": true,
"revision": 123
}
],
"kpis": {
"budgetMinor": 123,
"lineCount": 123,
"spentMinor": 123,
"spentPercent": 123,
"monthsGone": 123,
"months": 123,
"committedMinor": 123,
"remainingMinor": 123,
"remainingPercent": 123
},
"monthly": [
{
"month": "<string>",
"label": "<string>",
"spentMinor": 123,
"committedMinor": 123,
"current": true
}
],
"peak": {
"month": "<string>",
"label": "<string>",
"totalMinor": 123,
"sources": [
"<string>"
]
},
"approvals": {
"totalMinor": 123,
"items": [
{
"source": "cycle",
"id": "<string>",
"title": "<string>",
"addressLine": "<string>",
"contextLabel": "<string>",
"amountMinor": 123,
"state": "required",
"sentAt": "<string>",
"dueOn": "<string>",
"revision": 123
}
]
},
"lines": [
{
"id": "<string>",
"kind": "programmes",
"name": "<string>",
"description": "<string>",
"position": 123,
"countLabel": "<string>",
"budgetMinor": 123,
"spentMinor": 123,
"committedMinor": 123,
"pendingMinor": 123,
"remainingMinor": 123,
"usedPercent": 123
}
],
"total": {
"budgetMinor": 123,
"spentMinor": 123,
"committedMinor": 123,
"pendingMinor": 123,
"remainingMinor": 123,
"usedPercent": 123
},
"unallocated": {
"budgetMinor": 123,
"spentMinor": 123,
"committedMinor": 123,
"pendingMinor": 123,
"remainingMinor": 123,
"usedPercent": 123
}
}{
"_tag": "TenantCreateRejected",
"reason": "<string>",
"field": "<string>"
}{
"_tag": "Unauthenticated"
}{
"_tag": "TenantSuspended",
"tenantId": "<string>",
"reason": "<string>"
}{
"_tag": "EntitlementMissing",
"tenantId": "<string>",
"moduleId": "<string>"
}{
"_tag": "TenantNotFound",
"slug": "<string>"
}{
"_tag": "WebhookDuplicate",
"integration": "<string>",
"externalId": "<string>"
}{
"_tag": "RateLimited",
"key": "<string>",
"retryAfterSeconds": 123,
"message": "<string>"
}{
"_tag": "IntegrationUnavailable",
"integration": "<string>",
"detail": "<string>"
}Authorizations
Response
Success