Aller au contenu

omnisense/omnibill Référence de l’API

Étage
Famille
Version
1.x
Vérifié en réel
Son README ne le dit pas
Licence
MIT
composer require omnisense/omnibill:1.x-dev

Lue dans les fichiers PHP du paquet au commit 472e2cf40ca6 : 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é.

Omnibill

  • Config class

    A gateway's configuration while its factory builds it: the options given, the factory's defaults under them, and the keys that must be filled.

    5 methods

  • Gateway class

    A gateway's actions behind one door: the first action supporting a request answers it.

    13 methods

  • GatewayFactory class

    The Omnibus way: a gateway's factory fills a Config - its name, title, capabilities, the options it needs, its client ("omnibill.api", a closure of the Config: a provider's API, a token signer, a store) and its actions ("omnibill.action.<name>") - and the gateway is those actions, the client handed to the ones that ask for it.

    3 methods

  • GatewayFactoryInterface interface

    Builds a gateway from its options (a platform's address, a client and its secret, a mailer's sender...).

    2 methods

  • GatewayInterface interface

    One way to transmit and receive electronic invoices, configured - an e-mail, an approved platform, the public sector's portal: the same questions for all of them. Each typed method is a shortcut for execute() with its request; a gateway that does not do something throws NotSupportedException, and supports() says so beforehand.

    12 methods

  • Registry class

    The application's gateways by name, each built once from its factory and options:

    8 methods

Omnibill\Action

  • ActionInterface interface

    One thing a gateway does: answers the requests it supports.

    2 methods

  • ApiAwareInterface interface

    An action that works through the gateway's own client: a provider's API, a signer, a store.

    1 method

  • ApiAwareTrait trait

    1 method

Omnibill\Bridge\Symfony

  • OmnibillBundle class

    Omnibill in a Symfony application: the gateway packages installed (omnibill/email, omnibill/afnor, omnibill/chorus-pro) registered, the gateways built from configuration and injectable by their name:

    2 methods

Omnibill\Exception

  • InvalidConfigException class

    A gateway misconfigured: an option missing, an unknown factory, an invoice or a status without what the gateway needs.

  • InvalidKeyException class

    The platform refused the application's credentials: a client, a secret, a technical account.

  • InvalidNotificationException class

    A callback that is not the provider's: its signature does not hold, or it is too old.

  • NotSupportedException class

    The gateway does not do that: no directory behind an e-mail, no inbox for a supplier on Chorus Pro. supports() says so beforehand.

    1 method

  • OmnibillException interface

    Every exception Omnibill throws.

  • ProviderException class

    The platform refused the request, or answered with an error.

    1 method · 2 properties

  • UnreachableException class

    The platform did not answer: no connection, a timeout, a server error, a quota exceeded. Nothing was transmitted, nothing was decided: try again.

Omnibill\Http

  • Answer class

    A provider's answer, read whole: its status, headers (lower-case names) and body. send() is the one place the family's gateways call through: no connection, a timeout, a server error or a quota exceeded is an UnreachableException - the provider said nothing about the request - and anything else comes back for the gateway to read. The request's secrets stay out of what it throws: the HTTP client's message with the key's parameters masked (Redaction::text(), api_key=***), its exception wrapped as a copy (Redaction::copy()), no trace keeping the arguments where the options stood.

    4 methods · 3 properties

  • ClientCredentials class

    An OAuth 2.0 access token by the client credentials grant - what the platforms' APIs ask (XP Z12-013's, PISTE's): asked once, kept until a minute before it lapses.

    3 methods

  • Redaction class

    What a failed call may carry of its credentials, taken out before the failure leaves the package: an HTTP client's exception quotes the URL called (a key in its query, a password in its user part), and every exception's trace keeps the arguments of the calls under it (the request options, headers and query with the key) unless PHP runs with zend.exception_ignore_args.

    5 methods · 1 constant

