共用方式為


使用合作夥伴中心 REST API 更新新商務的轉移要求

本文涵蓋如何在合作夥伴中心使用 REST API,以接受或取消新商務授權型或 Azure 方案項目的轉移要求。 此範例包含 REST 語法、標頭和 REST 回應。

適當的角色:管理代理人

先決條件

  • 合作夥伴中心驗證中所述的憑證。 此案例支援使用獨立應用程式和 App+使用者認證進行驗證。
  • 客戶標識碼 (customer-tenant-id)。 如果您不知道客戶的標識碼,您可以在 合作夥伴中心 中查閱,方法是選取 [客戶 工作區],然後從客戶清單中選取客戶,接著選取 帳戶。 在客戶的 [帳戶] 頁面上,在 [客戶帳戶資訊] 區段中尋找 Microsoft 帳戶識別碼。 Microsoft識別碼與客戶標識碼 (customer-tenant-id) 相同。
  • 現有傳輸的傳輸標識碼。

REST 要求

要求語法

方法 要求 URI
PATCH {baseURL}/v1/customers/{customer-id}/transfers/{transfer-id} HTTP/1.1

URI 參數

使用下列路徑參數來識別客戶,並指定要接受的轉移。

名字 類型 必填 描述
客戶標識碼 字串 是的 識別客戶的 GUID 格式客戶識別碼
transfer-id 字串 是的 識別傳輸的 GUID 格式的傳輸識別碼

要求標頭

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

取消轉移的要求範例

只有在 擱置 狀態時,才能取消傳輸。 只有建立傳輸的目標合作夥伴可以取消傳輸。

PATCH /v1/customers/a624f7f8-408b-49B0-9320-df79e56bed55/transfers/43fb1d3a-79fe-45a9-863e-9a4acf17b630 HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
MS-RequestId: 8389053b-731c-4261-9899-1583d7859153
X-Locale: en-US
Content-Type: application/json
Host: api.partnercenter.microsoft.com
Content-Length: 0

{
    "id": "43fb1d3a-79fe-45a9-863e-9a4acf17b630",
    "status": "Cancel",
    "targetPartnerTenantId": "aaaabbbb-0000-cccc-1111-dddd2222eeee",
    "sourcePartnerTenantId": "bbbbcccc-1111-dddd-2222-eeee3333fff",
    "customerName": "ipdbtrans2"
}

接受轉移的要求範例

接受轉移包含項目明細。 下表描述了請求主體中的 TransferLineItem 屬性。

財產 類型 必填 描述
識別碼 字串 轉移項目的唯一標識符,成功建立 transferEntity 後套用。
訂閱識別碼 字串 是的 訂用帳戶標識碼
產品類型 字串 是的 要轉移的類型應該是 OnlineServicesNCE 以授權為基礎的訂用帳戶
PATCH /v1/customers/a624f7f8-408b-49B0-9320-df79e56bed55/transfers/43fb1d3a-79fe-45a9-863e-9a4acf17b630 HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
MS-RequestId: 8389053b-731c-4261-9899-1583d7859153
X-Locale: en-US
Content-Type: application/json
Host: api.partnercenter.microsoft.com
Content-Length: 0

{
    "id": "43fb1d3a-79fe-45a9-863e-9a4acf17b630",
    "status": "Accept",
    "transferType": 3,
    "targetPartnerTenantId": "aaaabbbb-0000-cccc-1111-dddd2222eeee",
    "sourcePartnerTenantId": "bbbbcccc-1111-dddd-2222-eeee3333fff",
    "customerName": "ipdbtrans2",
    "lineItems": [{
        "id": 0,
        "subscriptionId": "aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e",
        "productType": "OnlineServicesNCE"
    }]
}

傳輸更新的 REST 回應

如果成功,這個方法會在回應本文中傳回已填入的 TransferSubmitResult 資源。

回應成功和錯誤碼

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

取消傳輸的回應範例

HTTP/1.1 200 OK
Content-Length: 3389
Content-Type: application/json; charset=utf-8
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
MS-RequestId: 8389053b-731c-4261-9899-1583d7859153
X-Locale: en-US
Date: Wed, 25 Mar 2020 19:13:06 GMT

{
    "id": "43fb1d3a-79fe-45a9-863e-9a4acf17b630",
    "status": "Cancel",
    "transferType": 3,
    "customerEmailId": "",
    "createdTime": "2024-04-30T18:31:41.5133355Z",
    "lastModifiedTime": "2024-04-30T18:31:41Z",
    "expirationTime": "2024-05-31T00:00:00Z",
    "customerName": "ipdbtrans2",
    "customerTenantId": "a624f7f8-408b-49B0-9320-df79e56bed55",
    "partnertenantid": "aaaabbbb-0000-cccc-1111-dddd2222eeee",
    "sourcePartnerName": "Test_Test_IP4_AG",
    "sourcePartnerTenantId": "aaaabbbb-0000-cccc-1111-dddd2222eeee",
    "targetPartnerName": "Test_Test_DB_AG",
    "targetPartnerTenantId": "aaaabbbb-0000-cccc-1111-dddd2222eeee",
    "targetPartnerEmailId": "aaaabbbb-0000-cccc-1111-dddd2222eeee",
    "transferDirection": 1,
    "ignoreEligibilityCheck": false,
    "lastModifiedUser": "7ffdaa28-3b1c-4a61-b580-e1aa6ecf833c",
    "links": {
        "self": {
            "uri": "/customers/a624f7f8-408b-49B0-9320-df79e56bed55/transfers/43fb1d3a-79fe-45a9-863e-9a4acf17b630",
            "method": "GET",
            "headers": []
        }
    }
}

接受傳輸的回應範例

HTTP/1.1 200 OK
Content-Length: 3389
Content-Type: application/json; charset=utf-8
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
MS-RequestId: 8389053b-731c-4261-9899-1583d7859153
X-Locale: en-US
Date: Wed, 25 Mar 2020 19:13:06 GMT

{
    "id": "43fb1d3a-79fe-45a9-863e-9a4acf17b630",
    "status": "InProgress",
    "transferType": 3,
    "customerEmailId": "",
    "createdTime": "2024-04-30T18:31:41.5133355Z",
    "lastModifiedTime": "2024-05-01T00:51:55Z",
    "expirationTime": "2024-05-31T00:00:00Z",
    "customerName": "ipdbtrans2",
    "customerTenantId": "a624f7f8-408b-49B0-9320-df79e56bed55",
    "partnertenantid": "aaaabbbb-0000-cccc-1111-dddd2222eeee",
    "sourcePartnerName": "Test_Test_IP4_AG",
    "sourcePartnerTenantId": "aaaabbbb-0000-cccc-1111-dddd2222eeee",
    "targetPartnerName": "Test_Test_DB_AG",
    "targetPartnerTenantId": "aaaabbbb-0000-cccc-1111-dddd2222eeee",
    "targetPartnerEmailId": "aaaabbbb-0000-cccc-1111-dddd2222eeee",
    "transferDirection": 2,
    "ignoreEligibilityCheck": false,
    "lastModifiedUser": "1671774b-679f-4543-a152-1f8b14006c0e",
    "lineItems": [{
        "id": 0,
        "subscriptionId": "aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e",
        "billingCycle": "unknown",
        "quantity": 0,
        "productType": 5,
        "status": "InProgress"
    }],
    "links": {
        "self": {
            "uri": "/customers/a624f7f8-408b-49B0-9320-df79e56bed55/transfers/43fb1d3a-79fe-45a9-863e-9a4acf17b630",
            "method": "GET",
            "headers": []
        }
    }
}