Are you receiving SNAP/EBT benefits? The Expensify.org/SNAP-VAX campaign is live and accepting new members. Learn more about receiving $50 for submitting a SNAP receipt and $50 for getting your COVID-19 vaccine here and join today!

API Report Exporter

Mikail
Mikail Approved! Accountant Posts: 7 Expensify Newcomer

Hello,

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 Posts: 354 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")>
    	        <#else>
    	            <#assign postedDate = "Not Applicable">
    	        </#if>
    

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

Answers