{
  "openapi": "3.0.3",
  "info": {
    "title": "SLTax API",
    "version": "1.3.0",
    "description": "Surplus lines tax calculate + Forms + Filing Calendar for 50 states + DC + PR + USVI. Entitlements: entitlement-sltax-api, entitlement-sltax-forms, entitlement-sltax-calendar. Forms/calendar include SAMPLE rows \u2014 confirm with DOI/stamping office before filing."
  },
  "servers": [
    {
      "url": "/api/v1"
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "FormType": {
        "type": "string",
        "enum": [
          "stamp_wording",
          "diligent_search",
          "declination",
          "disclosure",
          "affidavit",
          "sla_report"
        ]
      },
      "FormCatalogItem": {
        "type": "object",
        "required": [
          "state",
          "form_type",
          "form_id",
          "title",
          "effective_from"
        ],
        "properties": {
          "state": {
            "type": "string",
            "example": "TX"
          },
          "form_type": {
            "$ref": "#/components/schemas/FormType"
          },
          "form_id": {
            "type": "string",
            "example": "tx-stamp-wording-2011"
          },
          "title": {
            "type": "string"
          },
          "effective_from": {
            "type": "string",
            "format": "date"
          },
          "effective_to": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "source_cite": {
            "type": "string"
          },
          "source_url": {
            "type": "string",
            "format": "uri"
          },
          "fillable_fields": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "insured_name",
              "premium",
              "effective_date",
              "carrier_name"
            ]
          },
          "output_formats": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "text",
                "html",
                "pdf_url"
              ]
            }
          }
        }
      },
      "StampWordingRequest": {
        "type": "object",
        "required": [
          "state"
        ],
        "properties": {
          "state": {
            "type": "string",
            "example": "TX"
          },
          "effective_date": {
            "type": "string",
            "format": "date"
          },
          "line_of_business": {
            "type": "string",
            "example": "general_liability"
          },
          "premium": {
            "type": "number"
          },
          "carrier_name": {
            "type": "string"
          },
          "insured_name": {
            "type": "string"
          }
        }
      },
      "StampWordingResponse": {
        "type": "object",
        "required": [
          "state",
          "form_id",
          "wording",
          "effective_from"
        ],
        "properties": {
          "state": {
            "type": "string"
          },
          "form_id": {
            "type": "string"
          },
          "wording": {
            "type": "string",
            "description": "Ready-to-paste stamp / legend text"
          },
          "html": {
            "type": "string"
          },
          "effective_from": {
            "type": "string",
            "format": "date"
          },
          "source_cite": {
            "type": "string"
          },
          "disclaimer": {
            "type": "string"
          }
        }
      },
      "FormRenderRequest": {
        "type": "object",
        "required": [
          "state",
          "form_type"
        ],
        "properties": {
          "state": {
            "type": "string",
            "example": "FL"
          },
          "form_type": {
            "$ref": "#/components/schemas/FormType"
          },
          "form_id": {
            "type": "string",
            "description": "Optional pin to a specific catalog version; omit to resolve by effective_date"
          },
          "effective_date": {
            "type": "string",
            "format": "date"
          },
          "output": {
            "type": "string",
            "enum": [
              "text",
              "html",
              "pdf"
            ],
            "default": "text"
          },
          "fields": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "example": {
              "insured_name": "Acme LLC",
              "premium": "10000",
              "carrier_name": "Example Surplus Ins. Co.",
              "declining_carrier_1": "Admitted Co A",
              "declining_carrier_2": "Admitted Co B",
              "declining_carrier_3": "Admitted Co C"
            }
          }
        }
      },
      "FormRenderResponse": {
        "type": "object",
        "required": [
          "state",
          "form_type",
          "form_id",
          "body"
        ],
        "properties": {
          "state": {
            "type": "string"
          },
          "form_type": {
            "$ref": "#/components/schemas/FormType"
          },
          "form_id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "body": {
            "type": "string",
            "description": "Rendered text or HTML"
          },
          "pdf_url": {
            "type": "string",
            "format": "uri",
            "description": "Present when output=pdf; short-lived signed URL"
          },
          "effective_from": {
            "type": "string",
            "format": "date"
          },
          "source_cite": {
            "type": "string"
          },
          "missing_fields": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Required catalog fields not supplied"
          },
          "disclaimer": {
            "type": "string"
          }
        }
      },
      "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": {
    "/calculate": {
      "post": {
        "summary": "Calculate surplus lines tax",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "state"
                ],
                "properties": {
                  "state": {
                    "type": "string",
                    "example": "TX"
                  },
                  "premium": {
                    "type": "number",
                    "example": 10000
                  },
                  "effective_date": {
                    "type": "string",
                    "format": "date"
                  },
                  "broker_fee": {
                    "type": "number"
                  },
                  "exclude_broker_fee": {
                    "type": "boolean"
                  },
                  "wet_marine": {
                    "type": "boolean"
                  },
                  "fire_insurance": {
                    "type": "boolean"
                  },
                  "hurricane": {
                    "type": "boolean"
                  },
                  "locality_code": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result"
          },
          "400": {
            "description": "Validation error"
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "402": {
            "description": "Quota exceeded"
          }
        }
      }
    },
    "/rates": {
      "get": {
        "summary": "List current or as-of rates",
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "date",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Rate list"
          }
        }
      }
    },
    "/historical-rates": {
      "get": {
        "summary": "Historical rate for a state on a date",
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "date",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Historical rate"
          }
        }
      }
    },
    "/jurisdictions": {
      "get": {
        "summary": "List jurisdictions",
        "security": [],
        "responses": {
          "200": {
            "description": "Jurisdiction list"
          }
        }
      }
    },
    "/coverages": {
      "get": {
        "summary": "Coverage tags",
        "security": [],
        "responses": {
          "200": {
            "description": "Coverage catalog"
          }
        }
      }
    },
    "/forms/types": {
      "get": {
        "summary": "List form type codes",
        "description": "Catalog metadata. Requires forms entitlement; does not consume quota.",
        "responses": {
          "200": {
            "description": "Form types",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "types": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/FormType"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "403": {
            "description": "Key lacks entitlement-sltax-forms"
          }
        }
      }
    },
    "/forms/catalog": {
      "get": {
        "summary": "List forms available for a jurisdiction",
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "form_type",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/FormType"
            }
          },
          {
            "name": "date",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "As-of date for effective-dated catalog (default: today)"
          },
          {
            "name": "confidence",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "verified",
                "estimated",
                "unverified"
              ]
            }
          },
          {
            "name": "history",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Catalog rows",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "state": {
                      "type": "string"
                    },
                    "as_of": {
                      "type": "string",
                      "format": "date"
                    },
                    "forms": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/FormCatalogItem"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error"
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "403": {
            "description": "Key lacks entitlement-sltax-forms"
          }
        }
      }
    },
    "/forms/stamp-wording": {
      "post": {
        "summary": "Resolve surplus-lines stamp / legend wording",
        "description": "Counts 1 against forms monthly quota.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StampWordingRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Stamp wording",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StampWordingResponse"
                }
              }
            }
          },
          "400": {
            "description": "Validation error"
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "402": {
            "description": "Forms quota exceeded"
          },
          "403": {
            "description": "Key lacks entitlement-sltax-forms"
          },
          "404": {
            "description": "No wording for jurisdiction/date"
          }
        }
      }
    },
    "/forms/render": {
      "post": {
        "summary": "Render a fillable form (diligent search, declination, affidavit, \u2026)",
        "description": "Counts 1 against forms monthly quota.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FormRenderRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Rendered form",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FormRenderResponse"
                }
              }
            }
          },
          "400": {
            "description": "Validation error"
          },
          "401": {
            "description": "Missing/invalid API key"
          },
          "402": {
            "description": "Forms quota exceeded"
          },
          "403": {
            "description": "Key lacks entitlement-sltax-forms"
          },
          "404": {
            "description": "Form not found for jurisdiction/date"
          }
        }
      }
    },
    "/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"
          }
        }
      }
    },
    "/forms/coverage": {
      "get": {
        "summary": "Forms data coverage (stamp + diligent confidence counts)",
        "tags": [
          "Forms"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Coverage summary"
          }
        }
      }
    },
    "/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"
          }
        }
      }
    },
    "/forms/diligent-required": {
      "get": {
        "summary": "Is diligent search required for state/date?",
        "tags": [
          "Forms"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "date",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/forms/placement-brief": {
      "post": {
        "summary": "Stamp + diligent (+ calendar due if entitled)",
        "tags": [
          "Forms"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  }
}
