How to get invoice details for New CSP azure plan using REST API or .Net SDK

Dnyaneshwar Surywanshi 156 Reputation points
2021-10-26T09:39:50.46+00:00

In my project i want to show cost management dashboard currently in my tenant there are multiple subscriptions like legacy CSP and new modern CSP (Azure plan) so now i want get invoice details for modern CSP (Azure plan) . So how i can archive this using any REST API or .Net SDK.

Azure Cost Management
Azure Cost Management
A Microsoft offering that enables tracking of cloud usage and expenditures for Azure and other cloud providers.
2,042 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. SadiqhAhmed-MSFT 37,846 Reputation points Microsoft Employee
    2021-10-28T19:17:32.893+00:00

    @Dnyaneshwar Surywanshi Thank you for your post and I apologize for the delayed response!

    You can use the invoices API or SDK to get invoices for modern CSP.

    https://learn.microsoft.com/en-us/rest/api/billing/2020-05-01/invoices/list-by-billing-account

    https://learn.microsoft.com/en-us/dotnet/api/microsoft.azure.management.billing.invoicesoperationsextensions?view=azure-dotnet

    If you want to get the line-items for an invoice, you can use Transactions API/SDK

    https://learn.microsoft.com/en-us/rest/api/billing/2020-05-01/transactions/list-by-invoice

    https://learn.microsoft.com/en-us/dotnet/api/microsoft.azure.management.billing.transactionsoperationsextensions?view=azure-dotnet

    ----------------------------------------------------------------------------------------------------------------------

    If the response helped, do "Accept Answer" and up-vote it

    0 comments No comments