使用合作夥伴中心 REST API 接受客戶的訂用帳戶轉移
本文涵蓋如何使用合作夥伴中心的 REST API 來接受客戶的訂閱轉移。 此範例包含 REST 語法、標頭和 REST 回應。
注意
本主題僅適用於傳統授權型服務,不適用於新的商務體驗。 如需轉移新商務授權型訂閱的詳細資訊,請參閱 新的商務轉移主題。
適當的角色:系統管理代理程式
必要條件
認證,如合作夥伴中心驗證所述。 此案例支援使用獨立應用程式和 App+使用者認證進行驗證。
客戶識別碼 (
customer-tenant-id
)。 如果您不知道客戶的標識碼,您可以在合作夥伴中心中選取 [客戶] 工作區,然後從客戶清單中查看客戶,然後從 [帳戶]。 在客戶的 [帳戶] 頁面上,尋找 [客戶帳戶資訊] 區段中的 [Microsoft 識別碼]。 Microsoft 識別碼與客戶識別碼 (customer-tenant-id
) 相同。現有傳輸的傳輸標識碼。
REST 要求
要求語法
方法 | 要求 URI |
---|---|
POST | {baseURL}/v1/customers/{customer-id}/transfer/{transfer-id}/accept HTTP/1.1 |
URI 參數
使用下列路徑參數來識別客戶,並指定要接受的轉移。
名稱 | 類型 | 必要 | 描述 |
---|---|---|---|
customer-id | 字串 | Yes | 識別客戶的 GUID 格式客戶識別碼。 |
transfer-id | 字串 | Yes | 識別傳輸的 GUID 格式傳輸識別碼。 |
要求標頭
如需詳細資訊,請參閱合作夥伴中心 REST 標頭。
要求範例
POST /v1/customers/d6bf25b7-e0a8-4f2d-a31b-97b55cfc774d/transfers/aa2bddb6-9cc8-4949-80fe-a37d5e0a13ba/accept 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
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
{
"orders": [
{
"id": "21b92393-ffce-4bc7-87c5-62cfa897d8f9",
"alternateId": "21b92393-ffce-4bc7-87c5-62cfa897d8f9",
"referenceCustomerId": "b67f0b00-f9e8-4c57-bcb5-0b8b95c6ccf0",
"billingCycle": "annual",
"currencyCode": "USD",
"lineItems": [
{
"lineItemNumber": 0,
"offerId": "5344C201-3099-44E5-B333-C3EB0401EDE0",
"termDuration": "P1Y",
"transactionType": "New",
"friendlyName": "Dynamics 365 Customer Engagement Plan (36 mo)",
"quantity": 1,
"partnerIdOnRecord": "5139005",
"links": {
}
}
],
"creationDate": "2020-03-25T22:24:23.183+00:00",
"status": "completed",
"transactionType": "UserPurchase",
"links": {
"self": {
"uri": "/customers/b67f0b00-f9e8-4c57-bcb5-0b8b95c6ccf0/orders/21b92393-ffce-4bc7-87c5-62cfa897d8f9",
"method": "GET",
"headers": [ ]
},
"patchOperation": {
"uri": "/customers/b67f0b00-f9e8-4c57-bcb5-0b8b95c6ccf0/orders/21b92393-ffce-4bc7-87c5-62cfa897d8f9",
"method": "PATCH",
"headers": [ ]
}
},
"attributes": {
"etag": "eyJpZCI6IjIxYjkyMzkzLWZmY2UtNGJjNy04N2M1LTYyY2ZhODk3ZDhmOSIsInZlcnNpb24iOjF9",
"objectType": "Order"
}
},
{
"id": "7414b8ea-c167-4cc4-bc8e-b43efc177a46",
"alternateId": "7414b8ea-c167-4cc4-bc8e-b43efc177a46",
"referenceCustomerId": "b67f0b00-f9e8-4c57-bcb5-0b8b95c6ccf0",
"billingCycle": "annual",
"currencyCode": "USD",
"lineItems": [
{
"lineItemNumber": 0,
"offerId": "1A90EE13-2CB4-4785-BB0F-542813F00A37",
"termDuration": "P1Y",
"transactionType": "New",
"friendlyName": "Dynamics 365 Business Central Essential",
"quantity": 1,
"partnerIdOnRecord": "5139005",
"links": {
}
}
],
"creationDate": "2020-03-25T22:24:34.59+00:00",
"status": "completed",
"transactionType": "UserPurchase",
"links": {
"self": {
"uri": "/customers/b67f0b00-f9e8-4c57-bcb5-0b8b95c6ccf0/orders/7414b8ea-c167-4cc4-bc8e-b43efc177a46",
"method": "GET",
"headers": [ ]
},
"patchOperation": {
"uri": "/customers/b67f0b00-f9e8-4c57-bcb5-0b8b95c6ccf0/orders/7414b8ea-c167-4cc4-bc8e-b43efc177a46",
"method": "PATCH",
"headers": [ ]
}
},
"attributes": {
"etag": "eyJpZCI6Ijc0MTRiOGVhLWMxNjctNGNjNC1iYzhlLWI0M2VmYzE3N2E0NiIsInZlcnNpb24iOjF9",
"objectType": "Order"
}
}
],
"transferErrors": [
{
"transferGroupId": "1",
"lineItems": [
{
"id": 1,
"subscriptionId": "aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e",
"entitlementId": "aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e",
"offerId": "A4179D30-CC09-49F0-977E-DC2CB70B874F",
"friendlyName": "Project Online Essentials",
"quantity": 1,
"transferGroupId": "1",
"addonItems": [ ],
"partnerIdOnRecord": "5139005",
"billingCycle": "annual",
"sourceSubscriptionId": "aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e"
}
],
"code": 900103,
"description": "Subscription SyncState must be SyncComplete for the Subscription to be a source in a Subscription Ownership Transfer. Subscription: aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e, current state: None",
"attributes": {
"objectType": "TransferError"
}
}
],
"attributes": {
"objectType": "TransferSubmitResult"
}
}