API Report Exporter

Mikail Approved! Accountant Posts: 14 Expensify Newcomer


I am using Postman to write calls to the Expensify API Report Exporter. Does anyone know how to get the credit card transaction posting date in the report export templates using the Expensify API? You can create a CSV custom export to include the credit card transaction posting date by using {expense:posted}, but if you use the same field name with the Freemarker language ${expense.posted}<#t> then the results are null. I have 15 different domains for the same company, and I need a report that can include all of the transactions for all 15 domains. I understand that ${expense.posted}<#t> will work for the reconciliation export, but the reconciliation export REQUIRES ONE domain address as a filter which means I cannot pull data for all 15 domains without changing the variable 15 times or using a collection runner. I do not want to use a collection runner because the company acquires about 30 new locations (with new domains) every year and I can't add maintenance time right now.

Any help would be greatly appreciated! Please post a reply! Thank you!

Best Answer

  • Ted Harris
    Ted Harris Expensify Success Coach - Admin, Expensify Team, Expensify Student Ambassador Posts: 359 Expensify Team
    Answer ✓

    Hi @Mikail, here's how I've seen others do it in their Freemarker templates:

            <#if expense.details.posted?has_content && expense.managedCard>
    	            <#assign postedDate = expense.details.posted?date("yyyyMMdd")?string("yyyy-MM-dd")>
    	            <#assign postedDate = "Not Applicable">

    Then just print ${postedDate} and this should work across all reports you export that have company card transactions on.