{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/upgrowth-dz/json-schema/upgrowth-dz-legal-form-schema.json",
  "title": "LegalForm",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/upgrowth-dz-openapi.yml#/components/schemas/LegalForm",
  "type": "object",
  "required": [
    "code",
    "name",
    "steps"
  ],
  "properties": {
    "code": {
      "type": "string",
      "description": "For example SARL, EURL or SPA."
    },
    "name": {
      "type": "string",
      "description": "The name of the form, in the language of the request."
    },
    "associates": {
      "type": "object",
      "properties": {
        "min": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Fewest partners."
        },
        "max": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Most partners, null when there is no limit."
        },
        "note": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "capital": {
      "type": "object",
      "properties": {
        "min_capital_dzd": {
          "type": [
            "integer",
            "null"
          ],
          "description": "The legal minimum, null when the law fixes none."
        },
        "usual_capital_dzd": {
          "type": [
            "integer",
            "null"
          ],
          "description": "The capital usually asked in practice: an observation, not a legal rule."
        },
        "public_offering_capital_dzd": {
          "type": [
            "integer",
            "null"
          ],
          "description": "The minimum for a company that makes a public offering."
        },
        "min_capital_tnd": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Tunisia: the legal minimum in dinars, null when the law fixes none."
        },
        "public_offering_capital_tnd": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Tunisia: the minimum in dinars for a company that makes a public offering."
        },
        "min_capital_mad": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Morocco: the legal minimum in dirhams, null when the law fixes none."
        },
        "public_offering_capital_mad": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Morocco: the minimum in dirhams for a company that makes a public offering."
        },
        "note": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "steps": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/FeeStep"
      }
    },
    "published_fees_total": {
      "type": "object",
      "properties": {
        "min_dzd": {
          "type": [
            "integer",
            "null"
          ]
        },
        "max_dzd": {
          "type": [
            "integer",
            "null"
          ]
        },
        "scope_note": {
          "type": [
            "string",
            "null"
          ],
          "description": "What the total covers."
        },
        "excludes": {
          "type": [
            "string",
            "null"
          ],
          "description": "What it leaves out."
        }
      }
    },
    "liability": {
      "type": [
        "string",
        "null"
      ],
      "description": "Tunisia and Morocco: who bears the losses and how far."
    },
    "legal_basis": {
      "type": [
        "string",
        "null"
      ],
      "description": "Tunisia and Morocco: the law and articles the form comes from."
    },
    "registration_effect": {
      "type": [
        "string",
        "null"
      ],
      "description": "Tunisia and Morocco: what the registration gives the company."
    },
    "source": {
      "anyOf": [
        {
          "$ref": "#/$defs/SourceRef"
        },
        {
          "type": "null"
        }
      ],
      "description": "Tunisia and Morocco: the official page or text the form was read in."
    }
  },
  "$defs": {
    "FeeStep": {
      "type": "object",
      "required": [
        "step",
        "fee",
        "priced"
      ],
      "properties": {
        "step": {
          "type": "string",
          "description": "The creation step."
        },
        "fee": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "dzd": {
                  "type": "integer",
                  "description": "The fee in dinars."
                },
                "dzd_electronic": {
                  "type": "integer",
                  "description": "The fee when paid electronically."
                },
                "dzd_min": {
                  "type": "integer",
                  "description": "The lowest fee, when it depends on the case."
                },
                "dzd_max": {
                  "type": "integer",
                  "description": "The highest fee, when it depends on the case."
                },
                "tnd": {
                  "type": "integer",
                  "description": "Tunisia: the fee in dinars."
                },
                "tnd_electronic": {
                  "type": "integer",
                  "description": "Tunisia: the fee in dinars when the procedure is carried out electronically."
                },
                "tnd_min": {
                  "type": "integer",
                  "description": "Tunisia: the lowest fee in dinars, when it depends on the case."
                },
                "tnd_max": {
                  "type": "integer",
                  "description": "Tunisia: the highest fee in dinars, when it depends on the case."
                },
                "mad": {
                  "type": "integer",
                  "description": "Morocco: the fee in dirhams."
                }
              }
            },
            {
              "type": "null"
            }
          ],
          "description": "The fee the State fixes, null when no text fixes one."
        },
        "priced": {
          "type": "boolean",
          "description": "False for a third-party price that no text fixes, such as the notary or the bank: it carries no amount on purpose."
        },
        "delay": {
          "type": [
            "string",
            "null"
          ],
          "description": "Tunisia and Morocco: the official delay of the step, when a page states one."
        },
        "documents": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Tunisia and Morocco: the documents the step asks for."
        },
        "source": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "$ref": "#/$defs/SourceRef"
            },
            {
              "type": "null"
            }
          ],
          "description": "The official text the fee comes from: a reference for Algeria, the official page for Tunisia and Morocco."
        },
        "note": {
          "type": [
            "string",
            "null"
          ],
          "description": "A note on the step, in French for Algeria, in the language of the request for Tunisia and Morocco."
        }
      }
    },
    "SourceRef": {
      "type": "object",
      "required": [
        "url",
        "title",
        "retrieved"
      ],
      "properties": {
        "url": {
          "type": "string",
          "description": "The official page the record was read on.",
          "format": "uri"
        },
        "title": {
          "type": "string",
          "description": "What the page is."
        },
        "retrieved": {
          "type": "string",
          "description": "The day the page was read, as YYYY-MM-DD."
        }
      }
    }
  }
}