Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug In transactions API #1812

Closed
emansih opened this issue Oct 23, 2018 · 3 comments
Closed

Bug In transactions API #1812

emansih opened this issue Oct 23, 2018 · 3 comments

Comments

@emansih
Copy link
Contributor

emansih commented Oct 23, 2018

I am running Firefly III version 4.7.7

When i attempt to retrieve expense data using the transactions API, using a slightly different parameter variable will cause multiple invalid data to show up.

curl -X GET \
  'https://demo.firefly-iii.org/api/v1/transactions?type=expense' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer xxx' 

Transaction ID 1356 does not shows up

curl -X GET \
  'https://demo.firefly-iii.org/api/v1/transactions?type=expenses' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer xxx' 

Transaction ID 1356 shows up

This is transaction ID 1356

 {
            "type": "transactions",
            "id": "1356",
            "attributes": {
                "updated_at": "2018-10-23T12:00:09+02:00",
                "created_at": "2018-10-23T12:00:09+02:00",
                "description": "Saving money for September",
                "transaction_description": null,
                "date": "2018-09-28",
                "type": "Transfer",
                "identifier": 0,
                "journal_id": 669,
                "reconciled": false,
                "amount": 140,
                "currency_id": 1,
                "currency_code": "EUR",
                "currency_symbol": "€",
                "currency_dp": 2,
                "foreign_amount": null,
                "foreign_currency_id": null,
                "foreign_currency_code": null,
                "foreign_currency_symbol": null,
                "foreign_currency_dp": null,
                "bill_id": null,
                "bill_name": null,
                "category_id": null,
                "category_name": null,
                "budget_id": null,
                "budget_name": null,
                "notes": null,
                "source_id": 1,
                "source_name": "Checking Account",
                "source_iban": "NL11XOLA6707795988",
                "source_type": "Asset account",
                "destination_id": 2,
                "destination_name": "Savings Account",
                "destination_iban": "NL96DZCO4665940223",
                "destination_type": "Asset account"
            },
            "links": {
                "0": {
                    "rel": "self",
                    "uri": "/transactions/1356"
                },
                "self": "https://demo.firefly-iii.org/api/v1/transactions/1356"
            }
        }

This issue was originally mentioned by @Ditti4 here. I did some investigation and found out about it.

@emansih
Copy link
Contributor Author

emansih commented Oct 23, 2018

curl -X GET \
  'https://demo.firefly-iii.org/api/v1/transactions?type=transfer' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer xxx' 
curl -X GET \
  'https://demo.firefly-iii.org/api/v1/transactions?type=transfers' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer xxx' 

will show the same data.

curl -X GET \
  'https://demo.firefly-iii.org/api/v1/transactions?type=deposit' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer xxx' 
curl -X GET \
  'https://demo.firefly-iii.org/api/v1/transactions?type=deposits' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer xxx' 

will show the same data.

This means that only expenses and expense type is having an issue

@JC5
Copy link
Member

JC5 commented Oct 23, 2018

The keyword expenses is not supported, so it will return the default types: deposits, transfers, and withdrawals.

The keyword expense is returning the wrong data.

https://github.com/firefly-iii/firefly-iii/blob/master/app/Api/V1/Controllers/TransactionController.php#L292

I'll get it fixed for the next version!

@JC5 JC5 added the bug label Oct 23, 2018
emansih added a commit to emansih/FireflyMobile that referenced this issue Oct 23, 2018
@JC5
Copy link
Member

JC5 commented Oct 23, 2018

Added "expenses" keyword.

JC5 added a commit that referenced this issue Oct 23, 2018
@emansih emansih closed this as completed Oct 24, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jan 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants