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:

The list of invoices.

NameDatatypeDescription
propertiesobjectAn invoice.
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 < > % & \ ? /

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_by_billing_profileselectbillingAccountName, billingProfileNameperiodStartDate, 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_accountselectbillingAccountName, invoiceNameGets an invoice by billing account name and ID. The operation is supported for all billing account types.
get_by_billing_subscriptionselectsubscriptionId, invoiceNameGets 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.
list_by_billing_accountselectbillingAccountNameperiodStartDate, 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_subscriptionselectsubscriptionIdperiodStartDate, 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.
getselectinvoiceNameGets an invoice by ID. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.
download_documents_by_billing_accountexecbillingAccountNameGets 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.
amendexecbillingAccountName, invoiceNameRegenerate 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_accountexecbillingAccountName, invoiceNamedocumentNameGets 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_accountexecbillingAccountName, invoiceNameGets 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_subscriptionexecsubscriptionIdGets 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_subscriptionexecsubscriptionId, invoiceNamedocumentNameGets 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.

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
billingAccountNamestringThe ID that uniquely identifies a billing account.
billingProfileNamestringThe ID that uniquely identifies a billing profile.
invoiceNamestringThe ID that uniquely identifies an invoice.
subscriptionIdstringThe ID that uniquely identifies a billing subscription.
countbooleanThe count query option allows clients to request a count of the matching resources included with the resources in the response.
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.
filterstringThe filter query option allows clients to filter a collection of resources that are addressed by a request URL.
orderBystringThe orderby query option allows clients to request resources in a particular order.
periodEndDatestring (date)The end date of the billing period for which the invoice is generated. The date is in MM-DD-YYYY format.
periodStartDatestring (date)The start date of the billing period for which the invoice is generated. The date is in MM-DD-YYYY format.
skipinteger (int64)The skip query option requests the number of items in the queried collection that are to be skipped and not included in the result.
topinteger (int64)The 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.

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
properties,
tags
FROM azure.billing.invoices
WHERE billingAccountName = '{{ billingAccountName }}' -- required
AND billingProfileName = '{{ billingProfileName }}' -- 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

Gets 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.

EXEC azure.billing.invoices.download_documents_by_billing_account 
@billingAccountName='{{ billingAccountName }}' --required
;