Fetching ALL data set from API iterating via response data Does this make sense? How would you achieve the same thing, with cleaner code?

function retrieveBatch(offset){
  var opts = {}
  opts.limit = 100
  if(offset) opts.offset = offset
  return new Promise(function(resolve, reject) {
    chargebee.subscription
    .list(opts)
    .request(function(err, value){
      if(err) return reject(err)
      return resolve(value)
    })
  })
}

function retireveAll(){
  var subscriptions = []
  function inception(data){
    if(!data) return retrieveBatch().then(inception)
    if(data &amp;&amp; data.list) subscriptions.push(data.list)
    if(data &amp;&amp; data.next_offset) return retrieveBatch(data.next_offset).then(inception)
    if(data &amp;&amp; !data.next_offset) return _.flatten(subscriptions)
  }
  return Promise.resolve(inception(false))
}
I only have some minor additions, maybe a little syntax sugar. I've tested most of it in the JavaScript console, and it still needs at least some JSBin trials before going live.

function retrieveBatch(offset){
  var opts = {
    limit  : 100,
    offset : offset || undefined
  };

  return new Promise(function(resolve, reject){
    chargebee.subscription
      .list(opts)
      .request(function(err, value){
        // return only if err is defined
        err &amp;&amp; return reject(err);
        // if you got this far, there's only one way out
        return resolve(value);
      })
  })
}

function retrieveAll(){
  var subscriptions = [];

  function inception(data){
    if(!data){
      return retrieveBatch().then(inception);
    }
    if(data.list){
      subscriptions.push(data.list);
    }
    if(data.next_offset){
      return retrieveBatch(data.next_offset).then(inception);
    }

    return _.flatten(subscriptions);
  }
  return Promise.resolve(inception(false))
}