分享方式:


更新客戶的帳單設定檔

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

更新 客戶的帳單配置檔,包括與配置文件相關聯的位址。

必要條件

  • 認證,如合作夥伴中心驗證所述。 此案例支援使用獨立應用程式和 App+使用者認證進行驗證。

  • 客戶識別碼 (customer-tenant-id)。 如果您不知道客戶的識別碼,您可以在合作夥伴中心查閱從首頁選取 [客戶],然後從客戶清單中選取客戶,然後選取 [帳戶]。 在客戶的 [帳戶] 頁面上,在 [客戶帳戶資訊] 區段中尋找 Microsoft 標識符 Microsoft 識別碼與客戶識別碼 (customer-tenant-id) 相同。

C#

若要更新客戶的帳單配置檔,請擷取帳單配置檔,並視需要更新屬性。 然後,擷取您的 IPartner.Customers 集合,然後呼叫 ById() 方法。 然後呼叫 Profiles 屬性,後面接著 Billing 屬性。 然後,藉由呼叫Update()UpdateAsync() 方法來完成。

// IAggregatePartner partnerOperations;
// var selectedCustomerId as string;

var billingProfile = partnerOperations.Customers.ById(selectedCustomerId).Profiles.Billing.Get();

// Apply changes to profile;

billingProfile = partnerOperations.Customers.ById(selectedCustomerId).Profiles.Billing.Update(billingProfile);

範例控制台測試應用程式專案:P artnerSDK.FeatureSamples 類別:UpdateCustomerBillingProfile.cs

REST 要求

要求語法

方法 要求 URI
PUT {baseURL}/v1/customers/{customer-tenant-id}/profiles/billing HTTP/1.1

URI 參數

使用下列查詢參數來更新帳單配置檔。

名稱 類型​​ 必要 描述
customer-tenant-id guid Y 此值是 GUID 格式的客戶 租使用者識別碼 ,可讓轉銷商篩選屬於轉銷商之指定客戶的結果。

要求標頭

要求本文

完整資源。

要求範例

PUT https://api.partnercenter.microsoft.com/v1/customers/<customer-tenant-id>/profiles/billing HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: ff85f13a-eb65-4b8e-9b67-05beb0565410
MS-CorrelationId: ff1b757d-cfaf-463a-b48b-0f96d05e95d7
Content-Type: application/json
Content-Length: 639
Expect: 100-continue

{
    "Id": "a58ceba5-60ac-48e4-a0bc-2a855811807a",
    "FirstName": "FirstName",
    "LastName": "LastName",
    "Email": "email@sample.com",
    "Culture": "en-US",
    "Language": "en",
    "CompanyName": "CompanyName",
    "DefaultAddress": {
        "Country": "US",
        "Region": null,
        "City": "Redmond",
        "State": "WA",
        "AddressLine1": "One Microsoft Way",
        "AddressLine2": null,
        "PostalCode": "98052",
        "FirstName": "FirstName",
        "LastName": "LastName",
        "PhoneNumber": "4255555555"
    },
    "Links": {
        "Self": {
            "Uri": "/v1/customers/<customer-tenant-id>/profiles/billing",
            "Method": "GET",
            "Headers": []
        }
    },
    "Attributes": {
        "Etag": "<etag>",
        "ObjectType": "CustomerBillingProfile"
    }
}

REST 回應

如果成功,這個方法會在回應本文中傳回更新 的配置檔 資源屬性。 此呼叫需要 ETag 來進行並行偵測。

回應成功和錯誤碼

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

回應範例

HTTP/1.1 200 OK
Content-Length: 1210
Content-Type: application/json
MS-CorrelationId: ff1b757d-cfaf-463a-b48b-0f96d05e95d7
MS-RequestId: ff85f13a-eb65-4b8e-9b67-05beb0565410
Date: Mon, 23 Nov 2015 18:20:43 GMT

{
    "id": "a58ceba5-60ac-48e4-a0bc-2a855811807a",
    "firstName": "FirstName",
    "lastName": "LastName",
    "email": "email@sample.com",
    "culture": "en-US",
    "language": "en",
    "companyName": "companyName",
    "defaultAddress": {
        "country": "US",
        "city": "Redmond",
        "state": "WA",
        "addressLine1": "One Microsoft Way",
        "postalCode": "98052",
        "firstName": "FirstName",
        "lastName": "LastName",
        "phoneNumber": "4255555555"
    },
    "links": {
        "self": {
            "uri": "/v1/customers/<customer-tenant-id>/profiles/billing",
            "method": "GET",
            "headers": []
        }
    },
    "attributes": {
        "etag": "<etag>",
        "objectType": "CustomerBillingProfile"
    }
}