创建或转移订阅

在您之后 订购客户的账号, 您可以创建许多不同的订阅:

  • 包年承诺订阅
  • 灵活的订阅
  • 免费试用 30 天
  • 以折扣价订阅

如需详细了解这些订阅使用的产品,请参阅 产品和 SKU

如果您未曾订购此客户的账号,您可以 转移订阅

使用 customerType = 'team' 的客户只能购买基本功能版和 Google Workspace 企业基本功能版。如果您尝试购买 任何其他 Google Workspace 订阅, 错误 - Customer is not eligible to purchase this subscription。客户 如购买基本功能版或基于用量的订阅,系统可能无法处理 订阅包年套餐,升级和降级选项有限。

创建订阅

要为新创建的客户账号创建订阅,请使用 以下 POST HTTP 请求并添加授权令牌:

POST https://reseller.googleapis.com/apps/reseller/v1/customers/CUSTOMER_ID/subscriptions

CUSTOMER_ID 是 客户的主域名或客户的唯一标识符, 检索转销商客户的账号

创建包年套餐

对于包年套餐订阅,并非所有 SKU 都具有相同的订阅 默认续订设置。我们建议始终传递 renewalSettings。创建 10 个席位的包年订阅:

POST https://reseller.googleapis.com/apps/reseller/v1/customers/CUSTOMER_ID/subscriptions
{
  "kind": "reseller#subscription",
  "customerId": "CUSTOMER_ID",
  "skuId": "SKU_ID",
  "plan": {
    "planName": "ANNUAL_MONTHLY_PAY"
  },
  "seats": {
    "kind": "subscriptions#seats",
    "numberOfSeats": 10
  },
  renewalSettings: {
    "renewalType": 'RENEW_CURRENT_USERS_MONTHLY_PAY'
  },
  "purchaseOrderId": "PURCHASE_ORDER_ID"
}

替换以下内容:

  • CUSTOMER_ID:客户的主域名 名称或客户的唯一标识符。
  • SKU_ID:唯一库存单元 (SKU) 标识符。如需了解详情,请参阅 产品和SKU ID
  • PURCHASE_ORDER_ID:可选的采购订单 可用于跟踪使用情况的 ID。

成功的响应将返回一个 HTTP 200 状态以及新订阅的 包年套餐的设置ANNUAL_MONTHLY_PAY 返回为 所有 API 响应中的 ANNUAL

以下是包年套餐回复的示例:

{
  "kind": "reseller#subscription",
  "customerId": "C0123456",
  "subscriptionId": "123",
  "billingMethod": "ONLINE",
  "skuId": "1010020028",
  "creationTime": "1331647980142",
  "plan": {
    "planName": "ANNUAL",
    "isCommitmentPlan": true,
    "commitmentInterval": {
      "startTime": "1331647980142",
      "endTime": "1363183980142"
    }
  },
  "seats": {
    "kind": "subscriptions#seats",
    "numberOfSeats": 10,
    "licensedNumberOfSeats": 10
  },
  "trialSettings": {
    "isInTrial": false
  },
  "renewalSettings": {
    "kind": "subscriptions#renewalSettings",
    "renewalType": "SWITCH_TO_PAY_AS_YOU_GO"
  },
  "purchaseOrderId": "my_example.com_annual_1",
  "status": "ACTIVE",
  "customerDomain": "my_example.com",
  "skuName": "Google Workspace Business Standard"
}

创建弹性方案

要为新创建的客户账号创建灵活订阅,请使用 以下 POST HTTP 请求并添加授权令牌:

POST https://reseller.googleapis.com/apps/reseller/v1/customers/CUSTOMER_ID/subscriptions
{
  "kind": "reseller#subscription",
  "customerId": "CUSTOMER_ID",
  "skuId": "SKU_ID",
  "plan": {
    "planName": "FLEXIBLE"
  },
  "seats": {
    "kind": "subscriptions#seats",
    "maximumNumberOfSeats": 10
  },
  "purchaseOrderId": "PURCHASE_ORDER_ID"
}

替换以下内容:

  • CUSTOMER_ID:客户的主域名 名称或客户的唯一标识符。
  • SKU_ID:唯一库存单元 (SKU) 标识符。如需了解详情,请参阅 产品和SKU ID
  • PURCHASE_ORDER_ID:可选的采购订单 可用于跟踪使用情况的 ID。

