How to retrieve just expenses?

fpettinella
fpettinella Expensify Customer Posts: 17 Expensify Admirer
edited October 2019 in Integrations and API

I see in the Documentation that there is "create" documented for expenses, but not "retrieve"/"get". Is there a way to do this?

I thought perhaps I could do this by doing the Export + Download of all the Reports, but now I see there is also no "retrieve"/"get" documentation for all report IDs, either.

Any way to get just expenses, regardless of whether they're in a report, based off some date/category/tag filters?

Best Answer

Answers

  • Sheena Trepanier
    Sheena Trepanier Expensify Team, Approved! Accountant, Expensify Student Ambassador Posts: 1,362 Expensify Team

    @fpettinella, good question. Expenses in an account are not considered part of the company policy, or exportable by anyone other than the account owner, until the expense is placed on a report tied to the company policy.

    Because of this, the API works to export expenses and reports based on the report ID the expense is on. I've got a few more team members who work with our API more often that haven't gotten back to me yet but if I learn anything else that would be helpful I'll let you know.

    Just a heads up, export based on submitter, policy, or a range of filters is available to a spreadsheet format, but again this excludes unreported expenses that exist in another's account.

  • Sheena Trepanier
    Sheena Trepanier Expensify Team, Approved! Accountant, Expensify Student Ambassador Posts: 1,362 Expensify Team

    Thinking on it some more @fpettinella, the API documentation looks like it should be possible.

    It makes sense to me, knowing how Expensify permissions work, that the account your using to export via the API would need to be a policy admin of each policy you were trying to export information from. This would give you the permissions necessary to export via spreadsheet format as well so it should be the same for the API.

    Then, when we look at the the Report Exportedsection of the API documentation, it’s indicated that you can export expense or report data. That, in combination with the knowledge that you can code your own Freemarker export template, makes me think that you can use the API to export expenses without needing to use the report ID.

    I'll still work on confirming that for you though and get back to you as soon as I can.

  • Sheena Trepanier
    Sheena Trepanier Expensify Team, Approved! Accountant, Expensify Student Ambassador Posts: 1,362 Expensify Team