Skip to main content

transactions

Creates, updates, deletes, gets or lists a transactions resource.

Overview

Nametransactions
TypeResource
Idazure.billing.transactions

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
azureCreditAppliedobjectThe amount of any Azure credits automatically applied to this transaction.
azurePlanstringDetails of the Azure plan.
billingCurrencystringThe ISO 4217 code for the currency in which this transaction is billed.
billingProfileDisplayNameobjectThe name of the billing profile.
billingProfileIdstringThe fully qualified ID that uniquely identifies a billing profile.
consumptionCommitmentDecrementedobjectThe amount of Microsoft Azure Consumption Commitment(MACC) decrement through the transaction.
creditTypestringThe credit type of the transaction. Applies only to credited transactions. Known values are: "Other", "AzureFreeCredit", "AzureCreditOffer", "ServiceInterruption", and "Refund". (Other, AzureFreeCredit, AzureCreditOffer, ServiceInterruption, Refund)
customerDisplayNamestringThe name of the customer.
customerIdstringThe fully qualified ID that uniquely identifies a customer.
datestring (date-time)The date of transaction.
discountnumberThe percentage discount, if any, applied to this transaction.
effectivePriceobjectThe price of the product after applying any discounts.
exchangeRatenumberThe exchange rate used to convert charged amount to billing currency, if applicable.
invoicestringInvoice name on which the transaction was billed or 'Pending' if the transaction is not billed.
invoiceIdstringThe fully qualified ID of the invoice on which the transaction was billed. This field is only applicable for transactions which are billed.
invoiceSectionDisplayNamestringThe name of the invoice section.
invoiceSectionIdstringThe fully qualified ID that uniquely identifies an invoice section.
isThirdPartybooleanWhether or not the transaction is third party.
kindstringType of the transaction, billed or unbilled. Known values are: "Other", "All", and "Reservation". (Other, All, Reservation)
marketPriceobjectThe retail price of the product.
partNumberstringThe part number of the product for which the transaction took place. The field is only applicable for Enterprise Agreement invoices.
pricingCurrencystringThe ISO 4217 code for the currency in which the product is priced.
productDescriptionstringThe description of the product for which the transaction took place.
productFamilystringThe family of the product for which the transaction took place.
productTypestringThe type of the product for which the transaction took place.
productTypeIdstringThe ID of the product type for which the transaction took place.
quantityintegerThe quantity purchased in the transaction.
reasonCodestringThere reason code for the transaction.
refundTransactionDetailsobjectThe refund details of a transaction.
servicePeriodEndDatestring (date-time)The end date of the product term, or the end date of the month in which usage ended.
servicePeriodStartDatestring (date-time)The date of the purchase of the product, or the start date of the month in which usage started.
specialTaxationTypestringIdentifies the type of tax calculation used for the invoice. The field is applicable only to invoices with special tax calculation logic. Known values are: "SubtotalLevel" and "InvoiceLevel". (SubtotalLevel, InvoiceLevel)
subTotalobjectThe pre-tax charged amount for the transaction.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
tagsobjectDictionary of metadata associated with the resource. It may not be populated for all resource types. Maximum key/value length supported of 256 characters. Keys/value should not empty value nor null. Keys can not contain < > % & \ ? /.
taxobjectThe tax amount applied to the transaction.
transactionAmountobjectThe charge associated with the transaction.
transactionTypestringThe type of transaction.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".
unitOfMeasurestringThe unit of measure used to bill for the product. For example, compute services are billed per hour.
unitTypestringThe description for the unit of measure for a given product.
unitsnumberThe number of units used for a given product.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_by_customerselectbilling_account_name, billing_profile_name, customer_name, periodStartDate, periodEndDate, typefilter, orderBy, top, skip, count, searchLists the billed or unbilled transactions by customer id for given start date and end date. Transactions include purchases, refunds and Azure usage charges. Unbilled transactions are listed under pending invoice Id and do not include tax. Tax is added to the amount once an invoice is generated.
list_by_invoice_sectionselectbilling_account_name, billing_profile_name, invoice_section_name, periodStartDate, periodEndDate, typefilter, orderBy, top, skip, count, searchLists the billed or unbilled transactions by invoice section name for given start date and end date. Transactions include purchases, refunds and Azure usage charges. Unbilled transactions are listed under pending invoice Id and do not include tax. Tax is added to the amount once an invoice is generated.
list_by_billing_profileselectbilling_account_name, billing_profile_name, periodStartDate, periodEndDate, typefilter, orderBy, top, skip, count, searchLists the billed or unbilled transactions by billing profile name for given start and end date. Transactions include purchases, refunds and Azure usage charges. Unbilled transactions are listed under pending invoice Id and do not include tax. Tax is added to the amount once an invoice is generated.
list_by_invoiceselectbilling_account_name, invoice_namefilter, orderBy, top, skip, count, searchLists the transactions for an invoice. Transactions include purchases, refunds and Azure usage charges.
get_transaction_summary_by_invoiceexecbilling_account_name, invoice_namefilter, searchGets the transaction summary for an invoice. Transactions include purchases, refunds and Azure usage charges.
transactions_download_by_invoiceexecbilling_account_name, invoice_nameGets a URL to download the transactions document for an invoice. The operation is supported for billing accounts with agreement type Enterprise Agreement.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
billing_account_namestringThe ID that uniquely identifies a billing account. Required.
billing_profile_namestringThe ID that uniquely identifies a billing profile. Required.
customer_namestringThe ID that uniquely identifies a customer. Required.
invoice_namestringThe ID that uniquely identifies an invoice. Required.
invoice_section_namestringThe ID that uniquely identifies an invoice section. Required.
periodEndDatestring (date)The end date to fetch the transactions. The date should be specified in MM-DD-YYYY format. Required.
periodStartDatestring (date)The start date to fetch the transactions. The date should be specified in MM-DD-YYYY format. Required.
typestringThe type of transaction. Known values are: "Other", "Billed", and "Unbilled". Required.
countbooleanThe count query option allows clients to request a count of the matching resources included with the resources in the response. Default value is None.
filterstringThe filter query option allows clients to filter the line items that are aggregated to create the line item summary. Default value is None.
orderBystringThe orderby query option allows clients to request resources in a particular order. Default value is None.
skipintegerThe skip query option requests the number of items in the queried collection that are to be skipped and not included in the result. Default value is None.
topintegerThe top query option requests the number of items in the queried collection to be included in the result. The maximum supported value for top is 50. Default value is None.

