Integration en quelques lignes
// Exemple avec fetch (JavaScript/Node.js)
const response = await fetch('https://formatx.fr/api/v1/convert', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
pdfBase64: '...', // Votre PDF en base64
profile: 'comfort', // basic, comfort, ou extended
autoValidate: true
})
});
const result = await response.json();
// result.data.facturxPdf contient le PDF Factur-X en base64
// result.data.xml contient le XML extrait# Exemple avec curl
curl -X POST https://formatx.fr/api/v1/convert \
-H "Content-Type: application/json" \
-d '{"pdfBase64": "...", "profile": "comfort"}'Pourquoi choisir l'API FormatX ?
Rapide
Conversion en moins de 30 secondes. Extraction IA des donnees, generation du XML et embedding dans le PDF.
Conforme
Factur-X genere conforme EN 16931. Compatible Chorus Pro et toutes les PDP francaises.
Simple
API REST standard. Envoyez un PDF en base64, recevez un Factur-X. Pas de SDK complexe.
Endpoints disponibles
POST
/api/v1/convertConvertit un PDF, Excel, Word ou image en Factur-X conforme.
Entree: PDF/Excel/Word/Image en base64 | Sortie: Factur-X PDF + XML
POST
/api/v1/validateValide un fichier Factur-X existant contre le schema EN 16931.
Entree: Factur-X PDF en base64 | Sortie: Rapport de validation
GET
/api/v1/statsStatistiques d'utilisation de votre compte API.
Sortie: Nombre de conversions, validations, etc.