{
  "_endpoint": "/api/dr/billingHistory/all?userId={userId}",
  "_auth_required": false,
  "_collection": "DomainInvoices — Billing & Invoice History",
  "_critical": "No auth — passing any userId returns billing records for that user",
  "fields": {
    "billingId": {
      "type": "int64",
      "description": "Primary key"
    },
    "domainId": {
      "type": "int64",
      "description": "Foreign key to domain"
    },
    "amount": {
      "type": "decimal",
      "description": "Total billed amount"
    },
    "invoiceNumber": {
      "type": "string",
      "description": "Invoice reference number"
    },
    "paymentStatus": {
      "type": "string",
      "nullable": true,
      "description": "Payment status — Pending / Paid / Failed / Refunded"
    },
    "paymentMode": {
      "type": "string",
      "nullable": true,
      "description": "Payment method — SBI ePay / NEFT / RTGS / DD"
    },
    "invoiceType": {
      "type": "string",
      "description": "Type of invoice — Domain Registration / Renewal / NS Purchase / NI Purchase"
    },
    "billingPeriod": {
      "type": "ISO8601 datetime",
      "description": "Billing period reference"
    },
    "generatedDate": {
      "type": "ISO8601 datetime",
      "description": "When the invoice was generated"
    },
    "paidDate": {
      "type": "ISO8601 datetime",
      "nullable": true,
      "description": "When payment was completed"
    },
    "userId": {
      "type": "string",
      "description": "Email/userId of billing user"
    },
    "organisationId": {
      "type": "int64",
      "description": "Organisation this billing belongs to"
    },
    "description": {
      "type": "string",
      "nullable": true,
      "description": "Invoice line-item description"
    }
  }
}
