Add transaction to group via API
M
Michelle
The API has an endpoint to create a new group from existing transactions, but not to add/remove transactions from an existing group. I like to write scripts to automate my budgeting and this would be very helpful for me! Maybe could be as simple as adding "group_id" on the create and update transaction endpoints to assign it to a group, or "group_id: false" to remove it?
Log In
J
JP Shipherd
This is an interesting idea! We are just in the final stages of releasing a v2 API with a more robust set of endpoints. This ISN'T supported in the new API, but after we complete the initial release, it is something that we could look at.
The approach you've suggested (updating the
group_id
property of an existing transaction) would work well with the v2 PUT /transactions design. There may be some reasons I'm not yet aware of why this approach wouldn't work, but I will research it after v2 is released!)I'm curious what behavior you would expect in a case where a transaction group were made up of only two transactions, and you used this approach to set the
group_id
property to null
for one of them? Would you expect the API to fail with a message indicating that this would leave only one transaction in the group, which is not allowed, or would you want it to silently restore the other transaction, and delete the group transaction? Neither seems ideal to me, which may be one reason that we currently require you to ungroup and regroup when making changes to a transaction group.