分享方式:


取得客戶的帳單設定檔

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

取得客戶的帳單設定檔。

在合作夥伴中心,您可以先 選取客戶 來執行這項作業。 您可以在 [帳單資訊 ] 標題底下 找到帳單設定檔。

必要條件

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

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

C#

若要取得客戶的帳單設定檔,請使用您的 IPartner.Customers 集合並呼叫 ById() 方法。 然後呼叫 Profiles 屬性,後面接著 Billing 屬性。 最後,呼叫 Get() GetAsync() 方法。

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

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

範例 主控台測試應用程式 專案 :PartnerSDK.FeatureSamples 類別 :GetCustomerBillingProfile.cs

REST 要求

要求語法

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

URI 參數

使用下列查詢參數來取得帳單設定檔。

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

要求標頭

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

要求本文

要求範例

GET https://api.partnercenter.microsoft.com/v1/customers/<customer-tenant-id>/profiles/billing HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: a5581a74-2778-4e34-9172-18baa4877081
MS-CorrelationId: 51d521b3-62db-4682-b75d-fb8ab09113b2

REST 回應

如果成功,這個方法會傳迴響應本文中的 Profile 資源集合

回應成功和錯誤碼

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

回應範例

HTTP/1.1 200 OK
Content-Length: 1206
Content-Type: application/json
MS-CorrelationId: 51d521b3-62db-4682-b75d-fb8ab09113b2
MS-RequestId: a5581a74-2778-4e34-9172-18baa4877081
Date: Mon, 23 Nov 2015 18:13:43 GMT

{
    "id": "<billing-profile-id>",
    "firstName": "FirstName",
    "lastName": "LastName",
    "email": "email@sample.com",
    "culture": "en-US",
    "language": "en",
    "companyName": "CompanyName",
    "defaultAddress": {
        "country": "US",
        "city": "Redmond",
        "state": "WA",
        "addressLine1": "1 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"
    }
}