Purpose

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

get all

This endpoint is used to retrieve all transactions.

Request:
GET /api/v1/transactions/all

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"
            }
        ]
    }
]
PropertyDescriptionTypeFilterableSortable
idthe id of the transactionUUIDv4YesYes
user_idthe id of the user owning this transactionUUIDv4NoYes
currency_idthe id of the currency this transaction is usingUUIDv4?YesYes
account_idthe id of the account this transaction belongs toUUIDv4YesYes
recipient_idthe id of the recipient this transaction belongs toUUIDv4YesYes
statusthe status of the transaction, will always be 1=completednumberNoYes
timestampthe time when this transaction has taken placetimestampYesYes
total_amountthe total amount of money of all positions combinedMoney?YesYes
commentan optional comment describing this transactionstring?YesYes
tag_idsthe ids of tags this transaction belongs toUUIDv4[]YesNo
assetthe asset this transactions belongs toAsset?YesNo
positionsthe positions this transaction consists ofPosition[]NoNo

get by id

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

Request:
GET /api/v1/transactions/{transaction_id}

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[]

get summary

This endpoint is used to retrieve a summary of transactions.
You probably need to apply a filter. If you apply the same filter as with the get all endpoint you can get a summary disregarding pagination.

Request:
GET /api/v1/transactions/summary

Response:

{
    "count": 123,
    "total_amount": "123.45€"
}
PropertyDescriptionType
countthe number of transactions in filternumber
total_amountthe total monetary amount of transactions in filterstring

create transaction

This endpoint is used to create new transactions.

Request:
POST /api/v1/transactions

{
    "account_id": "525c32a8-c200-4c5d-a3c7-ef8936cc1c84",
    "recipient_id": "e3001fbc-1e28-44ad-94f6-9900be5dbc52",
    "status": 1,
    "timestamp": "2023-01-01T10:10:00Z",
    "comment": "hello world!",
    "tag_ids": ["baf5ba00-440c-4d8a-a614-be2cbf4c2beb", "61d6ffc7-9d41-4d4d-ac0b-1c4fb92606eb"],
    "asset_id": "43e14483-6c56-4e56-a6f9-17917ac5f4c4",
    "positions": [
        {
            "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
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, should always be 1=completednumber
timestampthe time when this transaction has taken placetimestamp
commentan optional comment describing this transactionstring?
tag_idsthe ids of tags this transaction belongs toUUIDv4[]
asset_idthe id of the asset this transactions belongs toAsset?
positionsthe positions this transaction consists ofPosition[]

Response:

{
    "id": "b0e4eb0c-3719-4da8-bedc-27ca238b6ebc"
}

modify transaction

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

Request:
PUT /api/v1/transactions/{transaction_id}

{
    "account_id": "525c32a8-c200-4c5d-a3c7-ef8936cc1c84",
    "recipient_id": "e3001fbc-1e28-44ad-94f6-9900be5dbc52",
    "status": 1,
    "timestamp": "2023-01-01T10:10:00Z",
    "comment": "hello world!",
    "tag_ids": ["baf5ba00-440c-4d8a-a614-be2cbf4c2beb", "61d6ffc7-9d41-4d4d-ac0b-1c4fb92606eb"],
    "asset_id": "43e14483-6c56-4e56-a6f9-17917ac5f4c4",
    "positions": [
        {
            "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
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, should always be 1=completednumber
timestampthe time when this transaction has taken placetimestamp
commentan optional comment describing this transactionstring?
tag_idsthe ids of tags this transaction belongs toUUIDv4[]
asset_idthe id of the asset this transactions belongs toAsset?
positionsthe positions this transaction consists ofPosition[]

delete transaction

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

Request:
DELETE /api/v1/transactions/{transaction_id}