Azure spending - Get usage summary for customer subscription

Retrieves the usage summary for all resources in a given customer's subscription for the current billing period.

GET https://api.partnercenter.microsoft.com/v1/customers/{customer_id}/subscriptions/{subscription_id}/usagesummary

URI Parameters

Name In Required Type Description
customer_id
path True

string

The customer Id.

subscription_id
path True

string

The subscription id.

Request Header

Name Required Type Description
Authorization True

string

Authorization Bearer token

ms-correlationid

string

Used for tracking requests internally. If a ms-correlationid is not provided, the server will generate a new one for each request

ms-cv

string

Used for tracking requests internally. If a ms-cv is not provided, the server will generate a new one for each request

ms-requestid

string

Used for idempotency of requests. If a ms-requestid is not provided, the server will generate a new one for each request

Responses

Name Type Description
200 OK

Collections.PagedResourceCollection[UsageManagement.SubscriptionUsageSummary]

The request was successful. The response body contains the usage summary.

Media Types: "application/json", "text/json", "application/xml", "text/xml"

400 Bad Request

There was a missing or an invalid input. The response body will provide the error details.

Media Types: "application/json", "text/json", "application/xml", "text/xml"

401 Unauthorized

The request was not authenticated. The client needs to authenticate with the partner API service first.

Media Types: "application/json", "text/json", "application/xml", "text/xml"

403 Forbidden

The request was authenticated but was refused since the caller does not have the rights to invoke it.

Media Types: "application/json", "text/json", "application/xml", "text/xml"

404 Not Found

The resource is not found or not available with the given input parameters.

Media Types: "application/json", "text/json", "application/xml", "text/xml"

500 Internal Server Error

The partner API service or one of its dependencies failed to fulfill the request. Callers may retry this.

Media Types: "application/json", "text/json", "application/xml", "text/xml"

Definitions

Name Description
Collections.PagedResourceCollection[UsageManagement.SubscriptionUsageSummary]
Link

Represents a link resource.

ResourceAttributes

Represents a resource attributes resource.

ResourceLinks

Represents a resource links resource.

StringStringKeyValuePair

Represents a key value pair resource.

UsageManagement.SubscriptionUsageSummary

Collections.PagedResourceCollection[UsageManagement.SubscriptionUsageSummary]

Name Type Description
attributes

ResourceAttributes

continuationToken

string

items

UsageManagement.SubscriptionUsageSummary[]

links

ResourceLinks

totalCount

integer (int32)

Represents a link resource.

Name Type Description
body

string

The body for the link.

headers

StringStringKeyValuePair[]

The collection of headers associated with this link.

method

string

The method for the link.

uri

string

The URI for the related resource.

ResourceAttributes

Represents a resource attributes resource.

Name Type Description
etag

string

The entity tag used for concurrency control.

objectType

string

The object type for the resource attributes.

Represents a resource links resource.

Name Type Description
next

Link

Additional next associated with the resource links.

previous

Link

Additional previous associated with the resource links.

self

Link

Additional self associated with the resource links.

StringStringKeyValuePair

Represents a key value pair resource.

Name Type Description
key

string

The key for the key value pair.

value

string

The value for the key value pair.

UsageManagement.SubscriptionUsageSummary

Name Type Description
attributes

ResourceAttributes

billingEndDate

string (date-time)

billingStartDate

string (date-time)

currencyCode

string

currencyLocale

string

id

string

lastModifiedDate

string (date-time)

links

ResourceLinks

name

string

resourceId

string

resourceName

string

totalCost

number (double)

usdTotalCost

number (double)