Invoices - Download Documents By Billing Subscription

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.

POST https://management.azure.com/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/downloadDocuments?api-version=2024-04-01

URI Parameters

Name In Required Type Description
subscriptionId
path True

string

The ID that uniquely identifies a billing subscription.

Regex pattern: ^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$

api-version
query True

string

The version of the API to be used with the client request. The current version is 2024-04-01.

Request Body

Name Type Description
parameters

DocumentDownloadRequest[]

A list of download details for individual documents.

Responses

Name Type Description
200 OK

DocumentDownloadResult

A secure URL that can be used to download a an entity until the URL expires.

202 Accepted

An operation accepted result that returns a 'Location' header that the client can poll to view the result of the operation.

Headers

  • Location: string
  • Retry-After: integer
Other Status Codes

ErrorResponse

Error response describing why the operation failed.

Examples

InvoicesDownloadDocumentsByBillingSubscription

Sample request

POST https://management.azure.com/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/00000000-0000-0000-0000-000000000000/downloadDocuments?api-version=2024-04-01

[
  {
    "documentName": "12345678",
    "invoiceName": "E123456789"
  },
  {
    "documentName": "12345678",
    "invoiceName": "E987654321"
  }
]

Sample response

{
  "expiryTime": "2023-02-16T17:32:28Z",
  "url": "https://myaccount.blob.core.windows.net/invoices/1383724.pdf?sv=2019-02-02&sr=b&sp=r"
}
Location: https://management.azure.com/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/00000000-0000-0000-0000-000000000000/operationResults/invoiceDownload_11111111-1111-1111-1111-111111111111?api-version=2024-04-01
Retry-After: 10

Definitions

Name Description
DocumentDownloadRequest

A list of download details for individual documents.

DocumentDownloadResult

A secure URL that can be used to download a an entity until the URL expires.

ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

DocumentDownloadRequest

A list of download details for individual documents.

Name Type Description
documentName

string

The ID that uniquely identifies an invoice document. This ID may be an identifier for an invoice PDF, a credit note, or a tax receipt. If omitted, the most recent invoice PDF for the invoice will be returned.

invoiceName

string

The ID that uniquely identifies an invoice.

DocumentDownloadResult

A secure URL that can be used to download a an entity until the URL expires.

Name Type Description
expiryTime

string

The time in UTC when the download URL will expire.

url

string

The URL to the PDF or .zip file.

ErrorAdditionalInfo

The resource management error additional info.

Name Type Description
info

object

The additional info.

type

string

The additional info type.

ErrorDetail

The error detail.

Name Type Description
additionalInfo

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorDetail[]

The error details.

message

string

The error message.

target

string

The error target.

ErrorResponse

Error response

Name Type Description
error

ErrorDetail

The error object.