Lue dans les fichiers PHP du paquet au commit 57ee0e7b2093 : ses espaces de noms, classes, interfaces et énumérations, leurs constantes, propriétés et méthodes publiques avec leur PHPDoc, et les options que prennent ses fabriques. Rien n’en est exécuté.
AfnorGatewayFactoryclassAn approved platform (plateforme agréée) through the standard API of XP Z12-013 - one package for every platform that implements it, told apart by their addresses and credentials.
20 options · 1 method
ApiclassA platform's XP Z12-013 API, as its Flow Service and Directory Service OpenAPI 1.3.0 describe it (published by the FNFE-MPE with the standard, 2026-06-30): a bearer token by OAuth 2.0 client credentials, the Organization-Id header for a delegated company, a Request-Id for the logs.
10 methods · 6 properties · 1 constant
AbstractActionclassAn action on the platform's XP Z12-013 API.
1 method
FetchStatusActionclassGET /v1/flows/{flowId}?docType=Metadata: the platform's acknowledgement.
2 methods
LookupActionclassPOST /v1/directory-line/search: where a SIREN or a SIRET receives its invoices.
2 methods
NotifyActionclassA webhook's call: its signature checked, the Flow it carries read. A flow coming in announces something to receive().
2 methods
ReceiveActionclassPOST /v1/flows/search on the flows coming in, from the cursor; each one's file downloaded (docType Original): an invoice from a supplier, or a lifecycle message (CDAR) read for its status.
2 methods
ReportActionclassAn e-reporting file, submitted as a flow (flowSyntax FRR).
2 methods
SetStatusActionclassA status declared: its lifecycle message (CDAR), produced by the application, submitted as a flow of its own.
2 methods
SubmitActionclassPOST /v1/flows: the invoice's file and its flowInfo; the platform answers 202, the flow PENDING.
2 methods
Omnibill\Afnor
AfnorGatewayFactory class
final class AfnorGatewayFactory extends GatewayFactory AfnorGatewayFactory.php:41
An approved platform (plateforme agréée) through the standard API of XP Z12-013 - one package for every platform that implements it, told apart by their addresses and credentials.
options: flow_url: https://api.flow.example-pa.fr/flow-service # required: the Flow Service's root (before /v1) directory_url: https://api.directory.example-pa.fr/directory-service # the Directory Service's root; none: no lookup() token_url: https://auth.example-pa.fr/auth-service/<customer>/token # required: OAuth 2.0, client credentials client_id: '%env(PA_CLIENT_ID)%' # required client_secret: '%env(PA_CLIENT_SECRET)%' # required scope: ~ # when the platform asks one organization_id: ~ # Organization-Id: the company acted for, under a delegation webhook_key: '%env(default::PA_WEBHOOK_KEY)%' # the webhook's signing key (base64): notify() checks Afnor-Signature with it webhook_tolerance: 300 # seconds a callback may be old; 0: any age profile: ~ # the invoices' flowProfile when the Invoice gives none: Basic, CIUS, Extended-CTC-FR rule: ~ # their processingRule: B2B, B2BInt, B2C, B2G...
The platform decides what it implements beyond the standard's mandatory routes: a route it lacks answers an error, not a refusal.
Options
| Option | Default | |
|---|---|---|
directory_url | null | |
scope | null | |
organization_id | null | |
webhook_key | null | |
webhook_tolerance | 300 | |
profile | null | |
rule | null | |
omnibill.capabilities | new Capabilities([Syntax::FACTURX, Syntax::UBL, Syntax::CII, Syntax::CDAR, Syntax::FRR], approved: true, publicSector: true, maxSize: 100 * 1024 * 1024) | The Flow Service takes a file of 100 MB at most. |
omnibill.api | function (Config $c): Api {
$http = $this->http ?? HttpClient::create();
return new Api($http, new ClientCredentials($http, Api::PROVIDER, (string) $… | |
omnibill.action.submit | new SubmitAction() | |
omnibill.action.fetch_status | new FetchStatusAction() | |
omnibill.action.receive | new ReceiveAction() | |
omnibill.action.set_status | new SetStatusAction() | |
omnibill.action.report | new ReportAction() | |
omnibill.action.lookup | static fn(Config $c) => $c->get('directory_url') ? new LookupAction() : null | |
omnibill.action.notify | static fn(Config $c) => $c->get('webhook_key') ? new NotifyAction() : null | |
flow_url | required | |
token_url | required | |
client_id | required | |
client_secret | required |
AfnorGatewayFactory::__construct()
public function __construct(readonly ?HttpClientInterface $http = null)Api class
final class Api Api.php:27
A platform's XP Z12-013 API, as its Flow Service and Directory Service OpenAPI 1.3.0 describe it (published by the FNFE-MPE with the standard, 2026-06-30): a bearer token by OAuth 2.0 client credentials, the Organization-Id header for a delegated company, a Request-Id for the logs.
const PROVIDER = 'afnor'public readonly string $flowUrlpublic readonly ?string $directoryUrlpublic readonly ?string $organizationIdpublic readonly int $webhookTolerancepublic readonly ?string $profilepublic readonly ?string $rule
Api::__construct()
public function __construct(readonly HttpClientInterface $http, readonly ClientCredentials $credentials, public readonly string $flowUrl, public readonly ?string $directoryUrl = null, public readonly ?string $organizationId = null, readonly ?string $webhookKey = null, public readonly int $webhookTolerance = 300, public readonly ?string $profile = null, public readonly ?string $rule = null, readonly ?\Closure $clock = null)Api::call()
public function call(string $method, string $url, array $options = []): AnswerA call to the platform, the token renewed once when it is refused.
Api::submit()
public function submit(string $content, string $name, Syntax $syntax, ?string $trackingId, ?string $profile, ?string $rule): arrayUploads a file as a flow: POST /v1/flows, multipart - flowInfo (JSON) and file.
- Returns
the FullFlowInfo answered
Api::metadata()
public function metadata(string $flowId): array- Returns
the Flow, its metadata
Api::download()
public function download(string $flowId, string $docType = 'Original'): stringThe file of a flow, as its emitter gave it (docType Original).
Api::search()
public function search(?string $cursor, int $limit): arrayPOST /v1/flows/search: the flows received, from the cursor.
Api::lookup()
public function lookup(string $identifier): arrayPOST /v1/directory-line/search on a SIREN or a SIRET.
Api::verifyWebhook()
public function verifyWebhook(string $body, ?string $signature, ?string $timestamp): arrayA webhook's call, its Afnor-Signature checked: the HMAC-SHA-256, under the webhook's signing key, of the SHA-256 of "<body>@<timestamp>", in base64; Afnor-Signature-Timestamp in epoch seconds.
- Returns
the Flow it carries
Api::flow()
public static function flow(array $flow, ?string $invoiceNumber = null): FlowA Flow of the standard's, as the family's: its acknowledgement as a FlowState and, for an invoice sent, as its first lifecycle status - Ok: deposited (200), Error: rejected (213).
Api::lifecycle()
public static function lifecycle(string $cdar, ?string $filename = null): ?StatusChangeA lifecycle message (CDAR) read for what the family needs - where the DGFiP's Annex 2 (Flux 6, v2.3) puts it: the invoice's number (ReferenceReferencedDocument/IssuerAssignedID), its status code (ReferenceReferencedDocument/ProcessConditionCode), the reason given, the date (ExchangedDocument/IssueDateTime).
Omnibill\Afnor\Action
AbstractAction class
abstract class AbstractAction implements ActionInterface, ApiAwareInterface AbstractAction.php:11
An action on the platform's XP Z12-013 API.
AbstractAction::__construct()
public function __construct()FetchStatusAction class
final class FetchStatusAction extends AbstractAction FetchStatusAction.php:13
GET /v1/flows/{flowId}?docType=Metadata: the platform's acknowledgement.
The recipient's statuses arrive as lifecycle flows: receive().
FetchStatusAction::supports()
public function supports(Request $request): boolFetchStatusAction::execute()
public function execute(Request $request): voidLookupAction class
final class LookupAction extends AbstractAction LookupAction.php:10
POST /v1/directory-line/search: where a SIREN or a SIRET receives its invoices.
LookupAction::supports()
public function supports(Request $request): boolLookupAction::execute()
public function execute(Request $request): voidNotifyAction class
final class NotifyAction extends AbstractAction NotifyAction.php:16
A webhook's call: its signature checked, the Flow it carries read. A flow coming in announces something to receive().
NotifyAction::supports()
public function supports(Request $request): boolNotifyAction::execute()
public function execute(Request $request): voidReceiveAction class
final class ReceiveAction extends AbstractAction ReceiveAction.php:19
POST /v1/flows/search on the flows coming in, from the cursor; each one's file downloaded (docType Original): an invoice from a supplier, or a lifecycle message (CDAR) read for its status.
ReceiveAction::supports()
public function supports(Request $request): boolReceiveAction::execute()
public function execute(Request $request): voidReportAction class
final class ReportAction extends AbstractAction ReportAction.php:10
An e-reporting file, submitted as a flow (flowSyntax FRR).
ReportAction::supports()
public function supports(Request $request): boolReportAction::execute()
public function execute(Request $request): voidSetStatusAction class
final class SetStatusAction extends AbstractAction SetStatusAction.php:15
A status declared: its lifecycle message (CDAR), produced by the application, submitted as a flow of its own.
SetStatusAction::supports()
public function supports(Request $request): boolSetStatusAction::execute()
public function execute(Request $request): voidSubmitAction class
final class SubmitAction extends AbstractAction SubmitAction.php:10
POST /v1/flows: the invoice's file and its flowInfo; the platform answers 202, the flow PENDING.
SubmitAction::supports()
public function supports(Request $request): boolSubmitAction::execute()
public function execute(Request $request): void