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

5replies 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?

    Like
      • asfd64
      • asfd64
      • 9 mths 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.

      Like
    • Hi asfd64 . What you have setup with Tasker and YNAB sounds amazing! Like RobFreundlich , I have also been trying to create something like this. However, I am neither a programmer nor do I work in IT. I just try to learn what I can so that I can use coding to solve everyday problems. I have spent a huge amount of time trying to solve exactly the problem you've addressed. When a bank transaction happens, I want to 1) process it (i.e. categorize it) immediately, 2) be sure that I'm sharing the information with my wife (so that we don't both process the same transaction) and then 3) sync that information with YNAB. I'm pretty familiar with Tasker. So far I've created a profile that parses notifications from my bank, but I've got a long way to go to create the rest of the solution.

      If you would share your Tasker profiles with me, I would be extremely grateful. It would save me a ton of time and headache. I understand your concern about taking the time to sanitize the data by removing any personal information. Could you create a copy of each Tasker profile, then go through each profile and replace any personal information with 'dummy data' (e.g. John Doe or abc123), then export the profiles? The 'dummy data' would probably make the profiles no longer work properly. However, I'm sufficiently familiar with Tasker to be able to swap the dummy data with my own information and make the profiles work on my phone.

      Thank you for taking the time to create your Tasker/YNAB integration and for describing it here on the YNAB forums. And thank you for considering the request to share your Tasker profiles.

      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!

    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.

    Like
Like Follow
  • 4 mths agoLast active
  • 5Replies
  • 251Views
  • 4 Following