SELECT examples

Lists the billed or unbilled transactions by customer id for given start date and end date. Transactions include purchases, refunds and Azure usage charges. Unbilled transactions are listed under pending invoice Id and do not include tax. Tax is added to the amount once an invoice is generated.

SELECT
id,
name,
azureCreditApplied,
azurePlan,
billingCurrency,
billingProfileDisplayName,
billingProfileId,
consumptionCommitmentDecremented,
creditType,
customerDisplayName,
customerId,
date,
discount,
effectivePrice,
exchangeRate,
invoice,
invoiceId,
invoiceSectionDisplayName,
invoiceSectionId,
isThirdParty,
kind,
marketPrice,
partNumber,
pricingCurrency,
productDescription,
productFamily,
productType,
productTypeId,
quantity,
reasonCode,
refundTransactionDetails,
servicePeriodEndDate,
servicePeriodStartDate,
specialTaxationType,
subTotal,
systemData,
tags,
tax,
transactionAmount,
transactionType,
type,
unitOfMeasure,
unitType,
units
FROM azure.billing.transactions
WHERE billing_account_name = '{{ billing_account_name }}' -- required
AND billing_profile_name = '{{ billing_profile_name }}' -- required
AND customer_name = '{{ customer_name }}' -- required
AND periodStartDate = '{{ periodStartDate }}' -- required
AND periodEndDate = '{{ periodEndDate }}' -- required
AND type = '{{ type }}' -- required
AND filter = '{{ filter }}'
AND orderBy = '{{ orderBy }}'
AND top = '{{ top }}'
AND skip = '{{ skip }}'
AND count = '{{ count }}'
AND search = '{{ search }}'
;

Lifecycle Methods

Gets the transaction summary for an invoice. Transactions include purchases, refunds and Azure usage charges.

EXEC azure.billing.transactions.get_transaction_summary_by_invoice 
@billing_account_name='{{ billing_account_name }}' --required,
@invoice_name='{{ invoice_name }}' --required,
@filter='{{ filter }}',
@search='{{ search }}'
;