{
  "openapi": "3.0.3",
  "info": {
    "title": "Latea API",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://latea.strangeskills.com/api"
    }
  ],
  "paths": {
    "/auth": {
      "post": {
        "tags": [
          "Auth",
          "Users"
        ],
        "summary": "Authenticate",
        "operationId": "users-authentication",
        "requestBody": {
          "description": "Authentication data",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/UsernamePassword"
                  },
                  {
                    "$ref": "#/components/schemas/FBAuth"
                  },
                  {
                    "$ref": "#/components/schemas/GoogleAuth"
                  },
                  {
                    "$ref": "#/components/schemas/AppleAuth"
                  },
                  {
                    "$ref": "#/components/schemas/FallbackAuth"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Success."
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/auth/logout": {
      "post": {
        "tags": [
          "Auth",
          "Users"
        ],
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "Logout",
        "operationId": "users-authentication-logout",
        "responses": {
          "204": {
            "description": "Success."
          }
        }
      }
    },
    "/auth/password": {
      "put": {
        "tags": [
          "Auth",
          "Users"
        ],
        "summary": "Change Password",
        "operationId": "users-change-password",
        "requestBody": {
          "description": "Password Change Data",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "password",
                  "newpassword"
                ],
                "properties": {
                  "password": {
                    "type": "string"
                  },
                  "newpassword": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Success."
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/auth/recover": {
      "post": {
        "tags": [
          "Auth",
          "Users"
        ],
        "summary": "Request password recovery",
        "operationId": "users-password-recover",
        "requestBody": {
          "description": "Recovery request",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasswordRecoverRequest"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Success."
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/auth/recover/confirm": {
      "post": {
        "tags": [
          "Auth",
          "Users"
        ],
        "summary": "Confirm password recovery",
        "operationId": "users-password-recover-confirm",
        "requestBody": {
          "description": "Recovery confirmation",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasswordRecoverConfirm"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Success."
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/auth/user": {
      "get": {
        "tags": [
          "Auth",
          "Users"
        ],
        "summary": "Authentication",
        "operationId": "users-authentication-data",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Auth data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "type",
                    "organizations",
                    "organizationId"
                  ],
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "name": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "user",
                        "superadmin"
                      ]
                    },
                    "organizations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "organizationId"
                        ],
                        "properties": {
                          "organizationId": {
                            "type": "number"
                          }
                        }
                      }
                    },
                    "organizationId": {
                      "type": "number"
                    },
                    "apps": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/generic/countries": {
      "get": {
        "tags": [
          "Generic",
          "Countries"
        ],
        "summary": "Get countries",
        "operationId": "countries",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Countries information list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Country"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/latea/documents": {
      "get": {
        "tags": [
          "Document"
        ],
        "summary": "Get documents",
        "operationId": "documents",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "field",
            "in": "query",
            "required": true,
            "description": "Document prop",
            "schema": {
              "type": "string",
              "enum": [
                "serieName",
                "documentType",
                "date",
                "entityId",
                "entityName",
                "entityTaxNumber",
                "datetime"
              ]
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": true,
            "description": "Sort order",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": true,
            "description": "Split offset",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": true,
            "description": "List limit",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Search condition",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "startDate",
            "in": "query",
            "required": false,
            "description": "Filter by start date",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "required": false,
            "description": "Filter by end date",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "documentType",
            "in": "query",
            "required": false,
            "description": "Filter by document type",
            "schema": {
              "type": "string",
              "enum": [
                "I",
                "SI",
                "IR",
                "CN",
                "RC",
                "TG",
                "PU"
              ]
            }
          },
          {
            "name": "year",
            "in": "query",
            "required": false,
            "description": "Filter by year",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "description": "Response format",
            "schema": {
              "type": "string",
              "enum": [
                "xlsx"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Document meta information.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "list",
                    "count"
                  ],
                  "properties": {
                    "list": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/DocumentMeta"
                      }
                    },
                    "count": {
                      "type": "number"
                    }
                  }
                }
              },
              "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Document"
        ],
        "summary": "Put document",
        "operationId": "put-document",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "description": "Document information",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "entityName",
                  "entityTaxNumber",
                  "date",
                  "lines"
                ],
                "properties": {
                  "reference": {
                    "type": "string",
                    "pattern": "^(?!AT)(?!.*[._-]{2,})[A-Za-z0-9][A-Za-z0-9._-]{0,32}[A-Za-z0-9]\\/[0-9]*$",
                    "nullable": true
                  },
                  "uniqueExternalRef": {
                    "type": "string",
                    "nullable": true
                  },
                  "entityId": {
                    "type": "number"
                  },
                  "entityName": {
                    "type": "string"
                  },
                  "date": {
                    "type": "string",
                    "format": "date"
                  },
                  "dueDate": {
                    "type": "string",
                    "format": "date"
                  },
                  "duplicatedDate": {
                    "type": "string",
                    "format": "date"
                  },
                  "discountPercentage": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 100
                  },
                  "entityTaxNumber": {
                    "type": "string"
                  },
                  "address": {
                    "type": "object",
                    "required": [
                      "addressDetail",
                      "postalCode",
                      "city",
                      "country"
                    ],
                    "properties": {
                      "addressDetail": {
                        "type": "string"
                      },
                      "postalCode": {
                        "type": "string"
                      },
                      "city": {
                        "type": "string"
                      },
                      "country": {
                        "$ref": "#/components/schemas/CountryCode"
                      }
                    }
                  },
                  "serieId": {
                    "type": "number",
                    "nullable": true
                  },
                  "serieName": {
                    "type": "string",
                    "nullable": true
                  },
                  "documentType": {
                    "type": "string",
                    "enum": [
                      "I",
                      "SI",
                      "IR",
                      "CN",
                      "RC",
                      "TG",
                      "PU"
                    ]
                  },
                  "taxExemptionId": {
                    "type": "number"
                  },
                  "observations": {
                    "type": "string"
                  },
                  "movementStartDate": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "movementEndDate": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "fromAddress": {
                    "type": "object",
                    "required": [
                      "addressDetail",
                      "postalCode",
                      "city",
                      "country"
                    ],
                    "properties": {
                      "addressDetail": {
                        "type": "string"
                      },
                      "postalCode": {
                        "type": "string"
                      },
                      "city": {
                        "type": "string"
                      },
                      "country": {
                        "$ref": "#/components/schemas/CountryCode"
                      }
                    }
                  },
                  "toAddress": {
                    "type": "object",
                    "required": [
                      "addressDetail",
                      "postalCode",
                      "city",
                      "country"
                    ],
                    "properties": {
                      "addressDetail": {
                        "type": "string"
                      },
                      "postalCode": {
                        "type": "string"
                      },
                      "city": {
                        "type": "string"
                      },
                      "country": {
                        "$ref": "#/components/schemas/CountryCode"
                      }
                    }
                  },
                  "lines": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "object",
                      "required": [
                        "id",
                        "description",
                        "productType",
                        "quantity",
                        "price"
                      ],
                      "properties": {
                        "id": {
                          "type": "number"
                        },
                        "productId": {
                          "type": "number"
                        },
                        "description": {
                          "type": "string"
                        },
                        "productType": {
                          "type": "string",
                          "enum": [
                            "product",
                            "service",
                            "document_receipt"
                          ]
                        },
                        "quantity": {
                          "type": "number",
                          "minimum": 0.00001
                        },
                        "price": {
                          "type": "number",
                          "minimum": 0.00001
                        },
                        "discountValue": {
                          "type": "number",
                          "minimum": 0
                        },
                        "discountPercentage": {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 100
                        },
                        "taxId": {
                          "type": "number"
                        },
                        "taxRegionId": {
                          "type": "number"
                        },
                        "forcedTotal": {
                          "type": "number",
                          "minimum": 0.00001
                        },
                        "refLineId": {
                          "type": "number"
                        },
                        "refDocumentId": {
                          "type": "number"
                        },
                        "refSerieId": {
                          "type": "number"
                        }
                      }
                    }
                  }
                },
                "oneOf": [
                  {
                    "required": [
                      "serieId"
                    ]
                  },
                  {
                    "required": [
                      "documentType"
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Document information.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Document"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "description": "Optional structured details about the error. When `code` is `validation` and `message` is `referência externa já existe`, this identifies the document already using the submitted `uniqueExternalRef`.",
                      "properties": {
                        "id": {
                          "type": "number"
                        },
                        "serieId": {
                          "type": "number"
                        },
                        "date": {
                          "type": "string",
                          "format": "date"
                        },
                        "documentNumber": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/latea/documents/at/communicate": {
      "post": {
        "tags": [
          "Document",
          "AT"
        ],
        "summary": "Communicate document to AT",
        "operationId": "document-communicate",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "description": "Document identification",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "serieId"
                ],
                "properties": {
                  "id": {
                    "type": "number"
                  },
                  "serieId": {
                    "type": "number"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Document communicated."
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/latea/documents/cancel": {
      "put": {
        "tags": [
          "Document"
        ],
        "summary": "Cancel document",
        "operationId": "document-cancel",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "description": "Document identification",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "serieId",
                  "cancelledMotive"
                ],
                "properties": {
                  "id": {
                    "type": "number"
                  },
                  "serieId": {
                    "type": "number"
                  },
                  "cancelledMotive": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Document cancelled."
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/latea/documents/document/{id}/serie/{serieId}": {
      "get": {
        "tags": [
          "Document"
        ],
        "summary": "Get document",
        "operationId": "get-document",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Document id",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "serieId",
            "in": "path",
            "required": true,
            "description": "Serie id",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "description": "Response format",
            "schema": {
              "type": "string",
              "enum": [
                "pdf",
                "json",
                "text"
              ]
            }
          },
          {
            "name": "mode",
            "in": "query",
            "required": false,
            "description": "Response mode",
            "schema": {
              "type": "string",
              "enum": [
                "A4",
                "POS"
              ]
            }
          },
          {
            "name": "template",
            "in": "query",
            "required": false,
            "description": "PDF template",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "originalOnly",
            "in": "query",
            "required": false,
            "description": "Original page only",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Document data.",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentWithMeta"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/latea/documents/summary": {
      "get": {
        "tags": [
          "Document"
        ],
        "summary": "Get document summary",
        "operationId": "documents-summary",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Document summary information.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "invoiced",
                    "invoicedCurrentYear",
                    "invoicedCurrentMonth",
                    "invoicedToday"
                  ],
                  "properties": {
                    "invoiced": {
                      "type": "object",
                      "required": [
                        "grossAmount",
                        "liquidAmount",
                        "taxAmount",
                        "taxTable"
                      ],
                      "properties": {
                        "grossAmount": {
                          "type": "number"
                        },
                        "liquidAmount": {
                          "type": "number"
                        },
                        "taxAmount": {
                          "type": "number"
                        },
                        "taxTable": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "taxPercentage",
                              "amount"
                            ],
                            "properties": {
                              "taxPercentage": {
                                "type": "number"
                              },
                              "amount": {
                                "type": "number"
                              }
                            }
                          }
                        }
                      }
                    },
                    "totalInvoicedCurrentYear": {
                      "type": "object",
                      "required": [
                        "grossAmount",
                        "liquidAmount",
                        "taxAmount",
                        "taxTable"
                      ],
                      "properties": {
                        "grossAmount": {
                          "type": "number"
                        },
                        "liquidAmount": {
                          "type": "number"
                        },
                        "taxAmount": {
                          "type": "number"
                        },
                        "taxTable": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "taxPercentage",
                              "amount"
                            ],
                            "properties": {
                              "taxPercentage": {
                                "type": "number"
                              },
                              "amount": {
                                "type": "number"
                              }
                            }
                          }
                        }
                      }
                    },
                    "totalInvoicedCurrentMonth": {
                      "type": "object",
                      "required": [
                        "grossAmount",
                        "liquidAmount",
                        "taxAmount",
                        "taxTable"
                      ],
                      "properties": {
                        "grossAmount": {
                          "type": "number"
                        },
                        "liquidAmount": {
                          "type": "number"
                        },
                        "taxAmount": {
                          "type": "number"
                        },
                        "taxTable": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "taxPercentage",
                              "amount"
                            ],
                            "properties": {
                              "taxPercentage": {
                                "type": "number"
                              },
                              "amount": {
                                "type": "number"
                              }
                            }
                          }
                        }
                      }
                    },
                    "totalInvoicedToday": {
                      "type": "object",
                      "required": [
                        "grossAmount",
                        "liquidAmount",
                        "taxAmount",
                        "taxTable"
                      ],
                      "properties": {
                        "grossAmount": {
                          "type": "number"
                        },
                        "liquidAmount": {
                          "type": "number"
                        },
                        "taxAmount": {
                          "type": "number"
                        },
                        "taxTable": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "taxPercentage",
                              "amount"
                            ],
                            "properties": {
                              "taxPercentage": {
                                "type": "number"
                              },
                              "amount": {
                                "type": "number"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/latea/entities": {
      "get": {
        "tags": [
          "Entity"
        ],
        "summary": "Get entities",
        "operationId": "list-entity",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "field",
            "in": "query",
            "required": true,
            "description": "Entity prop",
            "schema": {
              "type": "string",
              "enum": [
                "id",
                "name",
                "taxNumber"
              ]
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": true,
            "description": "Sort order",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": true,
            "description": "Split offset",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": true,
            "description": "List limit",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Search condition",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Entity information.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "list",
                    "count"
                  ],
                  "properties": {
                    "list": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Entity"
                      }
                    },
                    "count": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Entity"
        ],
        "summary": "Put entity",
        "operationId": "put-entity",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "description": "Entity information",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "taxNumber",
                  "type"
                ],
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "taxNumber": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "telephone": {
                    "type": "string"
                  },
                  "mobile": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "customer",
                      "supplier",
                      "both"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Entity information.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Entity"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Entity"
        ],
        "summary": "Update entity",
        "operationId": "update-entity",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "description": "Entity information",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/IdentifiedEntity"
                  },
                  {
                    "$ref": "#/components/schemas/NotIdentifiedEntity"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Entity information.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Entity"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/latea/entities/address": {
      "post": {
        "tags": [
          "Entity",
          "Address"
        ],
        "summary": "Put entity address",
        "operationId": "put-entity-address",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "description": "Entity Address information",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "addressDetail",
                  "postalCode",
                  "city",
                  "country"
                ],
                "properties": {
                  "addressDetail": {
                    "type": "string"
                  },
                  "postalCode": {
                    "type": "string"
                  },
                  "city": {
                    "type": "string"
                  },
                  "country": {
                    "$ref": "#/components/schemas/CountryCode"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Entity address information.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Address"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Entity",
          "Address"
        ],
        "summary": "Update entity address",
        "operationId": "update-entity-address",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "description": "Entity Address information",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "addressDetail",
                  "postalCode",
                  "city",
                  "country"
                ],
                "properties": {
                  "id": {
                    "type": "number"
                  },
                  "addressDetail": {
                    "type": "string"
                  },
                  "postalCode": {
                    "type": "string"
                  },
                  "city": {
                    "type": "string"
                  },
                  "country": {
                    "$ref": "#/components/schemas/CountryCode"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Entity address information.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Address"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/latea/entities/address/entity/{entityId}/id/{id}": {
      "delete": {
        "tags": [
          "Entity",
          "Address"
        ],
        "summary": "Delete entity address",
        "operationId": "delete-entity-address",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "entityId",
            "in": "path",
            "required": true,
            "description": "Entity id",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Address id",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Success"
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/latea/entities/id/{id}": {
      "get": {
        "tags": [
          "Entity"
        ],
        "summary": "Get entity",
        "operationId": "get-entity",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Entity id",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Entity information.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Entity"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Entity"
        ],
        "summary": "Delete entity",
        "operationId": "delete-entity",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Entity id",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Success."
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/latea/entities/id/{id}/addresses": {
      "get": {
        "tags": [
          "Entity",
          "Address"
        ],
        "summary": "Get entity addresses",
        "operationId": "get-entity-addreses",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Entity id",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Entity addresses information.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "list",
                    "count"
                  ],
                  "properties": {
                    "list": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Address"
                      }
                    },
                    "count": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/latea/exports/saft/{year}": {
      "get": {
        "tags": [
          "Exports",
          "SAFT"
        ],
        "summary": "Export a year's SAFT",
        "operationId": "export-saft-year",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "year",
            "in": "path",
            "required": true,
            "description": "Year",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Saft.",
            "content": {
              "application/xml": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/latea/exports/saft/{year}/{month}": {
      "get": {
        "tags": [
          "Exports",
          "SAFT"
        ],
        "summary": "Export SAFT",
        "operationId": "export-saft",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "year",
            "in": "path",
            "required": true,
            "description": "Year",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "month",
            "in": "path",
            "required": true,
            "description": "Month",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Saft.",
            "content": {
              "application/xml": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/latea/products": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "Get products",
        "operationId": "products",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "field",
            "in": "query",
            "required": true,
            "description": "Product prop",
            "schema": {
              "type": "string",
              "enum": [
                "reference",
                "description"
              ]
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": true,
            "description": "Sort order",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": true,
            "description": "Split offset",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": true,
            "description": "List limit",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Search condition",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Product meta information.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "list",
                    "count"
                  ],
                  "properties": {
                    "list": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ProductEditable"
                      }
                    },
                    "count": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Product"
        ],
        "summary": "Put product",
        "operationId": "put-product",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "description": "Product information",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "reference",
                  "description",
                  "taxId",
                  "type"
                ],
                "properties": {
                  "reference": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string",
                    "minLength": 2
                  },
                  "taxId": {
                    "type": "number"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "product",
                      "service"
                    ]
                  },
                  "controlStock": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Product information.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Product"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Product"
        ],
        "summary": "Update product",
        "operationId": "update-product",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "description": "Product information",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "reference",
                  "description",
                  "taxId",
                  "type"
                ],
                "properties": {
                  "id": {
                    "type": "number"
                  },
                  "reference": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string",
                    "minLength": 2
                  },
                  "taxId": {
                    "type": "number"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "product",
                      "service"
                    ]
                  },
                  "controlStock": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Product information.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Product"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/latea/products/forline": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "Get products for line",
        "operationId": "products-for-line",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "field",
            "in": "query",
            "required": true,
            "description": "Product prop",
            "schema": {
              "type": "string",
              "enum": [
                "reference",
                "description"
              ]
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": true,
            "description": "Sort order",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": true,
            "description": "Split offset",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": true,
            "description": "List limit",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Search condition",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Product line information.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "list",
                    "count"
                  ],
                  "properties": {
                    "list": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ProductForLine"
                      }
                    },
                    "count": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/latea/products/id/{id}": {
      "get": {
        "tags": [
          "Product"
        ],
        "summary": "Get product",
        "operationId": "product",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Product id",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Product information.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Product"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Product"
        ],
        "summary": "Delete product",
        "operationId": "delete-product",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Product id",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Success"
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/latea/products/info": {
      "post": {
        "tags": [
          "Product"
        ],
        "summary": "Get info for products",
        "operationId": "products-info",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "description": "Product IDs to query info for",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "productIds"
                ],
                "properties": {
                  "productIds": {
                    "type": "array",
                    "items": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Product information.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "productId",
                      "reference",
                      "type",
                      "controlStock",
                      "stock"
                    ],
                    "properties": {
                      "productId": {
                        "type": "number"
                      },
                      "reference": {
                        "type": "string"
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "product",
                          "service"
                        ]
                      },
                      "controlStock": {
                        "type": "boolean"
                      },
                      "stock": {
                        "type": "number",
                        "nullable": true
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/latea/regions": {
      "get": {
        "tags": [
          "Tax",
          "Regions"
        ],
        "summary": "Get regions",
        "operationId": "regions",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Region information.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "list",
                    "count"
                  ],
                  "properties": {
                    "list": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Region"
                      }
                    },
                    "count": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/latea/series": {
      "get": {
        "tags": [
          "Serie"
        ],
        "summary": "Get series",
        "operationId": "series",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "active",
            "in": "query",
            "description": "Filter by active status",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "documentType",
            "in": "query",
            "description": "Filter by document type",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "SI",
                "I",
                "IR",
                "TG",
                "CN",
                "RC",
                "PU"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Serie meta information.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "list",
                    "count"
                  ],
                  "properties": {
                    "list": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Serie"
                      }
                    },
                    "count": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Serie"
        ],
        "summary": "Create serie",
        "operationId": "create-serie",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "description": "Serie information",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "documentType",
                  "manual",
                  "duplicated",
                  "active"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 35,
                    "pattern": "^(?!AT)(?!.*[._-]{2,})[A-Za-z0-9][A-Za-z0-9._-]{0,32}[A-Za-z0-9]$"
                  },
                  "documentType": {
                    "type": "string",
                    "enum": [
                      "SI",
                      "I",
                      "IR",
                      "TG",
                      "CN",
                      "RC",
                      "PU"
                    ]
                  },
                  "manual": {
                    "type": "boolean"
                  },
                  "duplicated": {
                    "type": "boolean"
                  },
                  "atcud": {
                    "type": "string",
                    "minLength": 8,
                    "maxLength": 100,
                    "pattern": "^(?=(?:[^AEIOU01]*[A-Z0-9]){8})(?!.*[AEIOU01]).{8,}$"
                  },
                  "active": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Serie information.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Serie"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Serie"
        ],
        "summary": "Update serie",
        "operationId": "update-serie",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "description": "Serie information",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "active"
                ],
                "properties": {
                  "id": {
                    "type": "number"
                  },
                  "active": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Serie information.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Serie"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/latea/series/id/{id}": {
      "delete": {
        "tags": [
          "Serie"
        ],
        "summary": "Delete serie",
        "operationId": "delete-serie",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Serie id",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Success"
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/latea/taxes": {
      "get": {
        "tags": [
          "Tax"
        ],
        "summary": "Get taxes",
        "operationId": "taxes",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Taxes information.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TaxMeta"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Tax"
        ],
        "summary": "Put tax",
        "operationId": "put-tax",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "description": "Tax information",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "code",
                  "description",
                  "active"
                ],
                "properties": {
                  "code": {
                    "type": "string",
                    "enum": [
                      "NOR",
                      "INT",
                      "RED",
                      "ISE"
                    ]
                  },
                  "description": {
                    "type": "string"
                  },
                  "active": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Tax information.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaxMeta"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Tax"
        ],
        "summary": "Update tax",
        "operationId": "update-tax",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "description": "Tax information",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "code",
                  "description",
                  "active"
                ],
                "properties": {
                  "id": {
                    "type": "number"
                  },
                  "code": {
                    "type": "string",
                    "enum": [
                      "NOR",
                      "INT",
                      "RED",
                      "ISE"
                    ]
                  },
                  "description": {
                    "type": "string"
                  },
                  "active": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tax information.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaxMeta"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/latea/taxes/id/{id}": {
      "get": {
        "tags": [
          "Tax"
        ],
        "summary": "Get tax",
        "operationId": "tax",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Tax id",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Tax information.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Tax"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Tax"
        ],
        "summary": "Delete tax",
        "operationId": "delete-tax",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Tax id",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Success."
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/latea/taxes/regions": {
      "put": {
        "tags": [
          "Tax",
          "Region"
        ],
        "summary": "Update tax region",
        "operationId": "update-tax-region",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "description": "Tax regions information",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "taxId",
                  "regions"
                ],
                "properties": {
                  "taxId": {
                    "type": "number"
                  },
                  "regions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "regionId",
                        "startDate",
                        "taxPercentage"
                      ],
                      "properties": {
                        "startDate": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "endDate": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "taxPercentage": {
                          "type": "number"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tax regions information.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "taxId",
                    "regions"
                  ],
                  "properties": {
                    "taxId": {
                      "type": "number"
                    },
                    "regions": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TaxRegion"
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/latea/taxexemptions": {
      "get": {
        "tags": [
          "Tax"
        ],
        "summary": "Get tax exemptions",
        "operationId": "tax-exemptions",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Tax exemptions information.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TaxExemption"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/organizations": {
      "get": {
        "tags": [
          "Organizations"
        ],
        "summary": "Get organization",
        "operationId": "get-organization",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Organization information.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Organization"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Organizations"
        ],
        "summary": "Create organization",
        "operationId": "create-organization",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          },
          {}
        ],
        "requestBody": {
          "description": "User information",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "taxNumber",
                  "email",
                  "password",
                  "app"
                ],
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "taxNumber": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "password": {
                    "type": "string"
                  },
                  "address": {
                    "type": "object",
                    "required": [
                      "addressDetail",
                      "postalCode",
                      "city",
                      "country"
                    ],
                    "properties": {
                      "addressDetail": {
                        "type": "string"
                      },
                      "postalCode": {
                        "type": "string"
                      },
                      "city": {
                        "type": "string"
                      },
                      "country": {
                        "$ref": "#/components/schemas/CountryCode"
                      }
                    }
                  },
                  "key": {
                    "type": "string"
                  },
                  "app": {
                    "type": "string",
                    "enum": [
                      "latea",
                      "barn",
                      "ressivo"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Organization information.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Organization"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Organizations"
        ],
        "summary": "Update organization",
        "operationId": "update-organization",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "description": "User information",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "name",
                  "taxNumber",
                  "email"
                ],
                "properties": {
                  "id": {
                    "type": "number"
                  },
                  "name": {
                    "type": "string"
                  },
                  "taxNumber": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "address": {
                    "type": "object",
                    "required": [
                      "addressDetail",
                      "postalCode",
                      "city",
                      "country"
                    ],
                    "properties": {
                      "id": {
                        "type": "number"
                      },
                      "addressDetail": {
                        "type": "string"
                      },
                      "postalCode": {
                        "type": "string"
                      },
                      "city": {
                        "type": "string"
                      },
                      "country": {
                        "$ref": "#/components/schemas/CountryCode"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Organization information.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Organization"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/organizations/all": {
      "get": {
        "tags": [
          "Organizations"
        ],
        "summary": "Get all organizations (superadmin only)",
        "operationId": "get-organizations",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "description": "Search by name or email",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Max results (default 20, max 50)",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Organization list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "number"
                      },
                      "name": {
                        "type": "string"
                      },
                      "email": {
                        "type": "string"
                      },
                      "taxNumber": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/organizations/configuration": {
      "get": {
        "tags": [
          "Organizations"
        ],
        "summary": "Get organization configuration",
        "operationId": "get-organization-configuration",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Organization configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "organizationId": {
                      "type": "number"
                    },
                    "atUsername": {
                      "type": "string",
                      "nullable": true
                    },
                    "atPassword": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Organizations"
        ],
        "summary": "Update organization configuration",
        "operationId": "update-organization-configuration",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "description": "Configuration information",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "atUsername",
                  "atPassword"
                ],
                "properties": {
                  "atUsername": {
                    "type": "string"
                  },
                  "atPassword": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Organization configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "organizationId": {
                      "type": "number"
                    },
                    "atUsername": {
                      "type": "string",
                      "nullable": true
                    },
                    "atPassword": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/organizations/logo": {
      "put": {
        "tags": [
          "Organizations"
        ],
        "summary": "Update organization logo",
        "operationId": "update-organization-logo",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "description": "User information",
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Organization information.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Organization"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/organizations/{id}": {
      "delete": {
        "tags": [
          "Organizations"
        ],
        "summary": "Delete organization",
        "operationId": "delete-organization",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Organization id",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Success."
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/subscriptions": {
      "post": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Create subscription",
        "operationId": "create-subscription",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "description": "Subscription information",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "app",
                  "name"
                ],
                "properties": {
                  "app": {
                    "type": "string",
                    "enum": [
                      "barn",
                      "latea",
                      "ressivo"
                    ]
                  },
                  "name": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Subscription information.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "paymentStripeId",
                    "paymentURL"
                  ],
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "paymentStripeId": {
                      "type": "string"
                    },
                    "paymentURL": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/subscriptions/app-plans": {
      "get": {
        "tags": [
          "Plans"
        ],
        "summary": "Get active app plans for organizations",
        "operationId": "get-app-plans-for-org",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "app",
            "in": "query",
            "required": true,
            "description": "App name",
            "schema": {
              "type": "string",
              "enum": [
                "barn",
                "latea",
                "ressivo"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of active plans for the app",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Plan"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error"
          }
        }
      }
    },
    "/subscriptions/entity": {
      "get": {
        "tags": [
          "Customer Subscriptions"
        ],
        "summary": "Get entity subscriptions",
        "operationId": "get-entity-subscriptions",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "entityId",
            "in": "query",
            "description": "Filter by entity ID",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "planId",
            "in": "query",
            "description": "Filter by plan ID",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter by status",
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "active",
                "cancelled",
                "past_due",
                "paused"
              ]
            }
          },
          {
            "name": "search",
            "in": "query",
            "description": "Search by entity or plan name",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of entity subscriptions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/EntitySubscription"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Customer Subscriptions"
        ],
        "summary": "Create an entity subscription",
        "operationId": "create-entity-subscription",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "planId",
                  "entityId"
                ],
                "properties": {
                  "planId": {
                    "type": "integer"
                  },
                  "entityId": {
                    "type": "integer"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created subscription",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer"
                    },
                    "stripeSubscriptionId": {
                      "type": "string"
                    },
                    "clientSecret": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/subscriptions/entity/{id}": {
      "get": {
        "tags": [
          "Customer Subscriptions"
        ],
        "summary": "Get an entity subscription",
        "operationId": "get-entity-subscription",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Subscription ID",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Entity subscription",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EntitySubscription"
                }
              }
            }
          }
        }
      }
    },
    "/subscriptions/entity/{id}/cancel": {
      "post": {
        "tags": [
          "Customer Subscriptions"
        ],
        "summary": "Cancel an entity subscription",
        "operationId": "cancel-entity-subscription",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Subscription ID",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Subscription cancelled"
          }
        }
      }
    },
    "/subscriptions/entity/{id}/pause": {
      "post": {
        "tags": [
          "Customer Subscriptions"
        ],
        "summary": "Pause an entity subscription",
        "operationId": "pause-entity-subscription",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Subscription ID",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Subscription paused"
          }
        }
      }
    },
    "/subscriptions/entity/{id}/resume": {
      "post": {
        "tags": [
          "Customer Subscriptions"
        ],
        "summary": "Resume an entity subscription",
        "operationId": "resume-entity-subscription",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Subscription ID",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Subscription resumed"
          }
        }
      }
    },
    "/subscriptions/organization/{id}/cancel": {
      "post": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Cancel organization subscription at period end",
        "operationId": "cancel-organization-subscription",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Subscription ID",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Subscription cancellation scheduled"
          }
        }
      }
    },
    "/subscriptions/organization/{id}/change-plan": {
      "post": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Change organization subscription plan",
        "operationId": "change-organization-subscription-plan",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Subscription ID",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "planId"
                ],
                "properties": {
                  "planId": {
                    "type": "integer"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Subscription updated"
          }
        }
      }
    },
    "/subscriptions/organization/{id}/resume": {
      "post": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Resume organization subscription cancellation",
        "operationId": "resume-organization-subscription",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Subscription ID",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Subscription resumed"
          }
        }
      }
    },
    "/subscriptions/public/app-plans": {
      "get": {
        "tags": [
          "Plans"
        ],
        "summary": "Get public app plans",
        "operationId": "get-public-app-plans",
        "parameters": [
          {
            "name": "app",
            "in": "query",
            "required": true,
            "description": "App name",
            "schema": {
              "type": "string",
              "enum": [
                "barn",
                "latea",
                "ressivo"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of active plans for the app",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Plan"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error"
          }
        }
      }
    },
    "/subscriptions/{app}": {
      "get": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Get subscription",
        "operationId": "subscription",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "app",
            "in": "path",
            "required": true,
            "description": "App name",
            "schema": {
              "type": "string",
              "enum": [
                "barn",
                "latea",
                "ressivo"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Subscription meta information.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Subscription"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/users": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Get users",
        "operationId": "get-users",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "User information.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/User"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Users"
        ],
        "summary": "Create user",
        "operationId": "create-user",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "description": "User information",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "username",
                  "password"
                ],
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "username": {
                    "type": "string"
                  },
                  "password": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "User information.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/User"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Users"
        ],
        "summary": "Update user",
        "operationId": "update-user",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "description": "User information",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "name",
                  "username",
                  "password"
                ],
                "properties": {
                  "id": {
                    "type": "number"
                  },
                  "name": {
                    "type": "string"
                  },
                  "username": {
                    "type": "string"
                  },
                  "password": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "User information.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/User"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/users/apikeys": {
      "get": {
        "tags": [
          "Users",
          "API Keys"
        ],
        "summary": "Get user api keys",
        "operationId": "get-user-api-keys",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The keys of the app the caller is authenticated for. A key belongs to one app and the other apps never see it.\n",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/APIKey"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Users",
          "API Keys"
        ],
        "summary": "Create user api key",
        "operationId": "create-user-api-key",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "description": "User information",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "readOnly": {
                    "type": "boolean",
                    "default": false,
                    "description": "A read-only key may only issue GET, HEAD and OPTIONS requests; anything else is refused with 403 read_only_key. Set on creation and never changed afterwards.\n"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "User API Key information.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIKey"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Users",
          "API Keys"
        ],
        "summary": "Update user api key",
        "operationId": "update-user-api-key",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "description": "User information",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "name"
                ],
                "properties": {
                  "id": {
                    "type": "number"
                  },
                  "name": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "User API Key information.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIKey"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/users/apikeys/{id}": {
      "delete": {
        "tags": [
          "Users",
          "API Keys"
        ],
        "summary": "Delete user api key",
        "operationId": "delete-user-api-keyu",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "User id",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Success."
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/users/{id}": {
      "delete": {
        "tags": [
          "Users"
        ],
        "summary": "Delete user",
        "operationId": "delete-user",
        "security": [
          {
            "CookieAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "User id",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Success."
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statusCode",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "APIKey": {
        "description": "API key information",
        "required": [
          "id",
          "name",
          "key",
          "readOnly",
          "app"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "readOnly": {
            "type": "boolean",
            "description": "A read-only key may only issue GET, HEAD and OPTIONS requests."
          },
          "app": {
            "type": "string",
            "enum": [
              "latea",
              "barn",
              "ressivo"
            ],
            "description": "The app the key speaks for, taken from the app its creator was authenticated for. Routes of any other app refuse it with 403 app_not_allowed.\n"
          }
        }
      },
      "Address": {
        "description": "App token",
        "required": [
          "id",
          "addressDetail",
          "postalCode",
          "city",
          "country"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "addressDetail": {
            "type": "string"
          },
          "postalCode": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "country": {
            "type": "string",
            "minLength": 2,
            "maxLength": 2
          }
        }
      },
      "AppleAuth": {
        "type": "object",
        "required": [
          "appleCredential"
        ],
        "properties": {
          "appleCredential": {
            "type": "string"
          },
          "createIfNotFound": {
            "description": "Creates a new organization if user not found",
            "type": "boolean",
            "default": false
          }
        }
      },
      "Country": {
        "description": "App token",
        "required": [
          "countryCode",
          "name"
        ],
        "properties": {
          "countryCode": {
            "type": "string",
            "minLength": 2,
            "maxLength": 2
          },
          "name": {
            "type": "string"
          }
        }
      },
      "CountryCode": {
        "type": "string",
        "enum": [
          "AD",
          "AE",
          "AF",
          "AG",
          "AI",
          "AL",
          "AM",
          "AO",
          "AQ",
          "AR",
          "AS",
          "AT",
          "AU",
          "AW",
          "AX",
          "AZ",
          "BA",
          "BB",
          "BD",
          "BE",
          "BF",
          "BG",
          "BH",
          "BI",
          "BJ",
          "BL",
          "BM",
          "BN",
          "BO",
          "BQ",
          "BR",
          "BS",
          "BT",
          "BV",
          "BW",
          "BY",
          "BZ",
          "CA",
          "CC",
          "CD",
          "CF",
          "CG",
          "CH",
          "CI",
          "CK",
          "CL",
          "CM",
          "CN",
          "CO",
          "CR",
          "CU",
          "CV",
          "CW",
          "CX",
          "CY",
          "CZ",
          "DE",
          "DJ",
          "DK",
          "DM",
          "DO",
          "DZ",
          "EC",
          "EE",
          "EG",
          "EH",
          "ER",
          "ES",
          "ET",
          "FI",
          "FJ",
          "FK",
          "FM",
          "FO",
          "FR",
          "GA",
          "GB",
          "GD",
          "GE",
          "GF",
          "GG",
          "GH",
          "GI",
          "GL",
          "GM",
          "GN",
          "GP",
          "GQ",
          "GR",
          "GS",
          "GT",
          "GU",
          "GW",
          "GY",
          "HK",
          "HM",
          "HN",
          "HR",
          "HT",
          "HU",
          "ID",
          "IE",
          "IL",
          "IM",
          "IN",
          "IO",
          "IQ",
          "IR",
          "IS",
          "IT",
          "JE",
          "JM",
          "JO",
          "JP",
          "KE",
          "KG",
          "KH",
          "KI",
          "KM",
          "KN",
          "KP",
          "KR",
          "KW",
          "KY",
          "KZ",
          "LA",
          "LB",
          "LC",
          "LI",
          "LK",
          "LR",
          "LS",
          "LT",
          "LU",
          "LV",
          "LY",
          "MA",
          "MC",
          "MD",
          "ME",
          "MF",
          "MG",
          "MH",
          "MK",
          "ML",
          "MM",
          "MN",
          "MO",
          "MP",
          "MQ",
          "MR",
          "MS",
          "MT",
          "MU",
          "MV",
          "MW",
          "MX",
          "MY",
          "MZ",
          "NA",
          "NC",
          "NE",
          "NF",
          "NG",
          "NI",
          "NL",
          "NO",
          "NP",
          "NR",
          "NU",
          "NZ",
          "OM",
          "PA",
          "PE",
          "PF",
          "PG",
          "PH",
          "PK",
          "PL",
          "PM",
          "PN",
          "PR",
          "PS",
          "PT",
          "PW",
          "PY",
          "QA",
          "RE",
          "RO",
          "RS",
          "RU",
          "RW",
          "SA",
          "SB",
          "SC",
          "SD",
          "SE",
          "SG",
          "SH",
          "SI",
          "SJ",
          "SK",
          "SL",
          "SM",
          "SN",
          "SO",
          "SR",
          "SS",
          "ST",
          "SV",
          "SX",
          "SY",
          "SZ",
          "TC",
          "TD",
          "TF",
          "TG",
          "TH",
          "TJ",
          "TK",
          "TL",
          "TM",
          "TN",
          "TO",
          "TR",
          "TT",
          "TV",
          "TW",
          "TZ",
          "UA",
          "UG",
          "UM",
          "US",
          "UY",
          "UZ",
          "VA",
          "VC",
          "VE",
          "VG",
          "VI",
          "VN",
          "VU",
          "WF",
          "WS",
          "XK",
          "YE",
          "YT",
          "ZA",
          "ZM",
          "ZW"
        ]
      },
      "Document": {
        "required": [
          "id",
          "hash",
          "entityName",
          "entityTaxNumber",
          "datetime",
          "serieId",
          "lines"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "uniqueExternalRef": {
            "type": "string",
            "nullable": true
          },
          "hash": {
            "type": "string"
          },
          "entityId": {
            "type": "number",
            "nullable": true
          },
          "entityName": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "dueDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "discountPercentage": {
            "type": "number",
            "minimum": 0,
            "maximum": 100,
            "nullable": true
          },
          "datetime": {
            "type": "string",
            "format": "date-time"
          },
          "entityTaxNumber": {
            "type": "string"
          },
          "address": {
            "type": "object",
            "required": [
              "id",
              "addressDetail",
              "postalCode",
              "city",
              "country"
            ],
            "properties": {
              "id": {
                "type": "number"
              },
              "addressDetail": {
                "type": "string"
              },
              "postalCode": {
                "type": "string"
              },
              "city": {
                "type": "string"
              },
              "country": {
                "type": "string",
                "minLength": 2,
                "maxLength": 2
              }
            }
          },
          "serieId": {
            "type": "number"
          },
          "observations": {
            "type": "string",
            "nullable": true
          },
          "fromAddress": {
            "type": "object",
            "required": [
              "id",
              "addressDetail",
              "postalCode",
              "city",
              "country"
            ],
            "properties": {
              "id": {
                "type": "number"
              },
              "addressDetail": {
                "type": "string"
              },
              "postalCode": {
                "type": "string"
              },
              "city": {
                "type": "string"
              },
              "country": {
                "type": "string",
                "minLength": 2,
                "maxLength": 2
              }
            }
          },
          "toAddress": {
            "type": "object",
            "required": [
              "id",
              "addressDetail",
              "postalCode",
              "city",
              "country"
            ],
            "properties": {
              "id": {
                "type": "number"
              },
              "addressDetail": {
                "type": "string"
              },
              "postalCode": {
                "type": "string"
              },
              "city": {
                "type": "string"
              },
              "country": {
                "type": "string",
                "minLength": 2,
                "maxLength": 2
              }
            }
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "description",
                "productType",
                "quantity",
                "price"
              ],
              "properties": {
                "id": {
                  "type": "number"
                },
                "productId": {
                  "type": "number",
                  "nullable": true
                },
                "description": {
                  "type": "string"
                },
                "productType": {
                  "type": "string",
                  "enum": [
                    "product",
                    "service",
                    "document_receipt"
                  ]
                },
                "quantity": {
                  "type": "number",
                  "minimum": 0.00001
                },
                "price": {
                  "type": "number",
                  "minimum": 0.00001
                },
                "discountValue": {
                  "type": "number",
                  "minimum": 0,
                  "nullable": true
                },
                "discountPercentage": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 100,
                  "nullable": true
                },
                "taxId": {
                  "type": "number",
                  "nullable": true
                },
                "taxRegionId": {
                  "type": "number",
                  "nullable": true
                }
              }
            }
          },
          "documentNumber": {
            "type": "string"
          }
        }
      },
      "DocumentMeta": {
        "required": [
          "id",
          "serieId",
          "serieName",
          "entityName",
          "entityTaxNumber",
          "date",
          "cancelled",
          "datetime",
          "referenced"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "uniqueExternalRef": {
            "type": "string",
            "nullable": true
          },
          "serieId": {
            "type": "number"
          },
          "serieName": {
            "type": "string"
          },
          "entityId": {
            "type": "number",
            "nullable": true
          },
          "entityName": {
            "type": "string"
          },
          "entityTaxNumber": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "dueDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "duplicatedName": {
            "type": "string",
            "nullable": true
          },
          "duplicatedNumber": {
            "type": "number",
            "nullable": true
          },
          "duplicatedDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "reference": {
            "type": "string",
            "pattern": "^(?!AT)(?!.*[._-]{2,})[A-Za-z0-9][A-Za-z0-9._-]{0,32}[A-Za-z0-9]\\/[0-9]*$",
            "nullable": true
          },
          "grossTotal": {
            "type": "number"
          },
          "paid": {
            "type": "number",
            "nullable": true
          },
          "atCode": {
            "type": "string",
            "nullable": true
          },
          "manual": {
            "type": "boolean"
          },
          "duplicated": {
            "type": "boolean"
          },
          "cancelled": {
            "type": "boolean"
          },
          "datetime": {
            "type": "string",
            "format": "date-time"
          },
          "referenced": {
            "type": "boolean"
          }
        }
      },
      "DocumentWithMeta": {
        "required": [
          "id",
          "serieId",
          "serieName",
          "documentType",
          "hash",
          "entityName",
          "entityTaxNumber",
          "datetime",
          "cancelled",
          "lines"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "uniqueExternalRef": {
            "type": "string",
            "nullable": true
          },
          "serieId": {
            "type": "number"
          },
          "serieName": {
            "type": "string"
          },
          "documentType": {
            "type": "string"
          },
          "atcud": {
            "type": "string",
            "nullable": true
          },
          "hash": {
            "type": "string"
          },
          "entityId": {
            "type": "number",
            "nullable": true
          },
          "entityName": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "dueDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "duplicatedName": {
            "type": "string",
            "nullable": true
          },
          "duplicatedNumber": {
            "type": "number",
            "nullable": true
          },
          "duplicatedDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "discountPercentage": {
            "type": "number",
            "minimum": 0,
            "maximum": 100,
            "nullable": true
          },
          "datetime": {
            "type": "string",
            "format": "date-time"
          },
          "atCode": {
            "type": "string",
            "nullable": true
          },
          "reference": {
            "type": "string",
            "pattern": "^(?!AT)(?!.*[._-]{2,})[A-Za-z0-9][A-Za-z0-9._-]{0,32}[A-Za-z0-9]\\/[0-9]*$",
            "nullable": true
          },
          "manual": {
            "type": "boolean"
          },
          "duplicated": {
            "type": "boolean"
          },
          "cancelled": {
            "type": "boolean"
          },
          "entityTaxNumber": {
            "type": "string"
          },
          "address": {
            "type": "object",
            "required": [
              "id",
              "addressDetail",
              "postalCode",
              "city",
              "country"
            ],
            "properties": {
              "id": {
                "type": "number"
              },
              "addressDetail": {
                "type": "string"
              },
              "postalCode": {
                "type": "string"
              },
              "city": {
                "type": "string"
              },
              "country": {
                "type": "string",
                "minLength": 2,
                "maxLength": 2
              }
            }
          },
          "observations": {
            "type": "string",
            "nullable": true
          },
          "fromAddress": {
            "type": "object",
            "required": [
              "id",
              "addressDetail",
              "postalCode",
              "city",
              "country"
            ],
            "properties": {
              "id": {
                "type": "number"
              },
              "addressDetail": {
                "type": "string"
              },
              "postalCode": {
                "type": "string"
              },
              "city": {
                "type": "string"
              },
              "country": {
                "type": "string",
                "minLength": 2,
                "maxLength": 2
              }
            }
          },
          "toAddress": {
            "type": "object",
            "required": [
              "id",
              "addressDetail",
              "postalCode",
              "city",
              "country"
            ],
            "properties": {
              "id": {
                "type": "number"
              },
              "addressDetail": {
                "type": "string"
              },
              "postalCode": {
                "type": "string"
              },
              "city": {
                "type": "string"
              },
              "country": {
                "type": "string",
                "minLength": 2,
                "maxLength": 2
              }
            }
          },
          "taxAmount": {
            "type": "number"
          },
          "grossTotal": {
            "type": "number"
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "description",
                "productType",
                "quantity",
                "price",
                "docPrice",
                "grossAmount"
              ],
              "properties": {
                "id": {
                  "type": "number"
                },
                "productId": {
                  "type": "number",
                  "nullable": true
                },
                "description": {
                  "type": "string"
                },
                "productType": {
                  "type": "string",
                  "enum": [
                    "product",
                    "service",
                    "document_receipt"
                  ]
                },
                "quantity": {
                  "type": "number",
                  "minimum": 0.00001
                },
                "price": {
                  "type": "number",
                  "minimum": 0.00001
                },
                "docPrice": {
                  "type": "number",
                  "minimum": 0.00001
                },
                "discountValue": {
                  "type": "number",
                  "minimum": 0,
                  "nullable": true
                },
                "discountPercentage": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 100,
                  "nullable": true
                },
                "taxId": {
                  "type": "number",
                  "nullable": true
                },
                "regionId": {
                  "type": "number",
                  "nullable": true
                },
                "taxRegionId": {
                  "type": "number",
                  "nullable": true
                },
                "taxExemptionId": {
                  "type": "number",
                  "nullable": true
                },
                "taxExemptionCode": {
                  "type": "string",
                  "nullable": true
                },
                "taxExemptionDescription": {
                  "type": "string",
                  "nullable": true
                },
                "liquidTotal": {
                  "type": "number"
                },
                "lineDiscount": {
                  "type": "number"
                },
                "globalDiscount": {
                  "type": "number"
                },
                "taxAmount": {
                  "type": "number"
                },
                "grossAmount": {
                  "type": "number"
                },
                "refLineId": {
                  "type": "number",
                  "nullable": true
                },
                "refDocumentId": {
                  "type": "number",
                  "nullable": true
                },
                "refDocumentType": {
                  "type": "string",
                  "nullable": true
                },
                "refSerieName": {
                  "type": "string",
                  "nullable": true
                }
              }
            }
          }
        }
      },
      "Entity": {
        "description": "App token",
        "required": [
          "id",
          "name",
          "taxNumber",
          "type"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "taxNumber": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email",
            "nullable": true
          },
          "telephone": {
            "type": "string",
            "nullable": true
          },
          "mobile": {
            "type": "string",
            "nullable": true
          },
          "type": {
            "type": "string",
            "enum": [
              "customer",
              "supplier",
              "both"
            ]
          }
        }
      },
      "EntitySubscription": {
        "description": "Entity subscription to a customer plan",
        "properties": {
          "id": {
            "type": "number"
          },
          "planId": {
            "type": "number"
          },
          "planName": {
            "type": "string"
          },
          "entityId": {
            "type": "number"
          },
          "entityName": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "active",
              "cancelled",
              "past_due",
              "paused"
            ]
          },
          "currentPeriodStart": {
            "type": "string",
            "format": "date-time"
          },
          "currentPeriodEnd": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "FBAuth": {
        "type": "object",
        "required": [
          "facebookCredential"
        ],
        "properties": {
          "facebookCredential": {
            "type": "string"
          },
          "createIfNotFound": {
            "description": "Creates a new organization if user not found",
            "type": "boolean",
            "default": false
          }
        }
      },
      "FallbackAuth": {
        "type": "object",
        "required": [
          "fallbackRegistration"
        ],
        "properties": {
          "fallbackRegistration": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "username": {
            "type": "string",
            "format": "email"
          },
          "password": {
            "type": "string"
          }
        }
      },
      "GoogleAuth": {
        "type": "object",
        "required": [
          "googleCredential"
        ],
        "properties": {
          "googleCredential": {
            "type": "string"
          },
          "createIfNotFound": {
            "description": "Creates a new organization if user not found",
            "type": "boolean",
            "default": false
          }
        }
      },
      "IdentifiedEntity": {
        "type": "object",
        "required": [
          "id",
          "name",
          "type"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "telephone": {
            "type": "string"
          },
          "mobile": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "customer",
              "supplier",
              "both"
            ]
          }
        }
      },
      "NotIdentifiedEntity": {
        "type": "object",
        "required": [
          "id",
          "taxNumber",
          "type"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "taxNumber": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "customer",
              "supplier",
              "both"
            ]
          }
        }
      },
      "Organization": {
        "description": "Organization information",
        "required": [
          "id",
          "name",
          "taxNumber",
          "email"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "taxNumber": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "logofilename": {
            "type": "string",
            "nullable": true
          },
          "addressId": {
            "type": "number",
            "nullable": true
          },
          "address": {
            "type": "object",
            "required": [
              "addressDetail",
              "postalCode",
              "city",
              "country"
            ],
            "properties": {
              "addressDetail": {
                "type": "string"
              },
              "postalCode": {
                "type": "string"
              },
              "city": {
                "type": "string"
              },
              "country": {
                "type": "string",
                "minLength": 2,
                "maxLength": 2
              }
            }
          }
        }
      },
      "PasswordRecoverConfirm": {
        "type": "object",
        "required": [
          "token",
          "password"
        ],
        "properties": {
          "token": {
            "type": "string"
          },
          "password": {
            "type": "string"
          }
        }
      },
      "PasswordRecoverRequest": {
        "type": "object",
        "required": [
          "email"
        ],
        "properties": {
          "email": {
            "type": "string",
            "format": "email"
          },
          "app": {
            "type": "string"
          }
        }
      },
      "Plan": {
        "description": "App-level subscription plan",
        "properties": {
          "id": {
            "type": "number"
          },
          "app": {
            "type": "string",
            "enum": [
              "barn",
              "latea",
              "ressivo"
            ]
          },
          "name": {
            "type": "string"
          },
          "price": {
            "type": "number"
          },
          "productName": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "features": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "invoices",
                "exports",
                "basic",
                "custom_domain"
              ]
            }
          },
          "frequency": {
            "type": "string",
            "enum": [
              "monthly",
              "annual"
            ]
          },
          "stripeProductId": {
            "type": "string"
          },
          "stripePriceId": {
            "type": "string"
          },
          "platformFeePercent": {
            "type": "number",
            "nullable": true
          },
          "active": {
            "type": "boolean"
          },
          "datetime": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Product": {
        "required": [
          "id",
          "reference",
          "description",
          "taxId",
          "type",
          "controlStock"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "reference": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "minLength": 2
          },
          "taxId": {
            "type": "number"
          },
          "type": {
            "type": "string",
            "enum": [
              "product",
              "service"
            ]
          },
          "controlStock": {
            "type": "boolean"
          }
        }
      },
      "ProductEditable": {
        "required": [
          "id",
          "reference",
          "description",
          "taxId",
          "type",
          "controlStock",
          "editable"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "reference": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "minLength": 2
          },
          "taxId": {
            "type": "number"
          },
          "type": {
            "type": "string",
            "enum": [
              "product",
              "service"
            ]
          },
          "controlStock": {
            "type": "boolean"
          },
          "stock": {
            "type": "number",
            "nullable": true
          },
          "editable": {
            "type": "boolean"
          }
        }
      },
      "ProductForLine": {
        "required": [
          "id",
          "reference",
          "description",
          "taxId",
          "type",
          "controlStock",
          "taxPercentage",
          "regionId"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "reference": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "minLength": 2
          },
          "taxId": {
            "type": "number"
          },
          "type": {
            "type": "string"
          },
          "controlStock": {
            "type": "boolean"
          },
          "taxPercentage": {
            "type": "number",
            "minimum": 0,
            "maximum": 100
          },
          "regionId": {
            "type": "number"
          }
        }
      },
      "Region": {
        "description": "Region",
        "required": [
          "id",
          "name"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "Serie": {
        "description": "Serie",
        "required": [
          "id",
          "name",
          "documentType",
          "manual",
          "duplicated",
          "active"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 35,
            "pattern": "^(?!AT)(?!.*[._-]{2,})[A-Za-z0-9][A-Za-z0-9._-]{0,32}[A-Za-z0-9]$"
          },
          "documentType": {
            "type": "string",
            "enum": [
              "SI",
              "I",
              "IR",
              "TG",
              "CN",
              "RC",
              "PU"
            ]
          },
          "manual": {
            "type": "boolean"
          },
          "duplicated": {
            "type": "boolean"
          },
          "duplicatedName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 35,
            "pattern": "^(?!AT)(?!.*[._-]{2,})[A-Za-z0-9][A-Za-z0-9._-]{0,32}[A-Za-z0-9]$",
            "nullable": true
          },
          "atcud": {
            "type": "string",
            "minLength": 8,
            "maxLength": 100,
            "pattern": "^(?=(?:[^AEIOU01]*[A-Z0-9]){8})(?!.*[AEIOU01]).{8,}$",
            "nullable": true
          },
          "active": {
            "type": "boolean"
          }
        }
      },
      "Subscription": {
        "description": "Subscription",
        "required": [
          "app",
          "name"
        ],
        "properties": {
          "id": {
            "type": "number",
            "nullable": true
          },
          "planId": {
            "type": "number",
            "nullable": true
          },
          "app": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "endDatetime": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "active",
              "cancelled",
              "past_due",
              "paused"
            ]
          },
          "cancelAtPeriodEnd": {
            "type": "boolean"
          },
          "trialActive": {
            "type": "boolean"
          },
          "trialUnlimited": {
            "type": "boolean"
          },
          "trialEndDatetime": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        }
      },
      "Tax": {
        "description": "Tax",
        "required": [
          "id",
          "code",
          "description",
          "regions",
          "active"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "code": {
            "type": "string",
            "enum": [
              "NOR",
              "INT",
              "RED",
              "ISE"
            ]
          },
          "description": {
            "type": "string"
          },
          "regions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TaxRegion"
            }
          },
          "active": {
            "type": "boolean"
          }
        }
      },
      "TaxExemption": {
        "description": "Tax Exemption",
        "required": [
          "id",
          "code",
          "description"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "code": {
            "type": "string"
          },
          "description": {
            "type": "string"
          }
        }
      },
      "TaxMeta": {
        "description": "Tax meta",
        "required": [
          "id",
          "code",
          "description",
          "active"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "code": {
            "type": "string",
            "enum": [
              "NOR",
              "INT",
              "RED",
              "ISE"
            ]
          },
          "description": {
            "type": "string"
          },
          "active": {
            "type": "boolean"
          }
        }
      },
      "TaxRegion": {
        "description": "Tax Region",
        "required": [
          "id",
          "regionId",
          "startDate",
          "taxPercentage"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "regionId": {
            "type": "number"
          },
          "startDate": {
            "type": "string",
            "format": "date-time"
          },
          "endDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        }
      },
      "User": {
        "description": "User information",
        "required": [
          "id",
          "name",
          "username",
          "type"
        ],
        "properties": {
          "id": {
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "username": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "user",
              "superadmin"
            ]
          },
          "resetpassword": {
            "type": "boolean"
          }
        }
      },
      "UsernamePassword": {
        "type": "object",
        "required": [
          "username",
          "password"
        ],
        "properties": {
          "username": {
            "type": "string"
          },
          "password": {
            "type": "string"
          },
          "createIfNotFound": {
            "description": "Creates a new organization if user not found",
            "type": "boolean",
            "default": false
          }
        }
      }
    },
    "securitySchemes": {
      "CookieAuth": {
        "type": "apiKey",
        "in": "cookie",
        "name": "strangeskills.sid"
      },
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "apikey"
      }
    }
  },
  "x-doc-sections": [
    {
      "id": "customer-subscriptions",
      "title": "Customer subscriptions",
      "group": "Latea",
      "paths": [
        "/subscriptions/entity",
        "/subscriptions/entity/{id}",
        "/subscriptions/entity/{id}/cancel",
        "/subscriptions/entity/{id}/pause",
        "/subscriptions/entity/{id}/resume"
      ]
    },
    {
      "id": "documents",
      "title": "Documents",
      "group": "Latea",
      "paths": [
        "/latea/documents",
        "/latea/documents/at/communicate",
        "/latea/documents/cancel",
        "/latea/documents/document/{id}/serie/{serieId}",
        "/latea/documents/summary"
      ]
    },
    {
      "id": "entities",
      "title": "Entities",
      "group": "Latea",
      "paths": [
        "/latea/entities",
        "/latea/entities/address",
        "/latea/entities/address/entity/{entityId}/id/{id}",
        "/latea/entities/id/{id}",
        "/latea/entities/id/{id}/addresses"
      ]
    },
    {
      "id": "exports",
      "title": "Exports",
      "group": "Latea",
      "paths": [
        "/latea/exports/saft/{year}",
        "/latea/exports/saft/{year}/{month}"
      ]
    },
    {
      "id": "products",
      "title": "Products",
      "group": "Latea",
      "paths": [
        "/latea/products",
        "/latea/products/forline",
        "/latea/products/id/{id}",
        "/latea/products/info"
      ]
    },
    {
      "id": "regions",
      "title": "Regions",
      "group": "Latea",
      "paths": [
        "/latea/regions"
      ]
    },
    {
      "id": "series",
      "title": "Series",
      "group": "Latea",
      "paths": [
        "/latea/series",
        "/latea/series/id/{id}"
      ]
    },
    {
      "id": "taxes",
      "title": "Taxes",
      "group": "Latea",
      "paths": [
        "/latea/taxes",
        "/latea/taxes/id/{id}",
        "/latea/taxes/regions"
      ]
    },
    {
      "id": "taxexemptions",
      "title": "Taxexemptions",
      "group": "Latea",
      "paths": [
        "/latea/taxexemptions"
      ]
    },
    {
      "id": "auth",
      "title": "Auth",
      "group": "Account and platform",
      "paths": [
        "/auth",
        "/auth/logout",
        "/auth/password",
        "/auth/recover",
        "/auth/recover/confirm",
        "/auth/user"
      ]
    },
    {
      "id": "generic",
      "title": "Generic",
      "group": "Account and platform",
      "paths": [
        "/generic/countries"
      ]
    },
    {
      "id": "organizations",
      "title": "Organizations",
      "group": "Account and platform",
      "paths": [
        "/organizations",
        "/organizations/all",
        "/organizations/configuration",
        "/organizations/logo",
        "/organizations/{id}"
      ]
    },
    {
      "id": "subscriptions",
      "title": "Subscriptions",
      "group": "Account and platform",
      "paths": [
        "/subscriptions",
        "/subscriptions/app-plans",
        "/subscriptions/organization/{id}/cancel",
        "/subscriptions/organization/{id}/change-plan",
        "/subscriptions/organization/{id}/resume",
        "/subscriptions/public/app-plans",
        "/subscriptions/{app}"
      ]
    },
    {
      "id": "users",
      "title": "Users",
      "group": "Account and platform",
      "paths": [
        "/users",
        "/users/apikeys",
        "/users/apikeys/{id}",
        "/users/{id}"
      ]
    }
  ]
}
