Purpose

The accounts route contains all endpoints related to the management of accounts.
Do not confuse this route with the users route used to manage user accounts in Dukatia.

get all

This endpoint is used to retrieve all accounts.

Request:
GET /api/v1/accounts/all

Response:

[
    {
        "id": "525c32a8-c200-4c5d-a3c7-ef8936cc1c84",
        "name": "bank xy",
        "default_currency_id": "ffc53ce5-0bd2-4464-94b3-9866e506fd91",
        "user_id": "6b875d6c-7d4e-4ae3-931f-270604df1d7f",
        "tag_ids": ["baf5ba00-440c-4d8a-a614-be2cbf4c2beb", "61d6ffc7-9d41-4d4d-ac0b-1c4fb92606eb"],
        "balance": 12345
    }
]
PropertyDescriptionTypeFilterableSortable
idid of the accountUUIDv4YesNo
namename of the accountstringYesNo
default_currency_idcurrency id of all newly added transactions using this accountUUIDv4YesNo
user_iduser_id that owns this accountUUIDv4NoNo
tag_idsall tags assigned to this accountUUIDv4[]YesNo
balancecurrent balance of account in centsnumber?YesNo

get by id

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

Request:
GET /api/v1/accounts/{account_id}

Response:

{
    "id": "525c32a8-c200-4c5d-a3c7-ef8936cc1c84",
    "name": "bank xy",
    "default_currency_id": "ffc53ce5-0bd2-4464-94b3-9866e506fd91",
    "user_id": "6b875d6c-7d4e-4ae3-931f-270604df1d7f",
    "tag_ids": ["baf5ba00-440c-4d8a-a614-be2cbf4c2beb", "61d6ffc7-9d41-4d4d-ac0b-1c4fb92606eb"],
    "balance": 12345
}
PropertyDescriptionType
idid of the accountUUIDv4
namename of the accountstring
default_currency_idcurrency id of all newly added transactions using this accountUUIDv4
user_iduser_id that owns this accountUUIDv4
tag_idsall tags assigned to this accountUUIDv4[]
balancecurrent balance of account in centsnumber?

create account

This endpoint is used to create new accounts.

Request:
POST /api/v1/accounts

{
    "name": "bank xy",
    "default_currency_id": "ffc53ce5-0bd2-4464-94b3-9866e506fd91",
    "tag_ids": ["baf5ba00-440c-4d8a-a614-be2cbf4c2beb", "61d6ffc7-9d41-4d4d-ac0b-1c4fb92606eb"]
}
PropertyDescriptionType
namename of the accountstring
default_currency_idcurrency id of all newly added transactions using this accountUUIDv4
tag_idsall tags assigned to this accountUUIDv4[]?

Response:

{
    "id": "525c32a8-c200-4c5d-a3c7-ef8936cc1c84"
}

modify account

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

Request:
PUT /api/v1/accounts/{account_id}

{
    "name": "bank xy",
    "default_currency_id": "ffc53ce5-0bd2-4464-94b3-9866e506fd91",
    "tag_ids": ["baf5ba00-440c-4d8a-a614-be2cbf4c2beb", "61d6ffc7-9d41-4d4d-ac0b-1c4fb92606eb"]
}
PropertyDescriptionType
namename of the accountstring
default_currency_idcurrency id of all newly added transactions using this accountUUIDv4
tag_idsall tags assigned to this accountUUIDv4[]?