创建或转移订阅

为客户的账号下单后,您可以创建多种不同的订阅:

  • 包年订阅
  • 弹性订阅
  • 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 状态以及包年方案的新订阅设置。在所有 API 响应中,ANNUAL_MONTHLY_PAY 都将作为 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"
}

创建免费试用

如需为新创建的客户账号创建 30 天免费试用订阅,请使用以下 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,系统会移除折扣。

如需为新创建的客户账号创建折扣包年合约订阅,请使用以下 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:Google 提供的折扣代码。

以下是折扣包年方案响应的示例:

{
  "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 云端硬盘或 Google 保险柜订阅的 Google Workspace 订阅,请使用 batch 操作转移状态为 ACTIVE 的所有订阅。逐个转移每个订阅会导致错误。

只有在暂停原因为 PENDING_TOS_ACCEPTANCETRIAL_ENDEDRENEWAL_WITH_TYPE_CANCEL 时,才允许转移已暂停的订阅。

转移旧版 SKU 时,subscriptions.list 会返回需要转移的 SKU 的 skuId。客户实际拥有的 SKU 的 skuId 会返回为 transferInfo.currentLegacySkuId。如需查看 skuIds 的完整列表以及这些方案所使用的商品,请参阅产品和 SKU

转账不适用折扣优惠代码。