How to get the GL Code included in Expense Report Export via API

Hello. We are working on an integration between Expensify and our accounting application using the API and thus require the GL Code linked to the expense category. Is there any way to get it besides putting the code in the category name, which seems counter intuitive since there is a field for the Category GL Code but it doesn't get populated in the report export via the API.
Best Answer
-
@Mathew_Usage Can you try using {category.GlCode} rather than {expense.GLCode}?
Answers
-
Apologies, I see that I have posted this in the wrong area, but don't see a way to move it
-
Rachael Hopkins Expensify Success Coach - Admin, Expensify Team, Expensify Student Ambassador Posts: 904 Expensify Team
No worries @Mathew_Usage I've moved it for you!
-
Rachael Hopkins Expensify Success Coach - Admin, Expensify Team, Expensify Student Ambassador Posts: 904 Expensify Team
Hi @Mathew_Usage since no one else is wading in here, let me see if I can help!
To clarify - are you trying to import the GL code into Expensify or export it out?
-
@Mathew_Usage Are your GL codes being uploaded into Expensify with your categories? As long as you've added your GL codes to your categories within your policy, you'll be able to export this field. This field is available only on corporate policies.
-
Hi @RachCHopkins. Thank you for responding. I am trying to export the expense report out of Expensify, with the GL Code linked to the expense category included in the export. This is in order to create the expense record in our accounting application against the correct GL Code. Although the expense category has a GL code linked, and the GL Code field is included in the export template, the field does not get populated. Other posts have suggested that the GL Code needs to be included in the category description, but that doesn't make sense since Expensify allows you to link a GL Code to the Expense Category and lists it as an available field for inclusion in the export template.
-
@Nicole Trepanier Thank you for your feedback. Yes, the GL Codes are in Expensify with the Categories. The policy is created in the Control Plan, which I believe is a corporate plan?
-
@Mathew_Usage I'm not seeing a policy with GL codes on your account under this email. Do you log into Expensify under a different email?
-
@Nicole Trepanier Yes, this email account is the one I have been using to test approving the expenses. The account that has the policy etc is under [email protected] and it is the Sage Integration Policy I am testing. Thank you
-
@Mathew_Usage Thanks for clarifying. Can you send us the call you are using that is failing to populate this field?
-
I am making a call to the following URL:
https://integrations.expensify.com/Integration-Server/ExpensifyIntegrations
using the following (partnerUserSecret edited):
requestJobDescription={
"type":"file",
"credentials":{
"partnerUserID":"aa_mathew_trew_co_za",
"partnerUserSecret":"6f9441..."
},
"onReceive":{
"immediateResponse":["returnRandomFileName"]
},
"inputSettings":{
"type":"combinedReportData",
"reportState":"APPROVED,REIMBURSED",
"limit":"10",
"filters":{
"startDate":"2019-05-01",
"endDate":"2019-08-30",
"markedAsExported":"Expensify Export"
}
},
"outputSettings":{
"fileExtension":"csv",
"fileBasename":"Sage200_Integration_16_07_2019",
},
"test":"true",
"onFinish":[
{"actionName":"markAsExported","label":"Expensify Export"},
{"actionName":"email","recipients":"[email protected]", "message":"Report is ready."}
]
}
using the following report template:
<#if addHeader == true>
Merchant,Original Amount,Category,categoryGLCode,comment, Report number,Expense number <#lt>
</#if>
<#assign reportNumber = 1>
<#assign expenseNumber = 1>
<#list reports as report>
<#list report.transactionList as expense>
${expense.merchant},<#t>
<#-- note: expense.amount prints the original amount only -->
${expense.amount},<#t>
${expense.category},<#t>
${expense.GLCode},<#t>
${expense.comment},<#t>
${reportNumber},<#t>
${expenseNumber}<#lt>
<#assign expenseNumber = expenseNumber + 1>
</#list>
<#assign reportNumber = reportNumber + 1>
</#list>
-
Are you able to see what we are doing wrong?
-