Transactions Cached?

I'm adding a feature to my app (bar for YNAB) where I show the count of unapproved transactions. I'm using the /transactions?type=unapproved endpoint. 

My problem is, in the YNAB Web UI and the iOS app, I sometimes see unapproved transactions, but they aren't reflected in the API until hours later. 

Is this normal behavior? It seems like unapproved transactions should show up in the Web app, mobile apps and API at the same time. 

15replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • Adding more information. Today the mobile app says I have 7 unapproved transaction, the web app says I have 5 unapproved transactions and the API says I have 1.

     

    Web app, mobile app and API results below:

    Like
  • One more strange observation about this issue. I noticed that the API requests for transactions that are unapproved does not fetch anything until after I log into YNAB and view the unapproved transactions in the web UI. Then they start appearing from the API.

    This seems like a bug.

    Hoping to get some insight into this because I built some really cool features in my app that depend on that /transactions?type=unapproved call. 

    Like
  • Hi Don ,

    I think I have a few answers for you on this, but let me know if you still have any more questions.

     

    I'm not exactly sure about the difference between web and mobile, they should in theory be the same, but there can be some lagging between the two--we could definitely dig into that for you.

     

    Also, that message is comprise of 3 things: transactions needing approval, transactions needing a category, and transactions to import.

     

    The ones that are needing approval are the only ones you  would get with the "unapproved" filter.
    Needing category is a separate filter/count.


    The number to import is not something we support in the API yet, so you wouldn't be able to get the same exact number comparing that in the web/mobile and the API.

     

    Let me know if that helps!

    Like
  • The problem seems to be that the unapproved transactions API endpoint (/transactions?type=unapproved), does not actually return unapproved transactions until after I view my budget with the web app.

    Only after that does the API start returning unapproved transactions. I'm not trying to get anything other than those types of transactions. There's a bug in the API that's preventing that API call from working.

    Like 1
    • Don Yes! I have noticed this as well. Have no unapproved transactions showing in my webapp no matter how I reload. Then I touch YNAB proper (I'm pretty sure even via the app, though I don't recall now), and poof, they show up in my webapp.

      Like
      • Don
      • Creator of bar for YNAB
      • donniefitz2
      • 8 mths ago
      • Reported - view

      Blue Guitar Yep. It’s weird. Hope they fix it soon. 

      Like
  • After looking into it further, I found that transactions don't appear in the API at all (no matter what the status) until you view them in either the mobile app or the web app.

    So the /transactions endpoints simply don't have updated transactions and neither do /budget calls. It's like transactions in the API don't exist until viewed in mobile or web, which is a shame because I created some really cool features in my app that assume this data (transactions) would be updated. 

     Chrissy Do you know if this behavior is by design or if it's a bug? 

    Thanks.

    Like
    • Don This is by design, at least for now (though it's definitely something on our radar for the future). The client apps (web/mobile) are the ones that actually do the importing of transactions. So you have to use one of the apps to trigger the import. Before transactions are imported they are not visible to the API. 

      Like
      • Don
      • Creator of bar for YNAB
      • donniefitz2
      • 8 mths ago
      • Reported - view

      Chrissy Okay. Well, I hope that gets resolved in the future. Thanks for following up. 

      Like
      • Don
      • Creator of bar for YNAB
      • donniefitz2
      • 3 mths ago
      • Reported - view

      Chrissy Revisiting this to see if there are there any plans to implement uncategorized transactions from an API call anytime soon? My app users are always asking why they can't categorize new transactions with my app and I have to tell them it's because YNAB doesn't support that (which most users don't really understand). Thanks.

      Like
    • Don Thanks for checking in! It's not currently being worked on, but I did pass this along and so it's on the radar. I will definitely follow up if that's something we're able to implement!

      Like
      • Don
      • Creator of bar for YNAB
      • donniefitz2
      • 2 mths ago
      • Reported - view

      Chrissy Okay. Thanks. 

      Like
  • Chrissy said:
    The client apps (web/mobile) are the ones that actually do the importing of transactions. So you have to use one of the apps to trigger the import. Before transactions are imported they are not visible to the API. 

     +1 for this. I am currently developing a WearOS app and some Android widgets to view my budgets and transactions. However, the transaction widget is kind of useless if it does not contain the latest information.

    Like
  • A quick follow up on this one: Linked Accounts that have incoming transactions to be imported are not reflected in the /transactions endpoint because they haven't hit the register yet.  We've recently implemented POST /budgets/{budget_id}/transactions/import that allows to you go ahead and import those transactions, just like the web and mobile clients do.

    Like
      • Don
      • Creator of bar for YNAB
      • donniefitz2
      • 1 mth ago
      • Reported - view

      Brady Thanks for the update. That's great news.

      Like
Like Follow
  • 1 mth agoLast active
  • 15Replies
  • 601Views
  • 5 Following