Download a Usage Report

You can use the billing API to download raw usage report data in a CSV file.

Prerequisites

  • You have the Provider Administrator, the Provider Billing User, the Customer Administrator, or the Customer Billing User role in your VMware Cloud Partner Navigator organization.
  • You have at least one cloud service is active in your organization.
  • Obtain an access token from your organization and set it as the csp-auth-token request header. See Using VMware Cloud Partner Navigator APIs.

Procedure

  1. Enter the ID of the organization from which you want to download the usage report file and run a GET request.
    GET https://console.navigator.vmware.com/cphub/api/billing/v1/orgs/org_ID/usage-report/file
    As a cloud provider, you can specify a customer organization using the tenantId input parameter. If you leave tenantId unspecified, usage reports for all customers in the provider organization are downloaded.
  2. (Optional) To filter the time period for which to obtain the raw usage data, enter the startTime and endTime input parameters in UNIX epoch time and run a GET request.
    GET https://console.navigator.vmware.com/cphub/api/billing/v1/orgs/org_ID/usage-report/file?startTime=epoch_timestamp&endTime=epoch_timestamp
    Note: Values given for startTime and endTime are rounded off to the first and last days of the nearest month.

Results

You get the raw usage billing report as a downloadable CSV file. You can view the filename in the Content-Disposition response header.
Content-Disposition →attachment; filename="....csv"

Example: Usage Report File Download

This example downloads a CSV file with the on-demand service usage for a given time period and customer.

Download the CSV file.
GET https://console.navigator.vmware.com/cphub/api/billing/v1/orgs/00dcd47b-867d-46a1-b5ac-c9c22a4427cb/usage-report/file?tenantId=73338bcc-17e0-4480-9d25-f654532a1ee0&startTime=1537029569000&endTime=1540053569000
You receive a response listing the headers used in the CSV file to arrange the generated raw usage data.
Status 200 OK
"Org Id","Org Name","Org Status","Tag","Service Id","Service Name","Subscription Id","Sku Name","Sku Description","Datacenter","Billable Usage Timestamp","Price ()","Usage Qty","Commit Qty","Billable Qty","Product Family","Customer Segment","Cross Reference Sku"