has anybody a working example of the changeSeats function for Subscriptions?
I'm working on automating the ordering of licenses for our customers and i can't get it to work.
i get subscriptions.list but in chageSeats i get a warning that i'm passing the wrong number of parameters, unfortunately i don't know what i should pass and can't find it in the docs, only the http GET requests...
Thanks for any assistance.
Here's what i have...
result = AdminReseller.Subscriptions.list({
//have an email address take the domain part (this is already a valid customer of my reseller, checks have been earlier on)
customerId: sheet.getRange(row,2).getValue().split('@')[1],
pageToken: pageToken,
});
for (var i = 0; i < result.subscriptions.length; i++) {
var sub = result.subscriptions[i];
var creationDate = new Date();
creationDate.setUTCSeconds(sub.creationTime);
Logger.log('customer ID: %s, date created: %s, plan name: %s, sku id: %s, subscriptionId: %s, seats: %s, licensed seats: %s',sub.customerId, creationDate.toDateString(), sub.plan.planName,sub.skuId, sub.subscriptionId, sub.seats.numberOfSeats, sub.seats.licensedNumberOfSeats);
//GOOGLE APPS ANNUAL
//If the customer requested apps licenses, we have the SKU and payment plan we expect...
if ((apps) && (sub.skuId=="Google-Apps-For-Business") && (sub.plan.planName=='ANNUAL')){
var totalSeats=apps+sub.seats.numberOfSeats;
var appsReturn = "Buying "+apps+" apps licenses, subID: "+sub.subscriptionId + " in addition to "+sub.seats.numberOfSeats+" total Seats: "+totalSeats+"\n";
//Up to here it works....
var response = AdminReseller.Subscriptions.changeSeats({
customerId: sub.customerId,
subscriptionId: sub.subscriptionId,
numberOfSeats: totalSeats,
});
}