Omnibill\Model

  • Addressing class

    Where a company receives its invoices, as a directory answers: a line of the national directory - a SIREN, maybe a SIRET and a routing code, the electronic address to send to, the kind of platform behind it.

    2 methods · 8 properties

  • Capabilities class

    What a gateway carries and how, said before anything is sent. The operations it answers are asked of the gateway itself (supports()).

    3 methods · 4 properties

  • Direction enum

    2 cases

  • EReport class

    An e-reporting file: the transactions with private persons or abroad, and their payments, as the tax administration asks them - already produced, like an invoice.

    1 method · 4 properties

  • Event enum

    3 cases

  • Flow class

    One transmission on a gateway: an invoice, a status, a report, sent or received. The platform's reference is what to keep, to ask about it again.

    2 methods · 13 properties

  • FlowKind enum

    What a flow carries.

    4 cases

  • FlowState enum

    Whether the platform took the file - its technical acknowledgement, not what the recipient did with the invoice (LifecycleStatus).

    3 cases

  • Inbox class

    What receive() found, and where to start next time: keep the cursor and give it back to the next receive().

    3 methods · 3 properties

  • Invoice class

    An invoice to transmit, or one received: its file, already conformant (Factur-X, UBL, CII - the application's to produce: horstoeko/zugferd), and what the application knows of it. The family reads nothing inside the file; what a gateway needs beyond it - a number to follow it by, a recipient's e-mail - is given here.

    4 methods · 11 properties

  • LifecycleStatus enum

    Where an invoice stands, in the words of the French reform: the lifecycle statuses of the DGFiP's external specifications (general file v3.2, 2026-04-30), each with its code - 200, 210, 212 and 213 are mandatory, the others optional. SENT is the family's own: an invoice handed to its recipient outside any platform (by e-mail).

    5 methods · 15 cases

  • Notification class

    What a platform told the application's webhook, its signature checked: an event about one flow. Fetch or receive what it announces.

    1 method · 5 properties

  • Party class

    A company on an invoice: who issues it, who receives it. Identifiers only - a name for the people who read it, an e-mail for the gateway that sends by e-mail.

    1 method · 7 properties

  • Received class

    One thing a gateway received for the application: an invoice from a supplier, or a status about an invoice - the flow it came in, and its file.

    2 methods · 3 properties

  • StatusChange class

    One step of an invoice's lifecycle: told by a platform, or declared by the application (setStatus: "paid", "refused"). Where a platform carries statuses as files (CDAR), the file is given: the family does not write one.

    1 method · 8 properties

  • Syntax enum

    The syntax of a file a gateway carries - the names XP Z12-013's Flow Service gives them. The family reads none: a file arrives conformant.

    2 methods · 5 cases

Omnibill\Request

  • FetchStatus class

    Where a flow stands now: the platform's acknowledgement, the invoice's status. Result: the Flow, updated.

    2 methods · 1 property

  • Lookup class

    Where a company receives its invoices: the directory's lines for a SIREN (9 digits) or a SIRET (14). Result: a list of Addressing, empty when the company is not in the directory.

    2 methods · 1 property

  • Notify class

    What the provider sent to the application's webhook: the raw body and the request's headers, for the signature. Result: the Notification, or InvalidNotificationException when the signature does not hold.

    3 methods · 2 properties

  • Receive class

    What arrived for the application since the cursor given: invoices from suppliers, statuses about its own invoices. Result: an Inbox, with the cursor to give next time.

    2 methods · 2 properties

  • Report class

    Transmit an e-reporting file. Result: its Flow.

    2 methods · 2 properties

  • Request class

    A question put to a gateway. The action that supports it answers by setting the result; the gateway hands the request back.

    3 methods

  • SetStatus class

    Declare a status: a supplier's invoice refused or approved, one's own invoice paid. Result: the Flow that carried it, or the invoice's, updated.

    2 methods · 2 properties

  • Submit class

    Transmit an invoice. Result: its Flow, PENDING until the platform checked it.

    2 methods · 2 properties

Omnibill

Config class

final class Config extends ArrayObject Config.php:13

A gateway's configuration while its factory builds it: the options given, the factory's defaults under them, and the keys that must be filled.

Config::defaults()

public function defaults(array $defaults): self

Sets each key not set yet.

Config::validateNotEmpty()

public function validateNotEmpty(array $keys): void

Config::get()

public function get(string $key, mixed $default = null): mixed

Config::bool()

public function bool(string $key): bool

A boolean option, as an environment variable gives it too: "1", "true", "yes", "on".

Config::list()

public function list(string $key): array

A list given as one environment variable arrives as a single comma-separated string: split here, at run time.

Gateway class

final class Gateway implements GatewayInterface Gateway.php:17

A gateway's actions behind one door: the first action supporting a request answers it.

Gateway::__construct()

public function __construct(readonly string $name, readonly string $title, readonly Capabilities $capabilities, readonly array $actions)

Gateway::getName()

public function getName(): string

Gateway::getTitle()

public function getTitle(): string

Gateway::capabilities()

public function capabilities(): Capabilities

Gateway::supports()

public function supports(string $request): bool

Gateway::execute()

public function execute(Request\Request $request): Request\Request

Gateway::submit()

public function submit(Invoice $invoice, ?string $trackingId = null): Flow

Gateway::fetchStatus()

public function fetchStatus(Flow $flow): Flow

Gateway::receive()

public function receive(?string $cursor = null, int $limit = 25): Inbox

Gateway::setStatus()

public function setStatus(StatusChange $change, ?Flow $flow = null): Flow

Gateway::lookup()

public function lookup(string $identifier): array

Gateway::report()

public function report(EReport $report, ?string $trackingId = null): Flow

Gateway::notify()

public function notify(string $body, array $headers = []): Notification

GatewayFactory class

abstract class GatewayFactory implements GatewayFactoryInterface GatewayFactory.php:20

The Omnibus way: a gateway's factory fills a Config - its name, title, capabilities, the options it needs, its client ("omnibill.api", a closure of the Config: a provider's API, a token signer, a store) and its actions ("omnibill.action.<name>") - and the gateway is those actions, the client handed to the ones that ask for it.

