Admin SDK Google Workspace Reseller サービスを使用すると、Apps Script で Admin SDK Reseller API を使用できます。この API を使用すると、承認済みの販売パートナー管理者は、お客様の注文を行い、Google Workspace の月額後払いサブスクリプションを管理できます。
リファレンス
このサービスの詳細については、Admin SDK Google Workspace Reseller API のリファレンス ドキュメントをご覧ください。Apps Script のすべての高度なサービスと同様に、Admin SDK Google Workspace Reseller サービスでは、公開 API と同じオブジェクト、メソッド、パラメータを使用します。詳細については、メソッド シグネチャの決定方法をご覧ください。
/** * 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. * @see https://developers.google.com/admin-sdk/reseller/reference/rest/v1/subscriptions/list */functiongetSubscriptions(){letresult;letpageToken;do{result=AdminReseller.Subscriptions.list({pageToken:pageToken});for(constsubofresult.subscriptions){constcreationDate=newDate();creationDate.setUTCSeconds(sub.creationTime);console.log('customer ID: %s, date created: %s, plan name: %s, sku id: %s',sub.customerId,creationDate.toDateString(),sub.plan.planName,sub.skuId);}pageToken=result.nextPageToken;}while(pageToken);}