{
  "openapi": "3.1.0",
  "info": {
    "title": "Ficha.Work API",
    "version": "1.0.0",
    "summary": "Public read-only API for Ficha.Work plans and prices.",
    "description": "Ficha.Work is time-tracking and workday-registration software for companies in Spain. This public API is anonymous and read-only: it returns the plans and calculates the monthly price for a number of active users. It does not expose customer data and needs no API key or login. The same information is available through the MCP server at https://www.ficha.work/mcp.",
    "contact": {
      "name": "Ficha.Work",
      "email": "ayuda@ficha.work",
      "url": "https://www.ficha.work/en/developers"
    },
    "termsOfService": "https://www.ficha.work/es/terminos"
  },
  "externalDocs": {
    "description": "Ficha.Work API and MCP server",
    "url": "https://www.ficha.work/en/developers"
  },
  "servers": [
    {
      "url": "https://www.ficha.work",
      "description": "Production"
    }
  ],
  "security": [],
  "tags": [
    {
      "name": "Pricing",
      "description": "Plans and monthly price."
    }
  ],
  "paths": {
    "/api/v1/plans": {
      "get": {
        "operationId": "listPlans",
        "tags": [
          "Pricing"
        ],
        "summary": "List plans and what every plan includes",
        "description": "Company and consultancy plans, prices per user per month (VAT excluded), what is included, NFC base price, free-trial terms and links. Pass `plan` to get only that plan.",
        "security": [],
        "parameters": [
          {
            "name": "plan",
            "in": "query",
            "required": false,
            "description": "Return only this plan: \"company\" or \"consulting\". Default: both.",
            "schema": {
              "type": "string",
              "enum": [
                "company",
                "consulting"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Plans overview",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlansOverview"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/price": {
      "get": {
        "operationId": "calculatePrice",
        "tags": [
          "Pricing"
        ],
        "summary": "Calculate the monthly price",
        "description": "Monthly price for a number of active users and a plan, with 21 % Spanish VAT. The consultancy plan bills at least 50 users.",
        "security": [],
        "parameters": [
          {
            "name": "users",
            "in": "query",
            "required": true,
            "description": "Number of active users (workers + managers + the owner/admin).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100000
            },
            "example": 12
          },
          {
            "name": "plan",
            "in": "query",
            "required": false,
            "description": "\"company\" (1 €/user/month) or \"consulting\" for payroll advisors (0,80 €/user/month, 50-user minimum). Default: company.",
            "schema": {
              "type": "string",
              "enum": [
                "company",
                "consulting"
              ],
              "default": "company"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Price quote",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceQuote"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Plan": {
        "type": "object",
        "required": [
          "plan",
          "name",
          "pricePerUserMonthEur",
          "vatRate"
        ],
        "properties": {
          "plan": {
            "type": "string",
            "enum": [
              "company",
              "consulting"
            ]
          },
          "name": {
            "type": "string"
          },
          "pricePerUserMonthEur": {
            "type": "number",
            "examples": [
              1
            ]
          },
          "vatRate": {
            "type": "number",
            "examples": [
              0.21
            ]
          },
          "minimumUsers": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Minimum billed users; null when there is no minimum."
          },
          "lockIn": {
            "type": "boolean"
          },
          "for": {
            "type": "string"
          }
        }
      },
      "PlansOverview": {
        "type": "object",
        "required": [
          "product",
          "plans"
        ],
        "properties": {
          "product": {
            "type": "string"
          },
          "plans": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Plan"
            }
          },
          "allFeaturesInEveryPlan": {
            "type": "boolean"
          },
          "included": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "nfcBases": {
            "type": "object",
            "properties": {
              "priceEur": {
                "type": "number"
              },
              "oneTime": {
                "type": "boolean"
              },
              "vatAndShippingIncluded": {
                "type": "boolean"
              },
              "deliveryWorkingDays": {
                "type": "string"
              }
            }
          },
          "trial": {
            "type": "object",
            "properties": {
              "days": {
                "type": "integer"
              },
              "paymentMethodRequired": {
                "type": "boolean"
              },
              "chargedFromDay": {
                "type": "integer"
              },
              "cancelBeforeAtNoCost": {
                "type": "boolean"
              }
            }
          },
          "paymentMethods": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "billing": {
            "type": "string"
          },
          "support": {
            "type": "string"
          },
          "compliance": {
            "type": "string"
          },
          "links": {
            "type": "object",
            "properties": {
              "signup": {
                "type": "string",
                "format": "uri"
              },
              "pricing": {
                "type": "string",
                "format": "uri"
              },
              "pricingMarkdown": {
                "type": "string",
                "format": "uri"
              },
              "contact": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      },
      "PriceQuote": {
        "type": "object",
        "required": [
          "plan",
          "requestedUsers",
          "billedUsers",
          "pricePerUserEur",
          "subtotalEur",
          "vatRate",
          "vatEur",
          "totalEur",
          "currency",
          "billing"
        ],
        "properties": {
          "plan": {
            "type": "string",
            "enum": [
              "company",
              "consulting"
            ]
          },
          "requestedUsers": {
            "type": "integer"
          },
          "billedUsers": {
            "type": "integer"
          },
          "pricePerUserEur": {
            "type": "number"
          },
          "subtotalEur": {
            "type": "number"
          },
          "vatRate": {
            "type": "number"
          },
          "vatEur": {
            "type": "number"
          },
          "totalEur": {
            "type": "number"
          },
          "currency": {
            "type": "string",
            "const": "EUR"
          },
          "billing": {
            "type": "string",
            "const": "monthly"
          },
          "notes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "signupUrl": {
            "type": "string",
            "format": "uri"
          },
          "pricingPage": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  }
}