Nothing here calls anything: a factory whose provider is reached over HTTP takes its client in its own constructor.

GatewayFactory::getName()

public function getName(): string

GatewayFactory::create()

public function create(array $options = []): GatewayInterface

GatewayFactory::createConfig()

public function createConfig(array $options = []): Config

GatewayFactoryInterface interface

interface GatewayFactoryInterface GatewayFactoryInterface.php:6

Builds a gateway from its options (a platform's address, a client and its secret, a mailer's sender...).

GatewayFactoryInterface::getName()

public function getName(): string

The name gateways are configured with: "email", "afnor", "chorus-pro".

..

GatewayFactoryInterface::create()

public function create(array $options = []): GatewayInterface

GatewayInterface interface

interface GatewayInterface GatewayInterface.php:26

One way to transmit and receive electronic invoices, configured - an e-mail, an approved platform, the public sector's portal: the same questions for all of them. Each typed method is a shortcut for execute() with its request; a gateway that does not do something throws NotSupportedException, and supports() says so beforehand.

A gateway carries files already conformant. It produces none, reads none beyond what it must to route them (a lifecycle message's status), and keeps no books: the application does.

GatewayInterface::getName()

public function getName(): string

GatewayInterface::getTitle()

public function getTitle(): string

GatewayInterface::capabilities()

public function capabilities(): Capabilities

What it carries, and whether it is an approved platform's channel.

GatewayInterface::supports()

public function supports(string $request): bool

GatewayInterface::execute()

public function execute(Request $request): Request
Returns

answered

Throws

Exception\NotSupportedException

Throws

Exception\ProviderException

GatewayInterface::submit()

public function submit(Invoice $invoice, ?string $trackingId = null): Flow

Transmit an invoice: its flow, to keep.

GatewayInterface::fetchStatus()

public function fetchStatus(Flow $flow): Flow

The flow as the platform has it now.

GatewayInterface::receive()

public function receive(?string $cursor = null, int $limit = 25): Inbox

What arrived since the cursor: invoices, statuses.

GatewayInterface::setStatus()

public function setStatus(StatusChange $change, ?Flow $flow = null): Flow

Declare a status: paid, refused, approved.

..

GatewayInterface::lookup()

public function lookup(string $identifier): array

Where a company receives its invoices (SIREN or SIRET).

GatewayInterface::report()

public function report(EReport $report, ?string $trackingId = null): Flow

Transmit an e-reporting file.

GatewayInterface::notify()

public function notify(string $body, array $headers = []): Notification

What the platform is telling us (a webhook): checked against its signature, read as one event.

Throws

Exception\InvalidNotificationException when the signature does not hold

Registry class

final class Registry Registry.php:16

The application's gateways by name, each built once from its factory and options:

new Registry([new EmailGatewayFactory($mailer), new AfnorGatewayFactory($http)], [ 'email' => ['factory' => 'email', 'options' => ['from' => 'factures@example.org']], 'platform' => ['factory' => 'afnor', 'options' => ['flow_url' => 'https://api.flow.example-pa.fr/flow-service', 'token_url' => '...', 'client_id' => '...', 'client_secret' => '...']], ]);

Registry::__construct()

public function __construct(iterable $factories, readonly array $config)

Registry::get()

public function get(string $name): GatewayInterface

Registry::has()

public function has(string $name): bool

Registry::options()

public function options(string $name): array
Returns

the options a gateway is configured with

Registry::create()

public function create(string $name, array $overrides = []): GatewayInterface

A gateway built afresh, its configured options with $overrides over them - an instance typed in a back office, say. Not kept: get() still gives the configured one.

Registry::names()

public function names(): array
Returns

the configured gateways' names

Registry::all()

public function all(): array

Registry::factories()

public function factories(): array
Returns

the factories installed: what factory: may name

Omnibill\Action

ActionInterface interface

interface ActionInterface ActionInterface.php:8

One thing a gateway does: answers the requests it supports.

ActionInterface::supports()

public function supports(Request $request): bool

ActionInterface::execute()

public function execute(Request $request): void

Sets the request's result, or throws an Omnibill\Exception\OmnibillException.

ApiAwareInterface interface

interface ApiAwareInterface ApiAwareInterface.php:6

An action that works through the gateway's own client: a provider's API, a signer, a store.

ApiAwareInterface::setApi()

public function setApi(object $api): void

ApiAwareTrait trait

trait ApiAwareTrait ApiAwareTrait.php:10

ApiAwareTrait::setApi()

public function setApi(object $api): void

Omnibill\Bridge\Symfony

OmnibillBundle class

final class OmnibillBundle extends AbstractBundle OmnibillBundle.php:48

Omnibill in a Symfony application: the gateway packages installed (omnibill/email, omnibill/afnor, omnibill/chorus-pro) registered, the gateways built from configuration and injectable by their name:

omnibill: gateways: email: factory: email options: { from: 'factures@example.org' } platform: factory: afnor options: { flow_url: '%env(PA_FLOW_URL)%', directory_url: '%env(PA_DIRECTORY_URL)%', token_url: '%env(PA_TOKEN_URL)%', client_id: '%env(PA_CLIENT_ID)%', client_secret: '%env(PA_CLIENT_SECRET)%' } public: factory: chorus-pro options: { client_id: '%env(PISTE_CLIENT_ID)%', client_secret: '%env(PISTE_CLIENT_SECRET)%', login: '%env(CPRO_LOGIN)%', password: '%env(CPRO_PASSWORD)%' }

public function __construct(GatewayInterface $email, GatewayInterface $platform) }

