mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-01-14 21:23:29 +01:00
POST /api/transactions/ - account_id object does not exist. #65
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @RodrigoPrestes on GitHub (Oct 17, 2025).
Hello, I tried to create a new transaction using the API
/api/transactions/but it failed with HTTP error 400.I had created the account through the GUI, when calling GET
/api/accounts/I receive this:So, it does return the account.
For reference here's the body I'm sending on the create transaction POST resquest:
I thought I might be missing something but the issue is very similar to https://github.com/eitchtee/WYGIWYH/issues/253.
One extra detail, I'm doing the POST request inside n8n, I created a second user for n8n and only gave the 'Can add Transaction' permission. I also tried adding the 'Can view Account' but I still get 400.
@eitchtee commented on GitHub (Oct 17, 2025):
Hey Rodrigo, hope you're enjoying WYGIWYH.
We currently don't support permission scoping, any permission added to the user via the Django Admin is ignored. The way it currently works is, basically, a user has full access to any account it creates, or is shared with it.
My suspicion is that your n8n user doesn't have access to the account you're trying to add a transaction to. You have two options:
Sidebar>Management>Accounts>Click the arrow button besides each account name and select your user on the Shared with field. Repeat this for any account you want.Let me know if this fixes your issue.
P.S. Ideally, we should move to a Token based access on the API, with proper permissions, like you tried to do, but time has been really short lately to implement anything, hopefully someday.
@RodrigoPrestes commented on GitHub (Oct 17, 2025):
That was it, I needed to share the account.
For my use case that's more than enough.
Thanks.
@avier99 commented on GitHub (Nov 27, 2025):
Hey @RodrigoPrestes possible you could share your n8n setup workflow?
i am having trouble connecting it with my wygiwyh!!
i am planning to link a sheet there to automatically import my transactions (temporarily)
@RodrigoPrestes commented on GitHub (Nov 28, 2025):
Hi @avier99, here's how I've done it:
On the WYGIWYH side:
Managment > Users > + ButtonCategories, clicked on the Share button (the ↱ arrow) of a categoryShared with usersdropdown I selected the n8n user and then saved (This was the missing piece for me)On the n8n side:
Create transaction, with this:(data is fictional, not hard coded on the real node)
Method =
POSTURL =
http://wygiwyh.yourinstance.com:8000/api/transactions/, Replace the domain with your WYGIWYH URLAuthentication =
Generic Credential TypeGeneric Auth Type =
Basic AuthBasic Auth = I had to create one, on the pencil icon on the right and then add the same credentials for the n8n user on WYGIWYH
Send Query Parameters =
offSend Headers =
offSend Body =
onBody Content Type =
JSONSpecify Body =
Using JSONJSON =
{{ $('Create transaction').first().json.body }}Notes:
Been working flawlessly here.
@eitchtee commented on GitHub (Nov 28, 2025):
Going by memory here, but I'm pretty sure you don't even need ids for most things, passing a string should work. e.g.:
account: "My Account",
category: "My category",
tags: ["My tags"],
entities: ["my entity"]
And for category and tags, they should get created automatically if they don't exist when doing this.
@avier99 commented on GitHub (Nov 28, 2025):
thanks @RodrigoPrestes ; will try it out soon