Training
Module
Configure and manage costs as a Microsoft partner by using Microsoft Cost Management - Training
Learn how to reconcile your bill and analyze costs across your customers and resources by using Microsoft Cost Management as a partner.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Gets a customer's service costs for the specified billing period.
Credentials as described in Partner Center authentication. This scenario supports authentication with App+User credentials.
A customer ID (customer-tenant-id
). If you don't know the customer's ID, you can look it up in Partner Center by selecting the Customers workspace, then the customer from the customer list, then Account. On the customer’s Account page, look for the Microsoft ID in the Customer Account Info section. The Microsoft ID is the same as the customer ID (customer-tenant-id
).
A billing period indicator (mostrecent
).
To retrieve a service costs summary for the specified customer:
Call the IAggregatePartner.Customers.ById method with the customer ID to identify the customer.
Use the ServiceCosts property to get an interface to customer service costs collection operations.
Call the ByBillingPeriod method with a member of the ServiceCostsBillingPeriod enumeration to return an IServiceCostsCollection.
Use the IServiceCostsCollection.Summary.Get or GetAsync method to get the customer's service costs summary.
// IAggregatePartner partnerOperations;
// string selectedCustomerId;
var serviceCostsSummary = partnerOperations.Customers.ById(selectedCustomerId).ServiceCosts.ByBillingPeriod(ServiceCostsBillingPeriod.MostRecent).Summary.Get();
Method | Request URI |
---|---|
GET | {baseURL}/v1/customers/{customer-id}/servicecosts/{billing-period} HTTP/1.1 |
Use the following path parameters to identify the customer and the billing period.
Name | Type | Required | Description |
---|---|---|---|
customer-id | guid | Yes | A GUID formatted customer ID that identifies the customer. |
billing-period | string | Yes | An indicator that represents the billing period. The only supported value is MostRecent. The case of the string does not matter. |
For more information, see Partner Center REST headers.
None.
GET https://api.partnercenter.microsoft.com/v1/customers/65726577-c208-40fd-9735-8c85ac9cac68/servicecosts/mostrecent HTTP/1.1
Authorization: Bearer <authorization token>
Accept: application/json
MS-RequestId: e6a3b6b2-230a-4813-999d-57f883b60d38
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
X-Locale: en-US
Host: api.partnercenter.microsoft.com
If successful, the response body contains a ServiceCostsSummary resource that provides information about the service costs.
Each response comes with an HTTP status code that indicates success or failure and additional debugging information. Use a network trace tool to read this code, error type, and additional parameters. For the full list, see Partner Center REST error codes.
HTTP/1.1 200 OK
Content-Length: 766
Content-Type: application/json; charset=utf-8
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
MS-RequestId: e6a3b6b2-230a-4813-999d-57f883b60d38
MS-CV: gPPoyNX1X0asAAcw.0
MS-ServerId: 101112202
Date: Fri, 02 Dec 2016 18: 54: 38 GMT
{
"billingStartDate": "2015-12-12T00:00:00Z",
"billingEndDate": "2016-01-11T00:00:00Z",
"pretaxTotal": 17.22,
"tax": 0.0,
"afterTaxTotal": 17.22,
"currencySymbol": "$",
"customerId": "ae1d5b32-f9ff-4252-b2bf-40e21937a51a",
"details":
[
{
"invoiceType": "Recurring",
"summary": {
"billingStartDate": "2015-12-12T00:00:00Z",
"billingEndDate": "2016-01-11T00:00:00Z",
"pretaxTotal": 17.22,
"tax": 0.0,
"afterTaxTotal": 17.22,
"currencyCode": "USD",
"currencySymbol": "$",
"customerId": "ae1d5b32-f9ff-4252-b2bf-40e21937a51a",
"links": {},
"attributes": {
"objectType": "ServiceCostsSummary"
}
}
},
{
"invoiceType": "OneTime",
"summary": {
"billingStartDate": "2019-04-01T00:00:00Z",
"billingEndDate": "2019-04-30T23:59:59.9999999Z",
"pretaxTotal": 2,
"tax": 0.2,
"afterTaxTotal": 2.2,
"currencyCode": "USD",
"currencySymbol": "$",
"customerId": "ae1d5b32-f9ff-4252-b2bf-40e21937a51a",
"links": {},
"attributes": {
"objectType": "ServiceCostsSummary"
}
}
}
],
"links": {
"serviceCostLineItems": {
"uri": "/customers/ae1d5b32-f9ff-4252-b2bf-40e21937a51a/servicecosts/MostRecent/lineitems",
"method": "GET",
"headers": []
},
"self": {
"uri": "/customers/ae1d5b32-f9ff-4252-b2bf-40e21937a51a/servicecosts/MostRecent",
"method": "GET",
"headers": []
}
},
"attributes": {
"objectType": "ServiceCostsSummary"
}
}
Training
Module
Configure and manage costs as a Microsoft partner by using Microsoft Cost Management - Training
Learn how to reconcile your bill and analyze costs across your customers and resources by using Microsoft Cost Management as a partner.