Nothing is built, nor checked, when the container compiles: a gateway is built the first time it is asked for, and an option left empty only shows then (InvalidConfigException).

A factory is autowired: what its constructor asks for - omnibill/email's mailer and status store - is the application's service of that type, when it has one; the application's http_client is given to those that call a platform. An application's own factories (a GatewayFactoryInterface) are registered too, autoconfigured.

OmnibillBundle::configure()

public function configure(DefinitionConfigurator $definition): void

OmnibillBundle::loadExtension()

public function loadExtension(array $config, ContainerConfigurator $container, ContainerBuilder $builder): void

Omnibill\Exception

InvalidConfigException class

final class InvalidConfigException extends LogicException implements OmnibillException InvalidConfigException.php:6

A gateway misconfigured: an option missing, an unknown factory, an invoice or a status without what the gateway needs.

InvalidKeyException class

final class InvalidKeyException extends ProviderException InvalidKeyException.php:6

The platform refused the application's credentials: a client, a secret, a technical account.

InvalidNotificationException class

final class InvalidNotificationException extends ProviderException InvalidNotificationException.php:6

A callback that is not the provider's: its signature does not hold, or it is too old.

NotSupportedException class

final class NotSupportedException extends LogicException implements OmnibillException NotSupportedException.php:11

The gateway does not do that: no directory behind an e-mail, no inbox for a supplier on Chorus Pro. supports() says so beforehand.

NotSupportedException::for()

public static function for(Request $request, string $gateway): self

OmnibillException interface

interface OmnibillException extends Throwable OmnibillException.php:6

Every exception Omnibill throws.

ProviderException class

class ProviderException extends RuntimeException implements OmnibillException ProviderException.php:6

The platform refused the request, or answered with an error.

public readonly string $provider
public readonly ?string $providerCode

The provider's own error code, when it gave one

ProviderException::__construct()

public function __construct(public readonly string $provider, string $message, public readonly ?string $providerCode = null, ?\Throwable $previous = null)

UnreachableException class

final class UnreachableException extends ProviderException UnreachableException.php:9

The platform did not answer: no connection, a timeout, a server error, a quota exceeded. Nothing was transmitted, nothing was decided: try again.

Omnibill\Http

Answer class

final readonly class Answer Answer.php:21

A provider's answer, read whole: its status, headers (lower-case names) and body. send() is the one place the family's gateways call through: no connection, a timeout, a server error or a quota exceeded is an UnreachableException - the provider said nothing about the request - and anything else comes back for the gateway to read. The request's secrets stay out of what it throws: the HTTP client's message with the key's parameters masked (Redaction::text(), api_key=***), its exception wrapped as a copy (Redaction::copy()), no trace keeping the arguments where the options stood.

public int $status
public array $headers
public string $body

Answer::__construct()

public function __construct(public int $status, public array $headers, public string $body, string $provider)

Answer::send()

