[Feature] Add API support for importing transactions from a file #420

Closed
opened 2026-02-28 19:03:26 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @j-f1 on GitHub (Jun 1, 2023).

Verified feature request does not already exist?

  • I have searched and found no existing issue

💻

  • Would you like to implement this feature?

Pitch: what problem are you trying to solve?

Currently, an OFX or CSV file can only be imported from the UI. Imports via the API can happen by manually parsing a CSV file and then inserting its transactions, but you lose the benefits of our import logic (including OFX parsing).

Describe your ideal solution to this problem

Add a new method to the API that allows passing in a file path which will be parsed and imported. It should follow the flow of the web app (which persists per-account import settings in the prefs field) while still allowing manual customization at the call site.

This change would require a refactor since a portion of the import logic is currently in the <ImportTransactions> component. Most important is the field mapping and date parsing for CSVs, but there are some other pieces of logic that should be moved into loot-core.

I’m not sure whether it would be best to have the method add transactions into the account in one step, return the transactions without adding them, or add the transactions and then return them in case the script wants to filter the imported transactions.

Teaching and learning

No response

Originally created by @j-f1 on GitHub (Jun 1, 2023). ### Verified feature request does not already exist? - [X] I have searched and found no existing issue ### 💻 - [ ] Would you like to implement this feature? ### Pitch: what problem are you trying to solve? Currently, an OFX or CSV file can only be imported from the UI. Imports via the API can happen by manually parsing a CSV file and then inserting its transactions, but you lose the benefits of our import logic (including OFX parsing). ### Describe your ideal solution to this problem Add a new method to the API that allows passing in a file path which will be parsed and imported. It should follow the flow of the web app (which persists per-account import settings in the `prefs` field) while still allowing manual customization at the call site. This change would require a refactor since a portion of the import logic is currently in the `<ImportTransactions>` component. Most important is the field mapping and date parsing for CSVs, but there are some other pieces of logic that should be moved into `loot-core`. I’m not sure whether it would be best to have the method add transactions into the account in one step, return the transactions without adding them, or add the transactions and then return them in case the script wants to filter the imported transactions. ### Teaching and learning _No response_
GiteaMirror added the APIneeds votesfeaturehelp wanted labels 2026-02-28 19:03:27 -06:00
Author
Owner

@github-actions[bot] commented on GitHub (Jun 1, 2023):

Thanks for sharing your idea!

This repository is now using lodash style issue management for enhancements. This means enhancement issues will now be closed instead of leaving them open. This doesn’t mean we don’t accept feature requests, though! We will consider implementing ones that receive many upvotes, and we welcome contributions for any feature requests marked as needing votes (just post a comment first so we can help you make a successful contribution).

The enhancement backlog can be found here: https://github.com/actualbudget/actual/issues?q=label%3A%22needs+votes%22+sort%3Areactions-%2B1-desc+

Don’t forget to upvote the top comment with 👍!

@github-actions[bot] commented on GitHub (Jun 1, 2023): :sparkles: Thanks for sharing your idea! :sparkles: This repository is now using lodash style issue management for enhancements. This means enhancement issues will now be closed instead of leaving them open. This doesn’t mean we don’t accept feature requests, though! We will consider implementing ones that receive many upvotes, and we welcome contributions for any feature requests marked as needing votes (just post a comment first so we can help you make a successful contribution). The enhancement backlog can be found here: https://github.com/actualbudget/actual/issues?q=label%3A%22needs+votes%22+sort%3Areactions-%2B1-desc+ Don’t forget to upvote the top comment with 👍! <!-- feature-auto-close-comment -->
Author
Owner

@mcalligator commented on GitHub (Apr 20, 2025):

This looks like it would be a handy feature. I would add that it requires a data validation step to check that the file being imported complies with the specification set in the prefs field for the account (with sensible defaults in place when none has been explicitly defined by the user). The amount of detail in any error response is up for discussion - an MVP could be to fail-on-first-error, indicating what and where the error is. A later enhancement could return a structure containing all the errors, to reduce the burden on the user to find and fix all of them.

As to whether the transactions should be imported in a single step, merely returned, or both, this should be determined by an API parameter.

@mcalligator commented on GitHub (Apr 20, 2025): This looks like it would be a handy feature. I would add that it requires a data validation step to check that the file being imported complies with the specification set in the `prefs` field for the account (with sensible defaults in place when none has been explicitly defined by the user). The amount of detail in any error response is up for discussion - an MVP could be to fail-on-first-error, indicating what and where the error is. A later enhancement could return a structure containing _all_ the errors, to reduce the burden on the user to find and fix all of them. As to whether the transactions should be imported in a single step, merely returned, or both, this should be determined by an API parameter.
Author
Owner

@willgryan commented on GitHub (Dec 2, 2025):

This would be useful indeed! Alternatively, I was going to programmatically add transactions using the API w/ the same OFX parsing code using by the file import in the web UI.

@willgryan commented on GitHub (Dec 2, 2025): This would be useful indeed! Alternatively, I was going to programmatically add transactions using the API w/ the same OFX parsing code using by the [file import in the web UI](url).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#420