Neotimo.XpZ12013.Sdk 1.2.1

dotnet add package Neotimo.XpZ12013.Sdk --version 1.2.1
                    
NuGet\Install-Package Neotimo.XpZ12013.Sdk -Version 1.2.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Neotimo.XpZ12013.Sdk" Version="1.2.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Neotimo.XpZ12013.Sdk" Version="1.2.1" />
                    
Directory.Packages.props
<PackageReference Include="Neotimo.XpZ12013.Sdk" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Neotimo.XpZ12013.Sdk --version 1.2.1
                    
#r "nuget: Neotimo.XpZ12013.Sdk, 1.2.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Neotimo.XpZ12013.Sdk@1.2.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Neotimo.XpZ12013.Sdk&version=1.2.1
                    
Install as a Cake Addin
#tool nuget:?package=Neotimo.XpZ12013.Sdk&version=1.2.1
                    
Install as a Cake Tool

XP Z12-013 SDK  ·  by Neotimo

CI NuGet License: MIT

Implémentation de référence .NET — bientôt Java / TypeScript / Python — de la norme AFNOR XP Z12-013 v1.2.0, l'API standardisée d'interopérabilité de la facturation électronique française (échanges entre systèmes d'information et Plateformes de Dématérialisation Partenaires).

Offert gratuitement par Neotimo / Avenir Numérique pour accélérer l'intégration de la réforme par les éditeurs et intégrateurs. Licence MIT.

<PackageReference Include="Neotimo.XpZ12013.Sdk" />

Compatible .NET 8 et .NET 9 (multi-ciblage net8.0 / net9.0).

La norme couvre deux services, tous deux pilotés depuis un seul client :

Service Annexe Rôle
Flow Service A Dépôt de flux (factures, cycles de vie, e-reporting), recherche, téléchargement, webhooks
Directory Service B Annuaire : SIREN, SIRET, codes routage, lignes annuaire

Démarrage rapide

using XpZ12013.Sdk;

using var client = new XpZ12013Client(new XpZ12013ClientOptions
{
    FlowServiceBaseUrl      = "https://api.flow.mon-pdp.fr/flow-service",
    DirectoryServiceBaseUrl = "https://api.directory.mon-pdp.fr/directory-service",

    // OAuth2 Client Credentials (refresh automatique)
    ClientId     = "...",
    ClientSecret = "...",
    TokenUrl     = "https://auth.mon-pdp.fr/auth-service/{custId}/token",
});

// Déposer une facture
await using var file = File.OpenRead("facture.xml");
var result = await client.CreateFlowAsync(
    new FlowInfo
    {
        Name        = "facture.xml",
        FlowSyntax  = FlowSyntax.FacturX,
        FlowProfile = FlowProfile.ExtendedCtcFr,
        TrackingId  = "CMD-2026-001",
    },
    file, fileName: "facture.xml", fileContentType: "application/xml");

if (result.IsSuccess)
    Console.WriteLine($"Flux déposé : {result.Data!.FlowId}");

Pourquoi ce SDK plutôt que des appels HTTP bruts

  • Typage fort de bout en bout — modèles, enums et réponses de la norme, sérialisation gérée.
  • Identifiants validésSiren (9 chiffres), Siret (14 chiffres), FlowId, WebhookId… avec conversions implicites depuis/vers string.
  • OAuth2 Client Credentials avec refresh automatique du token (ou Bearer statique).
  • Résilience intégrée — retries avec backoff exponentiel + jitter sur les erreurs transitoires.
  • Cœur sans dépendance — uniquement la BCL .NET (HttpClient + System.Text.Json). L'intégration Microsoft.Extensions.DependencyInjection est fournie dans un paquet séparé et optionnel (Neotimo.XpZ12013.Sdk.DependencyInjection).

Authentification

Mode Configuration
OAuth2 Client Credentials (défaut) ClientId, ClientSecret, TokenUrl, Scopes (optionnel)
Bearer JWT statique UseOAuth2 = false + BearerToken

La délégation multi-tenant est gérée via OrganizationId (en-tête Organization-Id). Chaque requête porte un Request-Id de corrélation.

Injection de dépendances (optionnel)

<PackageReference Include="Neotimo.XpZ12013.Sdk.DependencyInjection" />
services.AddXpZ12013Client(options =>
{
    options.FlowServiceBaseUrl      = "https://api.flow.mon-pdp.fr/flow-service";
    options.DirectoryServiceBaseUrl = "https://api.directory.mon-pdp.fr/directory-service";
    options.ClientId     = "...";
    options.ClientSecret = "...";
    options.TokenUrl     = "https://auth.mon-pdp.fr/auth-service/{custId}/token";
});

XpZ12013Client est enregistré en Singleton (le client HTTP est sans état).

Surface couverte

Flow ServiceCreateFlowAsync, SearchFlowsAsync, GetFlowMetadataAsync, DownloadFlowAsync, ListWebhooksAsync, GetWebhookAsync, CreateWebhookAsync, UpdateWebhookAsync, DeleteWebhookAsync.

Directory ServiceSearchCompaniesAsync / GetCompanyAsync (SIREN), SearchFacilitiesAsync / GetFacilityAsync (SIRET), SearchRoutingCodesAsync / GetRoutingCodeAsync, SearchDirectoryLinesAsync / GetDirectoryLineAsync.

SupervisionCheckFlowHealthAsync, CheckDirectoryHealthAsync.

Pagination des flux : itérez en réutilisant UpdatedAfter avec l'updatedAt du dernier flux reçu (comparaison stricte updatedAt > updatedAfter).

Multi-langue

Les clients Java / TypeScript / Python sont générés depuis les contrats OpenAPI 3.0.3 officiels de la norme (dossier /spec). Voir la feuille de route.

Structure du dépôt

spec/        Contrats OpenAPI AFNOR (source de génération multi-langue)
dotnet/      SDK C# fait main : XpZ12013.Sdk (cœur) + XpZ12013.Sdk.DependencyInjection
examples/    Exemples exécutables
tests/       Tests unitaires (xUnit)
clients/     Clients générés (Java / TS / Python) — à venir

Avertissement

Ce SDK est une implémentation de référence indépendante de la norme XP Z12-013. AFNOR® est une marque de l'Association française de normalisation. Reportez-vous toujours au texte normatif officiel de l'AFNOR comme source faisant foi.

Licence

MIT © 2026 Avenir Numérique (Neotimo).

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Neotimo.XpZ12013.Sdk:

Package Downloads
Neotimo.XpZ12013.Sdk.DependencyInjection

Enregistrement Microsoft.Extensions.DependencyInjection pour le SDK Neotimo XP Z12-013. Paquet séparé pour garder le SDK cœur sans dépendance.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.1 118 5/31/2026
1.2.0 114 5/31/2026