{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-cost-management/json-schema/microsoft-azure-cost-management-generate-cost-details-report-request-definition-schema.json",
  "title": "GenerateCostDetailsReportRequestDefinition",
  "description": "The definition of a cost detailed report.",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_superseded/microsoft-azure-cost-management-providers-api-openapi.yml#/components/schemas/GenerateCostDetailsReportRequestDefinition",
  "type": "object",
  "properties": {
    "metric": {
      "$ref": "#/$defs/CostDetailsMetricType",
      "description": "The type of the detailed report. By default ActualCost is provided"
    },
    "timePeriod": {
      "$ref": "#/$defs/CostDetailsTimePeriod",
      "description": "The specific date range of cost details requested for the report. This parameter cannot be used alongside either the invoiceId or billingPeriod parameters. If a timePeriod, invoiceId or billingPeriod parameter is not provided in the request body the API will return the current month's cost. API only allows data to be pulled for 1 month or less and no older than 13 months. If no timePeriod or billingPeriod or invoiceId is provided the API defaults to the open month time period"
    },
    "billingPeriod": {
      "type": "string",
      "description": "This parameter can be used only by Enterprise Agreement customers. Use the YearMonth(e.g. 202008) format. This parameter cannot be used alongside either the invoiceId or timePeriod parameters. If a timePeriod, invoiceId or billingPeriod parameter is not provided in the request body the API will return the current month's cost."
    },
    "invoiceId": {
      "type": "string",
      "description": "This parameter can only be used by Microsoft Customer Agreement customers. Additionally, it can only be used at the Billing Profile or Customer scope. This parameter cannot be used alongside either the billingPeriod or timePeriod parameters. If a timePeriod, invoiceId or billingPeriod parameter is not provided in the request body the API will return the current month's cost."
    }
  },
  "$defs": {
    "CostDetailsMetricType": {
      "type": "string",
      "description": "The type of the detailed report. By default ActualCost is provided",
      "enum": [
        "ActualCost",
        "AmortizedCost"
      ],
      "x-ms-enum": {
        "name": "CostDetailsMetricType",
        "modelAsString": true,
        "values": [
          {
            "name": "ActualCostCostDetailsMetricType",
            "value": "ActualCost",
            "description": "Actual cost data."
          },
          {
            "name": "AmortizedCostCostDetailsMetricType",
            "value": "AmortizedCost",
            "description": "Amortized cost data."
          }
        ]
      }
    },
    "CostDetailsTimePeriod": {
      "type": "object",
      "description": "The start and end date for pulling data for the cost detailed report. API only allows data to be pulled for 1 month or less and no older than 13 months.",
      "properties": {
        "start": {
          "type": "string",
          "description": "The start date to pull data from. example format 2020-03-15"
        },
        "end": {
          "type": "string",
          "description": "The end date to pull data to. example format 2020-03-15"
        }
      },
      "required": [
        "start",
        "end"
      ]
    }
  }
}