Purpose

The budgets route contains all endpoints related to the management of budgets.

get all

This endpoint is used to retrieve all budgets.

Request:
GET /api/v1/budgets/all

Response:

[
    {
        "id": "42d46365-1219-4a15-a536-4c2eca8e4bdf",
        "name": "technology",
        "user_id": "6b875d6c-7d4e-4ae3-931f-270604df1d7f",
        "amount": {
            "major": 123,
            "minor": 45,
            "minor_in_major": 100,
            "symbol": "€",
            "is_negative": false
        },
        "rollover": false,
        "period": 2,
        "filter_tag_ids": ["baf5ba00-440c-4d8a-a614-be2cbf4c2beb", "61d6ffc7-9d41-4d4d-ac0b-1c4fb92606eb"],
        "currency_id": "ffc53ce5-0bd2-4464-94b3-9866e506fd91",
        "active_from": "2023-01-01T10:10:00Z",
        "active_to": null,
        "used_amount": {
            "major": 10,
            "minor": 50,
            "minor_in_major": 100,
            "symbol": "€",
            "is_negative": false
        },
        "available_amount": {
            "major": 112,
            "minor": 95,
            "minor_in_major": 100,
            "symbol": "€",
            "is_negative": false
        },
        "utilization": 8.5054678007
    }
]
PropertyDescriptionTypeFilterableSortable
idthe id of the budgetUUIDv4YesNo
namethe name of the budgetstringYesNo
user_idthe id of the user owning this budgetUUIDv4NoNo
amountthe total amount set for the budgetMoneyYesNo
rolloverif unused budget is rolled over into the next periodbooleanYesNo
periodhow often the budget resets 0=daily, 1=weekly, 2=monthly, 3=quarterly, 4=yearlynumberNoNo
filter_tag_idsids of the tags whose transactions get included in this budgetUUIDv4[]YesNo
currency_idif of the currency used in this budgetUUIDv4YesNo
active_fromfrom which point in time onwards transactions should get included in this budgettimestampYesNo
active_tountil which point in time transactions should get included in this budgettimestamp?YesNo
used_amountamount of money spent in current periodMoney?NoNo
available_amountamount of money still available in current periodMoney?NoNo
utilizationpercentage of used money in current periodnumber?NoNo

get by id

This endpoint is used to retrieve a single budget by its id. You need to specify the id of the budget you want to retrieve in the request path.

Request:
GET /api/v1/budgets/{budget_id}

Response:

{
    "id": "42d46365-1219-4a15-a536-4c2eca8e4bdf",
    "name": "technology",
    "user_id": "6b875d6c-7d4e-4ae3-931f-270604df1d7f",
    "amount": {
        "major": 123,
        "minor": 45,
        "minor_in_major": 100,
        "symbol": "€",
        "is_negative": false
    },
    "rollover": false,
    "period": 2,
    "filter_tag_ids": ["baf5ba00-440c-4d8a-a614-be2cbf4c2beb", "61d6ffc7-9d41-4d4d-ac0b-1c4fb92606eb"],
    "currency_id": "ffc53ce5-0bd2-4464-94b3-9866e506fd91",
    "active_from": "2023-01-01T10:10:00Z",
    "active_to": null,
    "used_amount": {
        "major": 10,
        "minor": 50,
        "minor_in_major": 100,
        "symbol": "€",
        "is_negative": false
    },
    "available_amount": {
        "major": 112,
        "minor": 95,
        "minor_in_major": 100,
        "symbol": "€",
        "is_negative": false
    },
    "utilization": 8.5054678007
}
PropertyDescriptionType
idthe id of the budgetUUIDv4
namethe name of the budgetstring
user_idthe id of the user owning this budgetUUIDv4
amountthe total amount set for the budgetMoney
rolloverif unused budget is rolled over into the next periodboolean
periodhow often the budget resets 0=daily, 1=weekly, 2=monthly, 3=quarterly, 4=yearlynumber
filter_tag_idsids of the tags whose transactions get included in this budgetUUIDv4[]
currency_idif of the currency used in this budgetUUIDv4
active_fromfrom which point in time onwards transactions should get included in this budgettimestamp
active_tountil which point in time transactions should get included in this budgettimestamp?
used_amountamount of money spent in current periodMoney?
available_amountamount of money still available in current periodMoney?
utilizationpercentage of used money in current periodnumber?

get transactions

This endpoint is used to retrieve all transactions matching this budget in its current period.
You need to specify the id of the budget you want to retrieve transactions of in the request path.

Request:
GET /api/v1/budgets/{budget_id}/transactions

Response:

[
    {
        "id": "b0e4eb0c-3719-4da8-bedc-27ca238b6ebc",
        "user_id": "6b875d6c-7d4e-4ae3-931f-270604df1d7f",
        "currency_id": "ffc53ce5-0bd2-4464-94b3-9866e506fd91",
        "account_id": "525c32a8-c200-4c5d-a3c7-ef8936cc1c84",
        "recipient_id": "e3001fbc-1e28-44ad-94f6-9900be5dbc52",
        "status": 1,
        "timestamp": "2023-01-01T10:10:00Z",
        "total_amount": {
            "major": 10,
            "minor": 50,
            "minor_in_major": 100,
            "symbol": "€",
            "is_negative": false
        },
        "comment": "hello world!",
        "tag_ids": ["baf5ba00-440c-4d8a-a614-be2cbf4c2beb", "61d6ffc7-9d41-4d4d-ac0b-1c4fb92606eb"],
        "asset": null,
        "positions": [
            {
                "id": "0a02167e-9a47-41ad-90b1-936b17e3a6f1",
                "amount": {
                    "major": 10,
                    "minor": 50,
                    "minor_in_major": 100,
                    "symbol": "€",
                    "is_negative": false
                },
                "comment": "Im the only position!",
                "tag_id": "baf5ba00-440c-4d8a-a614-be2cbf4c2beb"
            }
        ]
    }
]
PropertyDescriptionType
idthe id of the transactionUUIDv4
user_idthe id of the user owning this transactionUUIDv4
currency_idthe id of the currency this transaction is usingUUIDv4?
account_idthe id of the account this transaction belongs toUUIDv4
recipient_idthe id of the recipient this transaction belongs toUUIDv4
statusthe status of the transaction, will always be 1=completednumber
timestampthe time when this transaction has taken placetimestamp
total_amountthe total amount of money of all positions combinedMoney?
commentan optional comment describing this transactionstring?
tag_idsthe ids of tags this transaction belongs toUUIDv4[]
assetthe asset this transactions belongs toAsset?
positionsthe positions this transaction consists ofPosition[]

create budget

This endpoint is used to create new budgets.

Request:
POST /api/v1/budgets

{
    "name": "technology",
    "amount": {
        "major": 123,
        "minor": 45,
        "minor_in_major": 100,
        "symbol": "€",
        "is_negative": false
    },
    "rollover": false,
    "period": 2,
    "filter_tag_ids": ["baf5ba00-440c-4d8a-a614-be2cbf4c2beb", "61d6ffc7-9d41-4d4d-ac0b-1c4fb92606eb"],
    "currency_id": "ffc53ce5-0bd2-4464-94b3-9866e506fd91",
    "active_from": "2023-01-01T10:10:00Z",
    "active_to": null,
}
PropertyDescriptionType
namethe name of the budgetstring
amountthe total amount set for the budgetMoney
rolloverif unused budget is rolled over into the next periodboolean
periodhow often the budget resets 0=daily, 1=weekly, 2=monthly, 3=quarterly, 4=yearlynumber
filter_tag_idsids of the tags whose transactions get included in this budgetUUIDv4[]
currency_idif of the currency used in this budgetUUIDv4
active_fromfrom which point in time onwards transactions should get included in this budgettimestamp
active_tountil which point in time transactions should get included in this budgettimestamp?

Response:

{
    "id": "42d46365-1219-4a15-a536-4c2eca8e4bdf"
}
PropertyDescriptionType
idthe id of the newly created budgetUUIDv4

modify budget

This endpoint is used to modify an existing budget.
You need to specify the id of the budget you want to modify in the request path.

Request:
PUT /api/v1/budget/{budget_id}

{
    "name": "technology",
    "amount": {
        "major": 123,
        "minor": 45,
        "minor_in_major": 100,
        "symbol": "€",
        "is_negative": false
    },
    "rollover": false,
    "period": 2,
    "filter_tag_ids": ["baf5ba00-440c-4d8a-a614-be2cbf4c2beb", "61d6ffc7-9d41-4d4d-ac0b-1c4fb92606eb"],
    "currency_id": "ffc53ce5-0bd2-4464-94b3-9866e506fd91",
    "active_from": "2023-01-01T10:10:00Z",
    "active_to": null,
}
PropertyDescriptionType
namethe name of the budgetstring
amountthe total amount set for the budgetMoney
rolloverif unused budget is rolled over into the next periodboolean
periodhow often the budget resets 0=daily, 1=weekly, 2=monthly, 3=quarterly, 4=yearlynumber
filter_tag_idsids of the tags whose transactions get included in this budgetUUIDv4[]
currency_idif of the currency used in this budgetUUIDv4
active_fromfrom which point in time onwards transactions should get included in this budgettimestamp
active_tountil which point in time transactions should get included in this budgettimestamp?

delete budget

This endpoint is used to delete an existing budget. You need to specify the id of the budget you want to delete in the request path.

Request:
DELETE /api/v1/budgets/{budget_id}