ynab / ynab-sdk-ruby

YNAB API Client for Ruby
https://api.ynab.com
Apache License 2.0
65 stars 12 forks source link

Missing one transaction from API response #43

Closed skeud closed 5 years ago

skeud commented 5 years ago

Hi there,

I'm using the get_transactions method but weirdly, there is one transaction that is not returned. I made several tests to be sure it wasn't my code, and everything works properly except one transaction never returned...

How can this be? Some caching?

My code below:

require 'ynab'
require 'date'
require 'money'

I18n.config.available_locales = :en
Money.locale_backend = :i18n

ynab = YNAB::API.new('MY-API-KEY')

budget_id = 'MY-BUDGET-ID'
year = 2018
month = 12

begin
  puts 'Fetching data from YNAB...'

  first_day_of_month_iso = Date.new(year, month, 30).iso8601

  puts "Numbers from #{first_day_of_month_iso}"

  transactions_response = ynab.transactions.get_transactions(budget_id, since_date: first_day_of_month_iso)

  total_incomes = 0
  transactions_response.data.transactions.each do |transaction|
    puts "#{transaction.date} - #{transaction.payee_name} - #{transaction.amount/1000}"
    total_incomes += transaction.amount
  end

  puts "Total incomes : #{Money.from_amount(total_incomes/1000, "CHF").format}"
end
bradymholt commented 5 years ago

@skeud 👋 Hello Thomas.

That's strange. Is there anything unique about the missing transaction? Is is a transfer, perhaps? Is it returned if you don't specify a since_date query?

skeud commented 5 years ago

Hi @bradymholt Indeed very weird. The transaction has nothing special nor unique. Not a transfer nope. Just one going into "To be budgeted". Like many others.

I tried without the since_date, but it still do not show up...

Should we chat privately so I can send you screenshots of the data? Realllly weird and blocking here...

bradymholt commented 5 years ago

@skeud - Yes! Could you send an email to api@youneedabudget.com with some details and then we can dig in?