Understanding Import_ID

Good afternoon,

I am currently using Tasker to grab my credit card notifications and post the transaction to YNAB using the API. Since I also have my accounts being synced with my bank I am using the import_id field and using the format YNAB:[milliunit_amount]:[iso_date]:[occurrence]

This is working very well but what I am finding is certain transactions are still being imported into YNAB from my bank. While using the API I can see that the transaction I imported using the API has the import ID with the date that the purchase was made but the transaction that was imported from the bank has an import ID with a date a couple days later. I am assuming it's the date it cleared. When YNAB imports transactions from the bank shouldn't the import ID contain the date the transaction was made and not the date it cleared and imported into YNAB?

I like to keep the bank sync running that way it will catch any transactions that may have failed through the API import or grab the one's that might have a different amount for example if I left a tip.

Thank you,

Ian

4replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • I don't have an answer for you, but I've considered writing that same Tasker task! Would you be interested in sharing it to save me (and probably others) the trouble?

    Reply Like
      • asfd64
      • asfd64
      • 3 wk ago
      • Reported - view

      RobFreundlich I'll see what I can do. I would need to find some time to go through it and remove any personal info I have that's either linked to my budget or sent to my wife's phone but also make sure it makes sense on what needs to be changed. Since the notification I create also allows you to expand it and click a change button that allows you change the category of the transaction and add a tip if needed or approve the transaction and I am also sending them to my wife's phone so she can change or approve them from the notification it ends up being 11 profiles that are set up on my phone. I don't have a lot of free time these days with work and family but I will see what I can do to get you started.

      You will need a few plugins for Tasker, I am using AutoWeb for the API piece. You can search for YNAB when adding a service and it will show up and give you all of YNAB's endpoints. Then you can configure it for your secret key. Once it is set up on the Web Services screen long press YNAB and choose Edit Default Parameters and add a new parameter Key: budget_id, Name: Budget ID, Default Value: Your Budget ID, Configurable: I have it checked. This will save you the time from always having  to put in your your budget ID each time you use the plugin. I have the notification show the Category balance in it so you use AutoWeb to create the transaction, then get the transaction to find out the transaction_id, then return the balance of the category for that transaction ID. So I do end up using it a few times during the Task.

      I use AutoNotification to intercept the bank notifications and parse the %antext into Payee, Amount and Account. I also use it to create the persistent notification of the transaction.

      I am using AutoTools to help me with the Arrays which is very helpful when changing the category of the transaction. Not necessary but if you want to sync them between phones you can use AutoRemote for that.

      I work in IT but I am not a programmer so I might not have it set up in the best way possible, but I have used tasker quite  a bit. I only recently started using the API, before that I had it set up with the notification but when I clicked on it it would open YNAB, click Add Transaction, enter the amount, click payee and paste the payee name in at which point I would manually click an existing payee that I wanted to use or create a new payee, then it would make sure the right account was used then I would click save. I wish I had tried the API sooner.

      Reply Like
  • Thanks,   asfd64 , your explanation is actually very helpful! I use some of the Auto plugins myself, so I can use what you've said as a foundation. I work in IT too, as a programmer🙂, so if I get it working, I might be able to parameterize it so that it's generic enough to publish for general use. I've been looking for something to do instead of sitting around on my *** every night, so now I've got a project!

    Reply Like
  • Hi asfd64 - The import_id does generally use the cleared/posted date for the transaction.  If you don't have that date or won't be able to determine it, another option would be to post the transactions without an import_id so they will be considered "user entered" and then when they do eventually get imported from your bank they should be matched since the API supports matching.  That way you'll see the transactions imported immediately and they won't get duplicated when they eventually get imported from the bank in YNAB.

    Reply Like
Like Follow
  • 3 wk agoLast active
  • 4Replies
  • 42Views
  • 3 Following