Share via


轉換新的商務訂用帳戶

適用於:合作夥伴中心 |由 21Vianet 營運的合作夥伴中心 |美國政府適用的 Microsoft Cloud 合作夥伴中心

適當的角色

  • 全域管理員
  • 系統管理代理人

這些方法同時支持傳統和新商務來源訂用帳戶。

注意

授權型服務的新商務體驗包含許多新功能,可供所有 雲端解決方案提供者 (CSP) 使用。 如需詳細資訊,請參閱 新的商務體驗概觀

用來將客戶的新商務訂用帳戶升級至目標訂用帳戶,或將 NCE 試用版轉換為付費訂閱。 若要轉換訂用帳戶,必須提出兩個 API 要求。 第一個 GET 合格轉換 ,以取得可供升級的 SKU。 然後 POST 轉換 以執行轉換。

取得轉換資格

傳回指定客戶、訂用帳戶和要求類型的合格轉換清單。 也會傳回目的地訂用帳戶升級資格。 轉換資格可能包括處於 EndofSaleWithConversions 狀態的供應專案。

必要條件

GDAP 角色

您至少需要下列其中一個 GDAP 角色:

  • 目錄讀取器
  • 全域讀取者

注意

雖然此 API 適用於舊版和 NCE,但 GDAP 僅適用於舊版。

REST 要求

要求語法

方法 要求 URI
GET {baseURL}/v1/customers/{customer-tenant-id}/subscriptions/{subscription-id}/transitionEligibility?eligibilityType={immediate, scheduled} HTTP/1.1

URI 參數

使用下列查詢參數傳回合格的轉換。

名稱 類型​​ 必要 描述
customer-tenant-id guid Y 對應至客戶租使用者的 GUID。
subscription-id guid Y 對應至初始訂用帳戶的 GUID。
eligibilityType string 描述何時要執行轉換;可以立即或排程。 預設值為 Immediate

要求標頭

如需詳細資訊,請參閱合作夥伴中心 REST 標頭

要求本文

要求範例

GET https://api.partnercenter.microsoft.com/v1/customers/{customer-tenant-id}/subscriptions/{subscription-id}/transitionEligibilities?eligibilityType=immediate HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: 18752a69-1aa1-4ef7-8f9d-eb3681b2d70a
MS-CorrelationId: 81b08ffe-4cf8-49cd-82db-5c2fb0a8e132
X-Locale: en-US

REST 回應

如果成功,這個方法會傳回回應本文中指定訂用帳戶的合格轉換清單。

回應成功和錯誤碼

每個回應都有一個 HTTP 狀態代碼,指出成功或失敗,以及更多偵錯資訊。 使用網路追蹤工具來讀取此程式代碼、錯誤類型和其他參數。 如需完整清單,請參閱錯誤碼

資格錯誤

錯誤描述和意義。

錯誤描述 意義
無法轉換訂用帳戶 - 來源訂用帳戶未作用中。 原始子狀態非作用中
無法轉換訂用帳戶 - 尚未布建來源訂用帳戶。 原始子履行State 未成功
轉換類型不相容 - 需要 AzureAD 訂用帳戶對應。 呼叫 GetSubscriptionUpgradeConflicts 時,LegacyCannotConvertSubscriptionId 錯誤
轉換類型不相容 - 授權轉移的訂用帳戶衝突。 如果任何 Microsoft Entra 服務具有來自不同訂用帳戶的訂用帳戶標識碼,請將它新增至衝突清單(包括舊版或新式購買流程所做的購買)

訂用帳戶資格錯誤

如果目的地訂用帳戶不符合升級資格,則會傳回下列其中一個原因。

如果來源訂用帳戶是試用版,或資格類型指定為 Scheduled,則會傳回空白清單。 您只能轉換為具有立即(也稱為「中期」)轉換的現有訂用帳戶,而不是排程的變更。

錯誤描述 錯誤碼
訂用帳戶未使用中。 SubscriptionNotActive = 1
訂用帳戶位於取消期間內。 SubscriptionInCancellationWindow = 2
訂用帳戶期限比來源訂用帳戶的期限持續時間短。 SubscriptionTermDurationShorterThanSourceTermDuration = 3
訂閱字詞結束日期在來源訂用帳戶的字詞結束日期之前。 訂閱字詞結束日期在來源訂用帳戶的字詞結束日期之前。 = 4

回應範例

HTTP/1.1 200 OK
Content-Length: 138
Content-Type: application/json
MS-CorrelationId: 81b08ffe-4cf8-49cd-82db-5c2fb0a8e132
MS-RequestId: 18752a69-1aa1-4ef7-8f9d-eb3681b2d70a
Date: Fri, 26 Feb 2021 20:42:26 GMT

