Admin SDK Reseller Service

The Admin SDK Reseller service allows you to use the Admin SDK Reseller API in Apps Script. This API allows authorized reseller admins to place customer orders and manage G Suite monthly post-pay subscriptions.


For detailed information on this service, see the reference documentation for the Admin SDK Reseller API. Like all advanced services in Apps Script, the Admin SDK Reseller service uses the same objects, methods, and parameters as the public API.

Sample code

The sample code below uses version 1 of the API.

Get a list of subscriptions

This sample logs the list of subscriptions, including the customer ID, date created, plan name, and the sku ID. Notice the use of page tokens to access the full list of results.

function getSubscriptions() {
  var result, subscriptions, pageToken;
  do {
    result = AdminReseller.Subscriptions.list({
      pageToken: pageToken,
    for (var i = 0; i < result.subscriptions.length; i++) {
      var sub = result.subscriptions[i];
      var creationDate = new Date();
      Logger.log('customer ID: %s, date created: %s, plan name: %s, sku id: %s',
          sub.customerId, creationDate.toDateString(), sub.plan.planName,
    pageToken = result.nextPageToken;
  } while (pageToken);

Send feedback about...

Apps Script
Apps Script