public static function send(HttpClientInterface $http, string $provider, string $method, string $url, array $options = []): self
$options

the HTTP client's options: body, json, query, headers, timeout

Answer::header()

public function header(string $name): ?string

Answer::json()

public function json(): array

The body as a JSON object.

ClientCredentials class

final class ClientCredentials ClientCredentials.php:13

An OAuth 2.0 access token by the client credentials grant - what the platforms' APIs ask (XP Z12-013's, PISTE's): asked once, kept until a minute before it lapses.

ClientCredentials::__construct()

public function __construct(readonly HttpClientInterface $http, readonly string $provider, readonly string $tokenUrl, readonly string $clientId, readonly string $clientSecret, readonly ?string $scope = null, readonly ?\Closure $clock = null)

ClientCredentials::token()

public function token(): string

ClientCredentials::reset()

public function reset(): void

Forget the token: the next call asks for a new one (after a 401).

Redaction class

final class Redaction Redaction.php:22

What a failed call may carry of its credentials, taken out before the failure leaves the package: an HTTP client's exception quotes the URL called (a key in its query, a password in its user part), and every exception's trace keeps the arguments of the calls under it (the request options, headers and query with the key) unless PHP runs with zend.exception_ignore_args.

copy() gives the previous exception to wrap instead of the client's own: the same class and code, its message with the key's parameters, the user part and every secret value replaced by ***, its trace without arguments, its own previous copied the same way. Properties of the client's class beyond those of \Exception are not copied (a Symfony HttpException's response, a PSR-18 exception's request: their URL holds the key). withoutArguments() takes the arguments out of the trace of the exception thrown in its place.

const MASK = '***'

Redaction::secrets()

public static function secrets(string $url, array $options = []): array

The secrets a request carries: the values of its query parameters, headers and body fields named as credentials (key, token, secret, password, signature, auth...), a bearer token, a basic password, the URL's user part.

$options

the HTTP client's options

Redaction::sensitive()

public static function sensitive(string $name): bool

Whether a parameter, header or field of this name holds a credential.

Redaction::text()

public static function text(string $text, array $secrets = []): string

A text without credentials: in every address, the user part and the parameters named as credentials masked (api_key=***); then every secret given, raw or URL-encoded, masked wherever it stands.

Redaction::copy()

public static function copy(\Throwable $failure, array $secrets = []): \Throwable

A copy of a failure to wrap in its place: its class, code, file and line, its message through text(), its trace without arguments, its previous copied the same way.

Redaction::withoutArguments()

public static function withoutArguments(\Throwable $failure): \Throwable

