Put budget lines
curl --request PUT \
--url https://api.sortx.co.uk/planned-maintenance/budgets/{year}/lines \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"expectedRevision": 123,
"lines": [
{
"name": "<string>",
"budgetMinor": 123,
"id": "<string>",
"description": "<string>"
}
]
}
'const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
expectedRevision: 123,
lines: [{name: '<string>', budgetMinor: 123, id: '<string>', description: '<string>'}]
})
};
fetch('https://api.sortx.co.uk/planned-maintenance/budgets/{year}/lines', 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/{year}/lines"
payload = {
"expectedRevision": 123,
"lines": [
{
"name": "<string>",
"budgetMinor": 123,
"id": "<string>",
"description": "<string>"
}
]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"period": {
"id": "<string>",
"startYear": 123,
"label": "<string>",
"startsOn": "<string>",
"endsOn": "<string>",
"current": true,
"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
}
}{
"_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
Put budget lines
Edit budgets: replace a year’s lines
PUT
/
planned-maintenance
/
budgets
/
{year}
/
lines
Put budget lines
curl --request PUT \
--url https://api.sortx.co.uk/planned-maintenance/budgets/{year}/lines \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"expectedRevision": 123,
"lines": [
{
"name": "<string>",
"budgetMinor": 123,
"id": "<string>",
"description": "<string>"
}
]
}
'const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
expectedRevision: 123,
lines: [{name: '<string>', budgetMinor: 123, id: '<string>', description: '<string>'}]
})
};
fetch('https://api.sortx.co.uk/planned-maintenance/budgets/{year}/lines', 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/{year}/lines"
payload = {
"expectedRevision": 123,
"lines": [
{
"name": "<string>",
"budgetMinor": 123,
"id": "<string>",
"description": "<string>"
}
]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"period": {
"id": "<string>",
"startYear": 123,
"label": "<string>",
"startsOn": "<string>",
"endsOn": "<string>",
"current": true,
"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
}
}{
"_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
Body
application/json