# Group Transactions

### List Wallet Transactions [GET /api/wallets/{wallet_id}/transactions]

Get list of wallet's transactions

+ Parameters
    + wallet_id (number) - ID of the Wallet in the form of an integer

+ Request (application/json)

    + Attributes (object)
        + from: (number) - From unix timestamp. Default is now() - 1 month
        + to: (string) - To unix timestamp. Default is now()

    + Headers
            authCode: 421a5bbd0624efebf12b2cbe5454b753

+ Response 200 (application/json)

    + Body

        [
            {
                "id":53402,
                "description":"Desc",
                "amount":-42.33,
                "abs_amount":42.33,
                "subtype":"confirmed",
                "datetime":1449706027,
                "type":"expense",
                "user_id":1,
                "wallet_id":2103
            },
            {
                "id":53412,
                "description":"Text",
                "amount":0.99,
                "abs_amount":0.99,
                "subtype":"confirmed",
                "datetime":1449736027,
                "type":"profit",
                "user_id":1,
                "wallet_id":2103
            }
        ]

### Add New Transaction [POST /api/wallets/{wallet_id}/transactions]

Add new transaction

+ Parameters
    + wallet_id (number) - ID of the Wallet in the form of an integer

+ Request (application/json)

    + Headers
            authCode: 421a5bbd0624efebf12b2cbe5454b753

    + Attributes (object)
        + wallet_id: 1 (number, required) - Wallet ID. Should be the same as in URL param
        + amount: 9.99 (number, required) - Transaction amount
        + description: Some description (string) - Transaction description
        + subtype: confirmed (string) - Transaction subtype. Default is 'confirmed'. If subtype is 'setup', it sets wallet total to amount.
        + datetime: (number) - Default is current unix timestamp

+ Response 200 (application/json)

    + Body

        {
            "id":53402,
            "description":"Desc",
            "amount":-42.33,
            "abs_amount":42.33,
            "subtype":"confirmed",
            "datetime":1449706027,
            "type":"expense",
            "user_id":1,
            "wallet_id":2103
        }

### Remove Transaction [DELETE /api/wallets/{wallet_id}/transactions/{transaction_id}]

Remove transaction from database. Also recalculate wallet total.

+ Parameters
    + wallet_id (number) - ID of the Wallet in the form of an integer
    + transaction_id (number) - ID of the Transaction in the form of an integer

+ Request (application/json)

    + Headers
            authCode: 421a5bbd0624efebf12b2cbe5454b753

+ Response 200 (application/json)

    + Body

        true