{
  "openapi": "3.1.0",
  "info": {
    "title": "EasyLaw Enterprise Headless API",
    "version": "1.0.0",
    "description": "Programmatic interface for statutory legal tariff calculations, corporate compliance roadmaps, verified practitioner discovery, and legal operations in Botswana.",
    "contact": {
      "name": "EasyLaw Legal Operations Desk",
      "url": "https://easylaw.co.bw/#/contact",
      "email": "operations@easylaw.co.bw"
    },
    "license": {
      "name": "Proprietary Platform Access",
      "url": "https://easylaw.co.bw/#/terms"
    }
  },
  "servers": [
    {
      "url": "https://easylaw.co.bw",
      "description": "Production Server (Gaborone / Falkenstein)"
    }
  ],
  "paths": {
    "/api/feecompass.php": {
      "post": {
        "summary": "Calculate Statutory Legal Costs & Transfer Duties",
        "description": "Calculates property conveyancing tariffs, transfer duty, deeds registry fees, and High Court litigation costs under Botswana statutes (Order 74, Cap 53:01, Cap 33:02).",
        "operationId": "calculateStatutoryFees",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "calculate_conveyancing",
                      "calculate_litigation",
                      "tariffs"
                    ],
                    "description": "Calculation category"
                  },
                  "property_value": {
                    "type": "number",
                    "description": "Property transfer valuation in Botswana Pula (BWP)"
                  },
                  "is_citizen": {
                    "type": "boolean",
                    "description": "Citizen status for transfer duty exemption under Cap 53:01"
                  },
                  "version": {
                    "type": "string",
                    "default": "2024-modern"
                  }
                },
                "required": [
                  "action"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "calculation": {
                      "type": "object",
                      "properties": {
                        "conveyancing_fee": {
                          "type": "number"
                        },
                        "conveyancing_vat": {
                          "type": "number"
                        },
                        "transfer_duty": {
                          "type": "number"
                        },
                        "duty_exemption_applied": {
                          "type": "number"
                        },
                        "deeds_fee": {
                          "type": "number"
                        },
                        "stamp_duty": {
                          "type": "number"
                        },
                        "total_cost": {
                          "type": "number"
                        },
                        "currency": {
                          "type": "string",
                          "example": "BWP"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/compliance.php": {
      "post": {
        "summary": "Retrieve Company Statutory Compliance Roadmap",
        "description": "Fetches deadlines, filing milestones, and penalty risks across CIPA, BURS, and FIA.",
        "operationId": "getComplianceRoadmap",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "get_compliance_data",
                      "save_profile"
                    ]
                  }
                },
                "required": [
                  "action"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Compliance milestones retrieved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "has_profile": {
                      "type": "boolean"
                    },
                    "milestones": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/marketplace.php": {
      "post": {
        "summary": "Search Verified Botswana Legal Practitioners",
        "description": "Returns verified attorneys, advocates, conveyancers, and corporate secretaries with specialties and ratings.",
        "operationId": "listPractitioners",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "action": {
                    "type": "string",
                    "default": "get_practitioners"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "List of practitioners",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "practitioners": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/contact.php": {
      "post": {
        "summary": "Submit Legal Operations Client Inquiry",
        "description": "Dispatches client lead intake or inquiry notifications to EasyLaw operations team.",
        "operationId": "submitContactInquiry",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "fullName": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "subject": {
                    "type": "string",
                    "enum": [
                      "general",
                      "practitioner",
                      "enterprise",
                      "technical"
                    ]
                  },
                  "message": {
                    "type": "string"
                  }
                },
                "required": [
                  "fullName",
                  "email",
                  "message"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Message dispatched successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}