Obtenir les éléments de ligne de factureGet invoice line items

S’applique à :Applies to:

  • Espace partenairesPartner Center
  • Espace partenaires géré par 21VianetPartner Center operated by 21Vianet
  • Espace partenaires de Microsoft Cloud GermanyPartner Center for Microsoft Cloud Germany
  • Espace partenaires de Microsoft Cloud for US GovernmentPartner Center for Microsoft Cloud for US Government

Vous pouvez utiliser les méthodes suivantes pour obtenir les détails d’une collection d’éléments de ligne de facturation (également appelés éléments de ligne de facturation clôturés) pour une facture spécifiée.You can use the following methods to get a collection details for of invoice line items (also known as closed billing line items) for a specified invoice.

À l’exception des correctifs de bogues, cette API n’est plus mise à jour.Except for bug fixes, this API is no longer being updated. Vous devez mettre à jour vos applications pour appeler l’API OneTime au lieu de Marketplace.You should update your applications to call the onetime API instead of marketplace. L’API OneTime fournit des fonctionnalités supplémentaires qui continueront à être mises à jour.The onetime API provides additional functionality, and will continue to be updated.

Vous devez utiliser OneTime pour interroger tous les Articles de la consommation commerciale au lieu de la place de marché.You should use onetime to query all commercial consumption line items instead of marketplace. Vous pouvez ou suivre les liens de l’appel d’estimation des liens.Or, you can follow the links in the estimate links call.

Cette API prend également en charge les types de fournisseurs Azure et office pour les abonnements Microsoft Azure (MS-AZR-0145P) et les offres Office, ce qui rend la fonctionnalité d’API à compatibilité descendante.This API also supports the provider types of azure and office for Microsoft Azure (MS-AZR-0145P) subscriptions and Office offers, which makes the API feature backward compatible.

PrérequisPrerequisites

  • Informations d’identification, comme décrit dans Authentification auprès de l’Espace partenaires.Credentials as described in Partner Center authentication. Ce scénario prend en charge l’authentification avec les informations d’identification de l’application autonome et de l’application + utilisateur.This scenario supports authentication with both standalone App and App+User credentials.

  • Identificateur de la facture.An invoice identifier. Cela permet d’identifier la facture pour laquelle récupérer les éléments de ligne.This identifies the invoice for which to retrieve the line items.

C#C#

Pour obtenir les lignes de la facture spécifiée :To get the line items for the specified invoice:

  1. Appelez la méthode méthode BYID pour obtenir une interface permettant de facturer les opérations pour la facture spécifiée.Call the ById method to get an interface to invoice operations for the specified invoice.

  2. Appelez la méthode GetAsync pour récupérer l’objet de la facture .Call the Get or GetAsync method to retrieve the invoice object. L’objet Invoice contient toutes les informations relatives à la facture spécifiée.The invoice object contains all of the information for the specified invoice.

  3. Utilisez la propriété InvoiceDetails de l’objet de facture pour obtenir l’accès à une collection d’objets InvoiceDetail , chacun contenant un BillingProvider et un InvoiceLineItemType.Use the invoice object's InvoiceDetails property to get access to a collection of InvoiceDetail objects, each of which contains a BillingProvider and an InvoiceLineItemType. Le BillingProvider identifie la source des informations détaillées sur la facture (par exemple, Office, Azure, OneTime) et le InvoiceLineItemType spécifie le type (par exemple, BillingLineItem).The BillingProvider identifies the source of the invoice detail information (such as Office, Azure, OneTime), and the InvoiceLineItemType specifies the type (for example, BillingLineItem).

L’exemple de code suivant utilise une boucle foreach pour traiter la collection InvoiceDetails .The following example code uses a foreach loop to process the InvoiceDetails collection. Une collection distincte d’éléments de ligne est récupérée pour chaque instance de InvoiceDetail .A separate collection of line items is retrieved for each InvoiceDetail instance.

Pour obtenir une collection d’éléments de ligne qui correspondent à une instance InvoiceDetail :To get a collection of line items that correspond to an InvoiceDetail instance:

  1. Transmettez le BillingProvider et le InvoiceLineItemType de l’instance à la méthode par .Pass the instance's BillingProvider and InvoiceLineItemType to the By method.

  2. Appelez la méthode GetAsync pour récupérer les éléments de ligne associés.Call the Get or GetAsync method to retrieve the associated line items.

  3. Créez un énumérateur pour parcourir la collection comme indiqué dans l’exemple suivant.Create an enumerator to traverse the collection as shown in the following example.

// IAggregatePartner partnerOperations;
// int invoicePageSize;
// string invoiceId;

// Retrieve the invoice.
var invoiceOperations = partnerOperations.Invoices.ById(invoiceId);
var invoice = invoiceOperations.Get();

