變更客戶訂用帳戶計費週期

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

更新訂單從每月到年度計費,或從年度到每月計費。

在合作夥伴中心,您可以瀏覽至客戶的訂用帳戶詳細數據頁面來執行這項作業。 完成後,您會看到一個選項,定義訂用帳戶目前的計費週期,並能夠變更並提交訂閱。

本文的範圍 不足:

  • 變更試用版的計費週期
  • 變更任何非年度供應專案的計費週期(每月、六年)和 Azure 訂用帳戶
  • 變更非使用中訂用帳戶的計費週期
  • 變更 Microsoft 線上服務 授權型訂閱的計費週期

必要條件

C#

若要變更計費周期的頻率,請更新 Order.BillingCycle 屬性。

// IAggregatePartner partnerOperations;
// string customerId;
// string offerId;
// string orderId;

var order = new Order()
{
    ReferenceCustomerId = customerId,
    BillingCycle = BillingCycleType.Annual,
    LineItems = new List<OrderLineItem>()
    {
        new OrderLineItem()
        {
            LineItemNumber = 0,
            OfferId = offerId,
            SubscriptionId = "69829602-C219-40FD-A3D5-4150FCA41A19",
            Quantity = 1
        }
    }
};

var createdOrder = partnerOperations.Customers.ById(customerId).Orders.ById(orderId).Patch(order);

REST 要求

要求語法

方法 要求 URI
PATCH {baseURL}/v1/customers/{customer-tenant-id}/orders/{order-id} HTTP/1.1

URI 參數

下表列出變更訂用帳戶數量所需的查詢參數。

名稱 類型​​ 必要 描述
customer-tenant-id GUID Y 識別客戶的 GUID 格式客戶租用戶標識碼
order-id GUID Y 訂單標識碼

要求標頭

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

要求本文

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

訂單

屬性 型別 必要 描述
ID string 成功建立訂單時提供的訂單標識碼
ReferenceCustomerId string Y 客戶標識碼
BillingCycle string Y 指出合作夥伴為此訂單計費的頻率。 支援的值是 BillingCycleType 中找到的成員名稱。
LineItems 物件陣列 Y OrderLineItem 資源的數位
CreationDate Datetime 訂單建立的日期,以日期時間格式
屬性 Object 包含 “ObjectType”: “OrderLineItem”

OrderLineItem

屬性 型別 必要 描述
LineItemNumber number Y 行項目編號,從 0 開始
OfferId string Y 供應項目的標識碼
SubscriptionId string Y 訂用帳戶的標識碼
FriendlyName string 合作夥伴所定義的訂用帳戶易記名稱,以協助釐清
數量 number Y 授權或實例數目
PartnerIdOnRecord string 記錄夥伴的 PartnerID
屬性 Object 包含 “ObjectType”: “OrderLineItem”

要求範例

更新為年度計費

PATCH https://api.partnercenter.microsoft.com/v1/customers/4d3cf487-70f4-4e1e-9ff1-b2bfce8d9f04/orders/CF3B0E37-BE0B-4CDD-B584-D1A97D98A922 HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: 17a2658e-d2cc-439b-a2f0-2aefd9344fbc
MS-CorrelationId: 60efdd24-17ef-4080-9b02-4fc315f916ff
X-Locale: en-US
Content-Type: application/json
Host: api.partnercenter.microsoft.com
Content-Length: 414
Expect: 100-continue

{
    "Id": null,
    "ReferenceCustomerId": "4d3cf487-70f4-4e1e-9ff1-b2bfce8d9f04",
    "BillingCycle" : "Annual",
    "LineItems": [{
            "LineItemNumber": 0,
            "OfferId": "2828BE95-46BA-4F91-B2FD-0BEF192ECF60",
            "SubscriptionId": "69829602-C219-40FD-A3D5-4150FCA41A19",
            "FriendlyName": "Some friendly name",
            "Quantity": 2,
            "PartnerIdOnRecord": null,
            "Attributes": {
                "ObjectType": "OrderLineItem"
            }
        }
    ],
    "CreationDate": null,
    "Attributes": {
        "ObjectType": "Order"
    }
}

REST 回應

如果成功,這個方法會在回應本文中傳回更新的訂閱順序。

回應成功和錯誤碼

每個回應都隨附 HTTP 狀態碼,會指出成功與否以及其他的偵錯資訊。 請使用網路追蹤工具來讀取此錯誤碼、錯誤類型和其他參數。 如需完整清單,請參閱錯誤碼

回應範例

HTTP/1.1 200 OK
Content-Length: 1135
Content-Type: application/json; charset=utf-8
MS-CorrelationId: 60efdd24-17ef-4080-9b02-4fc315f916ff
MS-RequestId: 17a2658e-d2cc-439b-a2f0-2aefd9344fbc
MS-CV: WtFy3zI8V0u2lnT9.0
MS-ServerId: 020021921
Date: Wed, 25 Jan 2017 23:01:08 GMT

{
    "id": "cf3b0e37-be0b-4cdd-b584-d1a97d98a922",
    "referenceCustomerId": "4d3cf487-70f4-4e1e-9ff1-b2bfce8d9f04",
    "billingCycle": "Annual",
    "lineItems": [{
            "lineItemNumber": 0,
            "offerId": "195416C1-3447-423A-B37B-EE59A99A19C4",
            "subscriptionId": "1C2B75C1-74A5-472A-A729-7F8CEFC477F9",
            "friendlyName": "new offer purchase",
            "quantity": 5,
            "links": {
                "subscription": {
                    "uri": "/customers/4d3cf487-70f4-4e1e-9ff1-b2bfce8d9f04/subscriptions/1C2B75C1-74A5-472A-A729-7F8CEFC477F9",
                    "method": "GET",
                    "headers": []
                }
            }
        },
        {
            "lineItemNumber": 1,
            "offerId": "2828BE95-46BA-4F91-B2FD-0BEF192ECF60",
            "subscriptionId": "69829602-C219-40FD-A3D5-4150FCA41A19",
            "friendlyName": "Some friendly name",
            "quantity": 2,
            "links": {
                "subscription": {
                    "uri": "/customers/4d3cf487-70f4-4e1e-9ff1-b2bfce8d9f04/subscriptions/69829602-C219-40FD-A3D5-4150FCA41A19",
                    "method": "GET",
                    "headers": []
                }
            }
        }
    ],
    "creationDate": "2017-01-25T14:53:12.093-08:00",
    "links": {
        "self": {
            "uri": "/customers/4d3cf487-70f4-4e1e-9ff1-b2bfce8d9f04/orders/cf3b0e37-be0b-4cdd-b584-d1a97d98a922",
            "method": "GET",
            "headers": []
        }
    },
    "attributes": {
        "etag": "eyJpZCI6ImNmM2IwZTM3LWJlMGItNGNkZC1iNTg0LWQxYTk3ZDk4YTkyMiIsInZlcnNpb24iOjJ9",
        "objectType": "Order"
    }
}