以下是弹性方案回复示例:

{
  "kind": "reseller#subscription",
  "customerId": "C0123456",
  "subscriptionId": "123",
  "billingMethod": "ONLINE",
  "skuId": "1010020028",
  "creationTime": "1331647980142",
  "plan": {
    "planName": "FLEXIBLE",
    "isCommitmentPlan": false
  },
  "seats": {
    "kind": "subscriptions#seats",
    "maximumNumberOfSeats": 10,
    "licensedNumberOfSeats": 0
  },
  "trialSettings": {
    "isInTrial": false
  },
  "purchaseOrderId": "my_example_flex_1",
  "status": "ACTIVE",
  "customerDomain": "my_example.com",
  "skuName": "Google Workspace Business Standard"
}

创建免费试用

要为新创建的客户的 请使用以下 POST HTTP 请求并在其中包含授权 令牌:

POST https://reseller.googleapis.com/apps/reseller/v1/customers/CUSTOMER_ID/subscriptions
{
  "kind": "reseller#subscription",
  "customerId": "CUSTOMER_ID",
  "skuId": "SKU_ID",
  "plan": {
    "planName": "TRIAL"
  },
  "seats": {
    "kind": "subscriptions#seats",
    "maximumNumberOfSeats": 10
  },
  "purchaseOrderId": "PURCHASE_ORDER_ID"
}

替换以下内容:

  • CUSTOMER_ID:客户的主域名 名称或客户的唯一标识符。
  • SKU_ID:唯一库存单元 (SKU) 标识符。如需了解详情,请参阅 产品和SKU ID
  • PURCHASE_ORDER_ID:可选的采购订单 可用于跟踪使用情况的 ID。

以下是针对 30 天免费试用方案的回复示例:

{
  "kind": "reseller#subscription",
  "customerId": "C0123456",
  "subscriptionId": "123",
  "billingMethod": "ONLINE",
  "skuId": "1010020028",
  "creationTime": "1331647980142",
  "plan": {
    "planName": "TRIAL",
    "isCommitmentPlan": false
  },
  "seats": {
    "kind": "subscriptions#seats",
    "maximumNumberOfSeats": 10,
    "licensedNumberOfSeats": 0
  },
  "trialSettings": {
    "isInTrial": true,
    "trialEndTime": "1331648420142"
  },
  "purchaseOrderId": "my_example_trial_1",
  "status": "ACTIVE",
  "customerDomain": "my_example.com",
  "skuName": "Google Workspace Business Standard"
}

创建折扣订阅

Google 可能会提供交易代码,以便您以折扣价创建订阅 。若要为订阅提供折扣,您必须在 订阅 insert 调用。如果客户从其自身的 原始 SKU,折扣将被移除。

为新创建的 G Suite 客户创建享有折扣的年度承诺订阅, 客户的账号,请使用以下 POST HTTP 请求并在其中包含 授权令牌:

POST https://reseller.googleapis.com/apps/reseller/v1/customers/CUSTOMER_ID/subscriptions
{
  "kind": "reseller#subscription",
  "customerId": "CUSTOMER_ID",
  "skuId": "SKU_ID",
  "plan": {
    "planName": "ANNUAL_MONTHLY_PAY"
  },
  "seats": {
    "kind": "subscriptions#seats",
    "numberOfSeats": 10
  },
  renewalSettings: {
    "renewalType": 'RENEW_CURRENT_USERS_MONTHLY_PAY'
  },
  "purchaseOrderId": "PURCHASE_ORDER_ID",
  "dealCode": "GOOGLE_CONTRACT_DEAL_CODE"
}

替换以下内容:

  • CUSTOMER_ID:客户的主域名 名称或客户的唯一标识符。
  • SKU_ID:唯一库存单元 (SKU) 标识符。如需了解详情,请参阅 产品和SKU ID
  • PURCHASE_ORDER_ID:可选的采购订单 可用于跟踪使用情况的 ID。
  • GOOGLE_CONTRACT_DEAL_CODE:可使用折扣代码 。

以下是针对包年方案的折扣回复示例:

