Report for Profit and Loss only returns monthly report and not yearly or quarterly #203
-
Good day Xero, I was trying to get the Profit and Loss report values in a yearly basis. See image below. but the return I received was just a report for the whole month. See image below: I checked the API documentation on https://xeroapi.github.io/xero-ruby/accounting/index.html#api-Accounting-getReportProfitAndLoss and changed "timeframe" into "time_frame", but same thing was still returned. I made the timeframe into "QUARTER", but the same output was received. Also changing it into "time_frame" didn't do the trick. Am I missing some params, or is it the API at fault? Cheers! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey @CaptureKervin, Just took a look at this. I think your issue is that you're not specifying a fromDate & toDate. From the docs:
If you do not specify, it retrieves the current month, and the timeframe is pretty irrelevant. If you specify a year of data, and then MONTH or QUARTER, you'll get the data segmented as expected. I haven't tried this specifically with the ruby wrapper, but that's how the API works (which I have verified). If you can try that in the wrapper and still face issues let me know and I'll take a closer look. |
Beta Was this translation helpful? Give feedback.
Hey @CaptureKervin,
Just took a look at this. I think your issue is that you're not specifying a fromDate & toDate.
From the docs:
https://developer.xero.com/documentation/api/accounting/reports#profit-and-loss
If you do not specify, it retrieves the current month, and the timeframe is pretty irrelevant.
If you specify a year of data, and then MONTH or QUARTER, you'll get the data segmented as expected.
I haven't tried this specifically with the ruby wrapper, but t…