foreach (var invoiceDetail in invoice.InvoiceDetails)
{
    Console.WriteLine(string.Format("Getting invoice line item for product {0} and line item type {1}",
        invoiceDetail.BillingProvider,
        invoiceDetail.InvoiceLineItemType));

    // Is this an unpaged or paged request?
    bool isUnPaged = (this.invoicePageSize <= 0);

    // If the scenario is unpaged, get all the invoice line items, otherwise get the first page.
    var invoiceLineItemsCollection =
        (isUnPaged)
        ? invoiceOperations.By(invoiceDetail.BillingProvider, invoiceDetail.InvoiceLineItemType).Get()
        : invoiceOperations.By(invoiceDetail.BillingProvider, invoiceDetail.InvoiceLineItemType).Get(this.invoicePageSize, 0);

    // Create an enumerator for traversing the line items collection.
    var invoiceLineItemEnumerator =
        partnerOperations.Enumerators.InvoiceLineItems.Create(invoiceLineItemsCollection);

    while (invoiceLineItemEnumerator.HasValue)
    {
        // invoiceLineItemEnumerator.Current contains a collection
        // of line items.
        Console.WriteLine(String.Format("invoiceLineItemEnumerator.Current has {0} line items.",
            invoiceLineItemEnumerator.Current.TotalCount));
        //
        // Insert code here to work with the line items.
        //
        Console.WriteLine();
        Console.Write("Press any key to retrieve the next invoice line items page");
        Console.ReadKey();

        // Get the next list of invoice line items.
        invoiceLineItemEnumerator.Next();
    }
}

Pour obtenir un exemple similaire, consultez les rubriques suivantes :For a similar example, see the following:

  • Exemple : Application de test de consoleSample: Console test app
  • Projet : exemples du kit de développement logiciel (SDK) Partner CenterProject: Partner Center SDK Samples
  • Classe : GetInvoiceLineItems.csClass: GetInvoiceLineItems.cs

Demande RESTREST request

Syntaxe de la requêteRequest syntax

Effectuez votre demande à l’aide de la syntaxe appropriée pour le fournisseur de facturation dans votre scénario.Make your request using the appropriate syntax for the billing provider in your scenario.

OfficeOffice

La syntaxe suivante s’applique lorsque le fournisseur de facturation est Office.The following syntax applies when the billing provider is Office.

MéthodeMethod URI de requêteRequest URI
GETGET {baseURL}/v1/Invoices/{Invoice-ID}/LineItems ? Provider = Office&invoicelineitemtype = billinglineitems&Size = {size} &offset = {offset} http/1.1{baseURL}/v1/invoices/{invoice-id}/lineitems?provider=office&invoicelineitemtype=billinglineitems&size={size}&offset={offset} HTTP/1.1

Abonnement Microsoft Azure (MS-AZR-0145P)Microsoft Azure (MS-AZR-0145P) subscription

Les syntaxes suivantes s’appliquent lorsque le fournisseur de facturation a un abonnement Microsoft Azure (MS-AZR-0145P).The following syntaxes apply when the billing provider has a Microsoft Azure (MS-AZR-0145P) subscription.

MéthodeMethod URI de requêteRequest URI
GETGET {baseURL}/v1/Invoices/{Invoice-ID}/LineItems ? Provider = Azure&invoicelineitemtype = billinglineitems&taille = {size} &offset = {offset} http/1.1{baseURL}/v1/invoices/{invoice-id}/lineitems?provider=azure&invoicelineitemtype=billinglineitems&size={size}&offset={offset} HTTP/1.1
GETGET {baseURL}/v1/Invoices/{Invoice-ID}/LineItems ? Provider = Azure&invoicelineitemtype = usagelineitems&taille = {size} &offset = {offset} http/1.1{baseURL}/v1/invoices/{invoice-id}/lineitems?provider=azure&invoicelineitemtype=usagelineitems&size={size}&offset={offset} HTTP/1.1
OneTimeOneTime

Les syntaxes suivantes s’appliquent lorsque le fournisseur de facturation est OneTime.The following syntaxes apply when the billing provider is OneTime. Cela comprend les frais liés aux réservations Azure, aux logiciels, aux plans Azure et aux produits de la place de marché commercial.This includes charges for Azure reservations, software, Azure plans, and commercial marketplace products.

MéthodeMethod URI de requêteRequest URI
GETGET {baseURL}/v1/Invoices/{Invoice-ID}/LineItems ? Provider = OneTime&invoicelineitemtype = billinglineitems&Size = {Size} http/1.1{baseURL}/v1/invoices/{invoice-id}/lineitems?provider=onetime&invoicelineitemtype=billinglineitems&size={size} HTTP/1.1
GETGET {baseURL}/v1/Invoices/{Invoice-ID}/LineItems/OneTime/billinglineitems&Size = {Size} ? SeekOperation = Next{baseURL}/v1/invoices/{invoice-id}/lineitems/onetime/billinglineitems&size={size}?seekOperation=Next

Syntaxes précédentesPrevious syntaxes

Si vous utilisez les syntaxes suivantes, assurez-vous d’utiliser la syntaxe appropriée pour votre cas d’utilisation.If you are using the following syntaxes, be sure to use the appropriate syntax for your use case.

À l’exception des correctifs de bogues, cette API n’est plus mise à jour.Except for bug fixes, this API is no longer being updated. Vous devez mettre à jour vos applications pour appeler l’API OneTime au lieu de Marketplace.You should update your applications to call the onetime API instead of marketplace. L’API OneTime fournit des fonctionnalités supplémentaires qui continueront à être mises à jour.The onetime API provides additional functionality, and will continue to be updated.

Vous devez utiliser OneTime pour interroger tous les Articles de la consommation commerciale au lieu de la place de marché.You should use onetime to query all commercial consumption line items instead of marketplace. Vous pouvez ou suivre les liens de l’appel d’estimation des liens.Or, you can follow the links in the estimate links call.

