0

I am using this [Xero API for fetching trial balances][1]. But, I currently need to fetch old data for the past one year but I am unable to fetch that data with that API.

Our query is like this:

function getXeroTrialBalanceReport() {  
   
   var headers = {
     'xero-tenant-id' : 12-XXXX-122132132, //Row number for Xero Tenant ID
     'Authorization' : 'Bearer ' + myToken(),
     'Accept' : 'application/json',
     'Content-Type' : 'application/json'
   };
   var options = {
     'headers' : headers
   };
   
   date = '2022-01-31';
   var url = 'https://api.xero.com/api.xro/2.0/Reports/TrialBalance?date='+date;
   //var url = 'https://api.xero.com/finance.xro/1.0/financialstatements/trialbalance';
 
     try{
     //Max 250 deals can only be fetched
     response = UrlFetchApp.fetch(url, options);
   } catch (e) {
     Logger.log(e);
   }
   return response;
 } ```

[1]: https://developer.xero.com/documentation/api/accounting/reports#trial-balance

This is critical for fetching data and need immediate help on this. Thanks in advance.
Kiran
  • 305
  • 1
  • 3
  • 7

0 Answers0