how to get expenses which are not in report

RandomRandom Posts: 8Expensify Customer Expensify Newcomer

I am trying to fetch expenses (which are not added to any report yet).

Here is request I am sending

{
    "url": "https://integrations.expensify.com/Integration-Server/ExpensifyIntegrations",
  "method": "POST",
  "encoding": "utf8",
  "form": {
    "requestJobDescription": "{\"credentials\":{\"partnerUserID\":\"xxxxxx\",\"partnerUserSecret\":\"xxxxxxx\"},\"type\":\"file\",\"onReceive\":{\"immediateResponse\":[\"returnRandomFileName\"]},\"inputSettings\":{\"type\":\"combinedReportData\",\"limit\":1000,\"filters\":{\"startDate\":\"2019-01-01\",\"endDate\":\"2019-12-31\"}},\"outputSettings\":{\"fileExtension\":\"json\"}}",
    "template": "<#list reports as report>  <#list report.transactionList as expense>    ${expense.created},<#t>    ${expense.merchant},<#t>    ${expense.amount},<#t>    ${expense.category}<#lt>    ${expense.tag}<#lt>    ${expense.type}<#lt>    ${expense.description}<#lt>${'\n'}  "
  }

followed by


{
    "url": "https://integrations.expensify.com/Integration-Server/ExpensifyIntegrations",
  "method": "POST",
  "encoding": "utf8",
  "form": {
    "requestJobDescription": "{\"credentials\":{\"partnerUserID\":\"xxxxxx\",\"partnerUserSecret\":\"xxxxxx\"},\"type\":\"download\",\"fileName\":\"<namefromabove.json>\",\"fileSystem\":\"integrationServer\"}"
  }
}

I am facing two problems..

  • Even though I specified filetype to be json, the downloaded data is csv
  • For some reason, api is only able to fetch data from expenses which were in last year's report. I need to fetch expenses which are in currently not added to any report. I tried changing startdate/enddate but that is not working.

Please help.

Tagged:

Best Answer

  • Nicole TrepanierNicole Trepanier Posts: 566 Expensify Success Coach
    Accepted Answer

    @Random I think the dummy report would be your best bet here. You can turn on scheduled submit to always add new expenses to your open report. Just set the submission to manually and it will stay open throughout the year. You'll still see these on your expenses page and be able to move them to their individual reports.

    The rest API isn't available publicly and though we are looking to make more of the API available in the future, I don't have a timeline yet.

Answers

  • Nicole TrepanierNicole Trepanier Posts: 566Expensify Success Coach - Admin Expensify Success Coach

    Hi @Random! Unfortunately, our API doesn't have the option to export expenses that are not on a report. Is there a reason you don't want to add your expenses to an open report?

  • RandomRandom Posts: 8Expensify Customer Expensify Newcomer

    currently my workflow involves adding all expenses throughout the year and generating several different reports at year end. so When i add expenses they are not in a particular report since at year end i have to put them in separate reports. I can try putting them in a dummy report throughout the year and then move them to their correct report at year end. but that is an extra step i have to do to make things work.

    Alternatively, one more suggestion , I see that your website uses rest api for rendering the HTML. Any possibility you could allow using api id/key to call those api's ? I am not sure current report api is working that well for my needs and that UI rest api would be perfect.

Sign In or Register to comment.