{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/grepr/json-schema/grepr-billing-periods-response-schema.json",
  "title": "BillingPeriodsResponse",
  "description": "Static customer header data for the billing page: display name + selectable reporting periods.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/grepr-billing-api-openapi.yml#/components/schemas/BillingPeriodsResponse",
  "properties": {
    "customerName": {
      "description": "Customer display name (e.g. \"ACME, Inc.\").",
      "type": "string"
    },
    "periods": {
      "default": [],
      "description": "Reporting periods available for this customer, newest first.",
      "items": {
        "$ref": "#/$defs/PeriodEntry"
      },
      "type": "array"
    }
  },
  "required": [
    "customerName",
    "periods"
  ],
  "type": "object",
  "$defs": {
    "PeriodEntry": {
      "description": "One reporting period — dropdown entry plus bounds for display.",
      "properties": {
        "current": {
          "description": "True if this entry's period contains today.",
          "type": "boolean"
        },
        "endDate": {
          "description": "Inclusive period end date — the last day in the period.",
          "format": "date",
          "type": "string"
        },
        "id": {
          "description": "Canonical period identifier used in the URL — \"YYYY-MM-DD\" (the period's start date) for both monthly and annual plans.",
          "type": "string"
        },
        "startDate": {
          "description": "Inclusive period start date.",
          "format": "date",
          "type": "string"
        }
      },
      "required": [
        "endDate",
        "id",
        "startDate"
      ],
      "type": "object"
    }
  }
}