创建或转移订阅

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

  • 包年订阅
  • 灵活订阅
  • 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 Workspace 订阅关联了 Google 云端硬盘或 Google Vault 订阅,请使用 batch 操作来转移所有状态为 ACTIVE 的订阅。逐个转移每个订阅会导致错误。

仅当暂停原因是 PENDING_TOS_ACCEPTANCETRIAL_ENDEDRENEWAL_WITH_TYPE_CANCEL 时,才允许转移已暂停的订阅。

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

转移功能不支持折扣优惠代码。