更新合作夥伴的帳單設定檔
適用於:合作夥伴中心 |由 21Vianet 營運的合作夥伴中心 |美國政府適用的 Microsoft Cloud 合作夥伴中心
更新 合作夥伴的帳單配置檔
必要條件
- 認證,如合作夥伴中心驗證所述。 此案例僅支援使用「應用程式+使用者」認證來進行驗證。
C#
若要更新合作夥伴帳單配置檔,請擷取現有的配置檔。 更新配置文件之後,請使用IAggregatePartner.Profiles 集合並呼叫 BillingProfile 屬性。 最後,呼叫 Update() 方法。
// IAggregatePartner partnerOperations;
BillingProfile existingBillingProfile = partnerOperations.Profiles.BillingProfile.Get();
// update the profile with a purchase order number
existingBillingProfile.PurchaseOrderNumber = new Random().Next(9000, 10000).ToString(CultureInfo.InvariantCulture);
BillingProfile updatedPartnerBillingProfile = partnerOperations.Profiles.BillingProfile.Update(existingBillingProfile);
範例: 控制台測試應用程式。 專案:合作夥伴中心 SDK 範例 類別:UpdateBillingProfile.cs
REST 要求
要求語法
方法 | 要求 URI |
---|---|
PUT | {baseURL}/v1/profiles/billing HTTP/1.1 |
要求標頭
如需詳細資訊,請參閱合作夥伴中心 REST 標頭。
要求本文
無。
要求範例
PUT https://api.partnercenter.microsoft.com/v1/profiles/billing HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: 9231559e-ed95-41e4-810b-e754ae32dc2f
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
Content-Length: 613
Expect: 100-continue
{
"CompanyName":"TEST_TEST_BugBash1",
"Address":{
"Country":"US",
"Region":null,
"City":"Redmond",
"State":"WA",
"AddressLine1":"1 Microsoft Way",
"AddressLine2":"","PostalCode":"98052",
"FirstName":null,
"LastName":null,
"PhoneNumber":null
},
"PrimaryContact":{
"FirstName":"Test",
"LastName":"Customer",
"Email":null,
"PhoneNumber":""
},
"PurchaseOrderNumber":"9888",
"TaxId":<TaxId>,
"BillingCurrency":"USD",
"Links":{
"Self":{
"Uri":"/profiles/billing",
"Method":"GET","Headers":[]
}
},
"Attributes":{
"Etag":<etag>,
"ObjectType":"BillingProfile"
}
}
REST 回應
如果成功,這個方法會在回應本文中傳 回 BillingProfile 物件。
回應成功和錯誤碼
每個回應都隨附 HTTP 狀態碼,會指出成功與否以及其他的偵錯資訊。 請使用網路追蹤工具來讀取此錯誤碼、錯誤類型和其他參數。 如需完整清單,請參閱錯誤碼。
回應範例
HTTP/1.1 200 OK
Content-Length: 568
Content-Type: application/json; charset=utf-8
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
MS-RequestId: 9231559e-ed95-41e4-810b-e754ae32dc2f
Date: Mon, 21 Mar 2016 05:47:16 GMT
{
"CompanyName":"TEST_TEST_BugBash1",
"Address":{
"Country":"US",
"Region":null,
"City":"Redmond",
"State":"WA",
"AddressLine1":"1 Microsoft Way",
"AddressLine2":"","PostalCode":"98052",
"FirstName":null,
"LastName":null,
"PhoneNumber":null
},
"PrimaryContact":{
"FirstName":"Test",
"LastName":"Customer",
"Email":null,
"PhoneNumber":""
},
"PurchaseOrderNumber":"9888",
"TaxId":<TaxId>,
"BillingDay":5;
"BillingCurrency":"USD",
"Links":{
"Self":{
"Uri":"/profiles/billing",
"Method":"GET","Headers":[]
}
},
"Attributes":{
"Etag":<etag>,
"ObjectType":"BillingProfile"
}
}