MéthodeMethod URI de requêteRequest URI Description du cas d’usage de syntaxeDescription of syntax use case
GETGET {baseURL}/v1/Invoices/{Invoice-ID}/LineItems/{Billing-Provider}/{Invoice-line-item-type} http/1.1{baseURL}/v1/invoices/{invoice-id}/lineitems/{billing-provider}/{invoice-line-item-type} HTTP/1.1 Vous pouvez utiliser cette syntaxe pour retourner une liste complète de chaque élément de ligne pour la facture donnée.You can use this syntax to return a full list of every line item for the given invoice.
GETGET {baseURL}/v1/Invoices/{Invoice-ID}/LineItems/{Billing-Provider}/{Invoice-line-item-type} ? Size = {size} &offset = {offset} http/1.1{baseURL}/v1/invoices/{invoice-id}/lineitems/{billing-provider}/{invoice-line-item-type}?size={size}&offset={offset} HTTP/1.1 Pour les factures volumineuses, vous pouvez utiliser cette syntaxe avec une taille spécifiée et un décalage de base 0 pour retourner une liste paginée d’éléments de ligne.For large invoices, you can use this syntax with a specified size and 0-based offset to return a paged list of line items.
GETGET {baseURL}/v1/Invoices/{Invoice-ID}/LineItems/OneTime/{Invoice-line-item-type} ? SeekOperation = suivant{baseURL}/v1/invoices/{invoice-id}/lineitems/OneTime/{invoice-line-item-type}?seekOperation=Next Vous pouvez utiliser cette syntaxe pour une facture avec une valeur de fournisseur de facturation de OneTime et définir seekOperation sur Next pour obtenir la page suivante d’éléments de ligne de facture.You can use this syntax for an invoice with a billing-provider value of OneTime and set seekOperation to Next to get the next page of invoice line items.
Paramètres d’URIURI parameters

Utilisez l’URI et les paramètres de requête suivants lors de la création de la demande.Use the following URI and query parameters when creating the request.

NomName TypeType ObligatoireRequired DescriptionDescription
ID de la factureinvoice-id stringstring OuiYes Chaîne qui identifie la facture.A string that identifies the invoice.
billing-providerbilling-provider stringstring OuiYes Fournisseur de facturation : « Office », « Azure », « OneTime ».The billing provider: "Office", "Azure", "OneTime". Dans le hérité, nous avons des modèles de données distincts pour les transactions Office & Azure.In the legacy, we have separate data models for Office & Azure transactions. Toutefois, le moderne dispose d’un seul modèle de données pour toutes les transactions filtrées via la valeur « OneTime ».However, the modern has one single data model across all transactions filtered through the "OneTime" value.
invoice-line-item-typeinvoice-line-item-type stringstring OuiYes Type de détail de la facture : « BillingLineItems », « UsageLineItems ».The type of invoice detail: "BillingLineItems", "UsageLineItems".
sizesize nombrenumber NonNo Nombre maximal d’éléments à retourner.The maximum number of items to return. Taille maximale par défaut = 2000Default max size = 2000
offsetoffset nombrenumber NonNo Index de base zéro du premier élément de ligne à retourner.The zero-based index of the first line item to return.
seekOperationseekOperation stringstring NonNo Si le fournisseur de facturation est égal à OneTime, définissez seekOperation sur suivant pour afficher la page suivante d’éléments de ligne de facture.If billing-provider equals OneTime, set seekOperation equal to Next to get the next page of invoice line items.
hasPartnerEarnedCredithasPartnerEarnedCredit boolbool NonNo Valeur indiquant s’il faut retourner les lignes pour lesquelles un crédit gagné est appliqué.The value indicating if to return the line items with partner earned credit applied. Remarque : ce paramètre est appliqué uniquement lorsque le type de fournisseur de facturation est OneTime et InvoiceLineItemType est UsageLineItems.Note: this parameter will be only applied when billing provider type is OneTime and InvoiceLineItemType is UsageLineItems.

En-têtes de requêteRequest headers

Pour plus d’informations, consultez En-têtes REST de l’Espace Partenaires.For more information, see Partner Center REST headers.

Corps de demandeRequest body

Aucun.None.

Réponse RESTREST response

En cas de réussite, la réponse contient la collection des détails de l’élément de ligne.If successful, the response contains the collection of line item details.

Pour l’élément de ligne ChargeType, la valeur Purchase est mappée sur New. Le remboursement de valeur est mappé sur Annuler.For the line item ChargeType, the value Purchase is mapped to New. The value Refund is mapped to Cancel.

Codes d’erreur et de réussite de la réponseResponse success and error codes

Chaque réponse est accompagnée d’un code d’état HTTP qui indique la réussite ou l’échec ainsi que des informations de débogage supplémentaires.Each response comes with an HTTP status code that indicates success or failure and additional debugging information. Utilisez un outil de trace réseau pour lire ce code, le type d’erreur et des paramètres supplémentaires.Use a network trace tool to read this code, error type, and additional parameters. Pour obtenir la liste complète, consultez Codes d’erreur REST de l’Espace partenaires.For the full list, see Partner Center REST error codes.

Exemples de demande-réponse RESTREST request-response examples

Exemple de requête-réponse 1Request-response example 1

Dans cet exemple, les détails sont les suivants :In this example, the details are as follows:

  • BillingProvider: OfficeBillingProvider: Office
  • InvoiceLineItemType: BillingLineItemsInvoiceLineItemType: BillingLineItems

Exemple de requête 1Request example 1

