I want to use the accounting batch feature to group together and export transactions data so that I can them import that data into my accounting system (Xero). But Xero has a strictly defined structure for the CSV file it will accept, and there doesn't seem to be any way to edit the order of fields, or to add in any custom fields, to the data that CivicRM exports.

I did find this useful blog post https://civicrm.org/blogs/pogstonesarahgladstone/creating-accounting-batch-export-format-accountedge which gives some pointers about how to hack the core files to make changes.

Surely there has to be an easier way?

  • How did you go about resolving your issue? We're about to head into the CiviContribute world, and I need to adjust the Batch export to match our accounting software. I need to add the contact's donor number (custom contact field) and reformat the date of the transaction. Would you mind sharing your solution for customizing the batch export? Thanks! Commented Jan 24, 2016 at 0:33
  • Hi Allen. In the end we didn't need to get our hands dirty with this, so probably not much help to you.
    – Graham
    Commented Jan 25, 2016 at 11:49
  • I wonder if there was any more movement with this? I'm in the same position, just need to adjust the fields in the export so that I can load in a summary format into Xero. I also looked at just producing a report for this but it was be a pity not to be able to use the batch export csv as that is precisely what it is for.
    – user8292
    Commented Jan 10, 2021 at 17:10

2 Answers 2


Have you seen Eileen's extension for integration with Xero? CiviXero

  • Thanks @frtommy - I have looked at this extension, and the game plan was/is to consider moving towards using this over time (when our knowledge of what we wanted from our links between CiviCRM and Xero was clearer, and so make us better able to assess whether the extension would be a good fit). Also, I got the impression when I did investigate it that it was very much a work in progress, and not the finished article, so I took the view that there was a risk that using the extension could potentially create more problems than it solves. We'll keep it under review, however.
    – Graham
    Commented Sep 11, 2015 at 8:38

You can alter your accounting batches with hook_civicrm_batchItems and hook_civicrm_batchQuery.

  • To clarify, JonG, I would write an extension that calls hook_civicrm_batchQuery to get new data into the batch query and then call hook_civicrm_batchItems to return the new data so it can be added to the CSV export. Is that correct? Commented Jan 24, 2016 at 18:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.