บริการตัวแทนจำหน่าย Google Workspace สำหรับ Admin SDK
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
บริการ Admin SDK Google Workspace Reseller ช่วยให้คุณใช้ Admin SDK Reseller API ใน Apps Script ได้
API นี้ช่วยให้ผู้ดูแลระบบตัวแทนจำหน่ายที่ได้รับอนุญาตสามารถสั่งซื้อในนามของลูกค้า
และจัดการการสมัครใช้บริการ Google Workspace แบบรายเดือนที่เรียกเก็บเงินภายหลัง
ได้
ข้อมูลอ้างอิง
ดูข้อมูลโดยละเอียดเกี่ยวกับบริการนี้ได้ในเอกสารอ้างอิงสำหรับ Admin SDK Google Workspace Reseller API เช่นเดียวกับบริการขั้นสูงทั้งหมดใน Apps Script บริการตัวแทนจำหน่าย Google Workspace ของ Admin SDK จะใช้ออบเจ็กต์ เมธอด และพารามิเตอร์เดียวกันกับ API สาธารณะ ดูข้อมูลเพิ่มเติมได้ที่วิธีกำหนดลายเซ็นของเมธอด
หากต้องการรายงานปัญหาและรับการสนับสนุนอื่นๆ โปรดดู
คู่มือการสนับสนุนสำหรับตัวแทนจำหน่าย Admin SDK
โค้ดตัวอย่าง
ตัวอย่างโค้ดด้านล่างใช้ API เวอร์ชัน 1
รับรายการการสมัครใช้บริการ
ตัวอย่างนี้จะบันทึกรายการการสมัครใช้บริการ รวมถึงรหัสลูกค้า
วันที่สร้าง ชื่อแพ็กเกจ และรหัส SKU
โปรดสังเกตการใช้โทเค็นหน้าเว็บเพื่อเข้าถึงรายการผลลัพธ์ทั้งหมด
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-31 UTC
[null,null,["อัปเดตล่าสุด 2025-08-31 UTC"],[[["\u003cp\u003eThe Admin SDK Google Workspace Reseller service enables authorized reseller admins to manage Google Workspace subscriptions and place customer orders via Apps Script.\u003c/p\u003e\n"],["\u003cp\u003eThis advanced service requires prior enabling before use and mirrors the functionality of the Admin SDK Reseller API.\u003c/p\u003e\n"],["\u003cp\u003eComprehensive reference documentation, support resources, and sample code are readily available for developers.\u003c/p\u003e\n"],["\u003cp\u003eSample code showcases how to retrieve and log a list of subscriptions, demonstrating pagination for accessing the complete result set.\u003c/p\u003e\n"]]],[],null,["# Admin SDK Google Workspace Reseller Service\n\nThe Admin SDK Google Workspace Reseller service allows\nyou to use the [Admin SDK Reseller API](/admin-sdk/reseller) in Apps Script.\nThis API allows authorized reseller admins to place customer orders\nand manage Google Workspace monthly post-pay\nsubscriptions.\n| **Note:** This is an advanced service that must be [enabled before use](/apps-script/guides/services/advanced).\n\nReference\n---------\n\nFor detailed information on this service, see the\n[reference documentation](/admin-sdk/reseller/v1/reference) for the\nAdmin SDK Google Workspace Reseller API. Like all\nadvanced services in Apps Script, the Admin SDK\nGoogle Workspace Reseller service uses the same\nobjects, methods, and parameters as the public API. For more information, see [How method signatures are determined](/apps-script/guides/services/advanced#how_method_signatures_are_determined).\n\nTo report issues and find other support, see the\n[Admin SDK Reseller support guide](/admin-sdk/reseller/support).\n\nSample code\n-----------\n\nThe sample code below uses [version 1](/admin-sdk/groups-migration/v1/reference)\nof the API.\n\n### Get a list of subscriptions\n\nThis sample logs the list of subscriptions, including the customer ID,\ndate created, plan name, and the SKU ID.\nNotice the use of page tokens to access the full list of results. \nadvanced/adminSDK.gs \n[View on GitHub](https://github.com/googleworkspace/apps-script-samples/blob/main/advanced/adminSDK.gs) \n\n```javascript\n/**\n * Logs the list of subscriptions, including the customer ID, date created, plan\n * name, and the sku ID. Notice the use of page tokens to access the full list\n * of results.\n * @see https://developers.google.com/admin-sdk/reseller/reference/rest/v1/subscriptions/list\n */\nfunction getSubscriptions() {\n let result;\n let pageToken;\n do {\n result = AdminReseller.Subscriptions.list({\n pageToken: pageToken\n });\n for (const sub of result.subscriptions) {\n const creationDate = new Date();\n creationDate.setUTCSeconds(sub.creationTime);\n console.log('customer ID: %s, date created: %s, plan name: %s, sku id: %s',\n sub.customerId, creationDate.toDateString(), sub.plan.planName,\n sub.skuId);\n }\n pageToken = result.nextPageToken;\n } while (pageToken);\n}\n```"]]