GET https://api.partnercenter.microsoft.com/v1/invoices/1234000000/lineitems?provider=Office&nvoicelineitemtype=BillingLineItems&size=2&offset=0 HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: 1eb2ecb8-37af-45f4-a1a1-358de3ca2b9e
MS-CorrelationId: 5e612512-4345-4bb0-866e-47aeda03fe54
X-Locale: en-US
MS-PartnerCenter-Application: Partner Center .NET SDK Samples
Host: api.partnercenter.microsoft.com

Exemple de réponse 1Response example 1

HTTP/1.1 200 OK
Content-Length: 2484
Content-Type: application/json; charset=utf-8
MS-CorrelationId: 5e612512-4345-4bb0-866e-47aeda03fe54
MS-RequestId: 1eb2ecb8-37af-45f4-a1a1-358de3ca2b9e
MS-CV: bpqyomePDUqrSSYC.0
MS-ServerId: 202010406
Date: Thu, 07 Sep 2017 23:31:09 GMT

{
    "totalCount": 2,
    "items": [{
            "partnerId": "3b33e682-00c3-41ee-9dd2-a548adf56438",
            "customerId": "74221236-D09C-4870-AC1D-33E155E9AEBE",
            "customerName": "TSTAGIN1CUST190",
            "mpnId": 4391507,
            "tier2MpnId": -1,
            "orderId": "567735045559164136",
            "subscriptionId": "4KIKawEAAAAAAAEA",
            "syndicationPartnerSubscriptionNumber": "1F58ACD7-FE51-4705-9567-D009C9ADA150",
            "offerId": "AAA5B3F0-0EE2-431B-A42F-3F18F3C6D540",
            "durableOfferId": "2F707C7C-2433-49A5-A437-9CA7CF40D3EB",
            "offerName": "EXCHANGE ONLINE (PLAN 2)",
            "domainName": "TStagin1Cust190.onmicrosoft.com",
            "billingCycleType": "MONTHLY",
            "subscriptionName": "EXCHANGE ONLINE (PLAN 2)",
            "subscriptionDescription": "EXCHANGE ONLINE (PLAN 2)",
            "subscriptionStartDate": "2017-05-12T00:00:00",
            "subscriptionEndDate": "2018-06-10T00:00:00",
            "chargeStartDate": "2017-05-12T00:00:00",
            "chargeEndDate": "2017-06-09T00:00:00",
            "chargeType": "New",
            "unitPrice": 0.0,
            "quantity": 3,
            "amount": 0.0,
            "totalOtherDiscount": 0.0,
            "subtotal": 0.0,
            "tax": 0.0,
            "totalForCustomer": 0.0,
            "currency": "USD",
            "invoiceLineItemType": "billing_line_items",
            "billingProvider": "office",
            "attributes": {
                "objectType": "LicenseBasedLineItem"
            }
        }, {
            "partnerId": "3b33e682-00c3-41ee-9dd2-a548adf56438",
            "customerId": "74221236-D09C-4870-AC1D-33E155E9AEBE",
            "customerName": "TSTAGIN1CUST190",
            "mpnId": 4391507,
            "tier2MpnId": -1,
            "orderId": "567735045564795186",
            "subscriptionId": "Ik4YawEAAAAAAAEA",
            "syndicationPartnerSubscriptionNumber": "D8A8F773-9D3E-4244-8797-3182075F09FA",
            "offerId": "618B53FE-9B99-428B-9745-F706AEAF3979",
            "durableOfferId": "69C67983-CF78-4102-83F6-3E5FD246864F",
            "offerName": "SHAREPOINT ONLINE (PLAN 2)",
            "domainName": "TStagin1Cust190.onmicrosoft.com",
            "billingCycleType": "MONTHLY",
            "subscriptionName": "SHAREPOINT ONLINE (PLAN 2)",
            "subscriptionDescription": "SHAREPOINT ONLINE (PLAN 2)",
            "subscriptionStartDate": "2017-05-13T00:00:00",
            "subscriptionEndDate": "2018-06-10T00:00:00",
            "chargeStartDate": "2017-05-13T00:00:00",
            "chargeEndDate": "2017-06-09T00:00:00",
            "chargeType": "New",
            "unitPrice": 0.0,
            "quantity": 1,
            "amount": 0.0,
            "totalOtherDiscount": 0.0,
            "subtotal": 0.0,
            "tax": 0.0,
            "totalForCustomer": 0.0,
            "currency": "USD",
            "invoiceLineItemType": "billing_line_items",
            "billingProvider": "office",
            "attributes": {
                "objectType": "LicenseBasedLineItem"
            }
        }
    ],
    "links": {
        "self": {
            "uri": "/invoices/1234000000/lineitems?provider=Office&nvoicelineitemtype=BillingLineItems&size=2&offset=0",
            "method": "GET",
            "headers": []
        },
        "next": {
            "uri": "/invoices/1234000000/lineitems?provider=Office&nvoicelineitemtype=BillingLineItems&size=2&offset=",
            "method": "GET",
            "headers": []
        }
    },
    "attributes": {
        "objectType": "Collection"
    }
}

Exemple de requête-réponse 2Request-response example 2

Dans l’exemple suivant, les détails sont les suivants :In the following example, the details are as follows:

  • BillingProvider: AzureBillingProvider: Azure
  • InvoiceLineItemType: BillingLineItemsInvoiceLineItemType: BillingLineItems

