{
  "openapi": "3.1.0",
  "info": {
    "title": "Tampa",
    "description": "API de facturation normalisée pour l'Afrique de l'Ouest.",
    "version": "0.1.0"
  },
  "paths": {
    "/taxpayers": {
      "post": {
        "tags": [
          "contribuables"
        ],
        "summary": "Create Taxpayer",
        "description": "Vérifie le jeton auprès de la DGI puis enregistre le contribuable.",
        "operationId": "create_taxpayer_taxpayers_post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaxpayerCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaxpayerCreatedResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "contribuables"
        ],
        "summary": "List Taxpayers",
        "description": "Liste les contribuables du compte authentifié.",
        "operationId": "list_taxpayers_taxpayers_get",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TaxpayerResponse"
                  },
                  "title": "Response List Taxpayers Taxpayers Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/taxpayers/{taxpayer_id}": {
      "get": {
        "tags": [
          "contribuables"
        ],
        "summary": "Get Taxpayer",
        "description": "Renvoie un contribuable du compte authentifié.",
        "operationId": "get_taxpayer_taxpayers__taxpayer_id__get",
        "parameters": [
          {
            "name": "taxpayer_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Taxpayer Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaxpayerResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "contribuables"
        ],
        "summary": "Update Taxpayer",
        "description": "Met à jour les coordonnées d'un contribuable du compte.",
        "operationId": "update_taxpayer_taxpayers__taxpayer_id__patch",
        "parameters": [
          {
            "name": "taxpayer_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Taxpayer Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaxpayerUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaxpayerResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "contribuables"
        ],
        "summary": "Delete Taxpayer",
        "description": "Supprime un contribuable s'il ne possède aucune facture.",
        "operationId": "delete_taxpayer_taxpayers__taxpayer_id__delete",
        "parameters": [
          {
            "name": "taxpayer_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Taxpayer Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/taxpayers/{taxpayer_id}/token": {
      "put": {
        "tags": [
          "contribuables"
        ],
        "summary": "Update Taxpayer Token",
        "description": "Vérifie puis remplace le jeton e-MECeF d'un contribuable.",
        "operationId": "update_taxpayer_token_taxpayers__taxpayer_id__token_put",
        "parameters": [
          {
            "name": "taxpayer_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Taxpayer Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaxpayerTokenUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaxpayerTokenResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/invoices": {
      "post": {
        "tags": [
          "factures"
        ],
        "summary": "Create Invoice",
        "description": "Certifie une facture et garantit l'idempotence de chaque tentative.",
        "operationId": "create_invoice_invoices_post",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "title": "Idempotency-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoiceSubmission"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "factures"
        ],
        "summary": "List Invoices",
        "description": "Liste les factures appartenant au compte authentifié.",
        "operationId": "list_invoices_invoices_get",
        "parameters": [
          {
            "name": "taxpayer_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Taxpayer Id"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Offset"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/InvoiceRead"
                  },
                  "title": "Response List Invoices Invoices Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/invoices/{invoice_id}": {
      "get": {
        "tags": [
          "factures"
        ],
        "summary": "Get Invoice",
        "description": "Renvoie une facture du compte authentifié.",
        "operationId": "get_invoice_invoices__invoice_id__get",
        "parameters": [
          {
            "name": "invoice_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Invoice Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/invoices/{invoice_id}/pdf": {
      "get": {
        "tags": [
          "factures"
        ],
        "summary": "Get Invoice Pdf",
        "description": "Rend à la demande le PDF d'une facture certifiée.",
        "operationId": "get_invoice_pdf_invoices__invoice_id__pdf_get",
        "parameters": [
          {
            "name": "invoice_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Invoice Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/health": {
      "get": {
        "tags": [
          "système"
        ],
        "summary": "Health",
        "description": "Indique que l'API tourne. Utilisé par Docker et la supervision.",
        "operationId": "health_health_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "type": "object",
                  "title": "Response Health Health Get"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AibGroup": {
        "type": "string",
        "enum": [
          "A",
          "B"
        ],
        "title": "AibGroup"
      },
      "Client": {
        "properties": {
          "ifu": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 13,
                "minLength": 13
              },
              {
                "type": "null"
              }
            ],
            "title": "Ifu"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "contact": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Contact"
          },
          "address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Address"
          }
        },
        "type": "object",
        "title": "Client"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "InvoiceInput": {
        "properties": {
          "type": {
            "$ref": "#/components/schemas/InvoiceType"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/InvoiceItem"
            },
            "type": "array",
            "minItems": 1,
            "title": "Items"
          },
          "operator": {
            "$ref": "#/components/schemas/Operator"
          },
          "client": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Client"
              },
              {
                "type": "null"
              }
            ]
          },
          "payment": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/Payment"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Payment"
          },
          "aib": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AibGroup"
              },
              {
                "type": "null"
              }
            ]
          },
          "reference": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 24,
                "minLength": 24
              },
              {
                "type": "null"
              }
            ],
            "title": "Reference"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "type",
          "items",
          "operator"
        ],
        "title": "InvoiceInput",
        "description": "Données DGI d'une facture, sans IFU fourni par l'appelant."
      },
      "InvoiceItem": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "price": {
            "type": "integer",
            "minimum": 0.0,
            "title": "Price",
            "description": "Prix unitaire TTC, en FCFA"
          },
          "quantity": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Quantity"
          },
          "taxGroup": {
            "$ref": "#/components/schemas/TaxGroup"
          },
          "code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Code"
          },
          "taxSpecific": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Taxspecific"
          },
          "originalPrice": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Originalprice"
          },
          "priceModification": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pricemodification"
          }
        },
        "type": "object",
        "required": [
          "name",
          "price",
          "quantity",
          "taxGroup"
        ],
        "title": "InvoiceItem"
      },
      "InvoiceRead": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "taxpayer_id": {
            "type": "string",
            "format": "uuid",
            "title": "Taxpayer Id"
          },
          "idempotency_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Idempotency Key"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "request": {
            "additionalProperties": true,
            "type": "object",
            "title": "Request"
          },
          "totals": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/InvoiceResponse"
              },
              {
                "type": "null"
              }
            ]
          },
          "security": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/InvoiceSecurityRead"
              },
              {
                "type": "null"
              }
            ]
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "pdf_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pdf Url"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "taxpayer_id",
          "idempotency_key",
          "status",
          "request",
          "totals",
          "security",
          "error",
          "pdf_url",
          "created_at",
          "updated_at"
        ],
        "title": "InvoiceRead",
        "description": "Représentation publique d'une facture."
      },
      "InvoiceResponse": {
        "properties": {
          "uid": {
            "type": "string",
            "title": "Uid"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "ta": {
            "type": "integer",
            "title": "Ta",
            "default": 0
          },
          "tb": {
            "type": "integer",
            "title": "Tb",
            "default": 0
          },
          "tc": {
            "type": "integer",
            "title": "Tc",
            "default": 0
          },
          "td": {
            "type": "integer",
            "title": "Td",
            "default": 0
          },
          "taa": {
            "type": "integer",
            "title": "Taa",
            "default": 0
          },
          "tab": {
            "type": "integer",
            "title": "Tab",
            "default": 0
          },
          "tac": {
            "type": "integer",
            "title": "Tac",
            "default": 0
          },
          "tad": {
            "type": "integer",
            "title": "Tad",
            "default": 0
          },
          "tae": {
            "type": "integer",
            "title": "Tae",
            "default": 0
          },
          "taf": {
            "type": "integer",
            "title": "Taf",
            "default": 0
          },
          "hab": {
            "type": "integer",
            "title": "Hab",
            "default": 0
          },
          "had": {
            "type": "integer",
            "title": "Had",
            "default": 0
          },
          "vab": {
            "type": "integer",
            "title": "Vab",
            "default": 0
          },
          "vad": {
            "type": "integer",
            "title": "Vad",
            "default": 0
          },
          "aib": {
            "type": "integer",
            "title": "Aib",
            "default": 0
          },
          "ts": {
            "type": "integer",
            "title": "Ts",
            "default": 0
          }
        },
        "type": "object",
        "required": [
          "uid",
          "total"
        ],
        "title": "InvoiceResponse",
        "description": "Totaux calculés par la DGI. À vérifier avant de confirmer."
      },
      "InvoiceSecurityRead": {
        "properties": {
          "code_mecef_dgi": {
            "type": "string",
            "title": "Code Mecef Dgi"
          },
          "counters": {
            "type": "string",
            "title": "Counters"
          },
          "nim": {
            "type": "string",
            "title": "Nim"
          },
          "date_time": {
            "type": "string",
            "title": "Date Time"
          },
          "qr_code": {
            "type": "string",
            "title": "Qr Code"
          }
        },
        "type": "object",
        "required": [
          "code_mecef_dgi",
          "counters",
          "nim",
          "date_time",
          "qr_code"
        ],
        "title": "InvoiceSecurityRead",
        "description": "Éléments publics de sécurité d'une facture certifiée."
      },
      "InvoiceSubmission": {
        "properties": {
          "taxpayer_id": {
            "type": "string",
            "format": "uuid",
            "title": "Taxpayer Id"
          },
          "invoice": {
            "$ref": "#/components/schemas/InvoiceInput"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "taxpayer_id",
          "invoice"
        ],
        "title": "InvoiceSubmission",
        "description": "Facture à certifier pour un contribuable du compte."
      },
      "InvoiceType": {
        "type": "string",
        "enum": [
          "FV",
          "EV",
          "FA",
          "EA"
        ],
        "title": "InvoiceType"
      },
      "Operator": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id"
          }
        },
        "type": "object",
        "required": [
          "name"
        ],
        "title": "Operator"
      },
      "Payment": {
        "properties": {
          "name": {
            "$ref": "#/components/schemas/PaymentType"
          },
          "amount": {
            "type": "integer",
            "minimum": 0.0,
            "title": "Amount"
          }
        },
        "type": "object",
        "required": [
          "name",
          "amount"
        ],
        "title": "Payment"
      },
      "PaymentType": {
        "type": "string",
        "enum": [
          "ESPECES",
          "VIREMENT",
          "CARTEBANCAIRE",
          "MOBILEMONEY",
          "CHEQUES",
          "CREDIT",
          "AUTRE"
        ],
        "title": "PaymentType"
      },
      "TaxGroup": {
        "type": "string",
        "enum": [
          "A",
          "B",
          "C",
          "D",
          "E",
          "F"
        ],
        "title": "TaxGroup"
      },
      "TaxpayerCreate": {
        "properties": {
          "ifu": {
            "type": "string",
            "pattern": "^\\d{13}$",
            "title": "Ifu"
          },
          "name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "Name"
          },
          "emecef_token": {
            "type": "string",
            "minLength": 1,
            "title": "Emecef Token"
          },
          "address": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Address"
          },
          "city": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "City"
          },
          "phone": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 50
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone"
          },
          "email": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 320
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          }
        },
        "type": "object",
        "required": [
          "ifu",
          "name",
          "emecef_token"
        ],
        "title": "TaxpayerCreate",
        "description": "Données nécessaires à l'enregistrement d'un contribuable."
      },
      "TaxpayerCreatedResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "ifu": {
            "type": "string",
            "title": "Ifu"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Address"
          },
          "city": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "City"
          },
          "phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "nim": {
            "type": "string",
            "title": "Nim"
          },
          "token_valid_until": {
            "type": "string",
            "format": "date-time",
            "title": "Token Valid Until"
          }
        },
        "type": "object",
        "required": [
          "id",
          "ifu",
          "name",
          "created_at",
          "nim",
          "token_valid_until"
        ],
        "title": "TaxpayerCreatedResponse",
        "description": "Informations publiques renvoyées après vérification auprès de la DGI."
      },
      "TaxpayerResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "ifu": {
            "type": "string",
            "title": "Ifu"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Address"
          },
          "city": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "City"
          },
          "phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "ifu",
          "name",
          "created_at"
        ],
        "title": "TaxpayerResponse",
        "description": "Informations publiques d'un contribuable."
      },
      "TaxpayerTokenResponse": {
        "properties": {
          "nim": {
            "type": "string",
            "title": "Nim"
          },
          "token_valid_until": {
            "type": "string",
            "format": "date-time",
            "title": "Token Valid Until"
          }
        },
        "type": "object",
        "required": [
          "nim",
          "token_valid_until"
        ],
        "title": "TaxpayerTokenResponse",
        "description": "Résultat de la vérification d'un nouveau jeton e-MECeF."
      },
      "TaxpayerTokenUpdate": {
        "properties": {
          "emecef_token": {
            "type": "string",
            "minLength": 1,
            "title": "Emecef Token"
          }
        },
        "type": "object",
        "required": [
          "emecef_token"
        ],
        "title": "TaxpayerTokenUpdate",
        "description": "Nouveau jeton e-MECeF d'un contribuable."
      },
      "TaxpayerUpdate": {
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "address": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Address"
          },
          "city": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "City"
          },
          "phone": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 50
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone"
          },
          "email": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 320
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "TaxpayerUpdate",
        "description": "Coordonnées modifiables d'un contribuable."
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      }
    }
  },
  "servers": [
    {
      "url": "https://sandbox.otampa.com",
      "description": "Bac à sable (serveur de test DGI)"
    }
  ]
}