{
  "kind": "reseller#subscription",
  "customerId": "C0123456",
  "subscriptionId": "123",
  "billingMethod": "ONLINE",
  "skuId": "1010020028",
  "creationTime": "1331647980142",
  "plan": {
    "planName": "ANNUAL",
    "isCommitmentPlan": true,
    "commitmentInterval": {
      "startTime": "1331647980142",
      "endTime": "1363183980142"
    }
  },
  "seats": {
    "kind": "subscriptions#seats",
    "numberOfSeats": 10,
    "licensedNumberOfSeats": 10
  },
  "trialSettings": {
    "isInTrial": false
  },
  "renewalSettings": {
    "kind": "subscriptions#renewalSettings",
    "renewalType": "SWITCH_TO_PAY_AS_YOU_GO"
  },
  "purchaseOrderId": "my_example.com_annual_1",
  "status": "ACTIVE",
  "customerDomain": "my_example.com",
  "dealCode": "GOOGLE_CONTRACT_DEAL_CODE",
  "skuName": "Google Workspace Business Standard"
}

转移订阅

如果您没有使用 订购新的客户账号 操作,请在为 该客户。

要为未订购的客户账号创建订阅,请使用 以下 POST HTTP 请求:

POST https://reseller.googleapis.com/apps/reseller/v1/customers/CUSTOMER_ID/subscriptions?customerAuthToken=TOKEN_VALUE

替换以下内容:

  • CUSTOMER_ID:客户的主域名 名称或客户的唯一标识符。
  • TOKEN_VALUE:您的 客户。客户生成令牌后,令牌的有效期为 30 天。

有关客户如何获取转让令牌的详细信息,请参阅 Google Workspace 帮助中心

要转移采用包年套餐的客户的订阅,请使用 以下 POST HTTP 请求并添加授权令牌:

POST https://reseller.googleapis.com/apps/reseller/v1/customers/C0123456/subscriptions?customerAuthToken=auth token
{
  "customerId": "CUSTOMER_ID",
  "skuId": "SKU_ID",
  "plan": {
    "planName": "ANNUAL_MONTHLY_PAY"
  },
  "seats": {
    "numberOfSeats": 10,
    "licensedNumberOfSeats": 10
  },
  "purchaseOrderId": "PURCHASE_ORDER_ID"
}

替换以下内容:

  • CUSTOMER_ID:客户的主域名 名称或客户的唯一标识符。
  • SKU_ID:唯一库存单元 (SKU) 标识符。如需了解详情,请参阅 产品和SKU ID
  • PURCHASE_ORDER_ID:可选的采购订单 可用于跟踪使用情况的 ID。

成功的响应会返回 HTTP 200 状态 代码以及已转移订阅的设置 包年套餐:

{
  "kind": "reseller#subscription",
  "customerId": "C0123456",
  "subscriptionId": "123",
  "billingMethod": "ONLINE",
  "skuId": "1010020028",
  "creationTime": "1331647980142",
  "plan": {
    "planName": "ANNUAL",
    "isCommitmentPlan": true,
    "commitmentInterval": {
      "startTime": "1331647980142",
      "endTime": "1363183980142"
    }
  },
  "seats": {
    "kind": "subscriptions#seats",
    "numberOfSeats": 10,
    "licensedNumberOfSeats": 10
  },
  "trialSettings": {
    "isInTrial": false
  },
  "renewalSettings": {
    "kind": "subscriptions#renewalSettings",
    "renewalType": "SWITCH_TO_PAY_AS_YOU_GO"
  },
  "purchaseOrderId": "example.com_annual_1",
  "status": "ACTIVE",
  "resourceUiUrl": "URL to customer's Admin console dashboard",
  "skuName": "Google Workspace Business Standard"
}

转移限制

如果要转移 Google Workspace 订阅以及关联的 Google 云端硬盘 或 Google 保险柜订阅,请使用 batch 操作 来转移所有状态为 ACTIVE 的订阅。正在传输每个 一项订阅会导致错误。

仅当暂停原因满足以下条件时,才允许转移已暂停的订阅 PENDING_TOS_ACCEPTANCETRIAL_ENDEDRENEWAL_WITH_TYPE_CANCEL

转移旧版 SKU 时,subscriptions.list 会返回 skuId 需要转移的 SKU 的名称。您指定 Feed 项的 SKU 的 skuId customervactually 将作为 transferInfo.currentLegacySkuId 返回。对于 skuIds以及这些方案使用的产品的完整列表,请参阅 产品和 SKU

转移不适用于折扣交易代码。