Skip to main content

invoices

Creates, updates, deletes, gets or lists an invoices resource.

Overview

Nameinvoices
TypeResource
Idazure.billing.invoices

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.
amountDueobjectThe amount due as of now.
azurePrepaymentAppliedobjectThe amount of Azure prepayment applied to the charges. This field is applicable to billing accounts with agreement type Microsoft Customer Agreement.
billedAmountobjectThe total charges for the invoice billing period.
billedDocumentIdstringThe Id of the active invoice which is originally billed after this invoice was voided. This field is applicable to the void invoices only.
billingProfileDisplayNamestringThe name of the billing profile for which the invoice is generated.
billingProfileIdstringThe ID of the billing profile for which the invoice is generated.
creditAmountobjectThe total refund for returns and cancellations during the invoice billing period. This field is applicable to billing accounts with agreement type Microsoft Customer Agreement.
creditForDocumentIdstringThe Id of the invoice which got voided and this credit note was issued as a result. This field is applicable to the credit notes only.
documentTypestringThe type of the document. Known values are: "Other", "Invoice", "VoidNote", "TaxReceipt", "CreditNote", "Summary", and "Transactions". (Other, Invoice, VoidNote, TaxReceipt, CreditNote, Summary, Transactions)
documentsarrayList of documents available to download and view such as invoice, credit note, or tax receipt.
dueDatestring (date-time)The due date for the invoice.
failedPaymentsarrayList of failed payments.
freeAzureCreditAppliedobjectThe amount of free Azure credits applied to the charges. This field is applicable to billing accounts with agreement type Microsoft Customer Agreement.
invoiceDatestring (date-time)The date when the invoice was generated.
invoicePeriodEndDatestring (date-time)The end date of the billing period for which the invoice is generated. The date is in MM-DD-YYYY format.
invoicePeriodStartDatestring (date-time)The start date of the billing period for which the invoice is generated. The date is in MM-DD-YYYY format.
invoiceTypestringInvoice type. Known values are: "Other", "AzureServices", "AzureMarketplace", and "AzureSupport". (Other, AzureServices, AzureMarketplace, AzureSupport)
isMonthlyInvoicebooleanSpecifies if the invoice is generated as part of monthly invoicing cycle or not. This field is applicable to billing accounts with agreement type Microsoft Customer Agreement.
paymentsarrayList of payments.
purchaseOrderNumberstringAn optional purchase order number for the invoice.
rebillDetailsobjectRebill details for an invoice.
refundDetailsobjectThe details of a refund request.
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)
statusstringThe current status of the invoice. Known values are: "Other", "Due", "OverDue", "Paid", "Void", and "Locked". (Other, Due, OverDue, Paid, Void, Locked)
subTotalobjectThe pre-tax amount due. This field is applicable to billing accounts with agreement type Microsoft Customer Agreement.
subscriptionDisplayNamestringThe name of the billing subscription for which the invoice is generated.
subscriptionIdstringThe ID of the subscription for which the invoice is generated.
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 < > % & \ ? /.
taxAmountobjectThe amount of tax charged for the billing period. This field is applicable to billing accounts with agreement type Microsoft Customer Agreement.
totalAmountobjectThe amount due when the invoice was generated. This field is applicable to billing accounts with agreement type Microsoft Customer Agreement.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_by_billing_profileselectbilling_account_name, billing_profile_nameperiodStartDate, periodEndDate, filter, orderBy, top, skip, count, searchLists the invoices for a billing profile for a given start date and end date. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.
get_by_billing_accountselectbilling_account_name, invoice_nameGets an invoice by billing account name and ID. The operation is supported for all billing account types.
get_by_billing_subscriptionselectinvoice_name, subscription_idGets an invoice by subscription ID and invoice ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.
getselectinvoice_nameGets an invoice by ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.
list_by_billing_accountselectbilling_account_nameperiodStartDate, periodEndDate, filter, orderBy, top, skip, count, searchLists the invoices for a billing account for a given start date and end date. The operation is supported for all billing account types.
list_by_billing_subscriptionselectsubscription_idperiodStartDate, periodEndDate, filter, orderBy, top, skip, count, searchLists the invoices for a subscription. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.
amendexecbilling_account_name, invoice_nameRegenerate an invoice by billing account name and invoice name. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement.
download_by_billing_accountexecbilling_account_name, invoice_namedocumentNameGets a URL to download an invoice document. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement, Microsoft Customer Agreement or Enterprise Agreement.
download_summary_by_billing_accountexecbilling_account_name, invoice_nameGets a URL to download the summary document for an invoice. The operation is supported for billing accounts with agreement type Enterprise Agreement.
download_documents_by_billing_accountexecbilling_account_nameGets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.
download_by_billing_subscriptionexecinvoice_name, subscription_iddocumentNameGets a URL to download an invoice by billing subscription. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.
download_documents_by_billing_subscriptionexecsubscription_idGets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer 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.
invoice_namestringThe ID that uniquely identifies an invoice. Required.
subscription_idstring
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.
documentNamestringThe ID that uniquely identifies an invoice document. This ID may be an identifier for an invoice PDF, a credit note, or a tax receipt. Default value is None.
filterstringThe filter query option allows clients to filter a collection of resources that are addressed by a request URL. Default value is None.
orderBystringThe orderby query option allows clients to request resources in a particular order. Default value is None.
periodEndDatestring (date)The end date of the billing period for which the invoice is generated. The date is in MM-DD-YYYY format. Default value is None.
periodStartDatestring (date)The start date of the billing period for which the invoice is generated. The date is in MM-DD-YYYY format. 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 invoices for a billing profile for a given start date and end date. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.

SELECT
id,
name,
amountDue,
azurePrepaymentApplied,
billedAmount,
billedDocumentId,
billingProfileDisplayName,
billingProfileId,
creditAmount,
creditForDocumentId,
documentType,
documents,
dueDate,
failedPayments,
freeAzureCreditApplied,
invoiceDate,
invoicePeriodEndDate,
invoicePeriodStartDate,
invoiceType,
isMonthlyInvoice,
payments,
purchaseOrderNumber,
rebillDetails,
refundDetails,
specialTaxationType,
status,
subTotal,
subscriptionDisplayName,
subscriptionId,
systemData,
tags,
taxAmount,
totalAmount,
type
FROM azure.billing.invoices
WHERE billing_account_name = '{{ billing_account_name }}' -- required
AND billing_profile_name = '{{ billing_profile_name }}' -- required
AND periodStartDate = '{{ periodStartDate }}'
AND periodEndDate = '{{ periodEndDate }}'
AND filter = '{{ filter }}'
AND orderBy = '{{ orderBy }}'
AND top = '{{ top }}'
AND skip = '{{ skip }}'
AND count = '{{ count }}'
AND search = '{{ search }}'
;

Lifecycle Methods

Regenerate an invoice by billing account name and invoice name. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement.

EXEC azure.billing.invoices.amend 
@billing_account_name='{{ billing_account_name }}' --required,
@invoice_name='{{ invoice_name }}' --required
;