Lots - List By Billing Account

Lists all Microsoft Azure consumption commitments for a billing account. The API is only supported for Microsoft Customer Agreements (MCA) and Direct Enterprise Agreement (EA) billing accounts.

GET https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/lots?api-version=2023-05-01
GET https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/lots?api-version=2023-05-01&$filter={$filter}

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

May be used to filter the lots by Status, Source etc. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:).

Responses

Name Type Description
200 OK

Lots

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

LotsListByBillingAccount
LotsListByBillingAccountWithStatusFilter

LotsListByBillingAccount

Sample Request

GET https://management.azure.com/providers/Microsoft.Billing/billingAccounts/1234:5678/providers/Microsoft.Consumption/lots?api-version=2023-05-01

Sample Response

{
  "value": [
    {
      "id": "/providers/Microsoft.Billing/billingAccounts/1234:5678/billingProfiles/2468/providers/Microsoft.Consumption/lots/lot1",
      "name": "lot1",
      "type": "Microsoft.Consumption/lots",
      "properties": {
        "originalAmount": {
          "currency": "USD",
          "value": 5000
        },
        "closedBalance": {
          "currency": "USD",
          "value": 60.9
        },
        "source": "ConsumptionCommitment",
        "startDate": "2019-10-01T00:00:00Z",
        "expirationDate": "2019-11-01T00:00:00Z",
        "purchasedDate": "2019-09-01T00:00:00Z",
        "status": "Active"
      }
    },
    {
      "id": "/providers/Microsoft.Billing/billingAccounts/1234:5678/billingProfiles/2468/providers/Microsoft.Consumption/lots/lot2",
      "name": "lot2",
      "type": "Microsoft.Consumption/lots",
      "properties": {
        "originalAmount": {
          "currency": "USD",
          "value": 6000
        },
        "closedBalance": {
          "currency": "USD",
          "value": 80.9
        },
        "source": "ConsumptionCommitment",
        "startDate": "2019-11-01T00:00:00Z",
        "expirationDate": "2019-12-31T00:00:00Z",
        "purchasedDate": "2019-09-01T00:00:00Z",
        "status": "Expired"
      }
    }
  ]
}

LotsListByBillingAccountWithStatusFilter

Sample Request

GET https://management.azure.com/providers/Microsoft.Billing/billingAccounts/1234:5678/providers/Microsoft.Consumption/lots?api-version=2023-05-01&$filter=status eq 'active' AND source eq 'consumptioncommitment'

Sample Response

{
  "value": [
    {
      "id": "/providers/Microsoft.Billing/billingAccounts/1234:5678/billingProfiles/2468/providers/Microsoft.Consumption/lots/lot1",
      "name": "lot1",
      "type": "Microsoft.Consumption/lots",
      "properties": {
        "originalAmount": {
          "currency": "USD",
          "value": 5000
        },
        "closedBalance": {
          "currency": "USD",
          "value": 60.9
        },
        "source": "ConsumptionCommitment",
        "startDate": "2019-10-01T00:00:00Z",
        "expirationDate": "2019-11-01T00:00:00Z",
        "purchasedDate": "2019-09-01T00:00:00Z",
        "status": "Active"
      }
    }
  ]
}

Definitions

Name Description
amount

The amount plus currency .

AmountWithExchangeRate

The amount with exchange rate.

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.

Lots

Result of listing lot summary.

LotSource

The source of the lot.

LotSummary

A lot summary resource.

Reseller

The reseller properties.

Status

The status of the lot.

amount

The amount plus currency .

Name Type Description
currency

string

Amount currency.

value

number

Amount.

AmountWithExchangeRate

The amount with exchange rate.

Name Type Description
currency

string

Amount currency.

exchangeRate

number

The exchange rate.

exchangeRateMonth

integer

The exchange rate month.

value

number

Amount.

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.

Name Type Description
error

ErrorDetails

The details of the error.

Lots

Result of listing lot summary.

Name Type Description
nextLink

string

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

value

LotSummary[]

The list of lot summary.

LotSource

The source of the lot.

Name Type Description
ConsumptionCommitment

string

PromotionalCredit

string

PurchasedCredit

string

LotSummary

A lot summary resource.

Name Type Description
eTag

string

eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not.

id

string

Resource Id.

name

string

Resource name.

properties.billingCurrency

string

The billing currency of the lot.

properties.closedBalance

amount

The balance as of the last invoice.

properties.closedBalanceInBillingCurrency

AmountWithExchangeRate

The balance as of the last invoice in billing currency.

properties.creditCurrency

string

The currency of the lot.

properties.eTag

string

The eTag for the resource.

properties.expirationDate

string

The expiration date of a lot.

properties.isEstimatedBalance

boolean

If true, the listed details are based on an estimation and it will be subjected to change.

properties.originalAmount

amount

The original amount of a lot.

properties.originalAmountInBillingCurrency

AmountWithExchangeRate

The original amount of a lot in billing currency.

properties.poNumber

string

The po number of the invoice on which the lot was added. This property is not available for ConsumptionCommitment lots.

properties.purchasedDate

string

The date when the lot was added.

properties.reseller

Reseller

The reseller of the lot.

properties.source

LotSource

The source of the lot.

properties.startDate

string

The date when the lot became effective.

properties.status

Status

The status of the lot.

type

string

Resource type.

Reseller

The reseller properties.

Name Type Description
resellerDescription

string

The reseller property description.

resellerId

string

The reseller property ID.

Status

The status of the lot.

Name Type Description
Active

string

Canceled

string

Complete

string

Expired

string

Inactive

string

None

string