The failure given, the arguments out of its trace (and out of its previous ones'), as zend.exception_ignore_args would have left it.

Omnibill\Model

Addressing class

final readonly class Addressing Addressing.php:10

Where a company receives its invoices, as a directory answers: a line of the national directory - a SIREN, maybe a SIRET and a routing code, the electronic address to send to, the kind of platform behind it.

public string $siren
public ?string $siret
public ?string $routingCode
public ?string $electronicAddress
public ?string $name
public ?string $platform

WK: an approved platform (PA); DFH: the public portal (PPF), as the directory codes them

public ?string $status

Enabled, Disabled, Upcoming

public array $data

Addressing::__construct()

public function __construct(public string $siren, public ?string $siret = null, public ?string $routingCode = null, public ?string $electronicAddress = null, public ?string $name = null, public ?string $platform = null, public ?string $status = null, public array $data = [])
$platform

WK: an approved platform (PA); DFH: the public portal (PPF), as the directory codes them

$status

Enabled, Disabled, Upcoming

Addressing::isEnabled()

public function isEnabled(): bool

Capabilities class

final readonly class Capabilities Capabilities.php:9

What a gateway carries and how, said before anything is sent. The operations it answers are asked of the gateway itself (supports()).

public array $syntaxes

the files it carries

public bool $approved

whether it is an approved platform's channel (plateforme agréée): what the reform asks of B2B invoices

public bool $publicSector

whether it reaches public entities (B2G)

public ?int $maxSize

bytes a file may weigh

Capabilities::__construct()

public function __construct(public array $syntaxes = [Syntax::FACTURX, Syntax::UBL, Syntax::CII], public bool $approved = false, public bool $publicSector = false, public ?int $maxSize = null)
$syntaxes

the files it carries

$approved

whether it is an approved platform's channel (plateforme agréée): what the reform asks of B2B invoices

$publicSector

whether it reaches public entities (B2G)

$maxSize

bytes a file may weigh

Capabilities::carries()

public function carries(Syntax $syntax): bool

Capabilities::toArray()

public function toArray(): array

Direction enum

enum Direction Direction.php:5

case OUT = 'out'

Sent by the application

case IN = 'in'

Received by the application

EReport class

final readonly class EReport EReport.php:10

An e-reporting file: the transactions with private persons or abroad, and their payments, as the tax administration asks them - already produced, like an invoice.

public string $content
public string $filename
public Syntax $syntax
public ?string $rule

B2C, B2BInt... where the platform asks

EReport::__construct()

public function __construct(public string $content, public string $filename, public Syntax $syntax = Syntax::FRR, public ?string $rule = null)
$rule

B2C, B2BInt... where the platform asks

Event enum

enum Event Event.php:5

case FLOW_UPDATED = 'flow_updated'

A flow was taken or rejected by the platform

case RECEIVED = 'received'

Something arrived for the application: an invoice, a status

case OTHER = 'other'

Flow class

final readonly class Flow Flow.php:10

One transmission on a gateway: an invoice, a status, a report, sent or received. The platform's reference is what to keep, to ask about it again.

public string $reference

the gateway's name for it: a flow id, a deposit number, a message id

public FlowKind $kind
public Direction $direction
public FlowState $state
public ?string $trackingId

the application's own, where the platform keeps one

public ?string $invoiceNumber

the invoice it is about

public ?\DateTimeImmutable $submittedAt
public ?\DateTimeImmutable $updatedAt
public ?LifecycleStatus $status

the invoice's latest status, as far as the gateway knows

public array $history

the statuses known, oldest first

public array $errors

why the platform rejected it

public ?string $name
public array $data

what else the platform answered

Flow::__construct()

public function __construct(public string $reference, public FlowKind $kind = FlowKind::INVOICE, public Direction $direction = Direction::OUT, public FlowState $state = FlowState::PENDING, public ?string $trackingId = null, public ?string $invoiceNumber = null, public ?\DateTimeImmutable $submittedAt = null, public ?\DateTimeImmutable $updatedAt = null, public ?LifecycleStatus $status = null, public array $history = [], public array $errors = [], public ?string $name = null, public array $data = [])
$reference

the gateway's name for it: a flow id, a deposit number, a message id

$trackingId

the application's own, where the platform keeps one

$invoiceNumber

the invoice it is about

$status

the invoice's latest status, as far as the gateway knows

$history

the statuses known, oldest first

$errors

why the platform rejected it

$data

what else the platform answered

Flow::with()

public function with(?FlowState $state = null, ?LifecycleStatus $status = null, ?array $history = null, ?array $errors = null, ?\DateTimeImmutable $updatedAt = null, ?array $data = null): self

FlowKind enum

enum FlowKind FlowKind.php:6

What a flow carries.

case INVOICE = 'invoice'
case LIFECYCLE = 'lifecycle'
case REPORT = 'report'
case OTHER = 'other'

FlowState enum

enum FlowState FlowState.php:9

Whether the platform took the file - its technical acknowledgement, not what the recipient did with the invoice (LifecycleStatus).

case PENDING = 'pending'

Received, not checked yet

case ACCEPTED = 'accepted'

Checked and taken

case REJECTED = 'rejected'

Refused by the platform's checks: see the flow's errors

Inbox class

final readonly class Inbox Inbox.php:9

What receive() found, and where to start next time: keep the cursor and give it back to the next receive().

public array $items
public ?string $cursor
public bool $more

Inbox::__construct()

public function __construct(public array $items = [], public ?string $cursor = null, public bool $more = false)

Inbox::invoices()

public function invoices(): array

Inbox::statuses()

public function statuses(): array

Invoice class

final readonly class Invoice Invoice.php:12

An invoice to transmit, or one received: its file, already conformant (Factur-X, UBL, CII - the application's to produce: horstoeko/zugferd), and what the application knows of it. The family reads nothing inside the file; what a gateway needs beyond it - a number to follow it by, a recipient's e-mail - is given here.

public string $content

the file's bytes

public string $filename

with its extension: what the platform and the recipient see

public Syntax $syntax
public ?string $number

the invoice's number: what its statuses are followed by

public ?Party $seller
public ?Party $buyer
public ?\DateTimeImmutable $issuedAt
public ?string $total

the amount due, as a decimal string: "1234.50"

public ?string $currency
public ?string $profile

Basic, CIUS, Extended-CTC-FR, where the platform asks

public ?string $rule

the processing rule, where the platform asks: B2B, B2BInt, B2C, B2G...

Invoice::__construct()

public function __construct(public string $content, public string $filename, public Syntax $syntax, public ?string $number = null, public ?Party $seller = null, public ?Party $buyer = null, public ?\DateTimeImmutable $issuedAt = null, public ?string $total = null, public ?string $currency = 'EUR', public ?string $profile = null, public ?string $rule = null)
$content

the file's bytes

$filename

with its extension: what the platform and the recipient see

$number

the invoice's number: what its statuses are followed by

$total

the amount due, as a decimal string: "1234.50"

$profile

Basic, CIUS, Extended-CTC-FR, where the platform asks

$rule

the processing rule, where the platform asks: B2B, B2BInt, B2C, B2G...

Invoice::fromFile()

public static function fromFile(string $path, ?Syntax $syntax = null, ?string $number = null, ?Party $buyer = null): self

An invoice from a file on disk, its syntax told by the extension unless given.

Invoice::sha256()

public function sha256(): string

Invoice::size()

public function size(): int

LifecycleStatus enum

enum LifecycleStatus LifecycleStatus.php:12

Where an invoice stands, in the words of the French reform: the lifecycle statuses of the DGFiP's external specifications (general file v3.2, 2026-04-30), each with its code - 200, 210, 212 and 213 are mandatory, the others optional. SENT is the family's own: an invoice handed to its recipient outside any platform (by e-mail).

case SENT = 'sent'
case DEPOSITED = 'deposited'
case ISSUED = 'issued'
case RECEIVED = 'received'
case MADE_AVAILABLE = 'made_available'
case TAKEN_OVER = 'taken_over'
case APPROVED = 'approved'
case PARTIALLY_APPROVED = 'partially_approved'
case DISPUTED = 'disputed'
case SUSPENDED = 'suspended'
case COMPLETED = 'completed'
case REFUSED = 'refused'
case PAYMENT_SENT = 'payment_sent'
case PAID = 'paid'
case REJECTED = 'rejected'

LifecycleStatus::code()

public function code(): ?int

The reform's code: 200 to 213; null for SENT.

LifecycleStatus::label()

public function label(): string

Its name in the DGFiP's specifications.

LifecycleStatus::isMandatory()

public function isMandatory(): bool

Whether the reform makes it mandatory: Déposée, Refusée, Encaissée, Rejetée.

LifecycleStatus::isFinal()

public function isFinal(): bool

Whether nothing follows it: refused, rejected, paid.

LifecycleStatus::fromCode()

public static function fromCode(int|string $code): ?self

From a code, "212" or "fr:212" as some platforms write it; null when it is not one.

Notification class

final readonly class Notification Notification.php:9

What a platform told the application's webhook, its signature checked: an event about one flow. Fetch or receive what it announces.

public Event $event
public ?Flow $flow
public ?\DateTimeImmutable $at
public ?string $id

the same for a callback sent twice: what to deduplicate on

public array $data

the platform's payload

Notification::__construct()

public function __construct(public Event $event, public ?Flow $flow = null, public ?\DateTimeImmutable $at = null, public ?string $id = null, public array $data = [])
$id

the same for a callback sent twice: what to deduplicate on

$data

the platform's payload

Party class

final readonly class Party Party.php:10

A company on an invoice: who issues it, who receives it. Identifiers only - a name for the people who read it, an e-mail for the gateway that sends by e-mail.

public ?string $name
public ?string $siren

the legal unit (9 digits), France

public ?string $siret

the establishment (14 digits), France

public ?string $electronicAddress

the electronic invoicing address the directory gives (addressing identifier)

public ?string $routingCode

a service, a cost centre: the routing code under the SIRET

public ?string $email

where an e-mail gateway sends

public ?string $country

ISO 3166-1 alpha-2

Party::__construct()

public function __construct(public ?string $name = null, public ?string $siren = null, public ?string $siret = null, public ?string $electronicAddress = null, public ?string $routingCode = null, public ?string $email = null, public ?string $country = 'FR')
$siren

the legal unit (9 digits), France

$siret

the establishment (14 digits), France

$electronicAddress

the electronic invoicing address the directory gives (addressing identifier)

$routingCode

a service, a cost centre: the routing code under the SIRET

$email

where an e-mail gateway sends

$country

ISO 3166-1 alpha-2

Received class

final readonly class Received Received.php:10

One thing a gateway received for the application: an invoice from a supplier, or a status about an invoice - the flow it came in, and its file.

public Flow $flow
public ?Invoice $invoice
public ?StatusChange $status

Received::__construct()

public function __construct(public Flow $flow, public ?Invoice $invoice = null, public ?StatusChange $status = null)

Received::isInvoice()

public function isInvoice(): bool

StatusChange class

final readonly class StatusChange StatusChange.php:11

One step of an invoice's lifecycle: told by a platform, or declared by the application (setStatus: "paid", "refused"). Where a platform carries statuses as files (CDAR), the file is given: the family does not write one.

public LifecycleStatus $status
public ?string $invoiceNumber
public ?\DateTimeImmutable $at
public ?string $reason
public ?string $amount

for PAID or PARTIALLY_APPROVED, the amount, as a decimal string

public ?string $code

the platform's own code, as it gave it

public ?string $file

the lifecycle message itself (CDAR), where the platform carries one

public ?string $filename

StatusChange::__construct()

public function __construct(public LifecycleStatus $status, public ?string $invoiceNumber = null, public ?\DateTimeImmutable $at = null, public ?string $reason = null, public ?string $amount = null, public ?string $code = null, public ?string $file = null, public ?string $filename = null)
$code

the platform's own code, as it gave it

$amount

for PAID or PARTIALLY_APPROVED, the amount, as a decimal string

$file

the lifecycle message itself (CDAR), where the platform carries one

Syntax enum

enum Syntax Syntax.php:9

The syntax of a file a gateway carries - the names XP Z12-013's Flow Service gives them. The family reads none: a file arrives conformant.

case FACTURX = 'Factur-X'

A PDF/A-3 with its CII XML inside (Factur-X, ZUGFeRD)

case UBL = 'UBL'

UBL 2.1

case CII = 'CII'

UN/CEFACT Cross Industry Invoice

case CDAR = 'CDAR'

UN/CEFACT Cross Domain Acknowledgement and Response: a lifecycle status

case FRR = 'FRR'

An e-reporting file (transactions, payments)

Syntax::mimeType()

public function mimeType(): string

Syntax::extension()

public function extension(): string

Omnibill\Request

FetchStatus class

final class FetchStatus extends Request FetchStatus.php:8

Where a flow stands now: the platform's acknowledgement, the invoice's status. Result: the Flow, updated.

public readonly Flow $flow

FetchStatus::__construct()

public function __construct(public readonly Flow $flow)

FetchStatus::getFlow()

public function getFlow(): ?Flow

Lookup class

final class Lookup extends Request Lookup.php:12

Where a company receives its invoices: the directory's lines for a SIREN (9 digits) or a SIRET (14). Result: a list of Addressing, empty when the company is not in the directory.

public readonly string $identifier

Lookup::__construct()

public function __construct(public readonly string $identifier)

Lookup::getAddressings()

public function getAddressings(): ?array

Notify class

final class Notify extends Request Notify.php:12

What the provider sent to the application's webhook: the raw body and the request's headers, for the signature. Result: the Notification, or InvalidNotificationException when the signature does not hold.

public readonly string $body
public readonly array $headers

Notify::__construct()

public function __construct(public readonly string $body, public readonly array $headers = [])

Notify::header()

public function header(string $name): ?string

A header, whatever the case it came in.

Notify::getNotification()

public function getNotification(): ?Notification

Receive class

final class Receive extends Request Receive.php:12

What arrived for the application since the cursor given: invoices from suppliers, statuses about its own invoices. Result: an Inbox, with the cursor to give next time.

public readonly ?string $cursor
public readonly int $limit

Receive::__construct()

public function __construct(public readonly ?string $cursor = null, public readonly int $limit = 25)

Receive::getInbox()

public function getInbox(): ?Inbox

Report class

final class Report extends Request Report.php:9

Transmit an e-reporting file. Result: its Flow.

public readonly EReport $report
public readonly ?string $trackingId

Report::__construct()

public function __construct(public readonly EReport $report, public readonly ?string $trackingId = null)

Report::getFlow()

public function getFlow(): ?Flow

Request class

abstract class Request Request.php:9

A question put to a gateway. The action that supports it answers by setting the result; the gateway hands the request back.

Request::setResult()

public function setResult(mixed $result): void

Request::getResult()

public function getResult(): mixed

Request::isAnswered()

public function isAnswered(): bool

SetStatus class

final class SetStatus extends Request SetStatus.php:12

Declare a status: a supplier's invoice refused or approved, one's own invoice paid. Result: the Flow that carried it, or the invoice's, updated.

public readonly StatusChange $change
public readonly ?Flow $flow

SetStatus::__construct()

public function __construct(public readonly StatusChange $change, public readonly ?Flow $flow = null)

SetStatus::getFlow()

public function getFlow(): ?Flow

Submit class

final class Submit extends Request Submit.php:9

Transmit an invoice. Result: its Flow, PENDING until the platform checked it.

public readonly Invoice $invoice
public readonly ?string $trackingId

Submit::__construct()

public function __construct(public readonly Invoice $invoice, public readonly ?string $trackingId = null)

Submit::getFlow()

public function getFlow(): ?Flow