Exemple de requête 2Request example 2

GET https://api.partnercenter.microsoft.com/v1/invoices/1234000000/lineitems?provider=Azure&invoicelineitemtype=BillingLineItems&size=2&offset=0 HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: 1eb2ecb8-37af-45f4-a1a1-358de3ca2b9e
MS-CorrelationId: 5e612512-4345-4bb0-866e-47aeda03fe54
X-Locale: en-US
MS-PartnerCenter-Application: Partner Center .NET SDK Samples
Host: api.partnercenter.microsoft.com

Exemple de réponse 2Response example 2

HTTP/1.1 200 OK
Content-Length: 2484
Content-Type: application/json; charset=utf-8
MS-CorrelationId: 5e612512-4345-4bb0-866e-47aeda03fe54
MS-RequestId: 1eb2ecb8-37af-45f4-a1a1-358de3ca2b9e
MS-CV: bpqyomePDUqrSSYC.0
MS-ServerId: 202010406
Date: Thu, 07 Sep 2017 23:31:09 GMT

{
    "totalCount": 2,
    "items": [
        {
            "detailLineItemId": 1,
            "sku": "7UD-00001",
            "includedQuantity": 0,
            "overageQuantity": 745,
            "listPrice": 0.085,
            "currency": "USD",
            "pretaxCharges": 63.33,
            "taxAmount": 6.34,
            "postTaxTotal": 69.67,
            "pretaxEffectiveRate": 0.08500671,
            "postTaxEffectiveRate": 0.09351677,
            "chargeType": "Assess usage fee for current cycle",
            "invoiceLineItemType": "billing_line_items",
            "partnerId": "1F5CCB06-8E36-4A74-A74C-FCAA9E000000",
            "partnerName": "TEST_TEST_Big foot consulting",
            "partnerBillableAccountId": "1010578050",
            "customerId": "65726577-c208-40fd-9735-8c85ac000000",
            "domainName": "600test.onmicrosoft.com",
            "customerCompanyName": "601 tests",
            "mpnId": 4390934,
            "tier2MpnId": -1,
            "invoiceNumber": "1234000000",
            "subscriptionId": "87f4b92f-a490-485e-ad34-5b70cb000000",
            "subscriptionName": "Microsoft Azure",
            "subscriptionDescription": "Microsoft Azure",
            "billingCycleType": "Monthly",
            "orderId": "568297985427000000",
            "serviceName": "Azure App Service",
            "serviceType": "Standard Plan",
            "resourceGuid": "505db374-df8a-44df-9d8c-13c14b61dee1",
            "resourceName": "S1",
            "region": "",
            "consumedQuantity": 745,
            "chargeStartDate": "2019-08-02T00:00:00",
            "chargeEndDate": "2019-09-01T00:00:00",
            "unit": "1 Hour",
            "billingProvider": "azure",
            "attributes": {
                "objectType": "UsageBasedLineItem"
            }
        },
        {
            "detailLineItemId": 1,
            "sku": "7UD-00001",
            "includedQuantity": 0,
            "overageQuantity": 0.000882,
            "listPrice": 0.0383,
            "currency": "USD",
            "pretaxCharges": 0,
            "taxAmount": 0,
            "postTaxTotal": 0,
            "pretaxEffectiveRate": 0,
            "postTaxEffectiveRate": 0,
            "chargeType": "Assess usage fee for current cycle",
            "invoiceLineItemType": "billing_line_items",
            "partnerId": "1F5CCB06-8E36-4A74-A74C-FCAA9E87E26A",
            "partnerName": "TEST_TEST_Big foot consulting",
            "partnerBillableAccountId": "1010578050",
            "customerId": "65726577-c208-40fd-9735-8c85ac9cac68",
            "domainName": "600test.onmicrosoft.com",
            "customerCompanyName": "601 tests",
            "mpnId": 4390934,
            "tier2MpnId": -1,
            "invoiceNumber": "1234000000",
            "subscriptionId": "87f4b92f-a490-485e-ad34-5b70cb000000",
            "subscriptionName": "Microsoft Azure",
            "subscriptionDescription": "Microsoft Azure",
            "billingCycleType": "Monthly",
            "orderId": "568297985427000000",
            "serviceName": "Storage",
            "serviceType": "Standard Page Blob",
            "resourceGuid": "d23a5753-ff85-4ddf-af28-8cc5cf2d3882",
            "resourceName": "LRS Data Stored",
            "region": "",
            "consumedQuantity": 0.000882,
            "chargeStartDate": "2019-08-02T00:00:00",
            "chargeEndDate": "2019-09-01T00:00:00",
            "unit": "1 GB/Month",
            "billingProvider": "azure",
            "attributes": {
                "objectType": "UsageBasedLineItem"
            }
        }
    ],
    "links": {
        "self": {
            "uri": "/invoices/1234000000/lineitems?provider=Azure&invoicelineitemtype=BillingLineItems&size=2&offset=0",
            "method": "GET",
            "headers": []
        },
        "next": {
            "uri": "/invoices/1234000000/lineitems?provider=Azure&invoicelineitemtype=BillingLineItems&size=2&offset=2",
            "method": "GET",
            "headers": []
        }
    },
    "attributes": {
        "objectType": "Collection"
    }
}

Exemple de requête-réponse 3Request-response example 3

