Read from the package's own PHP files at the commit 2d73786e492d: its namespaces, classes, interfaces and enums, their public constants, properties and methods with their PHPDoc, and the options its factories take. Nothing of it is run.
ApiclassChorus Pro's "Factures" API through PISTE: a bearer token (OAuth 2.0 client credentials of a PISTE application) and the cpro-account header (the technical account, "login:password" in base64) on each call; every answer carries codeRetour (0: done) and libelle.
2 methods · 2 properties · 5 constants
ChorusProGatewayFactoryclassChorus Pro, the public sector's invoicing portal, through PISTE: a supplier's invoices to a public entity (B2G), deposited as flows and followed.
13 options · 1 method
StatusesclassChorus Pro's statuses of an invoice (statutCourantCode) as the reform's lifecycle statuses - this package's reading of them, where one matches; the code itself is always kept. Chorus Pro's validation circuits (A_VALIDER_1, VALIDEE_2...) and its own technical states have none.
1 method · 1 constant
FetchStatusActionclassPOST /v1/rechercher/fournisseur on the invoice's number: the invoice as Chorus Pro integrated it - from the flow it was deposited in, when several bear that number - and its current status (statut). Not found yet: the flow is still being processed, PENDING.
3 methods
SubmitActionclassPOST /v1/deposer/flux: the file in base64, its name, its syntax in Chorus Pro's words (syntaxeFlux). The answer's numeroFluxDepot names the flow.
4 methods
Omnibill\ChorusPro
Api class
final class Api Api.php:17
Chorus Pro's "Factures" API through PISTE: a bearer token (OAuth 2.0 client credentials of a PISTE application) and the cpro-account header (the technical account, "login:password" in base64) on each call; every answer carries codeRetour (0: done) and libelle.
const PROVIDER = 'chorus-pro'const API = 'https://api.piste.gouv.fr/cpro/factures'const OAUTH = 'https://oauth.piste.gouv.fr/api/oauth/token'const SANDBOX_API = 'https://sandbox-api.piste.gouv.fr/cpro/factures'const SANDBOX_OAUTH = 'https://sandbox-oauth.piste.gouv.fr/api/oauth/token'public readonly string $apiUrlpublic readonly ?int $userId
Api::__construct()
public function __construct(readonly HttpClientInterface $http, readonly ClientCredentials $credentials, readonly string $account, public readonly string $apiUrl = self::API, public readonly ?int $userId = null)Api::call()
public function call(string $path, array $body): array- Returns
the answer, codeRetour 0
ChorusProGatewayFactory class
final class ChorusProGatewayFactory extends GatewayFactory ChorusProGatewayFactory.php:35
Chorus Pro, the public sector's invoicing portal, through PISTE: a supplier's invoices to a public entity (B2G), deposited as flows and followed.
options: client_id: '%env(PISTE_CLIENT_ID)%' # required: the PISTE application's client_secret: '%env(PISTE_CLIENT_SECRET)%' # required login: '%env(CPRO_LOGIN)%' # required: the Chorus Pro technical account (TECH_1_...@cpro.fr) password: '%env(CPRO_PASSWORD)%' # required sandbox: false # true: PISTE's sandbox and Chorus Pro's qualification user_id: ~ # idUtilisateurCourant, when the account asks for it syntaxes: { Factur-X: IN_DP_E2_CII_FACTURX, UBL: IN_DP_E1_UBL_INVOICE, CII: IN_DP_E1_CII_16B } api_url: ~ # https://api.piste.gouv.fr/cpro/factures by default oauth_url: ~ # https://oauth.piste.gouv.fr/api/oauth/token by default
It submits and follows. Receiving (the public entities' side), the directory, e-reporting and callbacks are not Chorus Pro's to give a supplier through this API.
Options
| Option | Default | |
|---|---|---|
sandbox | false | |
user_id | null | |
syntaxes | [] | |
api_url | null | |
oauth_url | null | |
omnibill.capabilities | new Capabilities([Syntax::FACTURX, Syntax::UBL, Syntax::CII], approved: false, publicSector: true, maxSize: 10 * 1024 * 1024) | 10 MB a file uncompressed, 30 MB compressed (annex on the API services, deposerFluxFacture). |
omnibill.api | function (Config $c): Api {
$http = $this->http ?? HttpClient::create();
$sandbox = $c->bool('sandbox');
return new Api($http, new ClientCredenti… | |
omnibill.action.submit | static fn(Config $c) => new SubmitAction(array_replace(SubmitAction::defaults(), (array) $c['syntaxes'])) | |
omnibill.action.fetch_status | new FetchStatusAction() | |
client_id | required | |
client_secret | required | |
login | required | |
password | required |
ChorusProGatewayFactory::__construct()
public function __construct(readonly ?HttpClientInterface $http = null)Statuses class
final class Statuses Statuses.php:13
Chorus Pro's statuses of an invoice (statutCourantCode) as the reform's lifecycle statuses - this package's reading of them, where one matches; the code itself is always kept. Chorus Pro's validation circuits (A_VALIDER_1, VALIDEE_2...) and its own technical states have none.
const MAP = ['DEPOSEE' => LifecycleStatus::DEPOSITED, 'EN_COURS_ACHEMINEMENT' => LifecycleStatus::ISSUED, 'MISE_A_DISPOSITION' => LifecycleStatus::MADE_AVAILABLE, 'PRISE…
Statuses::of()
public static function of(?string $code): ?LifecycleStatusOmnibill\ChorusPro\Action
FetchStatusAction class
final class FetchStatusAction implements ActionInterface, ApiAwareInterface FetchStatusAction.php:22
POST /v1/rechercher/fournisseur on the invoice's number: the invoice as Chorus Pro integrated it - from the flow it was deposited in, when several bear that number - and its current status (statut). Not found yet: the flow is still being processed, PENDING.
FetchStatusAction::__construct()
public function __construct()FetchStatusAction::supports()
public function supports(Request $request): boolFetchStatusAction::execute()
public function execute(Request $request): voidSubmitAction class
final class SubmitAction implements ActionInterface, ApiAwareInterface SubmitAction.php:22
POST /v1/deposer/flux: the file in base64, its name, its syntax in Chorus Pro's words (syntaxeFlux). The answer's numeroFluxDepot names the flow.
SubmitAction::__construct()
public function __construct(readonly array $syntaxes)$syntaxesChorus Pro's syntaxeFlux for each Syntax
SubmitAction::supports()
public function supports(Request $request): boolSubmitAction::execute()
public function execute(Request $request): voidSubmitAction::defaults()
public static function defaults(): array