共用方式為


Reservation Transactions - List

List of transactions for reserved instances on billing account scope. Note: The refund transactions are posted along with its purchase transaction (i.e. in the purchase billing month). For example, The refund is requested in May 2021. This refund transaction will have event date as May 2021 but the billing month as April 2020 when the reservation purchase was made. Note: ARM has a payload size limit of 12MB, so currently callers get 400 when the response size exceeds the ARM limit. In such cases, API call should be made with smaller date ranges.

GET https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/reservationTransactions?api-version=2024-08-01
GET https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/reservationTransactions?$filter={$filter}&api-version=2024-08-01&useMarkupIfPartner={useMarkupIfPartner}&previewMarkupPercentage={previewMarkupPercentage}

URI Parameters

Name In Required Type Description
billingAccountId
path True

string

BillingAccount ID

api-version
query True

string

Version of the API to be used with the client request. The current version is 2023-03-01.

$filter
query

string

Filter reservation transactions by date range. The properties/EventDate for start date and end date. The filter supports 'le' and 'ge'. Note: API returns data for the entire start date's and end date's billing month. For example, filter properties/eventDate+ge+2020-01-01+AND+properties/eventDate+le+2020-12-29 will include data for the entire December 2020 month (i.e. will contain records for dates December 30 and 31)

previewMarkupPercentage
query

number

decimal

Preview markup percentage to be applied.

useMarkupIfPartner
query

boolean

Applies mark up to the transactions if the caller is a partner.

Responses

Name Type Description
200 OK

ReservationTransactionsListResult

OK. The request has succeeded.

Other Status Codes

ErrorResponse

Error response describing why the operation failed.

Security

azure_auth

Azure Active Directory OAuth2 Flow.

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

ReservationTransactionsByEnrollmentNumber

Sample request

GET https://management.azure.com/providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.Consumption/reservationTransactions?$filter=properties/eventDate+ge+2020-05-20+AND+properties/eventDate+le+2020-05-30&api-version=2024-08-01&useMarkupIfPartner=True&previewMarkupPercentage=15.5

Sample response

{
  "value": [
    {
      "id": "/billingAccounts/123456/providers/Microsoft.Consumption/reservationtransactions/201909091919",
      "name": "201909091919",
      "type": "Microsoft.Consumption/reservationTransactions",
      "tags": [],
      "properties": {
        "eventDate": "2019-09-09T19:19:04Z",
        "reservationOrderId": "00000000-0000-0000-0000-000000000000",
        "description": "Standard_DS1_v2 westus 1 Year",
        "eventType": "Refund",
        "quantity": 1,
        "amount": -21,
        "currency": "USD",
        "reservationOrderName": "Transaction-DS1_v2",
        "purchasingEnrollment": "123456",
        "armSkuName": "Standard_DS1_v2",
        "term": "P1Y",
        "region": "westus",
        "purchasingSubscriptionGuid": "a838a8c3-a408-49e1-ac90-42cb95bff9b2",
        "purchasingSubscriptionName": "Infrastructure Subscription",
        "accountName": "Microsoft Infrastructure",
        "accountOwnerEmail": "admin@microsoft.com",
        "departmentName": "Unassigned",
        "costCenter": "",
        "currentEnrollment": "123456",
        "billingFrequency": "recurring",
        "billingMonth": 20190901,
        "monetaryCommitment": 523123.9,
        "overage": 23234.49
      }
    },
    {
      "id": "/billingAccounts/123456/providers/Microsoft.Consumption/reservationtransactions/201909091919",
      "name": "201909091919",
      "type": "Microsoft.Consumption/reservationTransactions",
      "tags": [],
      "properties": {
        "eventDate": "2019-09-09T19:19:04Z",
        "reservationOrderId": "00000000-0000-0000-0000-000000000000",
        "description": "Standard_DS1_v2 westus 1 Year",
        "eventType": "Purchase",
        "quantity": 1,
        "amount": 21,
        "currency": "USD",
        "reservationOrderName": "Transaction-DS1_v2",
        "purchasingEnrollment": "123456",
        "armSkuName": "Standard_DS1_v2",
        "term": "P1Y",
        "region": "westus",
        "purchasingSubscriptionGuid": "a838a8c3-a408-49e1-ac90-42cb95bff9b2",
        "purchasingSubscriptionName": "Infrastructure Subscription",
        "accountName": "Microsoft Infrastructure",
        "accountOwnerEmail": "admin@microsoft.com",
        "departmentName": "Unassigned",
        "costCenter": "",
        "currentEnrollment": "123456",
        "billingFrequency": "recurring",
        "billingMonth": 20190901,
        "monetaryCommitment": 523123.9,
        "overage": 23234.49
      }
    }
  ]
}

Definitions

Name Description
ErrorDetails

The details of the error.

ErrorResponse

Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message.

Some Error responses:

  • 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "x-ms-ratelimit-microsoft.consumption-retry-after" header.

  • 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" header.

  • 504 Gateway Timeout - Service timed out while processing the request. Reduce the date range in the request, if possible.

ReservationTransaction

Reservation transaction resource.

ReservationTransactionsListResult

Result of listing reservation recommendations.

ErrorDetails

The details of the error.

Name Type Description
code

string

Error code.

message

string

Error message indicating why the operation failed.

ErrorResponse

Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message.

Some Error responses:

  • 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "x-ms-ratelimit-microsoft.consumption-retry-after" header.

  • 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" header.

  • 504 Gateway Timeout - Service timed out while processing the request. Reduce the date range in the request, if possible.

Name Type Description
error

ErrorDetails

The details of the error.

ReservationTransaction

Reservation transaction resource.

Name Type Description
id

string

Resource Id.

name

string

Resource name.

properties.accountName

string

The name of the account that makes the transaction.

properties.accountOwnerEmail

string

The email of the account owner that makes the transaction.

properties.amount

number

The charge of the transaction.

properties.armSkuName

string

This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records.

properties.billingFrequency

string

The billing frequency, which can be either one-time or recurring.

properties.billingMonth

integer

The billing month(yyyyMMdd), on which the event initiated.

properties.costCenter

string

The cost center of this department if it is a department and a cost center is provided.

properties.currency

string

The ISO currency in which the transaction is charged, for example, USD.

properties.currentEnrollment

string

The current enrollment.

properties.departmentName

string

The department name.

properties.description

string

The description of the transaction.

properties.eventDate

string

The date of the transaction

properties.eventType

string

The type of the transaction (Purchase, Cancel or Refund).

properties.monetaryCommitment

number

The monetary commitment amount at the enrollment scope.

properties.overage

number

The overage amount at the enrollment scope.

properties.purchasingEnrollment

string

The purchasing enrollment.

properties.purchasingSubscriptionGuid

string

The subscription guid that makes the transaction.

properties.purchasingSubscriptionName

string

The subscription name that makes the transaction.

properties.quantity

number

The quantity of the transaction.

properties.region

string

The region of the transaction.

properties.reservationOrderId

string

The reservation order ID is the identifier for a reservation purchase. Each reservation order ID represents a single purchase transaction. A reservation order contains reservations. The reservation order specifies the VM size and region for the reservations.

properties.reservationOrderName

string

The name of the reservation order.

properties.term

string

This is the term of the transaction.

tags

string[]

Resource tags.

type

string

Resource type.

ReservationTransactionsListResult

Result of listing reservation recommendations.

Name Type Description
nextLink

string

The link (url) to the next page of results.

value

ReservationTransaction[]

The list of reservation recommendations.