Dans l’exemple suivant, les détails sont les suivants :In the following example, the details are as follows:

  • BillingProvider: AzureBillingProvider: Azure
  • InvoiceLineItemType: UsageLineItemsInvoiceLineItemType: UsageLineItems

Exemple de requête 3Request example 3

GET https://api.partnercenter.microsoft.com/v1/invoices/1234000000/lineitems?provider=Azure&invoicelineitemtype=UsageLineItems&size=2&offset=0 HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: 1eb2ecb8-37af-45f4-a1a1-358de3ca2b9e
MS-CorrelationId: 5e612512-4345-4bb0-866e-47aeda03fe54
X-Locale: en-US
MS-PartnerCenter-Application: Partner Center .NET SDK Samples
Host: api.partnercenter.microsoft.com

Exemple de réponse 3Response example 3

HTTP/1.1 200 OK
Content-Length: 2484
Content-Type: application/json; charset=utf-8
MS-CorrelationId: 5e612512-4345-4bb0-866e-47aeda03fe54
MS-RequestId: 1eb2ecb8-37af-45f4-a1a1-358de3ca2b9e
MS-CV: bpqyomePDUqrSSYC.0
MS-ServerId: 202010406
Date: Thu, 07 Sep 2017 23:31:09 GMT

{
    "totalCount": 2,
    "items": [
        {
            "customerBillableAccount": "1439508127",
            "usageDate": "2019-08-05T00:00:00",
            "invoiceLineItemType": "usage_line_items",
            "partnerId": "1F5CCB06-8E36-4A74-A74C-FCAA9E000000",
            "partnerName": "TEST_TEST_BIG FOOT CONSULTING",
            "partnerBillableAccountId": "1010578050",
            "customerId": "9E9B71BA-3442-458B-B519-E1CCF72FBB54",
            "domainName": "test600.onmicrosoft.com",
            "customerCompanyName": "600 TEST",
            "mpnId": 4390934,
            "tier2MpnId": -1,
            "invoiceNumber": "1234000000",
            "subscriptionId": "F9BA6DA0-6DAC-4F88-B623-313C9B9C117A",
            "subscriptionName": "MICROSOFT AZURE",
            "subscriptionDescription": "MICROSOFT AZURE",
            "billingCycleType": "MONTHLY",
            "orderId": "568297985577171353",
            "serviceName": "STORAGE",
            "serviceType": "STANDARD PAGE BLOB",
            "resourceGuid": "9CC63CF8-6593-410A-B0E7-26A4EF71E8B3",
            "resourceName": "DISK DELETE OPERATIONS",
            "region": "",
            "consumedQuantity": 2.9616,
            "chargeStartDate": "2019-08-05T00:00:00",
            "chargeEndDate": "2019-09-04T00:00:00",
            "unit": "10K",
            "billingProvider": "azure",
            "attributes": {
                "objectType": "DailyUsageLineItem"
            }
        },
        {
            "customerBillableAccount": "1307536861",
            "usageDate": "2019-08-10T00:00:00",
            "invoiceLineItemType": "usage_line_items",
            "partnerId": "1F5CCB06-8E36-4A74-A74C-FCAA9E000000",
            "partnerName": "TEST_TEST_BIG FOOT CONSULTING",
            "partnerBillableAccountId": "1010578050",
            "customerId": "EB53B7BD-267E-440E-B3C0-8F0B40000000",
            "domainName": "brandontest.onmicrosoft.com",
            "customerCompanyName": "BRANDON'S TEST",
            "mpnId": 4390934,
            "tier2MpnId": -1,
            "invoiceNumber": "1234000000",
            "subscriptionId": "62D22561-AB15-41E5-AD59-99025C000000",
            "subscriptionName": "MICROSOFT AZURE",
            "subscriptionDescription": "MICROSOFT AZURE",
            "billingCycleType": "MONTHLY",
            "orderId": "568297985605838583",
            "serviceName": "VIRTUAL MACHINES",
            "serviceType": "D/DS SERIES WINDOWS",
            "resourceGuid": "62C64B6C-4033-4E20-AB33-9E81271AC12A",
            "resourceName": "D1/DS1",
            "region": "US WEST",
            "consumedQuantity": 24,
            "chargeStartDate": "2019-08-05T00:00:00",
            "chargeEndDate": "2019-09-04T00:00:00",
            "unit": "1 HOUR",
            "billingProvider": "azure",
            "attributes": {
                "objectType": "DailyUsageLineItem"
            }
        }
    ],
    "links": {
        "self": {
            "uri": "/invoices/1234000000/lineitems?provider=Azure&invoicelineitemtype=UsageLineItems&size=2&offset=0",
            "method": "GET",
            "headers": []
        },
        "next": {
            "uri": "/invoices/1234000000/lineitems?provider=Azure&invoicelineitemtype=UsageLineItems&size=2&offset=2",
            "method": "GET",
            "headers": []
        }
    },
    "attributes": {
        "objectType": "Collection"
    }
}

Exemple de requête-réponse 4Request-response example 4

Dans l’exemple suivant, les détails sont les suivants :In the following example, the details are as follows:

  • BillingProvider: OneTimeBillingProvider: OneTime
  • InvoiceLineItemType: BillingLineItemsInvoiceLineItemType: BillingLineItems

Exemple de requête 4Request example 4

