{
  "openapi": "3.0.3",
  "info": {
    "title": "SLTax Filing Calendar API",
    "version": "1.2.0",
    "description": "Surplus-lines filing due dates, stamping-office contacts, filing channel (SLIP / OPTins / paper / state portal), and late-fee statute summaries for 50 states + DC + PR + USVI. Effective-dated. Estimates only \u2014 confirm with the DOI or stamping office before filing.\n\nRequires Authentik entitlement `entitlement-sltax-calendar` and an active API key (`X-API-Key`).",
    "contact": {
      "name": "Ilion IT",
      "url": "https://sltax.ilionit.com/docs"
    }
  },
  "servers": [
    {
      "url": "https://sltax.ilionit.com/api/v1",
      "description": "Production"
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      }
    },
    "schemas": {
      "FilingChannel": {
        "type": "string",
        "enum": [
          "slip",
          "optins",
          "state_portal",
          "paper",
          "email",
          "hybrid"
        ]
      },
      "DueRule": {
        "type": "object",
        "required": [
          "basis",
          "days"
        ],
        "properties": {
          "basis": {
            "type": "string",
            "enum": [
              "days_after_effective",
              "days_after_bind",
              "days_after_inception",
              "end_of_month_plus_days",
              "fixed_calendar_day",
              "other"
            ]
          },
          "days": {
            "type": "integer",
            "example": 60
          },
          "calendar": {
            "type": "string",
            "enum": [
              "calendar",
              "business"
            ],
            "default": "calendar"
          },
          "notes": {
            "type": "string"
          }
        }
      },
      "StampingOffice": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Surplus Line Association of Texas"
          },
          "abbreviation": {
            "type": "string",
            "example": "SLAT"
          },
          "phone": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "mailing_address": {
            "type": "string"
          },
          "filing_portal_url": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "LateFeeRule": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string"
          },
          "amount_flat": {
            "type": "number",
            "nullable": true
          },
          "amount_percent": {
            "type": "number",
            "nullable": true,
            "description": "Decimal fraction, e.g. 0.05 = 5%"
          },
          "source_cite": {
            "type": "string"
          },
          "source_url": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "CalendarRecord": {
        "type": "object",
        "required": [
          "state",
          "effective_from",
          "channel",
          "due"
        ],
        "properties": {
          "state": {
            "type": "string",
            "example": "TX"
          },
          "effective_from": {
            "type": "string",
            "format": "date"
          },
          "effective_to": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "channel": {
            "$ref": "#/components/schemas/FilingChannel"
          },
          "channel_notes": {
            "type": "string"
          },
          "due": {
            "$ref": "#/components/schemas/DueRule"
          },
          "tax_payment_due": {
            "$ref": "#/components/schemas/DueRule"
          },
          "office": {
            "$ref": "#/components/schemas/StampingOffice"
          },
          "late_fee": {
            "$ref": "#/components/schemas/LateFeeRule"
          },
          "line_of_business_notes": {
            "type": "string"
          },
          "source_cite": {
            "type": "string"
          },
          "source_url": {
            "type": "string",
            "format": "uri"
          },
          "confidence": {
            "type": "string",
            "enum": [
              "verified",
              "estimated",
              "unverified"
            ]
          }
        }
      },
      "DueComputation": {
        "type": "object",
        "required": [
          "state",
          "policy_effective",
          "filing_due_date",
          "channel"
        ],
        "properties": {
          "state": {
            "type": "string"
          },
          "policy_effective": {
            "type": "string",
            "format": "date"
          },
          "policy_bind": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "filing_due_date": {
            "type": "string",
            "format": "date"
          },
          "tax_payment_due_date": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "channel": {
            "$ref": "#/components/schemas/FilingChannel"
          },
          "office": {
            "$ref": "#/components/schemas/StampingOffice"
          },
          "late_fee": {
            "$ref": "#/components/schemas/LateFeeRule"
          },
          "rule": {
            "$ref": "#/components/schemas/CalendarRecord"
          },
          "disclaimer": {
            "type": "string"
          }
        }
      },
      "LookupRequest": {
        "type": "object",
        "required": [
          "state",
          "policy_effective"
        ],
        "properties": {
          "state": {
            "type": "string",
            "example": "CA"
          },
          "policy_effective": {
            "type": "string",
            "format": "date"
          },
          "policy_bind": {
            "type": "string",
            "format": "date"
          },
          "line_of_business": {
            "type": "string"
          }
        }
      }
    }
  },
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "paths": {
    "/calendar/jurisdictions": {
      "get": {
        "summary": "List jurisdictions with calendar coverage",
        "description": "Thin list. Requires calendar entitlement; does not consume quota.",
        "responses": {
          "200": {
            "description": "Jurisdiction codes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "jurisdictions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "channel": {
                            "$ref": "#/components/schemas/FilingChannel"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "403": {
            "description": "Key lacks entitlement-sltax-calendar"
          }
        }
      }
    },
    "/calendar/office": {
      "get": {
        "summary": "Stamping office / SLA contact for a state",
        "description": "Counts 1 against calendar monthly quota.",
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "date",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Office record",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "state": {
                      "type": "string"
                    },
                    "as_of": {
                      "type": "string",
                      "format": "date"
                    },
                    "office": {
                      "$ref": "#/components/schemas/StampingOffice"
                    },
                    "channel": {
                      "$ref": "#/components/schemas/FilingChannel"
                    },
                    "source_cite": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error"
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "402": {
            "description": "Calendar quota exceeded"
          },
          "403": {
            "description": "Key lacks entitlement-sltax-calendar"
          },
          "404": {
            "description": "No office record"
          }
        }
      }
    },
    "/calendar/due": {
      "get": {
        "summary": "Compute filing due date for a policy",
        "description": "Counts 1 against calendar monthly quota.",
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "policy_effective",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "policy_bind",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "line_of_business",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Due computation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DueComputation"
                }
              }
            }
          },
          "400": {
            "description": "Validation error"
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "402": {
            "description": "Calendar quota exceeded"
          },
          "403": {
            "description": "Key lacks entitlement-sltax-calendar"
          },
          "404": {
            "description": "No calendar rule"
          }
        }
      }
    },
    "/calendar/lookup": {
      "post": {
        "summary": "Full calendar lookup (due + office + late fee + channel)",
        "description": "Counts 1 against calendar monthly quota. Preferred for AMS integrations.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LookupRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Full lookup",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DueComputation"
                }
              }
            }
          },
          "400": {
            "description": "Validation error"
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "402": {
            "description": "Calendar quota exceeded"
          },
          "403": {
            "description": "Key lacks entitlement-sltax-calendar"
          },
          "404": {
            "description": "No calendar rule"
          }
        }
      }
    },
    "/calendar/rules": {
      "get": {
        "summary": "Raw effective-dated calendar rules for a state",
        "description": "Counts 1 against calendar monthly quota.",
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "date",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Rule set",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "state": {
                      "type": "string"
                    },
                    "as_of": {
                      "type": "string",
                      "format": "date"
                    },
                    "rules": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CalendarRecord"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "402": {
            "description": "Calendar quota exceeded"
          },
          "403": {
            "description": "Key lacks entitlement-sltax-calendar"
          }
        }
      }
    },
    "/calendar/coverage": {
      "get": {
        "summary": "Calendar data coverage (confidence + computable dues)",
        "tags": [
          "Calendar"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Coverage summary"
          }
        }
      }
    }
  }
}
