1. Go to this page and download the library: Download factpulse/sdk library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
factpulse / sdk example snippets
FactPulse\SDK\FactPulseClient;
// Create the client
$client = new FactPulseClient(
"[email protected]",
"your_password",
"your-client-uuid" // From dashboard: Configuration > Clients
);
// Read your source PDF
$pdfB64 = base64_encode(file_get_contents("source_invoice.pdf"));
// Generate Factur-X and submit to PDP in one call
$result = $client->post("processing/invoices/submit-complete-async", [
"invoiceData" => [
"number" => "INV-2025-001",
"supplier" => [
"name" => "ACME Corporation",
"siret" => "12345678901234",
"iban" => "FR7630001007941234567890185",
"routing_address" => "12345678901234",
],
"recipient" => [
"name" => "Client Company SA",
"siret" => "98765432109876",
"routing_address" => "98765432109876",
],
"lines" => [
[
"description" => "Consulting services",
"quantity" => 10,
"unitPrice" => 100.0,
"vatRate" => 20.0,
],
],
],
"sourcePdf" => $pdfB64,
"profile" => "EN16931",
"destination" => ["type" => "afnor"],
]);
// PDF is in $result["content"] (auto-polled, auto-decoded from base64)
file_put_contents("facturx_invoice.pdf", $result["content"]);
echo "Flow ID: " . $result["afnorResult"]["flowId"] . "\n";