GET https://api.partnercenter.microsoft.com/v1/invoices/G000024135/lineitems/OneTime/BillingLineItems?size=2&offset=0 HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: 1eb2ecb8-37af-45f4-a1a1-358de3ca2b9e
MS-CorrelationId: 5e612512-4345-4bb0-866e-47aeda03fe54
X-Locale: en-US
MS-PartnerCenter-Application: Partner Center .NET SDK Samples
Host: api.partnercenter.microsoft.com

Exemple de réponse 4Response example 4

HTTP/1.1 200 OK
Content-Length: 2484
Content-Type: application/json; charset=utf-8
MS-CorrelationId: 5e612512-4345-4bb0-866e-47aeda03fe54
MS-RequestId: 1eb2ecb8-37af-45f4-a1a1-358de3ca2b9e
MS-CV: bpqyomePDUqrSSYC.0
MS-ServerId: 202010406
Date: Thu, 07 Sep 2017 23:31:09 GMT

 {
    "continuationToken": "d19617b8-fbe5-4684-a5d8-0230972fb0cf,0705c4a9-39f7-4261-ba6d-53e24a9ce47d_a4ayc/80/OGda4BO/1o/V0etpOqiLx1JwB5S3beHW0s=,0d81c700-98b4-4b13-9129-ffd5620f72e7",
    "totalCount": 2,
    "items": [
        {
            "partnerId": "6480d686-cfb4-424d-a945-6b9b9f000000",
            "customerId": "org:9060d13d-c5ed-482e-b059-a15a38000000",
            "customerName": "recipientCustomerName",
            "customerDomainName": "recipientCustomerDomain",
            "invoiceNumber": "1234000000",
            "quoteId": "abcd12345678",
            "mpnId": "4870137",
            "resellerMpnId": 0,
            "orderId": "QDOx5ZN3YR9uYhm4M1MGQJ_0nievUOrx1",
            "orderDate": "2018-02-08T22:31:42.9397946Z",
            "productId": "productid",
            "skuId": "skuid",
            "availabilityId": "availabilityid",
            "productName": "TEST PRODUCT",
            "skuName": "TEST SKU TITLE",
            "chargeType": "New",
            "unitPrice": 431.8,
            "effectiveUnitPrice": 496.07,
            "unitType": "Seats",
            "quantity": 1,
            "subtotal": 431.8,
            "taxTotal": 38.87,
            "totalForCustomer": 470.67,
            "currency": "USD",
            "providerName": "Test Networks Inc",
            "providerId": "12343810",
            "subscriptionDescription": "",
            "subscriptionId": "281e26fe-9ce7-415b-911c-f39232000000",
            "subscriptionStartDate": "2019-01-03T19:53:55.1292512+00:00",
            "subscriptionEndDate": "2019-02-02T19:53:55.1292512+00:00",
            "termAndBillingCycle": "1 Month Subscription",
            "alternateId": "1234278124b8",
            "priceAdjustmentDescription": "[\"100.0% Tier 1 Discount\"]",
            "pricingCurrency": "USD",
            "pcToBCExchangeRate": 1,
            "pcToBCExchangeRateDate": "2019-09-30T23:59:59Z",
            "billableQuantity": 0.0159369774,
            "meterDescription": "Bandwidth - Data Transfer In (GB) - Zone 2",
            "billingFrequency": "Monthly",
            "reservationOrderId": "883d475b-0000-2222-0000-8818752f1234",
            "invoiceLineItemType": "billing_line_items",
            "billingProvider": "one_time",
            "attributes": {
                "objectType": "OneTimeInvoiceLineItem"
            }
        },
        {
            "partnerId": "6480d686-cfb4-424d-a945-6b9b9f4badc2",
            "customerId": "org:9060d13d-c5ed-482e-b059-a15a38cbb28e",
            "customerName": "recipientCustomerName",
            "customerDomainName": "recipientCustomerDomain",
            "invoiceNumber": "1234000000",
            "quoteId": "abcd12345678",
            "mpnId": "4870137",
            "resellerMpnId": 0,
            "orderId": "QDOx5ZN3YR9uYhm4M1MGQJ_0nievUOrx1",
            "orderDate": "2018-02-08T22:31:42.9397946Z",
            "productId": "productid",
            "skuId": "skuid",
            "availabilityId": "availabilityid",
            "productName": "TEST PRODUCT",
            "skuName": "TEST SKU TITLE",
            "chargeType": "New",
            "unitPrice": 26.35,
            "effectiveUnitPrice": 496.07,
            "unitType": "1 Hour",
            "quantity": 1,
            "subtotal": 26.35,
            "taxTotal": 2.37,
            "totalForCustomer": 28.72,
            "currency": "USD",
            "providerName": "Test Networks Inc",
            "providerId": "12343810",
            "subscriptionDescription": "",
            "subscriptionId": "281e26fe-9ce7-415b-911c-f39232ea904a",
            "subscriptionStartDate": "2019-01-03T19:53:55.1292512+00:00",
            "subscriptionEndDate": "2019-02-02T19:53:55.1292512+00:00",
            "termAndBillingCycle": "1 Month Subscription",
            "alternateId": "1234578124b8",
            "priceAdjustmentDescription": "[\"100.0% Tier 1 Discount\"]",
            "pricingCurrency": "USD",
            "pcToBCExchangeRate": 1,
            "pcToBCExchangeRateDate": "2019-09-30T23:59:59Z",
            "billableQuantity": 0.0130687981,
            "meterDescription": "Bandwidth - Data Transfer In (GB) - Zone 2",
            "reservationOrderId": "",
            "invoiceLineItemType": "billing_line_items",
            "billingProvider": "one_time",
            "attributes": {
                "objectType": "OneTimeInvoiceLineItem"
            }
        }
    ],
    "links": {
        "self": {
            "uri": "/invoices/G000024135/lineitems?provider=OneTime&nvoicelineitemtype=BillingLineItems&size=2",
            "method": "GET",
            "headers": []
        },
        "next": {
            "uri": "/invoices/G000024135/lineitems?provider=OneTime&nvoicelineitemtype=BillingLineItems&size=2?seekOperation=Next",
            "method": "GET",
            "headers": [
                {
                    "key": "MS-ContinuationToken",
                    "value": "d19617b8-fbe5-4684-a5d8-0230972fb0cf,0705c4a9-39f7-4261-ba6d-53e24a9ce47d_a4ayc/80/OGda4BO/1o/V0etpOqiLx1JwB5S3beHW0s=,0d81c700-98b4-4b13-9129-ffd5620f72e7"
                }
            ]
        }
    },
    "attributes": {
        "objectType": "Collection"
    }
}

