Export Hub API¶
Port : 8005 | NodePort : 30005 | Repo : solyntek/djinn/services/djinn-export-hub
Exports de données financières vers des formats comptables et paie standards français.
Endpoints¶
| Méthode | Route | Description |
|---|---|---|
GET |
/health |
Health check |
GET |
/v1/formats |
Formats d'export disponibles |
POST |
/v1/export/fec |
Export FEC (norme DGFiP) |
POST |
/v1/export/sage |
Export Sage 100 |
POST |
/v1/export/pennylane |
Export Pennylane |
POST |
/v1/export/csv |
Export CSV générique |
POST |
/v1/export/payroll/silae |
Éléments variables Silae |
POST |
/v1/export/payroll/payfit |
Éléments variables PayFit |
POST |
/v1/validate/fec |
Valider un FEC existant |
Format FEC¶
18 colonnes obligatoires (norme DGFiP) : JournalCode, JournalLib, EcritureNum, EcritureDate, CompteNum, CompteLib, CompAuxNum, CompAuxLib, PieceRef, PieceDate, EcritureLib, Debit, Credit, EcrtureLet, DateLet, ValidDate, Montantdevise, Idevise.
Fichier TSV, nom normalisé : {SIREN}FEC{YYYYMMDD}.txt
Référence interactive¶
Générée à chaque build depuis la spec versionnée openapi/export-hub-v1.json (ADR-011) — aucune route documentée à la main.
Djinn Export Hub 0.1.0¶
Exports comptables FEC/Sage/Pennylane et éléments variables paie
Endpoints¶
GET /health¶
Health
Description
Health check endpoint.
Responses
Schema of the response body
{
"properties": {
"status": {
"type": "string",
"title": "Status",
"default": "ok"
},
"service": {
"type": "string",
"title": "Service",
"default": "export-hub"
},
"version": {
"type": "string",
"title": "Version",
"default": "0.1.0"
}
},
"type": "object",
"title": "HealthResponse",
"description": "Response for the health check endpoint."
}
GET /v1/formats¶
Formats
Description
List all supported export formats.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
X-API-Key |
header | No | |||
X-Internal-Service |
header | No | |||
X-Tenant-ID |
header | No |
Responses
POST /v1/export/fec¶
Export Fec
Description
Generate a FEC file from journal entries.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
X-API-Key |
header | No | |||
X-Internal-Service |
header | No | |||
X-Tenant-ID |
header | No |
Request body
{
"siren": "string",
"fiscal_year_start": "2022-04-13",
"fiscal_year_end": "2022-04-13",
"entries": [
{
"journal_code": "string",
"journal_lib": "string",
"ecriture_num": "string",
"ecriture_date": "2022-04-13",
"compte_num": "string",
"compte_lib": "string",
"comp_aux_num": "string",
"comp_aux_lib": "string",
"piece_ref": "string",
"piece_date": "2022-04-13",
"ecriture_lib": "string",
"debit": null,
"credit": null,
"ecriture_let": "string",
"date_let": null,
"valid_date": null,
"montant_devise": null,
"idevise": "string"
}
]
}
Schema of the request body
{
"properties": {
"siren": {
"type": "string",
"maxLength": 9,
"minLength": 9,
"pattern": "^\\d{9}$",
"title": "Siren",
"description": "SIREN (9 chiffres)"
},
"fiscal_year_start": {
"type": "string",
"format": "date",
"title": "Fiscal Year Start",
"description": "Début exercice fiscal"
},
"fiscal_year_end": {
"type": "string",
"format": "date",
"title": "Fiscal Year End",
"description": "Fin exercice fiscal"
},
"entries": {
"items": {
"$ref": "#/components/schemas/FECLine"
},
"type": "array",
"minItems": 1,
"title": "Entries"
}
},
"type": "object",
"required": [
"siren",
"fiscal_year_start",
"fiscal_year_end",
"entries"
],
"title": "FECExportRequest",
"description": "Requête d'export FEC."
}
Responses
POST /v1/export/sage¶
Export Sage
Description
Generate a Sage 100 export file.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
X-API-Key |
header | No | |||
X-Internal-Service |
header | No | |||
X-Tenant-ID |
header | No |
Request body
{
"entries": [
{
"journal_code": "string",
"journal_label": "string",
"entry_number": "string",
"entry_date": "2022-04-13",
"account_number": "string",
"account_label": "string",
"aux_account": null,
"aux_label": null,
"piece_ref": "string",
"piece_date": "2022-04-13",
"label": "string",
"debit": null,
"credit": null,
"lettrage": null,
"lettrage_date": null,
"validation_date": null,
"currency_amount": null,
"currency_code": null
}
]
}
Responses
POST /v1/export/pennylane¶
Export Pennylane
Description
Generate a Pennylane export file.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
X-API-Key |
header | No | |||
X-Internal-Service |
header | No | |||
X-Tenant-ID |
header | No |
Request body
{
"entries": [
{
"journal_code": "string",
"journal_label": "string",
"entry_number": "string",
"entry_date": "2022-04-13",
"account_number": "string",
"account_label": "string",
"aux_account": null,
"aux_label": null,
"piece_ref": "string",
"piece_date": "2022-04-13",
"label": "string",
"debit": null,
"credit": null,
"lettrage": null,
"lettrage_date": null,
"validation_date": null,
"currency_amount": null,
"currency_code": null
}
]
}
Responses
POST /v1/export/csv¶
Export Csv
Description
Generate a generic CSV export.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
X-API-Key |
header | No | |||
X-Internal-Service |
header | No | |||
X-Tenant-ID |
header | No |
Request body
Schema of the request body
{
"properties": {
"data": {
"items": {
"additionalProperties": true,
"type": "object"
},
"type": "array",
"maxItems": 100000,
"minItems": 1,
"title": "Data"
},
"delimiter": {
"type": "string",
"maxLength": 1,
"title": "Delimiter",
"default": ";"
}
},
"type": "object",
"required": [
"data"
],
"title": "CSVExportRequest",
"description": "Requête d'export CSV générique."
}
Responses
POST /v1/export/payroll¶
Export Payroll
Description
Generate a standardised payroll CSV export.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
X-API-Key |
header | No | |||
X-Internal-Service |
header | No | |||
X-Tenant-ID |
header | No |
Request body
Responses
POST /v1/export/payroll/silae¶
Export Silae
Description
Generate Silae payroll variable elements export.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
X-API-Key |
header | No | |||
X-Internal-Service |
header | No | |||
X-Tenant-ID |
header | No |
Request body
{
"variables": [
{
"employee_id": "string",
"employee_name": "string",
"period": "string",
"code": "string",
"label": "string",
"quantity": null,
"rate": null,
"amount": null,
"unit": "string",
"comment": null
}
]
}
Schema of the request body
{
"properties": {
"variables": {
"items": {
"$ref": "#/components/schemas/PayrollVariable"
},
"type": "array",
"minItems": 1,
"title": "Variables"
}
},
"type": "object",
"required": [
"variables"
],
"title": "PayrollExportRequest",
"description": "Requête d'export éléments variables paie (Silae/PayFit)."
}
Responses
POST /v1/export/payroll/payfit¶
Export Payfit
Description
Generate PayFit payroll variable elements export.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
X-API-Key |
header | No | |||
X-Internal-Service |
header | No | |||
X-Tenant-ID |
header | No |
Request body
{
"variables": [
{
"employee_id": "string",
"employee_name": "string",
"period": "string",
"code": "string",
"label": "string",
"quantity": null,
"rate": null,
"amount": null,
"unit": "string",
"comment": null
}
]
}
Schema of the request body
{
"properties": {
"variables": {
"items": {
"$ref": "#/components/schemas/PayrollVariable"
},
"type": "array",
"minItems": 1,
"title": "Variables"
}
},
"type": "object",
"required": [
"variables"
],
"title": "PayrollExportRequest",
"description": "Requête d'export éléments variables paie (Silae/PayFit)."
}
Responses
POST /v1/validate/fec¶
Validate Fec Endpoint
Description
Validate an existing FEC file content.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
X-API-Key |
header | No | |||
X-Internal-Service |
header | No | |||
X-Tenant-ID |
header | No |
Request body
Responses
{
"valid": true,
"errors": [
"string"
],
"warnings": [
"string"
],
"line_count": 0,
"total_debit": 10.12,
"total_credit": 10.12,
"balance_ok": true
}
Schema of the response body
{
"properties": {
"valid": {
"type": "boolean",
"title": "Valid",
"default": true
},
"errors": {
"items": {
"type": "string"
},
"type": "array",
"title": "Errors"
},
"warnings": {
"items": {
"type": "string"
},
"type": "array",
"title": "Warnings"
},
"line_count": {
"type": "integer",
"title": "Line Count",
"default": 0
},
"total_debit": {
"type": "number",
"title": "Total Debit",
"default": 0.0
},
"total_credit": {
"type": "number",
"title": "Total Credit",
"default": 0.0
},
"balance_ok": {
"type": "boolean",
"title": "Balance Ok",
"default": true
}
},
"type": "object",
"title": "FECValidationResult",
"description": "Résultat de validation FEC."
}
Schemas¶
CSVExportRequest¶
| Name | Type | Description |
|---|---|---|
data |
Array<> | |
delimiter |
string |
FECExportRequest¶
| Name | Type | Description |
|---|---|---|
entries |
Array<FECLine> | |
fiscal_year_end |
string(date) | Fin exercice fiscal |
fiscal_year_start |
string(date) | Début exercice fiscal |
siren |
string | SIREN (9 chiffres) |
FECLine¶
| Name | Type | Description |
|---|---|---|
comp_aux_lib |
string | |
comp_aux_num |
string | |
compte_lib |
string | |
compte_num |
string | |
credit |
||
date_let |
||
debit |
||
ecriture_date |
string(date) | |
ecriture_let |
string | |
ecriture_lib |
string | |
ecriture_num |
string | |
idevise |
string | |
journal_code |
string | |
journal_lib |
string | |
montant_devise |
||
piece_date |
string(date) | |
piece_ref |
string | |
valid_date |
FECValidateRequest¶
| Name | Type | Description |
|---|---|---|
content |
string |
FECValidationResult¶
| Name | Type | Description |
|---|---|---|
balance_ok |
boolean | |
errors |
Array<string> | |
line_count |
integer | |
total_credit |
number | |
total_debit |
number | |
valid |
boolean | |
warnings |
Array<string> |
FormatInfo¶
| Name | Type | Description |
|---|---|---|
category |
string | |
description |
string | |
format |
string |
HealthResponse¶
| Name | Type | Description |
|---|---|---|
service |
string | |
status |
string | |
version |
string |
HTTPValidationError¶
| Name | Type | Description |
|---|---|---|
detail |
Array<ValidationError> |
JournalEntry¶
| Name | Type | Description |
|---|---|---|
account_label |
string | Libellé du compte |
account_number |
string | Numéro de compte (PCG) |
aux_account |
Compte auxiliaire | |
aux_label |
Libellé auxiliaire | |
credit |
||
currency_amount |
||
currency_code |
ISO 4217 | |
debit |
||
entry_date |
string(date) | Date de l'écriture |
entry_number |
string | Numéro d'écriture |
journal_code |
string | Code journal (VE, HA, BQ, OD, ...) |
journal_label |
string | Libellé du journal |
label |
string | Libellé de l'écriture |
lettrage |
Code de lettrage | |
lettrage_date |
||
piece_date |
string(date) | Date de la pièce |
piece_ref |
string | Référence de la pièce |
validation_date |
PayrollEntry¶
| Name | Type | Description |
|---|---|---|
employee_charges |
Charges salariales | |
employee_id |
string | Identifiant salarié |
employer_charges |
Charges patronales | |
gross_salary |
Salaire brut | |
net_salary |
Salaire net | |
period |
string | Periode YYYY-MM |
PayrollEntryExportRequest¶
| Name | Type | Description |
|---|---|---|
data |
Array<PayrollEntry> |
PayrollExportRequest¶
| Name | Type | Description |
|---|---|---|
variables |
Array<PayrollVariable> |
PayrollVariable¶
| Name | Type | Description |
|---|---|---|
amount |
Montant calculé | |
code |
string | Code rubrique paie |
comment |
||
employee_id |
string | Identifiant salarié |
employee_name |
string | Nom complet |
label |
string | Libellé de l'élément |
period |
string | Periode YYYY-MM |
quantity |
Quantité (jours, heures) | |
rate |
Taux (TJM, taux horaire) | |
unit |
string | Unité (jours, heures, forfait) |
PennylaneExportRequest¶
| Name | Type | Description |
|---|---|---|
entries |
Array<JournalEntry> |
SageExportRequest¶
| Name | Type | Description |
|---|---|---|
entries |
Array<JournalEntry> |
ValidationError¶
| Name | Type | Description |
|---|---|---|
ctx |
||
input |
||
loc |
Array<> | |
msg |
string | |
type |
string |