Neotimo.XpZ12013.Sdk
1.2.0
See the version list below for details.
dotnet add package Neotimo.XpZ12013.Sdk --version 1.2.0
NuGet\Install-Package Neotimo.XpZ12013.Sdk -Version 1.2.0
<PackageReference Include="Neotimo.XpZ12013.Sdk" Version="1.2.0" />
<PackageVersion Include="Neotimo.XpZ12013.Sdk" Version="1.2.0" />
<PackageReference Include="Neotimo.XpZ12013.Sdk" />
paket add Neotimo.XpZ12013.Sdk --version 1.2.0
#r "nuget: Neotimo.XpZ12013.Sdk, 1.2.0"
#:package Neotimo.XpZ12013.Sdk@1.2.0
#addin nuget:?package=Neotimo.XpZ12013.Sdk&version=1.2.0
#tool nuget:?package=Neotimo.XpZ12013.Sdk&version=1.2.0
XP Z12-013 SDK · by Neotimo
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" />
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és —
Siren(9 chiffres),Siret(14 chiffres),FlowId,WebhookId… avec conversions implicites depuis/versstring. - 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égrationMicrosoft.Extensions.DependencyInjectionest 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êteOrganization-Id). Chaque requête porte unRequest-Idde 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 Service — CreateFlowAsync, SearchFlowsAsync, GetFlowMetadataAsync, DownloadFlowAsync,
ListWebhooksAsync, GetWebhookAsync, CreateWebhookAsync, UpdateWebhookAsync, DeleteWebhookAsync.
Directory Service — SearchCompaniesAsync / GetCompanyAsync (SIREN),
SearchFacilitiesAsync / GetFacilityAsync (SIRET), SearchRoutingCodesAsync / GetRoutingCodeAsync,
SearchDirectoryLinesAsync / GetDirectoryLineAsync.
Supervision — CheckFlowHealthAsync, CheckDirectoryHealthAsync.
Pagination des flux : itérez en réutilisant
UpdatedAfteravec l'updatedAtdu dernier flux reçu (comparaison stricteupdatedAt > 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 | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
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.