Obtiene una dirección URL para descargar varios documentos de factura (pdf de factura, recibos fiscales, notas de crédito) como un archivo ZIP. La operación se admite para las cuentas de facturación con el tipo de contrato Microsoft Partner Agreement o Contrato de cliente de Microsoft.
POST https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/downloadDocuments?api-version=2020-05-01
Parámetros de identificador URI
Nombre |
En |
Requerido |
Tipo |
Description |
billingAccountName
|
path |
True
|
string
|
Identificador que identifica de forma única una cuenta de facturación.
|
api-version
|
query |
True
|
string
|
Versión de la API que se va a usar con la solicitud de cliente. La versión actual es 2020-05-01.
|
Cuerpo de la solicitud
Nombre |
Tipo |
Description |
downloadUrls
|
string[]
|
Matriz de direcciones URL de descarga para documentos individuales
|
Respuestas
Nombre |
Tipo |
Description |
200 OK
|
DownloadUrl
|
Aceptar. La solicitud se ha realizado correctamente.
|
202 Accepted
|
|
Accepted.
Headers
- Location: string
- Retry-After: string
|
Other Status Codes
|
ErrorResponse
|
Respuesta de error que describe el motivo del error de la operación.
|
Seguridad
azure_auth
Flujo de OAuth2 de Azure Active Directory.
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Nombre |
Description |
user_impersonation
|
suplantación de su cuenta de usuario
|
Ejemplos
BillingProfileInvoiceDownload
Sample Request
POST https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/downloadDocuments?api-version=2020-05-01
[
"https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01",
"https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01",
"https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01"
]
import java.util.Arrays;
/** Samples for Invoices DownloadMultipleBillingProfileInvoices. */
public final class Main {
/*
* x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/MultipleModernInvoiceDownload.json
*/
/**
* Sample code: BillingProfileInvoiceDownload.
*
* @param manager Entry point to BillingManager.
*/
public static void billingProfileInvoiceDownload(com.azure.resourcemanager.billing.BillingManager manager) {
manager
.invoices()
.downloadMultipleBillingProfileInvoices(
"{billingAccountName}",
Arrays
.asList(
"https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01",
"https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01",
"https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01"),
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.billing import BillingManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-billing
# USAGE
python billing_profile_invoice_download.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = BillingManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.invoices.begin_download_multiple_billing_profile_invoices(
billing_account_name="{billingAccountName}",
download_urls=[
"https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01",
"https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01",
"https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01",
],
).result()
print(response)
# x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/MultipleModernInvoiceDownload.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armbilling_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/MultipleModernInvoiceDownload.json
func ExampleInvoicesClient_BeginDownloadMultipleBillingProfileInvoices() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewInvoicesClient().BeginDownloadMultipleBillingProfileInvoices(ctx, "{billingAccountName}", []*string{
to.Ptr("https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01"),
to.Ptr("https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01"),
to.Ptr("https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01")}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.DownloadURL = armbilling.DownloadURL{
// URL: to.Ptr("https://myaccount.blob.core.windows.net/invoices/1383724.pdf?sv=2019-02-02&sr=b&sp=r"),
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { BillingManagementClient } = require("@azure/arm-billing");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to 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.
*
* @summary 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.
* x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/MultipleModernInvoiceDownload.json
*/
async function billingProfileInvoiceDownload() {
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const billingAccountName = "{billingAccountName}";
const downloadUrls = [
"https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01",
"https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01",
"https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01",
];
const credential = new DefaultAzureCredential();
const client = new BillingManagementClient(credential, subscriptionId);
const result = await client.invoices.beginDownloadMultipleBillingProfileInvoicesAndWait(
billingAccountName,
downloadUrls
);
console.log(result);
}
billingProfileInvoiceDownload().catch(console.error);
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
Location: https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/operationResults/invoiceDownload_{operationId}?api-version=2020-05-01
Retry-After: 10
{
"url": "https://myaccount.blob.core.windows.net/invoices/1383724.pdf?sv=2019-02-02&sr=b&sp=r"
}
Definiciones
Nombre |
Description |
DownloadUrl
|
Una dirección URL segura que se puede usar para descargar una entidad hasta que expire la dirección URL.
|
ErrorDetails
|
Detalles del error.
|
ErrorResponse
|
La respuesta de error indica que el servicio no puede procesar la solicitud entrante. El motivo se proporciona en el mensaje de error.
|
ErrorSubDetails
|
|
DownloadUrl
Una dirección URL segura que se puede usar para descargar una entidad hasta que expire la dirección URL.
Nombre |
Tipo |
Description |
expiryTime
|
string
|
Hora UTC en la que expirará la dirección URL de descarga.
|
url
|
string
|
Dirección URL del archivo PDF.
|
ErrorDetails
Detalles del error.
Nombre |
Tipo |
Description |
code
|
string
|
Código de error.
|
details
|
ErrorSubDetails[]
|
Los detalles secundarios del error.
|
message
|
string
|
Mensaje de error que indica por qué se produjo un error en la operación.
|
target
|
string
|
Destino del error determinado.
|
ErrorResponse
La respuesta de error indica que el servicio no puede procesar la solicitud entrante. El motivo se proporciona en el mensaje de error.
Nombre |
Tipo |
Description |
error
|
ErrorDetails
|
Detalles del error.
|
ErrorSubDetails
Nombre |
Tipo |
Description |
code
|
string
|
Código de error.
|
message
|
string
|
Mensaje de error que indica por qué se produjo un error en la operación.
|
target
|
string
|
Destino del error determinado.
|