{
  "openapi": "3.0.0",
  "info": {
    "title": "Perfex CRM REST API",
    "description": "Comprehensive REST API for Perfex CRM system with full CRUD operations for all entities",
    "version": "2.0.8",
    "contact": {
      "name": "Themesic Interactive",
      "url": "https://1.envato.market/themesic"
    }
  },
  "security": [
    {
      "authtoken": []
    }
  ],
  "paths": {
    "/api/contacts": {
      "post": {
        "tags": ["Contacts"],
        "summary": "Create new contact",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {"$ref": "#/components/schemas/ContactInput"}
            }
          }
        },
        "responses": {
          "201": {
            "description": "Contact created successfully",
            "content": {
              "application/json": {
                "schema": {"$ref": "#/components/schemas/Contact"}
              }
            }
          }
        }
      }
    },
    "/api/contacts/{id}": {
      "put": {
        "tags": ["Contacts"],
        "summary": "Update contact",
        "parameters": [
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {"$ref": "#/components/schemas/ContactInput"}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Contact updated successfully",
            "content": {
              "application/json": {
                "schema": {"$ref": "#/components/schemas/Contact"}
              }
            }
          }
        }
      },
      "delete": {
        "tags": ["Contacts"],
        "summary": "Delete contact",
        "parameters": [
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}
        ],
        "responses": {
          "200": {
            "description": "Contact deleted successfully"
          }
        }
      }
    },
    "/api/contacts/{customer_id}/{id}": {
      "get": {
        "tags": ["Contacts"],
        "summary": "List all Contacts of a Customer (or a single contact when id is provided)",
        "parameters": [
          {"name": "customer_id", "in": "path", "required": true, "schema": {"type": "integer"}, "description": "Customer unique ID"},
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}, "description": "Contact unique ID (provide to get single contact)"}
        ],
        "responses": {
          "200": {
            "description": "Contact(s) information",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {"type": "array", "items": {"$ref": "#/components/schemas/Contact"}},
                    {"$ref": "#/components/schemas/Contact"}
                  ]
                }
              }
            }
          },
          "404": {"description": "No data were found"}
        }
      }
    },
    "/api/contacts/search/{keysearch}": {
      "get": {
        "tags": ["Contacts"],
        "summary": "Search Contact Information",
        "parameters": [
          {"name": "keysearch", "in": "path", "required": true, "schema": {"type": "string"}, "description": "Search keywords"}
        ],
        "responses": {
          "200": {
            "description": "Search results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {"$ref": "#/components/schemas/Contact"}
                }
              }
            }
          },
          "404": {"description": "No data were found"}
        }
      }
    },
    "/api/invoices": {
      "post": {
        "tags": ["Invoices"],
        "summary": "Add New invoice",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {"$ref": "#/components/schemas/InvoiceInput"}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Invoice Added Successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          },
          "404": {
            "description": "Invoice Add Fail or validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "error": {"type": "object"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflict - Invoice number already in use",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "error": {"type": "object"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/invoices/{id}": {
      "get": {
        "tags": ["Invoices"],
        "summary": "Request invoice information",
        "parameters": [
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}, "description": "Invoice unique ID"}
        ],
        "responses": {
          "200": {
            "description": "Invoice information",
            "content": {
              "application/json": {
                "schema": {"$ref": "#/components/schemas/Invoice"}
              }
            }
          },
          "404": {
            "description": "No data were found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": ["Invoices"],
        "summary": "Update invoice",
        "parameters": [
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}, "description": "Invoice unique ID"}
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {"$ref": "#/components/schemas/InvoiceUpdateInput"}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Invoice Updated Successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          },
          "404": {
            "description": "Invoice Update Fail or Invalid Invoice ID"
          },
          "409": {
            "description": "Conflict - validation errors or number already in use",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "error": {"type": "object"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": ["Invoices"],
        "summary": "Delete invoice",
        "parameters": [
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}, "description": "Invoice unique ID"}
        ],
        "responses": {
          "200": {
            "description": "Invoice Deleted Successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          },
          "404": {
            "description": "Invoice Delete Fail or Invalid Invoice ID"
          }
        }
      }
    },
    "/api/invoices/search/{keysearch}": {
      "get": {
        "tags": ["Invoices"],
        "summary": "Search invoice information",
        "parameters": [
          {"name": "keysearch", "in": "path", "required": true, "schema": {"type": "string"}, "description": "Search Keywords"}
        ],
        "responses": {
          "200": {
            "description": "Invoice Information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {"$ref": "#/components/schemas/Invoice"}
                }
              }
            }
          },
          "404": {
            "description": "No data were found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/projects": {
      "post": {
        "tags": ["Projects"],
        "summary": "Add New Project",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {"$ref": "#/components/schemas/ProjectInput"}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Project add successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          },
          "404": {
            "description": "Project add fail or validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "error": {"type": "object"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/projects/{id}": {
      "get": {
        "tags": ["Projects"],
        "summary": "Request project information",
        "parameters": [
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}, "description": "Project unique ID"}
        ],
        "responses": {
          "200": {
            "description": "Project information",
            "content": {
              "application/json": {
                "schema": {"$ref": "#/components/schemas/Project"}
              }
            }
          },
          "404": {
            "description": "No data were found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": ["Projects"],
        "summary": "Update a project",
        "parameters": [
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}, "description": "Project unique ID"}
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {"$ref": "#/components/schemas/ProjectUpdateInput"}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Project Update Successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          },
          "404": {
            "description": "Project Update Fail or Invalid Project ID"
          }
        }
      },
      "delete": {
        "tags": ["Projects"],
        "summary": "Delete a Project",
        "parameters": [
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}, "description": "Project unique ID"}
        ],
        "responses": {
          "200": {
            "description": "Project Delete Successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          },
          "404": {
            "description": "Project Delete Fail or Invalid Project ID"
          }
        }
      }
    },
    "/api/projects/search/{keysearch}": {
      "get": {
        "tags": ["Projects"],
        "summary": "Search Project Information",
        "parameters": [
          {"name": "keysearch", "in": "path", "required": true, "schema": {"type": "string"}, "description": "Search keywords"}
        ],
        "responses": {
          "200": {
            "description": "Project information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {"$ref": "#/components/schemas/Project"}
                }
              }
            }
          },
          "404": {
            "description": "No data were found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/tasks": {
      "post": {
        "tags": ["Tasks"],
        "summary": "Add New Task",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {"$ref": "#/components/schemas/TaskInput"}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Task add successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          },
          "404": {
            "description": "Task add fail or validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "error": {"type": "object"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/tasks/{id}": {
      "get": {
        "tags": ["Tasks"],
        "summary": "Request Task information",
        "parameters": [
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}, "description": "Task unique ID"}
        ],
        "responses": {
          "200": {
            "description": "Task information",
            "content": {
              "application/json": {
                "schema": {"$ref": "#/components/schemas/Task"}
              }
            }
          },
          "404": {
            "description": "No data were found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": ["Tasks"],
        "summary": "Update a task",
        "parameters": [
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}, "description": "Task unique ID"}
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {"$ref": "#/components/schemas/TaskUpdateInput"}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Task Update Successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          },
          "404": {
            "description": "Task Update Fail or Invalid Task ID"
          }
        }
      },
      "delete": {
        "tags": ["Tasks"],
        "summary": "Delete a Task",
        "parameters": [
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}, "description": "Task unique ID"}
        ],
        "responses": {
          "200": {
            "description": "Task Delete Successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          },
          "404": {
            "description": "Task Delete Fail or Invalid Task ID"
          }
        }
      }
    },
    "/api/tasks/search/{keysearch}": {
      "get": {
        "tags": ["Tasks"],
        "summary": "Search Tasks Information",
        "parameters": [
          {"name": "keysearch", "in": "path", "required": true, "schema": {"type": "string"}, "description": "Search Keywords"}
        ],
        "responses": {
          "200": {
            "description": "Tasks information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {"$ref": "#/components/schemas/Task"}
                }
              }
            }
          },
          "404": {
            "description": "No data were found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/tickets": {
      "post": {
        "tags": ["Tickets"],
        "summary": "Add New Ticket",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {"$ref": "#/components/schemas/TicketInput"}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ticket add successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          },
          "404": {
            "description": "Ticket add fail or validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "error": {"type": "object"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/tickets/{id}": {
      "get": {
        "tags": ["Tickets"],
        "summary": "Request Ticket information",
        "parameters": [
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}, "description": "Ticket unique ID"}
        ],
        "responses": {
          "200": {
            "description": "Ticket information",
            "content": {
              "application/json": {
                "schema": {"$ref": "#/components/schemas/Ticket"}
              }
            }
          },
          "404": {
            "description": "No data were found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": ["Tickets"],
        "summary": "Update a ticket",
        "parameters": [
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}, "description": "Ticket unique ID"}
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {"$ref": "#/components/schemas/TicketUpdateInput"}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ticket Update Successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          },
          "404": {
            "description": "Ticket Update Fail or Invalid Ticket ID"
          }
        }
      },
      "delete": {
        "tags": ["Tickets"],
        "summary": "Delete a Ticket",
        "parameters": [
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}, "description": "Ticket unique ID"}
        ],
        "responses": {
          "200": {
            "description": "Ticket Delete Successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          },
          "404": {
            "description": "Ticket Delete Fail or Invalid Ticket ID"
          }
        }
      }
    },
    "/api/tickets/search/{keysearch}": {
      "get": {
        "tags": ["Tickets"],
        "summary": "Search Ticket Information",
        "parameters": [
          {"name": "keysearch", "in": "path", "required": true, "schema": {"type": "string"}, "description": "Search keywords"}
        ],
        "responses": {
          "200": {
            "description": "Ticket information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {"$ref": "#/components/schemas/Ticket"}
                }
              }
            }
          },
          "404": {
            "description": "No data were found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/leads": {
      "get": {
        "tags": ["Leads"],
        "summary": "Request all Leads",
        "responses": {
          "200": {
            "description": "Lead information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {"$ref": "#/components/schemas/Lead"}
                }
              }
            }
          },
          "404": {
            "description": "No data were found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": ["Leads"],
        "summary": "Add New Lead",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {"$ref": "#/components/schemas/LeadInput"}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Lead add successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          },
          "404": {
            "description": "Lead add fail or validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "error": {"type": "object"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/leads/{id}": {
      "get": {
        "tags": ["Leads"],
        "summary": "Request Lead information",
        "parameters": [
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}, "description": "Lead unique ID"}
        ],
        "responses": {
          "200": {
            "description": "Lead information",
            "content": {
              "application/json": {
                "schema": {"$ref": "#/components/schemas/Lead"}
              }
            }
          },
          "404": {
            "description": "No data were found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": ["Leads"],
        "summary": "Update a lead",
        "parameters": [
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}, "description": "Lead unique ID"}
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {"$ref": "#/components/schemas/LeadUpdateInput"}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Lead Update Successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          },
          "404": {
            "description": "Lead Update Fail or Invalid Lead ID"
          }
        }
      },
      "delete": {
        "tags": ["Leads"],
        "summary": "Delete a Lead",
        "parameters": [
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}, "description": "Lead unique ID"}
        ],
        "responses": {
          "200": {
            "description": "Lead Delete Successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          },
          "404": {
            "description": "Lead Delete Fail or Invalid Lead ID"
          }
        }
      }
    },
    "/api/leads/search/{keysearch}": {
      "get": {
        "tags": ["Leads"],
        "summary": "Search Lead Information",
        "parameters": [
          {"name": "keysearch", "in": "path", "required": true, "schema": {"type": "string"}, "description": "Search Keywords"}
        ],
        "responses": {
          "200": {
            "description": "Lead information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {"$ref": "#/components/schemas/Lead"}
                }
              }
            }
          },
          "404": {
            "description": "No data were found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/custom_fields/{entity}": {
      "get": {
        "tags": ["Custom Fields"],
        "summary": "Get custom fields for entity",
        "parameters": [
          {"name": "entity", "in": "path", "required": true, "schema": {"type": "string"}}
        ],
        "responses": {
          "200": {
            "description": "Custom fields for entity",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {"$ref": "#/components/schemas/CustomFieldValue"}
                }
              }
            }
          }
        }
      }
    },
    "/api/custom_fields/{entity}/{id}": {
      "get": {
        "tags": ["Custom Fields"],
        "summary": "Get custom fields for entity with values for a specific record",
        "parameters": [
          {"name": "entity", "in": "path", "required": true, "schema": {"type": "string"}},
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}, "description": "Record id to fetch values for"}
        ],
        "responses": {
          "200": {
            "description": "Custom fields with values for record",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {"$ref": "#/components/schemas/CustomFieldValue"}
                }
              }
            }
          },
          "404": {"description": "Not valid data or no fields found"}
        }
      }
    },
    "/api/calendar": {
      "get": {
        "tags": ["Calendar"],
        "summary": "Get calendar events",
        "responses": {
          "200": {
            "description": "Calendar events retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "data": {
                      "type": "array",
                      "items": {"$ref": "#/components/schemas/CalendarEvent"}
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": ["Calendar"],
        "summary": "Create calendar event",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {"$ref": "#/components/schemas/CalendarEventInput"}
            }
          }
        },
        "responses": {
          "201": {
            "description": "Calendar event created successfully",
            "content": {
              "application/json": {
                "schema": {"type": "object","properties": {"status": {"type": "boolean"},"message": {"type": "string"}}}
              }
            }
          }
        }
      }
    },
    "/api/calendar/{id}": {
      "get": {
        "tags": ["Calendar"],
        "summary": "Get calendar event by ID",
        "parameters": [
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}
        ],
        "responses": {
          "200": {
            "description": "Calendar event retrieved successfully",
            "content": {
              "application/json": {
                "schema": {"$ref": "#/components/schemas/CalendarEvent"}
              }
            }
          },
          "404": {"description": "No data were found"}
        }
      },
      "put": {
        "tags": ["Calendar"],
        "summary": "Update calendar event",
        "parameters": [
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {"$ref": "#/components/schemas/CalendarEventInput"}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calendar event updated successfully",
            "content": {
              "application/json": {
                "schema": {"type": "object","properties": {"status": {"type": "boolean"},"message": {"type": "string"}}}
              }
            }
          },
          "404": {"description": "Data Update Fail"}
        }
      },
      "delete": {
        "tags": ["Calendar"],
        "summary": "Delete calendar event",
        "parameters": [
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}
        ],
        "responses": {
          "200": {
            "description": "Calendar event deleted successfully",
            "content": {
              "application/json": {
                "schema": {"type": "object","properties": {"status": {"type": "boolean"},"message": {"type": "string"}}}
              }
            }
          },
          "404": {"description": "Data Delete Fail"}
        }
      }
    },
    "/api/credit_notes": {
      "post": {
        "tags": ["Credit Notes"],
        "summary": "Create credit note",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {"$ref": "#/components/schemas/CreditNoteInput"}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Credit Note Added Successfully",
            "content": {
              "application/json": {
                "schema": {"type": "object","properties": {"status": {"type": "boolean"}, "message": {"type": "string"}}}
              }
            }
          },
          "404": {"description": "Credit Note Add Fail"},
          "409": {"description": "Conflict - number already in use"}
        }
      }
    },
    "/api/credit_notes/{id}": {
      "get": {
        "tags": ["Credit Notes"],
        "summary": "Get credit note by ID",
        "parameters": [
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}
        ],
        "responses": {
          "200": {
            "description": "Credit note retrieved successfully",
            "content": {
              "application/json": {
                "schema": {"$ref": "#/components/schemas/CreditNote"}
              }
            }
          },
          "404": {"description": "No data were found"}
        }
      },
      "put": {
        "tags": ["Credit Notes"],
        "summary": "Update credit note",
        "parameters": [
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {"$ref": "#/components/schemas/CreditNoteInput"}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Credit Note Updated Successfully",
            "content": {
              "application/json": {
                "schema": {"type": "object","properties": {"status": {"type": "boolean"}, "message": {"type": "string"}}}
              }
            }
          },
          "404": {"description": "Credit Note Update Fail"},
          "409": {"description": "Conflict - validation errors"}
        }
      },
      "delete": {
        "tags": ["Credit Notes"],
        "summary": "Delete credit note",
        "parameters": [
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}
        ],
        "responses": {
          "200": {
            "description": "Credit Note Deleted Successfully",
            "content": {
              "application/json": {
                "schema": {"type": "object","properties": {"status": {"type": "boolean"}, "message": {"type": "string"}}}
              }
            }
          },
          "404": {"description": "Credit Note Delete Fail"}
        }
      }
    },
    "/api/credit_notes/search/{keysearch}": {
      "get": {
        "tags": ["Credit Notes"],
        "summary": "Search credit notes",
        "parameters": [
          {"name": "keysearch", "in": "path", "required": true, "schema": {"type": "string"}, "description": "Search keywords"}
        ],
        "responses": {
          "200": {
            "description": "Search results",
            "content": {
              "application/json": {
                "schema": {"type": "array","items": {"$ref": "#/components/schemas/CreditNote"}}
              }
            }
          },
          "404": {"description": "No data were found"}
        }
      }
    },
    "/api/customers": {
      "post": {
        "tags": ["Customers"],
        "summary": "Create customer",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {"$ref": "#/components/schemas/CustomerInput"}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Customer add successful",
            "content": {
              "application/json": {
                "schema": {"type": "object","properties": {"status": {"type": "boolean"}, "message": {"type": "string"}}}
              }
            }
          },
          "404": {"description": "Customer add fail"}
        }
      }
    },
    "/api/customers/{id}": {
      "get": {
        "tags": ["Customers"],
        "summary": "Get customer by ID",
        "parameters": [
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}
        ],
        "responses": {
          "200": {
            "description": "Customer details",
            "content": {
              "application/json": {
                "schema": {"$ref": "#/components/schemas/Customer"}
              }
            }
          },
          "404": {"description": "No data were found"}
        }
      },
      "put": {
        "tags": ["Customers"],
        "summary": "Update customer",
        "parameters": [
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {"$ref": "#/components/schemas/CustomerInput"}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Customer Update Successful",
            "content": {
              "application/json": {
                "schema": {"type": "object","properties": {"status": {"type": "boolean"}, "message": {"type": "string"}}}
              }
            }
          },
          "404": {"description": "Customers Update Fail"}
        }
      },
      "delete": {
        "tags": ["Customers"],
        "summary": "Delete customer",
        "parameters": [
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}
        ],
        "responses": {
          "200": {
            "description": "Customer Delete Successful",
            "content": {
              "application/json": {
                "schema": {"type": "object","properties": {"status": {"type": "boolean"}, "message": {"type": "string"}}}
              }
            }
          },
          "404": {"description": "Customer Delete Fail"}
        }
      }
    },
    "/api/customers/search/{keysearch}": {
      "get": {
        "tags": ["Customers"],
        "summary": "Search Customer Information",
        "parameters": [
          {"name": "keysearch", "in": "path", "required": true, "schema": {"type": "string"}, "description": "Search keywords"}
        ],
        "responses": {
          "200": {
            "description": "Search results",
            "content": {
              "application/json": {
                "schema": {"type": "array","items": {"$ref": "#/components/schemas/Customer"}}
              }
            }
          },
          "404": {"description": "No data were found"}
        }
      }
    },
    "/api/estimates": {
      "post": {
        "tags": ["Estimates"],
        "summary": "Add New Estimates",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {"$ref": "#/components/schemas/EstimateInput"}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Estimate Added Successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          },
          "404": {
            "description": "Estimate Add Fail or validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "error": {"type": "object"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflict - Estimate number already in use",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "error": {"type": "object"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/estimates/{id}": {
      "get": {
        "tags": ["Estimates"],
        "summary": "Request Estimate information",
        "parameters": [
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}, "description": "Estimate unique ID"}
        ],
        "responses": {
          "200": {
            "description": "Estimate information",
            "content": {
              "application/json": {
                "schema": {"$ref": "#/components/schemas/Estimate"}
              }
            }
          },
          "404": {
            "description": "No data were found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": ["Estimates"],
        "summary": "Update a estimate",
        "parameters": [
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}, "description": "Estimate unique ID"}
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {"$ref": "#/components/schemas/EstimateUpdateInput"}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Estimate Updated Successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          },
          "404": {
            "description": "Estimate Update Fail",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflict - validation errors or number already in use",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "error": {"type": "object"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": ["Estimates"],
        "summary": "Delete Estimate",
        "parameters": [
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}, "description": "Estimate unique ID"}
        ],
        "responses": {
          "200": {
            "description": "Estimate Deleted Successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          },
          "404": {
            "description": "Estimate Delete Fail or Invalid Estimate ID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/estimates/search/{keysearch}": {
      "get": {
        "tags": ["Estimates"],
        "summary": "Search Estimate information",
        "parameters": [
          {"name": "keysearch", "in": "path", "required": true, "schema": {"type": "string"}, "description": "Search keywords"}
        ],
        "responses": {
          "200": {
            "description": "Estimate Information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {"$ref": "#/components/schemas/Estimate"}
                }
              }
            }
          },
          "404": {
            "description": "No data were found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/expenses": {
      "post": {
        "tags": ["Expenses"],
        "summary": "Add Expense",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {"$ref": "#/components/schemas/ExpenseInput"}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Expense Added Successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          },
          "404": {
            "description": "Expense Add Fail"
          },
          "409": {
            "description": "Conflict - validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "error": {"type": "object"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/expenses/{id}": {
      "get": {
        "tags": ["Expenses"],
        "summary": "Request Expense information",
        "parameters": [
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}, "description": "Expense unique ID"}
        ],
        "responses": {
          "200": {
            "description": "Expense information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {"$ref": "#/components/schemas/Expense"}
                }
              }
            }
          },
          "404": {
            "description": "No data were found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": ["Expenses"],
        "summary": "Update a Expense",
        "parameters": [
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}, "description": "Expense unique ID"}
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {"$ref": "#/components/schemas/ExpenseInput"}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Expense Updated Successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          },
          "404": {
            "description": "Expense Update Fail or Invalid Expense ID"
          },
          "409": {
            "description": "Conflict - Expense ID doesn't exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": ["Expenses"],
        "summary": "Delete Expense",
        "parameters": [
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}, "description": "Expense unique ID"}
        ],
        "responses": {
          "200": {
            "description": "Expense Deleted Successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          },
          "404": {
            "description": "Expense Delete Fail or Invalid Expense ID"
          }
        }
      }
    },
    "/api/expenses/search/{keysearch}": {
      "get": {
        "tags": ["Expenses"],
        "summary": "Search Expenses information",
        "parameters": [
          {"name": "keysearch", "in": "path", "required": true, "schema": {"type": "string"}, "description": "Search Keywords"}
        ],
        "responses": {
          "200": {
            "description": "Expenses Information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {"$ref": "#/components/schemas/Expense"}
                }
              }
            }
          },
          "404": {
            "description": "No data were found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/items/{id}": {
      "get": {
        "tags": ["Items"],
        "summary": "Request Invoice Item's information",
        "parameters": [
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}, "description": "Item unique ID"}
        ],
        "responses": {
          "200": {
            "description": "Item information",
            "content": {
              "application/json": {
                "schema": {"$ref": "#/components/schemas/Item"}
              }
            }
          },
          "404": {
            "description": "No data were found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/items/search/{keysearch}": {
      "get": {
        "tags": ["Items"],
        "summary": "Search Invoice Item's information",
        "parameters": [
          {"name": "keysearch", "in": "path", "required": true, "schema": {"type": "string"}, "description": "Search Keywords"}
        ],
        "responses": {
          "200": {
            "description": "Item Information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {"$ref": "#/components/schemas/ItemSearch"}
                }
              }
            }
          },
          "404": {
            "description": "No data were found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/milestones": {
      "post": {
        "tags": ["Milestones"],
        "summary": "Add New Milestone",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {"$ref": "#/components/schemas/MilestoneInput"}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Milestone add successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          },
          "404": {
            "description": "Milestone add fail or validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "error": {"type": "object"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/milestones/{id}": {
      "get": {
        "tags": ["Milestones"],
        "summary": "Request Milestones information",
        "parameters": [
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}, "description": "Milestone unique ID"}
        ],
        "responses": {
          "200": {
            "description": "Milestones information",
            "content": {
              "application/json": {
                "schema": {"$ref": "#/components/schemas/Milestone"}
              }
            }
          },
          "404": {
            "description": "No data were found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": ["Milestones"],
        "summary": "Update a Milestone",
        "parameters": [
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}, "description": "Milestone unique ID"}
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {"$ref": "#/components/schemas/MilestoneInput"}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Milestone Update Successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          },
          "404": {
            "description": "Milestone Update Fail or Invalid Milestone ID"
          }
        }
      },
      "delete": {
        "tags": ["Milestones"],
        "summary": "Delete a Milestone",
        "parameters": [
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}, "description": "Milestone unique ID"}
        ],
        "responses": {
          "200": {
            "description": "Milestone Delete Successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          },
          "404": {
            "description": "Milestone Delete Fail or Invalid Milestone ID"
          }
        }
      }
    },
    "/api/milestones/search/{keysearch}": {
      "get": {
        "tags": ["Milestones"],
        "summary": "Search Milestones Information",
        "parameters": [
          {"name": "keysearch", "in": "path", "required": true, "schema": {"type": "string"}, "description": "Search Keywords"}
        ],
        "responses": {
          "200": {
            "description": "Milestones information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {"$ref": "#/components/schemas/Milestone"}
                }
              }
            }
          },
          "404": {
            "description": "No data were found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/payments": {
      "post": {
        "tags": ["Payments"],
        "summary": "Add New Payment",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {"$ref": "#/components/schemas/PaymentInput"}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Payment add successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "paymentmode": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          },
          "404": {
            "description": "Payment add fail or validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "paymentmode": {"type": "boolean"},
                    "error": {"type": "object"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/payments/{id}": {
      "get": {
        "tags": ["Payments"],
        "summary": "List all Payments",
        "parameters": [
          {"name": "id", "in": "path", "required": false, "schema": {"type": "integer"}, "description": "Optional payment unique ID. If not provided, lists all payments"}
        ],
        "responses": {
          "200": {
            "description": "List all Payment Records",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {"$ref": "#/components/schemas/Payment"}
                }
              }
            }
          },
          "404": {
            "description": "No data were found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "paymentmode": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/payments/search/{keysearch}": {
      "get": {
        "tags": ["Payments"],
        "summary": "Search Payments Information",
        "parameters": [
          {"name": "keysearch", "in": "path", "required": true, "schema": {"type": "string"}, "description": "Search Keywords"}
        ],
        "responses": {
          "200": {
            "description": "Payments information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {"$ref": "#/components/schemas/Payment"}
                }
              }
            }
          },
          "404": {
            "description": "No data were found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "paymentmode": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/proposals": {
      "post": {
        "tags": ["Proposals"],
        "summary": "Add New Proposals",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {"$ref": "#/components/schemas/ProposalInput"}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Proposal add successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          },
          "404": {
            "description": "Proposal add fail or validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "error": {"type": "object"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/proposals/{id}": {
      "get": {
        "tags": ["Proposals"],
        "summary": "Request Proposal information",
        "parameters": [
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}, "description": "Proposal unique ID"}
        ],
        "responses": {
          "200": {
            "description": "Proposal information",
            "content": {
              "application/json": {
                "schema": {"$ref": "#/components/schemas/Proposal"}
              }
            }
          },
          "404": {
            "description": "No data were found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": ["Proposals"],
        "summary": "Update a proposal",
        "parameters": [
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}, "description": "Proposal unique ID"}
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {"$ref": "#/components/schemas/ProposalUpdateInput"}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Proposal Updated Successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          },
          "404": {
            "description": "Proposal Update Fail or Invalid Proposal ID"
          },
          "409": {
            "description": "Conflict - validation errors or Proposal ID doesn't exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "error": {"type": "object"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": ["Proposals"],
        "summary": "Delete Proposal",
        "parameters": [
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}, "description": "Proposal unique ID"}
        ],
        "responses": {
          "200": {
            "description": "Proposal Deleted Successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          },
          "404": {
            "description": "Proposal Delete Fail or Invalid Proposal ID"
          }
        }
      }
    },
    "/api/proposals/search/{keysearch}": {
      "get": {
        "tags": ["Proposals"],
        "summary": "Search proposals information",
        "parameters": [
          {"name": "keysearch", "in": "path", "required": true, "schema": {"type": "string"}, "description": "Search Keywords"}
        ],
        "responses": {
          "200": {
            "description": "Proposals Information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {"$ref": "#/components/schemas/Proposal"}
                }
              }
            }
          },
          "404": {
            "description": "No data were found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/staffs": {
      "post": {
        "tags": ["Staff"],
        "summary": "Add New Staff",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {"$ref": "#/components/schemas/StaffInput"}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Staff add successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          },
          "404": {
            "description": "Staff add fail or validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "error": {"type": "object"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/staffs/{id}": {
      "get": {
        "tags": ["Staff"],
        "summary": "Request Staff information",
        "parameters": [
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}, "description": "Staff unique ID"}
        ],
        "responses": {
          "200": {
            "description": "Staff information",
            "content": {
              "application/json": {
                "schema": {"$ref": "#/components/schemas/Staff"}
              }
            }
          },
          "404": {
            "description": "No data were found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": ["Staff"],
        "summary": "Update a Staff",
        "parameters": [
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}, "description": "Staff unique ID"}
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {"$ref": "#/components/schemas/StaffUpdateInput"}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Staff Update Successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          },
          "404": {
            "description": "Staff Update Fail or Invalid Staff ID"
          }
        }
      },
      "delete": {
        "tags": ["Staff"],
        "summary": "Delete a Staff",
        "parameters": [
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}, "description": "Staff unique ID"}
        ],
        "responses": {
          "200": {
            "description": "Staff Delete Successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          },
          "404": {
            "description": "Staff Delete Fail or Invalid Staff ID"
          }
        }
      }
    },
    "/api/staffs/search/{keysearch}": {
      "get": {
        "tags": ["Staff"],
        "summary": "Search Staff Information",
        "parameters": [
          {"name": "keysearch", "in": "path", "required": true, "schema": {"type": "string"}, "description": "Search keywords"}
        ],
        "responses": {
          "200": {
            "description": "Staff information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {"$ref": "#/components/schemas/Staff"}
                }
              }
            }
          },
          "404": {
            "description": "No data were found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/subscriptions": {
      "post": {
        "tags": ["Subscriptions"],
        "summary": "Add New Subscription",
        "requestBody": {
          "required": true,
          "content": {                                                 
            "multipart/form-data": {
              "schema": {"$ref": "#/components/schemas/SubscriptionInput"}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Data Added Successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          },
          "404": {
            "description": "Data Add Fail or validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "error": {"type": "object"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/subscriptions/{id}": {
      "get": {
        "tags": ["Subscriptions"],
        "summary": "Request Subscription Information",
        "parameters": [
          {"name": "id", "in": "path", "required": false, "schema": {"type": "integer"}, "description": "Subscription unique ID. If not provided, returns all subscriptions"}
        ],
        "responses": {
          "200": {
            "description": "Subscription information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {"$ref": "#/components/schemas/Subscription"}
                }
              }
            }
          },
          "404": {
            "description": "No data were found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": ["Subscriptions"],
        "summary": "Update a Subscription",
        "parameters": [
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}, "description": "Subscription unique ID"}
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {"$ref": "#/components/schemas/SubscriptionInput"}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Data Update Successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          },
          "404": {
            "description": "Data Update Fail or Invalid ID"
          }
        }
      },
      "delete": {
        "tags": ["Subscriptions"],
        "summary": "Delete a Subscription",
        "parameters": [
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}, "description": "Subscription unique ID"}
        ],
        "responses": {
          "200": {
            "description": "Delete Successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          },
          "404": {
            "description": "Delete Fail or Invalid ID"
          }
        }
      }
    },
    "/api/timesheets": {
      "post": {
        "tags": ["Timesheets"],
        "summary": "Add New Timesheet",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {"$ref": "#/components/schemas/TimesheetInput"}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Data Added Successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          },
          "404": {
            "description": "Data Add Fail or validation errors",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "error": {"type": "object"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/timesheets/{id}": {
      "get": {
        "tags": ["Timesheets"],
        "summary": "Request Timesheet Information",
        "parameters": [
          {"name": "id", "in": "path", "required": false, "schema": {"type": "integer"}, "description": "Timesheet unique ID. If not provided, returns all timesheets"}
        ],
        "responses": {
          "200": {
            "description": "Timesheet information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {"$ref": "#/components/schemas/Timesheet"}
                }
              }
            }
          },
          "404": {
            "description": "No data were found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": ["Timesheets"],
        "summary": "Update a Timesheet",
        "parameters": [
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}, "description": "Timesheet unique ID"}
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {"$ref": "#/components/schemas/TimesheetInput"}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Data Update Successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          },
          "404": {
            "description": "Data Update Fail or Invalid ID"
          }
        }
      },
      "delete": {
        "tags": ["Timesheets"],
        "summary": "Delete a Timesheet",
        "parameters": [
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}, "description": "Timesheet unique ID"}
        ],
        "responses": {
          "200": {
            "description": "Delete Successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          },
          "404": {
            "description": "Delete Fail or Invalid ID"
          }
        }
      }
    },
    "/api/contracts": {
      "post": {
        "tags": ["Contracts"],
        "summary": "Create contract",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {"$ref": "#/components/schemas/ContractInput"}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Contract added successfully",
            "content": {
              "application/json": {
                "schema": {"type": "object","properties": {"status": {"type": "boolean"}, "message": {"type": "string"}}}
              }
            }
          },
          "404": {"description": "Contract Add Fail"}
        }
      }
    },
    "/api/contracts/{id}": {
      "get": {
        "tags": ["Contracts"],
        "summary": "Get contract by ID",
        "parameters": [
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}
        ],
        "responses": {
          "200": {
            "description": "Contract details",
            "content": {
              "application/json": {
                "schema": {"$ref": "#/components/schemas/Contract"}
              }
            }
          },
          "404": {"description": "No data were found"}
        }
      },
      "put": {
        "tags": ["Contracts"],
        "summary": "Update contract",
        "parameters": [
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {"$ref": "#/components/schemas/ContractInput"}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Contract updated successfully",
            "content": {
              "application/json": {
                "schema": {"type": "object","properties": {"status": {"type": "boolean"}, "message": {"type": "string"}}}
              }
            }
          },
          "404": {"description": "Contract Update Fail"}
        }
      },
      "delete": {
        "tags": ["Contracts"],
        "summary": "Delete contract",
        "parameters": [
          {"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}
        ],
        "responses": {
          "200": {
            "description": "Contract deleted successfully",
            "content": {
              "application/json": {
                "schema": {"type": "object","properties": {"status": {"type": "boolean"}, "message": {"type": "string"}}}
              }
            }
          },
          "404": {"description": "Contract Delete Fail"}
        }
      }
    },
    "/api/contracts/search/{keysearch}": {
      "get": {
        "tags": ["Contracts"],
        "summary": "Search Contracts information",
        "parameters": [
          {"name": "keysearch", "in": "path", "required": true, "schema": {"type": "string"}, "description": "Search Keywords"}
        ],
        "responses": {
          "200": {
            "description": "Contracts information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {"$ref": "#/components/schemas/Contract"}
                }
              }
            }
          },
          "404": {
            "description": "No data were found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/common/expense_category": {
      "get": {
        "tags": ["Expense Categories"],
        "summary": "Request Expense category",
        "responses": {
          "200": {
            "description": "Expense category information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {"type": "string"},
                      "name": {"type": "string"},
                      "description": {"type": "string"}
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No data were found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/common/payment_mode": {
      "get": {
        "tags": ["Payment Modes"],
        "summary": "Request Payment Mode",
        "responses": {
          "200": {
            "description": "Payment mode information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {"type": "string"},
                      "name": {"type": "string"},
                      "description": {"type": "string"}
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No data were found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/common/taxes": {
      "get": {
        "tags": ["Taxes"],
        "summary": "Request Taxes",
        "responses": {
          "200": {
            "description": "Taxes information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {"type": "string"},
                      "name": {"type": "string"},
                      "taxrate": {"type": "string"}
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No data were found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {"type": "boolean"},
                    "message": {"type": "string"}
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "authtoken": {
        "type": "apiKey",
        "in": "header",
        "name": "authtoken",
        "description": "Authentication token from admin area"
      }
    },
    "schemas": {
      "Contact": {
        "type": "object",
        "properties": {
          "id": {"type": "integer"},
          "firstname": {"type": "string"},
          "lastname": {"type": "string"},
          "email": {"type": "string"},
          "phonenumber": {"type": "string"},
          "title": {"type": "string"},
          "userid": {"type": "integer"}
        }
      },
      "ContactInput": {
        "type": "object",
        "required": ["firstname", "lastname", "email"],
        "properties": {
          "firstname": {"type": "string"},
          "lastname": {"type": "string"},
          "email": {"type": "string"},
          "phonenumber": {"type": "string"},
          "title": {"type": "string"},
          "userid": {"type": "integer"}
        }
      },
      "Invoice": {
        "type": "object",
        "properties": {
          "id": {"type": "string"},
          "sent": {"type": "string"},
          "datesend": {"type": "string", "nullable": true},
          "clientid": {"type": "string"},
          "deleted_customer_name": {"type": "string", "nullable": true},
          "number": {"type": "string"},
          "prefix": {"type": "string"},
          "number_format": {"type": "string"},
          "datecreated": {"type": "string", "format": "date-time"},
          "date": {"type": "string", "format": "date"},
          "duedate": {"type": "string", "format": "date"},
          "currency": {"type": "string"},
          "subtotal": {"type": "string"},
          "total_tax": {"type": "string"},
          "total": {"type": "string"},
          "adjustment": {"type": "string"},
          "addedfrom": {"type": "string"},
          "hash": {"type": "string"},
          "status": {"type": "string"},
          "clientnote": {"type": "string", "nullable": true},
          "adminnote": {"type": "string", "nullable": true},
          "last_overdue_reminder": {"type": "string", "nullable": true},
          "cancel_overdue_reminders": {"type": "string"},
          "allowed_payment_modes": {"type": "string"},
          "token": {"type": "string", "nullable": true},
          "discount_percent": {"type": "string"},
          "discount_total": {"type": "string"},
          "discount_type": {"type": "string"},
          "recurring": {"type": "string"},
          "recurring_type": {"type": "string", "nullable": true},
          "custom_recurring": {"type": "string"},
          "cycles": {"type": "string"},
          "total_cycles": {"type": "string"},
          "is_recurring_from": {"type": "string", "nullable": true},
          "last_recurring_date": {"type": "string", "nullable": true},
          "terms": {"type": "string", "nullable": true},
          "sale_agent": {"type": "string"},
          "billing_street": {"type": "string"},
          "billing_city": {"type": "string"},
          "billing_state": {"type": "string"},
          "billing_zip": {"type": "string"},
          "billing_country": {"type": "string", "nullable": true},
          "shipping_street": {"type": "string", "nullable": true},
          "shipping_city": {"type": "string", "nullable": true},
          "shipping_state": {"type": "string", "nullable": true},
          "shipping_zip": {"type": "string", "nullable": true},
          "shipping_country": {"type": "string", "nullable": true},
          "include_shipping": {"type": "string"},
          "show_shipping_on_invoice": {"type": "string"},
          "show_quantity_as": {"type": "string"},
          "project_id": {"type": "string"},
          "subscription_id": {"type": "string"},
          "symbol": {"type": "string"},
          "name": {"type": "string"},
          "decimal_separator": {"type": "string"},
          "thousand_separator": {"type": "string"},
          "placement": {"type": "string"},
          "isdefault": {"type": "string"},
          "currencyid": {"type": "string"},
          "currency_name": {"type": "string"},
          "total_left_to_pay": {"type": "string"},
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {"type": "string"},
                "rel_id": {"type": "string"},
                "rel_type": {"type": "string"},
                "description": {"type": "string"},
                "long_description": {"type": "string"},
                "qty": {"type": "string"},
                "rate": {"type": "string"},
                "unit": {"type": "string"},
                "item_order": {"type": "string"}
              }
            }
          },
          "attachments": {"type": "array", "items": {"type": "object"}},
          "visible_attachments_to_customer_found": {"type": "boolean"},
          "client": {
            "type": "object",
            "properties": {
              "userid": {"type": "string"},
              "company": {"type": "string"},
              "vat": {"type": "string"},
              "phonenumber": {"type": "string"},
              "country": {"type": "string"},
              "city": {"type": "string"},
              "zip": {"type": "string"},
              "state": {"type": "string"},
              "address": {"type": "string"},
              "website": {"type": "string"},
              "datecreated": {"type": "string", "format": "date-time"},
              "active": {"type": "string"},
              "leadid": {"type": "string", "nullable": true},
              "billing_street": {"type": "string"},
              "billing_city": {"type": "string"},
              "billing_state": {"type": "string"},
              "billing_zip": {"type": "string"},
              "billing_country": {"type": "string"},
              "shipping_street": {"type": "string"},
              "shipping_city": {"type": "string"},
              "shipping_state": {"type": "string"},
              "shipping_zip": {"type": "string"},
              "shipping_country": {"type": "string"},
              "longitude": {"type": "string", "nullable": true},
              "latitude": {"type": "string", "nullable": true},
              "default_language": {"type": "string"},
              "default_currency": {"type": "string"},
              "show_primary_contact": {"type": "string"},
              "stripe_id": {"type": "string", "nullable": true},
              "registration_confirmed": {"type": "string"},
              "addedfrom": {"type": "string"}
            }
          },
          "payments": {"type": "array", "items": {"type": "object"}},
          "scheduled_email": {"type": "string", "nullable": true}
        }
      },
      "InvoiceInput": {
        "type": "object",
        "required": ["clientid", "number", "date", "currency", "newitems", "allowed_payment_modes", "billing_street", "subtotal", "total"],
        "properties": {
          "clientid": {"type": "integer", "description": "Customer id (required)"},
          "number": {"type": "integer", "description": "Invoice Number (required)"},
          "date": {"type": "string", "format": "date", "description": "Invoice Date (required)"},
          "duedate": {"type": "string", "format": "date", "description": "Due date for Invoice"},
          "currency": {"type": "integer", "description": "Currency field (required)"},
          "billing_street": {"type": "string", "maxLength": 255, "description": "Street Address (required)"},
          "billing_city": {"type": "string", "description": "City Name for billing"},
          "billing_state": {"type": "string", "description": "Name of state for billing"},
          "billing_zip": {"type": "string", "description": "Zip code"},
          "billing_country": {"type": "integer", "description": "Country code"},
          "include_shipping": {"type": "string", "description": "Set 'on' if you want add Shipping Address"},
          "show_shipping_on_invoice": {"type": "string", "description": "Shows shipping details in invoice"},
          "shipping_street": {"type": "string", "description": "Address of shipping"},
          "shipping_city": {"type": "string", "description": "City name for shipping"},
          "shipping_state": {"type": "string", "description": "Name of state for shipping"},
          "shipping_zip": {"type": "string", "description": "Zip code for shipping"},
          "shipping_country": {"type": "integer", "description": "Country code"},
          "cancel_overdue_reminders": {"type": "string", "description": "Prevent sending overdue remainders for invoice"},
          "tags": {"type": "string", "description": "TAGS comma separated"},
          "sale_agent": {"type": "integer", "description": "Sale Agent id"},
          "recurring": {"type": "string", "description": "Recurring 1 to 12 or custom"},
          "discount_type": {"type": "string", "description": "before_tax / after_tax discount type"},
          "repeat_every_custom": {"type": "integer", "description": "If recurring is custom set number gap"},
          "repeat_type_custom": {"type": "string", "description": "If recurring is custom set gap option (day/week/month/year)"},
          "cycles": {"type": "integer", "description": "Number of cycles 0 for infinite"},
          "adminnote": {"type": "string", "description": "Notes by admin"},
          "clientnote": {"type": "string", "description": "Client notes"},
          "terms": {"type": "string", "description": "Terms"},
          "discount_percent": {"type": "number", "description": "Discount percent"},
          "discount_total": {"type": "number", "description": "Discount total"},
          "adjustment": {"type": "number", "description": "Adjustment amount"},
          "subtotal": {"type": "number", "description": "Sub Total (calculation based on item Qty, Rate and Tax) (required)"},
          "total": {"type": "number", "description": "Total (calculation based on subtotal, Discount and Adjustment) (required)"},
          "total_tax": {"type": "number", "description": "Total tax"},
          "show_quantity_as": {"type": "string", "description": "Show quantity as"},
          "allowed_payment_modes": {
            "type": "array",
            "description": "Payment modes (required)",
            "items": {"type": "integer"}
          },
          "newitems": {
            "type": "array",
            "description": "New Items to be added (required)",
            "items": {
              "type": "object",
              "properties": {
                "description": {"type": "string", "description": "Item description"},
                "long_description": {"type": "string", "description": "Item long description"},
                "qty": {"type": "number", "description": "Quantity"},
                "rate": {"type": "number", "description": "Rate"},
                "order": {"type": "integer", "description": "Item order"},
                "unit": {"type": "string", "description": "Unit"},
                "taxname": {
                  "type": "array",
                  "description": "Tax names (e.g., CGST|9.00)",
                  "items": {"type": "string"}
                }
              }
            }
          }
        }
      },
      "InvoiceUpdateInput": {
        "type": "object",
        "required": ["clientid", "number", "date", "currency", "items", "allowed_payment_modes", "billing_street", "subtotal", "total"],
        "properties": {
          "clientid": {"type": "integer", "description": "Customer id (required)"},
          "number": {"type": "integer", "description": "Invoice Number (required)"},
          "date": {"type": "string", "format": "date", "description": "Invoice Date (required)"},
          "duedate": {"type": "string", "format": "date", "description": "Due date for Invoice"},
          "currency": {"type": "integer", "description": "Currency field (required)"},
          "billing_street": {"type": "string", "maxLength": 255, "description": "Street Address (required)"},
          "billing_city": {"type": "string", "description": "City Name for billing"},
          "billing_state": {"type": "string", "description": "Name of state for billing"},
          "billing_zip": {"type": "string", "description": "Zip code"},
          "billing_country": {"type": "integer", "description": "Country code"},
          "include_shipping": {"type": "string", "description": "Set 'on' if you want add Shipping Address"},
          "show_shipping_on_invoice": {"type": "string", "description": "Shows shipping details in invoice"},
          "shipping_street": {"type": "string", "description": "Address of shipping"},
          "shipping_city": {"type": "string", "description": "City name for shipping"},
          "shipping_state": {"type": "string", "description": "Name of state for shipping"},
          "shipping_zip": {"type": "string", "description": "Zip code for shipping"},
          "shipping_country": {"type": "integer", "description": "Country code"},
          "cancel_overdue_reminders": {"type": "string", "description": "Prevent sending overdue remainders for invoice"},
          "tags": {"type": "string", "description": "TAGS comma separated"},
          "sale_agent": {"type": "integer", "description": "Sale Agent id"},
          "recurring": {"type": "string", "description": "Recurring 1 to 12 or custom"},
          "discount_type": {"type": "string", "description": "before_tax / after_tax discount type"},
          "repeat_every_custom": {"type": "integer", "description": "If recurring is custom set number gap"},
          "repeat_type_custom": {"type": "string", "description": "If recurring is custom set gap option (day/week/month/year)"},
          "cycles": {"type": "integer", "description": "Number of cycles 0 for infinite"},
          "adminnote": {"type": "string", "description": "Notes by admin"},
          "clientnote": {"type": "string", "description": "Client notes"},
          "terms": {"type": "string", "description": "Terms"},
          "discount_percent": {"type": "number", "description": "Discount percent"},
          "discount_total": {"type": "number", "description": "Discount total"},
          "adjustment": {"type": "number", "description": "Adjustment amount"},
          "subtotal": {"type": "number", "description": "Sub Total (calculation based on item Qty, Rate and Tax) (required)"},
          "total": {"type": "number", "description": "Total (calculation based on subtotal, Discount and Adjustment) (required)"},
          "total_tax": {"type": "number", "description": "Total tax"},
          "show_quantity_as": {"type": "string", "description": "Show quantity as"},
          "allowed_payment_modes": {
            "type": "array",
            "description": "Payment modes (required)",
            "items": {"type": "integer"}
          },
          "items": {
            "type": "object",
            "description": "Existing items with Id (required)",
            "additionalProperties": {
              "type": "object",
              "properties": {
                "itemid": {"type": "string", "description": "Item id"},
                "order": {"type": "string", "description": "Item order"},
                "description": {"type": "string", "description": "Item description"},
                "long_description": {"type": "string", "description": "Item long description"},
                "qty": {"type": "string", "description": "Quantity"},
                "unit": {"type": "string", "description": "Unit"},
                "rate": {"type": "string", "description": "Rate"}
              }
            }
          },
          "newitems": {
            "type": "object",
            "description": "New Items to be added",
            "additionalProperties": {
              "type": "object",
              "properties": {
                "order": {"type": "string", "description": "Item order"},
                "description": {"type": "string", "description": "Item description"},
                "long_description": {"type": "string", "description": "Item long description"},
                "qty": {"type": "string", "description": "Quantity"},
                "unit": {"type": "string", "description": "Unit"},
                "rate": {"type": "string", "description": "Rate"}
              }
            }
          },
          "removed_items": {
            "type": "array",
            "description": "Items to be removed",
            "items": {"type": "integer"}
          }
        }
      },
      "Project": {
        "type": "object",
        "properties": {
          "id": {"type": "string"},
          "name": {"type": "string"},
          "description": {"type": "string", "nullable": true},
          "status": {"type": "string"},
          "clientid": {"type": "string"},
          "billing_type": {"type": "string"},
          "start_date": {"type": "string", "format": "date"},
          "deadline": {"type": "string", "format": "date"},
          "project_created": {"type": "string", "format": "date"},
          "date_finished": {"type": "string", "nullable": true},
          "progress": {"type": "string"},
          "progress_from_tasks": {"type": "string"},
          "project_cost": {"type": "string"},
          "project_rate_per_hour": {"type": "string"},
          "estimated_hours": {"type": "string"},
          "addedfrom": {"type": "string"},
          "rel_type": {"type": "string"},
          "potential_revenue": {"type": "string"},
          "potential_margin": {"type": "string"},
          "external": {"type": "string"}
        }
      },
      "ProjectInput": {
        "type": "object",
        "required": ["name", "rel_type", "clientid", "billing_type", "start_date", "status"],
        "properties": {
          "name": {"type": "string", "maxLength": 600, "description": "Project Name (required)"},
          "rel_type": {"type": "string", "enum": ["lead", "customer", "internal"], "description": "Project Related (required)"},
          "clientid": {"type": "integer", "maxLength": 11, "description": "Related ID (required)"},
          "billing_type": {"type": "integer", "description": "Billing Type (required)"},
          "start_date": {"type": "string", "format": "date", "description": "Project Start Date (required)"},
          "status": {"type": "integer", "description": "Project Status (required)"},
          "progress_from_tasks": {"type": "string", "description": "On or off progress from tasks"},
          "project_cost": {"type": "string", "description": "Project Cost"},
          "progress": {"type": "string", "description": "Project progress"},
          "project_rate_per_hour": {"type": "string", "description": "Project rate per hour"},
          "estimated_hours": {"type": "string", "description": "Project estimated hours"},
          "project_members": {
            "type": "array",
            "description": "Project members",
            "items": {"type": "integer"}
          },
          "deadline": {"type": "string", "format": "date", "description": "Project deadline"},
          "tags": {"type": "string", "description": "Project tags"},
          "description": {"type": "string", "description": "Project description"},
          "custom_fields": {"type": "object", "description": "Custom fields data"}
        }
      },
      "ProjectUpdateInput": {
        "type": "object",
        "required": ["name", "rel_type", "clientid", "billing_type", "start_date", "status"],
        "properties": {
          "name": {"type": "string", "description": "Project Name (required)"},
          "rel_type": {"type": "string", "enum": ["lead", "customer", "internal"], "description": "Project Related (required)"},
          "clientid": {"type": "integer", "description": "Related ID (required)"},
          "billing_type": {"type": "integer", "description": "Billing Type (required)"},
          "start_date": {"type": "string", "format": "date", "description": "Project Start Date (required)"},
          "status": {"type": "integer", "description": "Project Status (required)"},
          "progress_from_tasks": {"type": "string", "description": "On or off progress from tasks"},
          "project_cost": {"type": "string", "description": "Project Cost"},
          "progress": {"type": "string", "description": "Project progress"},
          "project_rate_per_hour": {"type": "string", "description": "Project rate per hour"},
          "estimated_hours": {"type": "string", "description": "Project estimated hours"},
          "project_members": {
            "type": "object",
            "description": "Project members",
            "additionalProperties": {"type": "string"}
          },
          "deadline": {"type": "string", "format": "date", "description": "Project deadline"},
          "tags": {"type": "string", "description": "Project tags"},
          "description": {"type": "string", "description": "Project description"},
          "settings": {
            "type": "object",
            "description": "Project settings",
            "properties": {
              "available_features": {
                "type": "object",
                "description": "Available features",
                "additionalProperties": {"type": "string"}
              }
            }
          },
          "file": {
            "type": "array",
            "description": "File attachments",
            "items": {"type": "string", "format": "binary"}
          }
        }
      },
      "Task": {
        "type": "object",
        "properties": {
          "id": {"type": "string"},
          "name": {"type": "string"},
          "description": {"type": "string"},
          "priority": {"type": "string"},
          "dateadded": {"type": "string", "format": "date-time"},
          "startdate": {"type": "string", "format": "date-time"},
          "duedate": {"type": "string", "format": "date-time"},
          "datefinished": {"type": "string", "nullable": true},
          "addedfrom": {"type": "string"},
          "is_added_from_contact": {"type": "string"},
          "status": {"type": "string"},
          "recurring_type": {"type": "string", "nullable": true},
          "repeat_every": {"type": "string"},
          "recurring": {"type": "string"},
          "is_recurring_from": {"type": "string", "nullable": true},
          "rel_type": {"type": "string"},
          "rel_id": {"type": "string"},
          "billable": {"type": "string"},
          "hourly_rate": {"type": "string"},
          "milestone": {"type": "string"},
          "cycles": {"type": "string"},
          "is_public": {"type": "string"}
        }
      },
      "TaskInput": {
        "type": "object",
        "required": ["name", "startdate"],
        "properties": {
          "name": {"type": "string", "maxLength": 600, "description": "Task Name (required)"},
          "startdate": {"type": "string", "format": "date", "description": "Task Start Date (required)"},
          "is_public": {"type": "string", "description": "Publicly available task"},
          "billable": {"type": "string", "description": "Task billable"},
          "hourly_rate": {"type": "string", "description": "Task hourly rate"},
          "milestone": {"type": "string", "description": "Task milestone"},
          "duedate": {"type": "string", "format": "date-time", "description": "Task deadline"},
          "priority": {"type": "string", "description": "Task priority"},
          "repeat_every": {"type": "string", "description": "Task repeat every"},
          "repeat_every_custom": {"type": "integer", "description": "Task repeat every custom"},
          "repeat_type_custom": {"type": "string", "description": "Task repeat type custom"},
          "cycles": {"type": "integer", "description": "Cycles"},
          "rel_type": {"type": "string", "enum": ["lead", "customer", "invoice", "project", "quotation", "contract", "annex", "ticket", "expense", "proposal"], "description": "Task Related"},
          "rel_id": {"type": "integer", "description": "Related ID"},
          "tags": {"type": "string", "description": "Task tags"},
          "description": {"type": "string", "description": "Task description"},
          "custom_fields": {"type": "object", "description": "Custom fields data"}
        }
      },
      "TaskUpdateInput": {
        "type": "object",
        "required": ["name", "startdate"],
        "properties": {
          "name": {"type": "string", "description": "Task Name (required)"},
          "startdate": {"type": "string", "format": "date", "description": "Task Start Date (required)"},
          "is_public": {"type": "string", "description": "Publicly available task"},
          "billable": {"type": "string", "description": "Task billable"},
          "hourly_rate": {"type": "string", "description": "Task hourly rate"},
          "milestone": {"type": "string", "description": "Task milestone"},
          "duedate": {"type": "string", "format": "date-time", "description": "Task deadline"},
          "priority": {"type": "string", "description": "Task priority"},
          "repeat_every": {"type": "string", "description": "Task repeat every"},
          "repeat_every_custom": {"type": "integer", "description": "Task repeat every custom"},
          "repeat_type_custom": {"type": "string", "description": "Task repeat type custom"},
          "cycles": {"type": "integer", "description": "Cycles"},
          "rel_type": {"type": "string", "enum": ["lead", "customer", "invoice", "project", "quotation", "contract", "annex", "ticket", "expense", "proposal"], "description": "Task Related"},
          "rel_id": {"type": "integer", "description": "Related ID"},
          "tags": {"type": "string", "description": "Task tags"},
          "description": {"type": "string", "description": "Task description"},
          "file": {
            "type": "array",
            "description": "File attachments",
            "items": {"type": "string", "format": "binary"}
          }
        }
      },
      "Ticket": {
        "type": "object",
        "properties": {
          "id": {"type": "string"},
          "ticketid": {"type": "string"},
          "adminreplying": {"type": "string"},
          "userid": {"type": "string"},
          "contactid": {"type": "string"},
          "email": {"type": "string", "nullable": true},
          "name": {"type": "string"},
          "department": {"type": "string"},
          "priority": {"type": "string"},
          "status": {"type": "string"},
          "service": {"type": "string"},
          "ticketkey": {"type": "string"},
          "subject": {"type": "string"},
          "message": {"type": "string"},
          "admin": {"type": "string"},
          "date": {"type": "string", "format": "date-time"},
          "project_id": {"type": "string"},
          "lastreply": {"type": "string", "nullable": true},
          "clientread": {"type": "string"},
          "adminread": {"type": "string"},
          "assigned": {"type": "string"},
          "line_manager": {"type": "string"},
          "milestone": {"type": "string"}
        }
      },
      "TicketInput": {
        "type": "object",
        "required": ["subject", "department", "contactid", "userid"],
        "properties": {
          "subject": {"type": "string", "description": "Ticket name (required)"},
          "department": {"type": "string", "description": "Ticket Department (required)"},
          "contactid": {"type": "string", "description": "Ticket Contact (required)"},
          "userid": {"type": "string", "description": "Ticket user (required)"},
          "project_id": {"type": "string", "description": "Ticket Project"},
          "message": {"type": "string", "description": "Ticket message"},
          "service": {"type": "string", "description": "Ticket Service"},
          "assigned": {"type": "string", "description": "Assign ticket"},
          "cc": {"type": "string", "description": "Ticket CC"},
          "priority": {"type": "string", "description": "Priority"},
          "tags": {"type": "string", "description": "Ticket tags"},
          "custom_fields": {"type": "object", "description": "Custom fields data"}
        }
      },
      "TicketUpdateInput": {
        "type": "object",
        "required": ["subject", "department", "contactid", "userid", "priority"],
        "properties": {
          "subject": {"type": "string", "description": "Ticket name (required)"},
          "department": {"type": "string", "description": "Ticket Department (required)"},
          "contactid": {"type": "string", "description": "Ticket Contact (required)"},
          "userid": {"type": "string", "description": "Ticket user (required)"},
          "priority": {"type": "string", "description": "Priority (required)"},
          "project_id": {"type": "string", "description": "Ticket Project"},
          "message": {"type": "string", "description": "Ticket message"},
          "service": {"type": "string", "description": "Ticket Service"},
          "assigned": {"type": "string", "description": "Assign ticket"},
          "tags": {"type": "string", "description": "Ticket tags"},
          "file": {
            "type": "array",
            "description": "File attachments",
            "items": {"type": "string", "format": "binary"}
          }
        }
      },
      "Lead": {
        "type": "object",
        "properties": {
          "id": {"type": "string"},
          "hash": {"type": "string"},
          "name": {"type": "string"},
          "contact": {"type": "string"},
          "title": {"type": "string"},
          "company": {"type": "string"},
          "description": {"type": "string"},
          "country": {"type": "string"},
          "zip": {"type": "string", "nullable": true},
          "city": {"type": "string"},
          "state": {"type": "string"},
          "address": {"type": "string"},
          "assigned": {"type": "string"},
          "dateadded": {"type": "string", "format": "date-time"},
          "from_form_id": {"type": "string"},
          "status": {"type": "string"},
          "source": {"type": "string"},
          "email": {"type": "string"},
          "website": {"type": "string"},
          "phonenumber": {"type": "string"},
          "default_language": {"type": "string"},
          "lastcontact": {"type": "string"},
          "is_public": {"type": "string"},
          "contacted_today": {"type": "string"},
          "custom_contact_date": {"type": "string"},
          "client_id": {"type": "string"}
        }
      },
      "LeadInput": {
        "type": "object",
        "required": ["source", "status", "name", "assigned"],
        "properties": {
          "source": {"type": "string", "description": "Lead source (required)"},
          "status": {"type": "string", "description": "Lead Status (required)"},
          "name": {"type": "string", "maxLength": 600, "description": "Lead Name (required)"},
          "assigned": {"type": "string", "description": "Lead assigned (required)"},
          "client_id": {"type": "string", "description": "Lead From Customer"},
          "tags": {"type": "string", "description": "Lead tags"},
          "contact": {"type": "string", "description": "Lead contact"},
          "title": {"type": "string", "description": "Position"},
          "email": {"type": "string", "description": "Lead Email Address"},
          "website": {"type": "string", "description": "Lead Website"},
          "phonenumber": {"type": "string", "description": "Lead Phone"},
          "company": {"type": "string", "description": "Lead company"},
          "address": {"type": "string", "description": "Lead address"},
          "city": {"type": "string", "description": "Lead City"},
          "zip": {"type": "string", "description": "Zip code"},
          "state": {"type": "string", "description": "Lead state"},
          "country": {"type": "string", "description": "Lead Country"},
          "default_language": {"type": "string", "description": "Lead Default Language"},
          "description": {"type": "string", "description": "Lead description"},
          "custom_contact_date": {"type": "string", "description": "Lead From Customer"},
          "contacted_today": {"type": "string", "description": "Lead Contacted Today"},
          "is_public": {"type": "string", "description": "Lead google sheet id"},
          "custom_fields": {
            "type": "object",
            "description": "Custom fields for lead"
          },
          "file": {
            "type": "array",
            "description": "File attachments",
            "items": {"type": "string", "format": "binary"}
          }
        }
      },
      "LeadUpdateInput": {
        "type": "object",
        "required": ["source", "status", "name", "assigned"],
        "properties": {
          "source": {"type": "string", "description": "Lead source (required)"},
          "status": {"type": "string", "description": "Lead Status (required)"},
          "name": {"type": "string", "description": "Lead Name (required)"},
          "assigned": {"type": "string", "description": "Lead assigned (required)"},
          "client_id": {"type": "string", "description": "Lead From Customer"},
          "tags": {"type": "string", "description": "Lead tags"},
          "contact": {"type": "string", "description": "Lead contact"},
          "title": {"type": "string", "description": "Position"},
          "email": {"type": "string", "description": "Lead Email Address"},
          "website": {"type": "string", "description": "Lead Website"},
          "phonenumber": {"type": "string", "description": "Lead Phone"},
          "company": {"type": "string", "description": "Lead company"},
          "address": {"type": "string", "description": "Lead address"},
          "city": {"type": "string", "description": "Lead City"},
          "zip": {"type": "string", "description": "Zip Code"},
          "state": {"type": "string", "description": "Lead state"},
          "country": {"type": "string", "description": "Lead Country"},
          "default_language": {"type": "string", "description": "Lead Default Language"},
          "description": {"type": "string", "description": "Lead description"},
          "lastcontact": {"type": "string", "description": "Lead Last Contact"},
          "is_public": {"type": "string", "description": "Lead google sheet id"},
          "file": {
            "type": "array",
            "description": "File attachments",
            "items": {"type": "string", "format": "binary"}
          }
        }
      },
      "CustomField": {
        "type": "object",
        "properties": {
          "id": {"type": "integer"},
          "name": {"type": "string"},
          "fieldto": {"type": "string"},
          "type": {"type": "string"},
          "options": {"type": "string"},
          "required": {"type": "integer"},
          "active": {"type": "integer"}
        }
      },
      "CustomFieldValue": {
        "type": "object",
        "properties": {
          "field_name": {"type": "string"},
          "custom_field_id": {"type": "integer"},
          "label": {"type": "string"},
          "required": {"type": "integer"},
          "type": {"type": "string"},
          "value": {"type": "string"},
          "options": {"type": "string"}
        }
      },
      "CalendarEvent": {
        "type": "object",
        "properties": {
          "id": {"type": "integer"},
          "title": {"type": "string"},
          "description": {"type": "string"},
          "start": {"type": "string", "format": "date-time"},
          "end": {"type": "string", "format": "date-time"},
          "color": {"type": "string"},
          "userid": {"type": "integer"}
        }
      },
      "CalendarEventInput": {
        "type": "object",
        "required": ["title", "start"],
        "properties": {
          "title": {"type": "string"},
          "description": {"type": "string"},
          "start": {"type": "string", "format": "date-time"},
          "end": {"type": "string", "format": "date-time"},
          "color": {"type": "string"},
          "userid": {"type": "integer"}
        }
      },
      "CreditNote": {
        "type": "object",
        "properties": {
          "id": {"type": "integer"},
          "number": {"type": "string"},
          "clientid": {"type": "integer"},
          "date": {"type": "string", "format": "date"},
          "currency": {"type": "integer"},
          "subtotal": {"type": "number"},
          "total": {"type": "number"},
          "status": {"type": "integer"}
        }
      },
      "CreditNoteInput": {
        "type": "object",
        "required": ["clientid", "date", "currency"],
        "properties": {
          "clientid": {"type": "integer"},
          "date": {"type": "string", "format": "date"},
          "currency": {"type": "integer"},
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "description": {"type": "string"},
                "qty": {"type": "number"},
                "rate": {"type": "number"},
                "taxname": {"type": "string"},
                "taxrate": {"type": "number"}
              }
            }
          }
        }
      },
      "Customer": {
        "type": "object",
        "properties": {
          "id": {"type": "integer"},
          "company": {"type": "string"},
          "email": {"type": "string"},
          "phone": {"type": "string"},
          "address": {"type": "string"},
          "city": {"type": "string"},
          "state": {"type": "string"},
          "zip": {"type": "string"},
          "country": {"type": "string"},
          "website": {"type": "string"},
          "created": {"type": "string", "format": "date-time"}
        }
      },
      "CustomerInput": {
        "type": "object",
        "required": ["company"],
        "properties": {
          "company": {"type": "string"},
          "email": {"type": "string"},
          "phone": {"type": "string"},
          "address": {"type": "string"},
          "city": {"type": "string"},
          "state": {"type": "string"},
          "zip": {"type": "string"},
          "country": {"type": "string"},
          "website": {"type": "string"}
        }
      },
      "Estimate": {
        "type": "object",
        "properties": {
          "id": {"type": "string"},
          "sent": {"type": "string"},
          "datesend": {"type": "string", "nullable": true},
          "clientid": {"type": "string"},
          "deleted_customer_name": {"type": "string", "nullable": true},
          "project_id": {"type": "string"},
          "number": {"type": "string"},
          "prefix": {"type": "string"},
          "number_format": {"type": "string"},
          "hash": {"type": "string"},
          "datecreated": {"type": "string", "format": "date-time"},
          "date": {"type": "string", "format": "date"},
          "expirydate": {"type": "string", "format": "date"},
          "currency": {"type": "string"},
          "subtotal": {"type": "string"},
          "total_tax": {"type": "string"},
          "total": {"type": "string"},
          "adjustment": {"type": "string"},
          "addedfrom": {"type": "string"},
          "status": {"type": "string"},
          "clientnote": {"type": "string"},
          "adminnote": {"type": "string"},
          "discount_percent": {"type": "string"},
          "discount_total": {"type": "string"},
          "discount_type": {"type": "string"},
          "invoiceid": {"type": "string", "nullable": true},
          "invoiced_date": {"type": "string", "nullable": true},
          "terms": {"type": "string"},
          "reference_no": {"type": "string"},
          "sale_agent": {"type": "string"},
          "billing_street": {"type": "string"},
          "billing_city": {"type": "string"},
          "billing_state": {"type": "string"},
          "billing_zip": {"type": "string"},
          "billing_country": {"type": "string"},
          "shipping_street": {"type": "string"},
          "shipping_city": {"type": "string"},
          "shipping_state": {"type": "string"},
          "shipping_zip": {"type": "string"},
          "shipping_country": {"type": "string"},
          "include_shipping": {"type": "string"},
          "show_shipping_on_estimate": {"type": "string"},
          "show_quantity_as": {"type": "string"},
          "pipeline_order": {"type": "string"},
          "is_expiry_notified": {"type": "string"},
          "acceptance_firstname": {"type": "string", "nullable": true},
          "acceptance_lastname": {"type": "string", "nullable": true},
          "acceptance_email": {"type": "string", "nullable": true},
          "acceptance_date": {"type": "string", "nullable": true},
          "acceptance_ip": {"type": "string", "nullable": true},
          "signature": {"type": "string", "nullable": true},
          "short_link": {"type": "string", "nullable": true},
          "symbol": {"type": "string"},
          "name": {"type": "string"},
          "decimal_separator": {"type": "string"},
          "thousand_separator": {"type": "string"},
          "placement": {"type": "string"},
          "isdefault": {"type": "string"},
          "currencyid": {"type": "string"},
          "currency_name": {"type": "string"},
          "attachments": {"type": "array", "items": {"type": "object"}},
          "visible_attachments_to_customer_found": {"type": "boolean"},
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {"type": "string"},
                "rel_id": {"type": "string"},
                "rel_type": {"type": "string"},
                "description": {"type": "string"},
                "long_description": {"type": "string"},
                "qty": {"type": "string"},
                "rate": {"type": "string"},
                "unit": {"type": "string"},
                "item_order": {"type": "string"}
              }
            }
          },
          "client": {
            "type": "object",
            "properties": {
              "userid": {"type": "string"},
              "company": {"type": "string"},
              "vat": {"type": "string"},
              "phonenumber": {"type": "string"},
              "country": {"type": "string"},
              "city": {"type": "string"},
              "zip": {"type": "string"},
              "state": {"type": "string"},
              "address": {"type": "string"},
              "website": {"type": "string"},
              "datecreated": {"type": "string", "format": "date-time"},
              "active": {"type": "string"},
              "leadid": {"type": "string", "nullable": true},
              "billing_street": {"type": "string"},
              "billing_city": {"type": "string"},
              "billing_state": {"type": "string"},
              "billing_zip": {"type": "string"},
              "billing_country": {"type": "string"},
              "shipping_street": {"type": "string"},
              "shipping_city": {"type": "string"},
              "shipping_state": {"type": "string"},
              "shipping_zip": {"type": "string"},
              "shipping_country": {"type": "string"},
              "longitude": {"type": "string", "nullable": true},
              "latitude": {"type": "string", "nullable": true},
              "default_language": {"type": "string"},
              "default_currency": {"type": "string"},
              "show_primary_contact": {"type": "string"},
              "stripe_id": {"type": "string", "nullable": true},
              "registration_confirmed": {"type": "string"},
              "addedfrom": {"type": "string"}
            }
          },
          "scheduled_email": {"type": "string", "nullable": true},
          "customfields": {"type": "array", "items": {"type": "object"}}
        }
      },
      "EstimateInput": {
        "type": "object",
        "required": ["clientid", "number", "date", "currency", "status", "newitems", "subtotal", "total", "billing_street"],
        "properties": {
          "clientid": {"type": "integer", "description": "Customer id"},
          "number": {"type": "integer", "description": "Estimate Number"},
          "date": {"type": "string", "format": "date", "description": "Estimate Date"},
          "expirydate": {"type": "string", "format": "date", "description": "Expiry Date of Estimate"},
          "currency": {"type": "integer", "description": "Currency field"},
          "status": {"type": "integer", "description": "Status id (default status is Accepted)"},
          "project_id": {"type": "integer", "description": "Project id"},
          "include_shipping": {"type": "integer", "description": "Include Shipping (0 or 1)"},
          "show_shipping_on_estimate": {"type": "integer", "description": "Show shipping on estimate (0 or 1)"},
          "billing_street": {"type": "string", "maxLength": 200, "description": "Street Address"},
          "billing_city": {"type": "string", "description": "City Name for billing"},
          "billing_state": {"type": "string", "description": "Name of state for billing"},
          "billing_zip": {"type": "string", "description": "Zip code"},
          "billing_country": {"type": "integer", "description": "Country code"},
          "shipping_street": {"type": "string", "description": "Address of shipping"},
          "shipping_city": {"type": "string", "description": "City name for shipping"},
          "shipping_state": {"type": "string", "description": "Name of state for shipping"},
          "shipping_zip": {"type": "string", "description": "Zip code for shipping"},
          "shipping_country": {"type": "integer", "description": "Country code"},
          "tags": {"type": "string", "description": "TAGS comma separated"},
          "reference_no": {"type": "string", "description": "Reference name"},
          "sale_agent": {"type": "integer", "description": "Sale Agent id"},
          "adminnote": {"type": "string", "description": "Notes by admin"},
          "clientnote": {"type": "string", "description": "Client notes"},
          "terms": {"type": "string", "description": "Terms"},
          "discount_type": {"type": "string", "description": "Discount type"},
          "discount_percent": {"type": "number", "description": "Discount percent"},
          "discount_total": {"type": "number", "description": "Discount total"},
          "adjustment": {"type": "number", "description": "Adjustment amount"},
          "subtotal": {"type": "number", "description": "Sub Total (calculation based on item Qty, Rate and Tax)"},
          "total": {"type": "number", "description": "Total (calculation based on subtotal, Discount and Adjustment)"},
          "total_tax": {"type": "number", "description": "Total tax"},
          "newitems": {
            "type": "array",
            "description": "New Items to be added",
            "items": {
              "type": "object",
              "properties": {
                "description": {"type": "string", "description": "Item description"},
                "long_description": {"type": "string", "description": "Item long description"},
                "qty": {"type": "number", "description": "Quantity"},
                "rate": {"type": "number", "description": "Rate"},
                "order": {"type": "integer", "description": "Item order"},
                "unit": {"type": "string", "description": "Unit"},
                "taxname": {
                  "type": "array",
                  "description": "Tax names (e.g., CGST|9.00)",
                  "items": {"type": "string"}
                }
              }
            }
          }
        }
      },
      "EstimateUpdateInput": {
        "type": "object",
        "required": ["clientid", "number", "date", "currency", "status", "items", "subtotal", "total", "billing_street"],
        "properties": {
          "clientid": {"type": "integer", "description": "Customer id"},
          "number": {"type": "integer", "description": "Estimate Number"},
          "date": {"type": "string", "format": "date", "description": "Estimate Date"},
          "expirydate": {"type": "string", "format": "date", "description": "Expiry Date of Estimate"},
          "currency": {"type": "integer", "description": "Currency field"},
          "status": {"type": "integer", "description": "Estimate Status (e.g., Draft, Sent)"},
          "project_id": {"type": "integer", "description": "Project id"},
          "include_shipping": {"type": "integer", "description": "Include Shipping (0 or 1)"},
          "show_shipping_on_estimate": {"type": "integer", "description": "Show shipping on estimate (0 or 1)"},
          "billing_street": {"type": "string", "maxLength": 200, "description": "Street Address"},
          "billing_city": {"type": "string", "description": "City Name for billing"},
          "billing_state": {"type": "string", "description": "Name of state for billing"},
          "billing_zip": {"type": "string", "description": "Zip code"},
          "billing_country": {"type": "integer", "description": "Country code"},
          "shipping_street": {"type": "string", "description": "Address of shipping"},
          "shipping_city": {"type": "string", "description": "City name for shipping"},
          "shipping_state": {"type": "string", "description": "Name of state for shipping"},
          "shipping_zip": {"type": "string", "description": "Zip code for shipping"},
          "shipping_country": {"type": "integer", "description": "Country code"},
          "tags": {"type": "string", "description": "TAGS comma separated"},
          "reference_no": {"type": "string", "description": "Reference #"},
          "sale_agent": {"type": "integer", "description": "Sale Agent id"},
          "adminnote": {"type": "string", "description": "Notes by admin"},
          "clientnote": {"type": "string", "description": "Client notes"},
          "terms": {"type": "string", "description": "Terms"},
          "discount_type": {"type": "string", "description": "before_tax / after_tax discount type"},
          "discount_percent": {"type": "number", "description": "Discount percent"},
          "discount_total": {"type": "number", "description": "Discount total"},
          "adjustment": {"type": "number", "description": "Adjustment amount"},
          "subtotal": {"type": "number", "description": "Sub Total (calculation based on item Qty, Rate and Tax)"},
          "total": {"type": "number", "description": "Total (calculation based on subtotal, Discount and Adjustment)"},
          "total_tax": {"type": "number", "description": "Total tax"},
          "items": {
            "type": "object",
            "description": "Existing items with Id",
            "additionalProperties": {
              "type": "object",
              "properties": {
                "itemid": {"type": "string", "description": "Item id"},
                "order": {"type": "string", "description": "Item order"},
                "description": {"type": "string", "description": "Item description"},
                "long_description": {"type": "string", "description": "Item long description"},
                "qty": {"type": "string", "description": "Quantity"},
                "unit": {"type": "string", "description": "Unit"},
                "rate": {"type": "string", "description": "Rate"},
                "custom_fields": {"type": "object", "description": "Custom fields for items"}
              }
            }
          },
          "newitems": {
            "type": "object",
            "description": "New Items to be added",
            "additionalProperties": {
              "type": "object",
              "properties": {
                "order": {"type": "string", "description": "Item order"},
                "description": {"type": "string", "description": "Item description"},
                "long_description": {"type": "string", "description": "Item long description"},
                "qty": {"type": "string", "description": "Quantity"},
                "unit": {"type": "string", "description": "Unit"},
                "rate": {"type": "string", "description": "Rate"},
                "custom_fields": {"type": "object", "description": "Custom fields for items"}
              }
            }
          },
          "removed_items": {
            "type": "array",
            "description": "Items to be removed",
            "items": {"type": "integer"}
          },
          "custom_fields": {
            "type": "object",
            "description": "Custom fields for estimate",
            "properties": {
              "estimate": {"type": "object"}
            }
          }
        }
      },
      "Expense": {
        "type": "object",
        "properties": {
          "id": {"type": "string"},
          "category": {"type": "string"},
          "currency": {"type": "string"},
          "amount": {"type": "string"},
          "tax": {"type": "string"},
          "tax2": {"type": "string"},
          "reference_no": {"type": "string"},
          "note": {"type": "string"},
          "expense_name": {"type": "string"},
          "clientid": {"type": "string"},
          "project_id": {"type": "string"},
          "billable": {"type": "string"},
          "invoiceid": {"type": "string", "nullable": true},
          "paymentmode": {"type": "string"},
          "date": {"type": "string", "format": "date"},
          "recurring_type": {"type": "string"},
          "repeat_every": {"type": "string"},
          "recurring": {"type": "string"},
          "cycles": {"type": "string"},
          "total_cycles": {"type": "string"},
          "custom_recurring": {"type": "string"},
          "last_recurring_date": {"type": "string", "nullable": true},
          "create_invoice_billable": {"type": "string"},
          "send_invoice_to_customer": {"type": "string"},
          "recurring_from": {"type": "string", "nullable": true},
          "dateadded": {"type": "string", "format": "date-time"},
          "addedfrom": {"type": "string"},
          "is_expense_created_in_xero": {"type": "string"},
          "userid": {"type": "string"},
          "company": {"type": "string"},
          "vat": {"type": "string"},
          "phonenumber": {"type": "string"},
          "country": {"type": "string"},
          "city": {"type": "string"},
          "zip": {"type": "string"},
          "state": {"type": "string"},
          "address": {"type": "string"},
          "website": {"type": "string"},
          "datecreated": {"type": "string", "format": "date-time"},
          "active": {"type": "string"},
          "leadid": {"type": "string", "nullable": true},
          "billing_street": {"type": "string"},
          "billing_city": {"type": "string"},
          "billing_state": {"type": "string"},
          "billing_zip": {"type": "string"},
          "billing_country": {"type": "string"},
          "shipping_street": {"type": "string"},
          "shipping_city": {"type": "string"},
          "shipping_state": {"type": "string"},
          "shipping_zip": {"type": "string"},
          "shipping_country": {"type": "string"},
          "longitude": {"type": "string", "nullable": true},
          "latitude": {"type": "string", "nullable": true},
          "default_language": {"type": "string"},
          "default_currency": {"type": "string"},
          "show_primary_contact": {"type": "string"},
          "stripe_id": {"type": "string", "nullable": true},
          "registration_confirmed": {"type": "string"},
          "name": {"type": "string"},
          "description": {"type": "string"},
          "show_on_pdf": {"type": "string"},
          "invoices_only": {"type": "string"},
          "expenses_only": {"type": "string"},
          "selected_by_default": {"type": "string"},
          "taxrate": {"type": "string", "nullable": true},
          "category_name": {"type": "string"},
          "payment_mode_name": {"type": "string"},
          "tax_name": {"type": "string", "nullable": true},
          "tax_name2": {"type": "string", "nullable": true},
          "taxrate2": {"type": "string", "nullable": true},
          "expenseid": {"type": "string"},
          "customfields": {"type": "array", "items": {"type": "object"}}
        }
      },
      "ExpenseInput": {
        "type": "object",
        "required": ["category", "amount", "date", "currency"],
        "properties": {
          "expense_name": {"type": "string", "description": "Expense Name"},
          "note": {"type": "string", "description": "Expense Note"},
          "category": {"type": "integer", "description": "Expense Category (required)"},
          "amount": {"type": "number", "description": "Expense Amount (required)"},
          "date": {"type": "string", "format": "date", "description": "Expense Date (required)"},
          "clientid": {"type": "integer", "description": "Customer id"},
          "project_id": {"type": "integer", "description": "Project id"},
          "currency": {"type": "integer", "description": "Currency Field (required)"},
          "tax": {"type": "integer", "description": "Tax 1"},
          "tax2": {"type": "integer", "description": "Tax 2"},
          "paymentmode": {"type": "integer", "description": "Payment mode"},
          "reference_no": {"type": "string", "description": "Reference #"},
          "billable": {"type": "integer", "description": "Billable (0 or 1)"},
          "recurring": {"type": "string", "description": "Recurring 1 to 12 or custom"},
          "repeat_every": {"type": "string", "description": "Repeat every (e.g., 6-month)"},
          "repeat_every_custom": {"type": "integer", "description": "If recurring is custom set number gap"},
          "repeat_type_custom": {"type": "string", "description": "If recurring is custom set gap option (day/week/month/year)"},
          "cycles": {"type": "integer", "description": "Number of cycles"},
          "create_invoice_billable": {"type": "integer", "description": "Create invoice billable (0 or 1)"},
          "send_invoice_to_customer": {"type": "integer", "description": "Send invoice to customer (0 or 1)"},
          "custom_fields": {
            "type": "object",
            "description": "Custom fields for expenses",
            "properties": {
              "expenses": {"type": "object"}
            }
          },
          "file": {
            "type": "array",
            "description": "File attachments",
            "items": {"type": "string", "format": "binary"}
          }
        }
      },
      "Item": {
        "type": "object",
        "properties": {
          "itemid": {"type": "string"},
          "rate": {"type": "string"},
          "taxrate": {"type": "string"},
          "taxid": {"type": "string"},
          "taxname": {"type": "string"},
          "taxrate_2": {"type": "string"},
          "taxid_2": {"type": "string"},
          "taxname_2": {"type": "string"},
          "description": {"type": "string"},
          "long_description": {"type": "string"},
          "group_id": {"type": "string"},
          "group_name": {"type": "string", "nullable": true},
          "unit": {"type": "string"}
        }
      },
      "ItemSearch": {
        "type": "object",
        "properties": {
          "rate": {"type": "string"},
          "id": {"type": "string"},
          "name": {"type": "string"},
          "subtext": {"type": "string"}
        }
      },
      "Milestone": {
        "type": "object",
        "properties": {
          "id": {"type": "string"},
          "name": {"type": "string"},
          "description": {"type": "string"},
          "description_visible_to_customer": {"type": "string"},
          "due_date": {"type": "string", "format": "date"},
          "project_id": {"type": "string"},
          "color": {"type": "string", "nullable": true},
          "milestone_order": {"type": "string"},
          "datecreated": {"type": "string", "format": "date"},
          "total_tasks": {"type": "string"},
          "total_finished_tasks": {"type": "string"}
        }
      },
      "MilestoneInput": {
        "type": "object",
        "required": ["project_id", "name", "due_date"],
        "properties": {
          "project_id": {"type": "string", "description": "Project id (required)"},
          "name": {"type": "string", "maxLength": 600, "description": "Milestone Name (required)"},
          "due_date": {"type": "string", "format": "date", "description": "Milestone Due date (required)"},
          "description": {"type": "string", "description": "Milestone Description"},
          "description_visible_to_customer": {"type": "string", "description": "Show description to customer"},
          "milestone_order": {"type": "string", "description": "Milestone Order"}
        }
      },
      "Payment": {
        "type": "object",
        "properties": {
          "id": {"type": "string"},
          "invoiceid": {"type": "string"},
          "amount": {"type": "string"},
          "paymentmode": {"type": "string"},
          "paymentmethod": {"type": "string"},
          "date": {"type": "string", "format": "date"},
          "daterecorded": {"type": "string", "format": "date-time"},
          "note": {"type": "string"},
          "transactionid": {"type": "string"},
          "description": {"type": "string", "nullable": true},
          "show_on_pdf": {"type": "string"},
          "invoices_only": {"type": "string"},
          "expenses_only": {"type": "string"},
          "selected_by_default": {"type": "string"},
          "active": {"type": "string"},
          "paymentid": {"type": "string"}
        }
      },
      "PaymentInput": {
        "type": "object",
        "required": ["invoiceid", "amount", "paymentmode"],
        "properties": {
          "invoiceid": {"type": "string", "maxLength": 600, "description": "Invoice ID associated with the payment (required)"},
          "amount": {"type": "string", "description": "Payment amount (required)"},
          "paymentmode": {"type": "string", "description": "Payment mode (required, e.g., cash, credit card, etc.)"},
          "paymentmethod": {"type": "string", "description": "Payment method details"},
          "note": {"type": "string", "description": "Additional payment note"},
          "transactionid": {"type": "string", "description": "Transaction ID"},
          "custom_fields": {"type": "string", "description": "Custom fields data (JSON format)"}
        }
      },
      "Proposal": {
        "type": "object",
        "properties": {
          "id": {"type": "string"},
          "subject": {"type": "string"},
          "content": {"type": "string"},
          "addedfrom": {"type": "string"},
          "datecreated": {"type": "string", "format": "date-time"},
          "total": {"type": "string"},
          "subtotal": {"type": "string"},
          "total_tax": {"type": "string"},
          "adjustment": {"type": "string"},
          "discount_percent": {"type": "string"},
          "discount_total": {"type": "string"},
          "discount_type": {"type": "string"},
          "show_quantity_as": {"type": "string"},
          "currency": {"type": "string"},
          "open_till": {"type": "string", "format": "date"},
          "date": {"type": "string", "format": "date"},
          "rel_id": {"type": "string"},
          "rel_type": {"type": "string"},
          "assigned": {"type": "string"},
          "hash": {"type": "string"},
          "proposal_to": {"type": "string"},
          "country": {"type": "string"},
          "zip": {"type": "string"},
          "state": {"type": "string"},
          "city": {"type": "string"},
          "address": {"type": "string"},
          "email": {"type": "string"},
          "phone": {"type": "string"},
          "allow_comments": {"type": "string"},
          "status": {"type": "string"},
          "estimate_id": {"type": "string", "nullable": true},
          "invoice_id": {"type": "string", "nullable": true},
          "date_converted": {"type": "string", "nullable": true},
          "pipeline_order": {"type": "string"},
          "is_expiry_notified": {"type": "string"},
          "acceptance_firstname": {"type": "string", "nullable": true},
          "acceptance_lastname": {"type": "string", "nullable": true},
          "acceptance_email": {"type": "string", "nullable": true},
          "acceptance_date": {"type": "string", "nullable": true},
          "acceptance_ip": {"type": "string", "nullable": true},
          "signature": {"type": "string", "nullable": true},
          "short_link": {"type": "string", "nullable": true},
          "symbol": {"type": "string"},
          "name": {"type": "string"},
          "decimal_separator": {"type": "string"},
          "thousand_separator": {"type": "string"},
          "placement": {"type": "string"},
          "isdefault": {"type": "string"},
          "currencyid": {"type": "string"},
          "currency_name": {"type": "string"},
          "attachments": {"type": "array", "items": {"type": "object"}},
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {"type": "string"},
                "rel_id": {"type": "string"},
                "rel_type": {"type": "string"},
                "description": {"type": "string"},
                "long_description": {"type": "string"},
                "qty": {"type": "string"},
                "rate": {"type": "string"},
                "unit": {"type": "string"},
                "item_order": {"type": "string"}
              }
            }
          },
          "visible_attachments_to_customer_found": {"type": "boolean"},
          "customfields": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "label": {"type": "string"},
                "value": {"type": "string"}
              }
            }
          }
        }
      },
      "ProposalInput": {
        "type": "object",
        "required": ["subject", "rel_type", "rel_id", "proposal_to", "email", "newitems", "currency", "date", "status", "subtotal", "total"],
        "properties": {
          "subject": {"type": "string", "maxLength": 191, "description": "Proposal Subject Name (required)"},
          "rel_type": {"type": "string", "enum": ["lead", "customer"], "description": "Proposal Related (required)"},
          "rel_id": {"type": "integer", "description": "Related ID (required)"},
          "proposal_to": {"type": "string", "maxLength": 191, "description": "Lead / Customer name (required)"},
          "email": {"type": "string", "format": "email", "maxLength": 150, "description": "Email id (required)"},
          "date": {"type": "string", "format": "date", "description": "Proposal Start Date (required)"},
          "open_till": {"type": "string", "format": "date", "description": "Proposal Open Till Date"},
          "currency": {"type": "integer", "description": "Currency id (required)"},
          "discount_type": {"type": "string", "description": "Discount type"},
          "status": {"type": "integer", "description": "Status id (required)"},
          "assigned": {"type": "string", "description": "Assignee id"},
          "subtotal": {"type": "number", "description": "Sub Total (required)"},
          "total": {"type": "number", "description": "Total (required)"},
          "address": {"type": "string", "description": "Address"},
          "newitems": {
            "type": "array",
            "description": "New Items to be added (required)",
            "items": {
              "type": "object",
              "properties": {
                "description": {"type": "string", "description": "Item description"},
                "long_description": {"type": "string", "description": "Item long description"},
                "qty": {"type": "number", "description": "Quantity"},
                "rate": {"type": "number", "description": "Rate"},
                "order": {"type": "integer", "description": "Item order"},
                "unit": {"type": "string", "description": "Unit"},
                "custom_fields": {
                  "type": "object",
                  "description": "Custom fields for items",
                  "properties": {
                    "items": {"type": "object"}
                  }
                }
              }
            }
          },
          "custom_fields": {
            "type": "object",
            "description": "Custom fields for proposal",
            "properties": {
              "proposal": {"type": "object"}
            }
          }
        }
      },
      "ProposalUpdateInput": {
        "type": "object",
        "required": ["subject", "rel_type", "rel_id", "proposal_to", "email", "items", "currency", "date", "status", "subtotal", "total"],
        "properties": {
          "subject": {"type": "string", "maxLength": 191, "description": "Proposal Subject Name (required)"},
          "rel_type": {"type": "string", "enum": ["lead", "customer"], "description": "Proposal Related (required)"},
          "rel_id": {"type": "integer", "description": "Related ID (required)"},
          "proposal_to": {"type": "string", "maxLength": 191, "description": "Lead / Customer name (required)"},
          "email": {"type": "string", "format": "email", "maxLength": 150, "description": "Email id (required)"},
          "date": {"type": "string", "format": "date", "description": "Proposal Start Date (required)"},
          "open_till": {"type": "string", "format": "date", "description": "Proposal Open Till Date"},
          "currency": {"type": "integer", "description": "Currency id (required)"},
          "discount_type": {"type": "string", "description": "Discount type"},
          "status": {"type": "integer", "description": "Status id (required)"},
          "assigned": {"type": "string", "description": "Assignee id"},
          "subtotal": {"type": "number", "description": "Sub Total (required)"},
          "total": {"type": "number", "description": "Total (required)"},
          "address": {"type": "string", "description": "Address"},
          "items": {
            "type": "object",
            "description": "Existing items with Id (required)",
            "additionalProperties": {
              "type": "object",
              "properties": {
                "itemid": {"type": "string", "description": "Item id"},
                "order": {"type": "string", "description": "Item order"},
                "description": {"type": "string", "description": "Item description"},
                "long_description": {"type": "string", "description": "Item long description"},
                "qty": {"type": "string", "description": "Quantity"},
                "unit": {"type": "string", "description": "Unit"},
                "rate": {"type": "string", "description": "Rate"},
                "custom_fields": {
                  "type": "object",
                  "description": "Custom fields for items",
                  "properties": {
                    "items": {"type": "object"}
                  }
                }
              }
            }
          },
          "newitems": {
            "type": "object",
            "description": "New Items to be added",
            "additionalProperties": {
              "type": "object",
              "properties": {
                "order": {"type": "string", "description": "Item order"},
                "description": {"type": "string", "description": "Item description"},
                "long_description": {"type": "string", "description": "Item long description"},
                "qty": {"type": "string", "description": "Quantity"},
                "unit": {"type": "string", "description": "Unit"},
                "rate": {"type": "string", "description": "Rate"},
                "custom_fields": {
                  "type": "object",
                  "description": "Custom fields for items",
                  "properties": {
                    "items": {"type": "object"}
                  }
                }
              }
            }
          },
          "removed_items": {
            "type": "array",
            "description": "Items to be removed",
            "items": {"type": "integer"}
          },
          "custom_fields": {
            "type": "object",
            "description": "Custom fields for proposal",
            "properties": {
              "proposal": {"type": "object"}
            }
          }
        }
      },
      "Staff": {
        "type": "object",
        "properties": {
          "staffid": {"type": "string"},
          "email": {"type": "string"},
          "firstname": {"type": "string"},
          "lastname": {"type": "string"},
          "facebook": {"type": "string"},
          "linkedin": {"type": "string"},
          "phonenumber": {"type": "string"},
          "skype": {"type": "string"},
          "password": {"type": "string"},
          "datecreated": {"type": "string", "format": "date-time"},
          "profile_image": {"type": "string"},
          "role": {"type": "string"},
          "hourly_rate": {"type": "string"},
          "default_language": {"type": "string"},
          "email_signature": {"type": "string"},
          "direction": {"type": "string"},
          "active": {"type": "string"}
        }
      },
      "StaffInput": {
        "type": "object",
        "required": ["firstname", "email", "password"],
        "properties": {
          "firstname": {"type": "string", "maxLength": 600, "description": "Staff Name (required)"},
          "email": {"type": "string", "format": "email", "description": "Staff Email (required)"},
          "password": {"type": "string", "description": "Staff password (required)"},
          "hourly_rate": {"type": "number", "description": "Hourly rate"},
          "phonenumber": {"type": "string", "description": "Staff phonenumber"},
          "facebook": {"type": "string", "description": "Staff facebook"},
          "linkedin": {"type": "string", "description": "Staff linkedin"},
          "skype": {"type": "string", "description": "Staff skype"},
          "default_language": {"type": "string", "description": "Staff default language"},
          "email_signature": {"type": "string", "description": "Staff email signature"},
          "direction": {"type": "string", "description": "Staff direction"},
          "send_welcome_email": {"type": "string", "description": "Staff send welcome email"},
          "departments": {
            "type": "array",
            "description": "Staff departments",
            "items": {"type": "integer"}
          },
          "custom_fields": {"type": "object", "description": "Custom fields data"}
        }
      },
      "StaffUpdateInput": {
        "type": "object",
        "required": ["firstname", "email", "password"],
        "properties": {
          "firstname": {"type": "string", "description": "Staff Name (required)"},
          "email": {"type": "string", "format": "email", "description": "Staff Email (required)"},
          "password": {"type": "string", "description": "Staff password (required)"},
          "hourly_rate": {"type": "string", "description": "Hourly rate"},
          "phonenumber": {"type": "string", "description": "Staff phonenumber"},
          "facebook": {"type": "string", "description": "Staff facebook"},
          "linkedin": {"type": "string", "description": "Staff linkedin"},
          "skype": {"type": "string", "description": "Staff skype"},
          "default_language": {"type": "string", "description": "Staff default language"},
          "email_signature": {"type": "string", "description": "Staff email signature"},
          "direction": {"type": "string", "description": "Staff direction"},
          "departments": {
            "type": "object",
            "description": "Staff departments",
            "additionalProperties": {"type": "string"}
          }
        }
      },
      "Subscription": {
        "type": "object",
        "properties": {
          "id": {"type": "string"},
          "name": {"type": "string"},
          "description": {"type": "string"},
          "description_in_item": {"type": "string"},
          "clientid": {"type": "string"},
          "date": {"type": "string", "format": "date"},
          "terms": {"type": "string"},
          "currency": {"type": "string"},
          "tax_id": {"type": "string"},
          "stripe_tax_id_2": {"type": "string"},
          "stripe_plan_id": {"type": "string"},
          "stripe_subscription_id": {"type": "string"},
          "tax_id_2": {"type": "string"},
          "next_billing_cycle": {"type": "string"},
          "ends_at": {"type": "string"},
          "status": {"type": "string"},
          "quantity": {"type": "string"},
          "project_id": {"type": "string"},
          "hash": {"type": "string"},
          "created": {"type": "string", "format": "date-time"},
          "created_from": {"type": "string"},
          "date_subscribed": {"type": "string", "format": "date-time"},
          "in_test_environment": {"type": "string"},
          "last_sent_at": {"type": "string", "format": "date-time"}
        }
      },
      "SubscriptionInput": {
        "type": "object",
        "required": ["name", "quantity", "next_billing_cycle", "currency", "clientid"],
        "properties": {
          "name": {"type": "string", "description": "Subscription Name (required)"},
          "description": {"type": "string", "description": "Detailed description of the subscription"},
          "description_in_item": {"type": "integer", "description": "Indicates if the description is included in the item (1 or 0)"},
          "clientid": {"type": "integer", "description": "Client ID (required)"},
          "date": {"type": "string", "format": "date", "description": "Subscription start date (YYYY-MM-DD)"},
          "terms": {"type": "string", "description": "Subscription terms"},
          "currency": {"type": "integer", "description": "Currency ID (required)"},
          "tax_id": {"type": "integer", "description": "Tax ID"},
          "stripe_tax_id_2": {"type": "string", "description": "Stripe tax ID"},
          "stripe_plan_id": {"type": "string", "description": "Stripe plan ID"},
          "stripe_subscription_id": {"type": "string", "description": "Stripe Subscription ID"},
          "tax_id_2": {"type": "integer", "description": "Second tax ID"},
          "next_billing_cycle": {"type": "integer", "description": "Next billing cycle timestamp (required)"},
          "ends_at": {"type": "integer", "description": "Subscription end timestamp"},
          "status": {"type": "string", "description": "Subscription status (e.g., active)"},
          "quantity": {"type": "integer", "description": "Subscription quantity (required)"},
          "project_id": {"type": "integer", "description": "Associated project ID"},
          "hash": {"type": "string", "description": "Unique hash identifier"},
          "created": {"type": "string", "format": "date-time", "description": "Creation timestamp (YYYY-MM-DD HH:MM:SS)"},
          "created_from": {"type": "integer", "description": "ID of the creator"},
          "date_subscribed": {"type": "string", "format": "date-time", "description": "Subscription date (YYYY-MM-DD HH:MM:SS)"},
          "in_test_environment": {"type": "integer", "description": "Indicates if the subscription is in a test environment (1 or 0)"},
          "last_sent_at": {"type": "string", "format": "date-time", "description": "Last sent timestamp (YYYY-MM-DD HH:MM:SS)"}
        }
      },
      "Timesheet": {
        "type": "object",
        "properties": {
          "id": {"type": "string"},
          "task_id": {"type": "string"},
          "start_time": {"type": "string", "format": "time"},
          "end_time": {"type": "string", "format": "time"},
          "staff_id": {"type": "string"},
          "hourly_rate": {"type": "string"},
          "note": {"type": "string"}
        }
      },
      "TimesheetInput": {
        "type": "object",
        "required": ["task_id", "start_time", "end_time", "staff_id", "hourly_rate", "note"],
        "properties": {
          "task_id": {"type": "string", "description": "Task ID (required)"},
          "start_time": {"type": "string", "format": "time", "description": "Start Time (required, format: HH:MM:SS)"},
          "end_time": {"type": "string", "format": "time", "description": "End Time (required, format: HH:MM:SS)"},
          "staff_id": {"type": "string", "description": "Staff Member ID (required)"},
          "hourly_rate": {"type": "string", "description": "Time (h) (required)"},
          "note": {"type": "string", "description": "Note (required)"}
        }
      },
      "Contract": {
        "type": "object",
        "properties": {
          "id": {"type": "integer"},
          "subject": {"type": "string"},
          "description": {"type": "string"},
          "clientid": {"type": "integer"},
          "date": {"type": "string", "format": "date"},
          "duedate": {"type": "string", "format": "date"},
          "contract_value": {"type": "number"},
          "currency": {"type": "integer"},
          "status": {"type": "integer"}
        }
      },
      "ContractInput": {
        "type": "object",
        "required": ["subject", "clientid", "date", "duedate"],
        "properties": {
          "subject": {"type": "string"},
          "description": {"type": "string"},
          "clientid": {"type": "integer"},
          "date": {"type": "string", "format": "date"},
          "duedate": {"type": "string", "format": "date"},
          "contract_value": {"type": "number"},
          "currency": {"type": "integer"},
          "status": {"type": "integer"}
        }
      }
    }
  }
}
