AvaTax-REST-V2-JS-SDK icon indicating copy to clipboard operation
AvaTax-REST-V2-JS-SDK copied to clipboard

Pagination issues

Open ryangibbsnc opened this issue 5 months ago • 2 comments

Pagination does not seem to work as expected. Two issues I have noticed are 1.) That the typescript types expect a FetchResult.nextLink property, however this does not exist, only a FetchResult.@nextLink (see image) 2.) Performing the same call twice in a row causes an issue in JsonConvert This class identifier has been already used for class "FetchResultSubclass".

Image

Take this .ts code to reproduce:

  const batchSize = 1000
  let attempt = 1

  const report = await api.listTransactionsByCompany({ 
    companyCode: 'DEFAULT', 
    skip: batchSize * (attempt - 1),
    orderBy: 'taxDate desc',
    filter: `taxDate between ${startDate.toISODate()} and ${endDate.toISODate()}`
  })
  // @ts-ignore for logging
  delete report.value
  console.log(report)

  attempt = 2
  const report2 = await api.listTransactionsByCompany({ 
    companyCode: 'DEFAULT', 
    skip: batchSize * (attempt - 1),
    orderBy: 'taxDate desc',
    filter: `taxDate between ${startDate.toISODate()} and ${endDate.toISODate()}`
  })

  // @ts-ignore for logging
  delete report2.value
  console.log(report2)

SDK details:

      avatax:
        specifier: ^25
        version: 25.6.2

ryangibbsnc avatar Jul 01 '25 13:07 ryangibbsnc