{
  "totalCount": 2,
  "items": [
    {
      "operationId": "1caf8ec7-62cc-4ab5-b35d-572d2a62974c",
      "catalogItemId": "CFQ7TTC0KZCR:0001:CFQ7TTC0K71H",
      "title": "Microsoft 365 E5 Test Sku Title",
      "description": "Microsoft 365 E5 Test Sku Description",
      "quantity": 1,
      "subscriptionEligibilities": [
        {
          "isEligible": false,
          "subscriptionId": "92301b7d-7598-4938-d6f2-d31e080e9da6",
          "subscriptionFriendlyName": "Microsoft 365 Business Premium",
          "subscriptionTermDuration": "P1M",
          "subscriptionBillingCycle": "monthly",
          "errors": [
            {
              "code": 3,
              "description": "The subscription's term duration is shorter than the source subscription's term duration."
            }
          ]
        },
        {
          "isEligible": true,
          "subscriptionId": "151467a1-4246-4a00-da7b-3405463d9b78",
          "subscriptionFriendlyName": "Microsoft 365 Business Premium",
          "subscriptionTermDuration": "P1Y",
          "subscriptionBillingCycle": "monthly",
          "errors": []
        }
      ],
      "eligibilities": [
        {
          "isEligible": true,
          "transitionType": "transition_only",
          "errors": []
        },
        {
          "isEligible": false,
          "transitionType": "transition_with_license_transfer",
          "errors": [
            {
              "code": 3,
              "description": "Subscription cannot be transitioned because there are conflicting services."
            }
          ]
        }
      ],
      "attributes": {
        "objectType": "TransitionEligibility"
      }
    },
    {
      "operationId": "1caf8ec7-62cc-4ab5-b35d-572d2a62974c",
      "catalogItemId": "CFQ7TTC0L4M3:0001:CFQ7TTC0K78T",
      "title": "Business Premium Test Sku Title",
      "description": "Business Premium Test Sku Description",
      "quantity": 1,
      "eligibilities": [
        {
          "isEligible": false,
          "transitionType": "transition_with_license_transfer",
          "errors": [
            {
              "code": 3,
              "description": "Subscription cannot be transitioned because there are conflicting services."
            }
          ]
        }
      ],
      "attributes": {
        "objectType": "TransitionEligibility"
      }
    }
  ],
  "attributes": {
    "objectType": "Collection"
  }
}

轉換后

張貼指定客戶和訂用帳戶的轉換要求。 傳回具有其初始狀態的轉換。

必要條件

GDAP 角色

您至少需要下列其中一個 GDAP 角色:

  • 目錄讀取者或全域讀取器(僅限轉換)
  • 目錄寫入器(使用授權轉移轉換)

注意

雖然此 API 適用於舊版和 NCE,但 GDAP 僅適用於舊版。

REST 要求

要求語法

方法 要求 URI
POST {baseURL}/v1/customers/{customer-tenant-id}/subscriptions/{subscription-id}/transitions HTTP/1.1

URI 參數

使用下列查詢參數來執行轉換。

名稱 類型​​ 必要 描述
customer-tenant-id guid Y 對應至客戶租使用者的 GUID。
subscription-id guid Y 對應至初始訂用帳戶的 GUID。

要求標頭

如需詳細資訊,請參閱合作夥伴中心 REST 標頭

要求本文

下表描述 要求本文中的 Transition 屬性。

屬性 型別 必要 描述
fromCatalogItemId string No 您要轉換的目錄專案。
fromSubscriptionId string No 您要轉換的訂用帳戶識別碼。
toCatalogItemId string Yes 您要轉換的目錄專案。
toSubscriptionId string No 您要轉換的訂用帳戶識別碼。
數量 整數 Yes 要轉換的授權數目。
termDuration string No 指定訂閱的期限。
billingCycle string No 指定訂用帳戶的計費週期。
transitionType string Yes 轉換類型。 可能的值 - transition_only、 。 transition_with_license_transfer

要求範例

POST https://api.partnercenter.microsoft.com/v1/customers/{customerId}/subscriptions/{subscriptionId}/transitions HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: 18752a69-1aa1-4ef7-8f9d-eb3681b2d70a
MS-CorrelationId: 81b08ffe-4cf8-49cd-82db-5c2fb0a8e132
X-Locale: en-US

{
    "fromCatalogItemId": "CFQ7TTC0LF8Q:0001:CFQ7TTC0K39X",
    "fromSubscriptionId": "e487e8dc-421e-4275-cb42-3c1c8daccf70",
    "toCatalogItemId": "CFQ7TTC0LF8R:0001:CFQ7TTC0KCSV",
    "toSubscriptionId": "0af52192-4a2a-4364-d25b-c8ecab3a5697",
    "quantity": 2,
    "termDuration": "P1M",
    "billingCycle": "Monthly",
    "transitionType": "transition_only"
}

REST 回應

如果成功,這個方法會 傳回具有其初始狀態的轉換 資源。

回應成功和錯誤碼

每個回應都有一個 HTTP 狀態代碼,指出成功或失敗,以及更多偵錯資訊。 使用網路追蹤工具來讀取此程式代碼、錯誤類型和其他參數。 如需完整清單,請參閱錯誤碼

回應範例

HTTP/1.1 200 OK
Content-Length: 138
Content-Type: application/json
MS-CorrelationId: 81b08ffe-4cf8-49cd-82db-5c2fb0a8e132
MS-RequestId: 18752a69-1aa1-4ef7-8f9d-eb3681b2d70a
Date: Fri, 26 Feb 2021 20:42:26 GMT

{
    "fromCatalogItemId": "CFQ7TTC0LF8Q:0001:CFQ7TTC0K39X",
    "fromSubscriptionId": "e487e8dc-421e-4275-cb42-3c1c8daccf70",
    "toCatalogItemId": "CFQ7TTC0LF8R:0001:CFQ7TTC0KCSV",
    "toSubscriptionId": "0af52192-4a2a-4364-d25b-c8ecab3a5697",
    "quantity": 2,
    "termDuration": "P1M",
    "billingCycle": "Monthly",
    "transitionType": "transition_only"
    "Events": [
        {
            "name": "Conversion",
            "status": "Started ",
            "timestamp": "2021-01-08T18:01:14.7488618Z",
            "attributes":
            {
                "objectType": "TransitionEvent"
            }
        }
    ],
    "attributes":
    {
        "objectType": "Transition" 
    }
}