Exemple de requête-réponse 5Request-response example 5

Dans l’exemple suivant, il existe une pagination à l’aide d’un jeton de continuation.In the following example, there is paging using a continuation token. Les détails sont les suivants :The details are as follows:

  • BillingProvider: OneTimeBillingProvider: OneTime
  • InvoiceLineItemType: BillingLineItemsInvoiceLineItemType: BillingLineItems
  • SeekOperation: suivantSeekOperation: Next

Exemple de requête 5Request example 5

GET https://api.partnercenter.microsoft.com/v1/invoices/G000024135/lineitems/OneTime/BillingLineItems?seekOperation=Next HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-ContinuationToken: d19617b8-fbe5-4684-a5d8-0230972fb0cf,0705c4a9-39f7-4261-ba6d-53e24a9ce47d_a4ayc/80/OGda4BO/1o/V0etpOqiLx1JwB5S3beHW0s=,0d81c700-98b4-4b13-9129-ffd5620f72e7
MS-RequestId: 1eb2ecb8-37af-45f4-a1a1-358de3ca2b9e
MS-CorrelationId: 5e612512-4345-4bb0-866e-47aeda03fe54
X-Locale: en-US
MS-PartnerCenter-Application: Partner Center .NET SDK Samples
Host: api.partnercenter.microsoft.com

Exemple de réponse 5Response example 5

HTTP/1.1 200 OK
Content-Length: 2484
Content-Type: application/json; charset=utf-8
MS-CorrelationId: 5e612512-4345-4bb0-866e-47aeda03fe54
MS-RequestId: 1eb2ecb8-37af-45f4-a1a1-358de3ca2b9e
MS-CV: bpqyomePDUqrSSYC.0
MS-ServerId: 202010406
Date: Thu, 07 Sep 2017 23:31:09 GMT

{
    "totalCount": 1,
    "items": [
        {
            "partnerId": "6480d686-cfb4-424d-a945-6b9b9f000000",
            "customerId": "org:9060d13d-c5ed-482e-b059-a15a38000000",
            "customerName": "recipientCustomerName",
            "customerDomainName": "recipientCustomerDomain",
            "invoiceNumber": "1234000000",
            "quoteId": "abcd12345678",
            "mpnId": "4870137",
            "resellerMpnId": 0,
            "orderId": "NeqT31Kziwf8gkCXM9YQToWTqU-9Jbm81",
            "orderDate": "2018-02-08T22:31:47.1751688Z",
            "productId": "DZH318Z0BQ3P",
            "skuId": "001F",
            "availabilityId": "DZH318Z0DR0H",
            "productName": "Reserved VM Instance, Standard_D1, AP East, 3 years",
            "skuName": "D Series",
            "chargeType": "New",
            "unitPrice": 1447,
            "effectiveUnitPrice": 496.07,
            "unitType": "Seats",
            "quantity": 1,
            "subtotal": 1447,
            "taxTotal": 130.24,
            "totalForCustomer": 1577.24,
            "currency": "USD",
            "providerName": "Test Networks Inc",
            "providerId": "12343810",
            "subscriptionDescription": "",
            "subscriptionId": "281e26fe-9ce7-415b-911c-f39232000000",
            "subscriptionStartDate": "2019-01-03T19:53:55.1292512+00:00",
            "subscriptionEndDate": "2019-02-02T19:53:55.1292512+00:00",
            "termAndBillingCycle": "1 Month Subscription",
            "alternateId": "1234568124b8",
            "priceAdjustmentDescription": "",
            "pricingCurrency": "USD",
            "pcToBCExchangeRate": 1,
            "pcToBCExchangeRateDate": "2019-09-30T23:59:59Z",
            "billableQuantity": 0.0130687981,
            "meterDescription": "Bandwidth - Data Transfer In (GB) - Zone 2",
            "reservationOrderId": "",
            "billingFrequency": "Monthly",
            "invoiceLineItemType": "billing_line_items",
            "billingProvider": "one_time",
            "attributes": {
                "objectType": "OneTimeInvoiceLineItem"
            }
        }
    ],
    "links": {
        "self": {
            "uri": "/invoices/G000024135/lineitems?provider=OneTime&nvoicelineitemtype=BillingLineItems&size=2",
            "method": "GET",
            "headers": []
        }
    },
    "attributes": {
        "objectType": "Collection"
    }
}