Menu

You generate Peppol UBL in PHP. Here is how to send it.
📰

You generate Peppol UBL in PHP. Here is how to send it.

DEV Community: php·Zero Lopp Labs·15 days ago
#FLIPrlA8
#devto#dev#compliant#urn#getpeppr
Reading 0:00
15s threshold

If you write invoicing software in PHP, you probably already produce Peppol UBL. num-num/ubl-invoice and josemmo/einvoicing do that well, and they are widely used.

Then comes the part they do not cover: getting the XML to your customer's customer. On Peppol that means going through an access point, and in PHP there are not many packages for that step.

So we published one. getpeppr/getpeppr-php takes the UBL you already have and sends it through the getpeppr API. It does not generate, rewrite or repair the document. Version 0.1.0 is MIT, needs PHP 8.2 or later (tested up to 8.5), and uses the PSR-18 HTTP client your application already has.

composer require getpeppr/getpeppr-php

Enter fullscreen mode

Exit fullscreen mode

From num-num/ubl-invoice to the network

use Getpeppr\Client ; use NumNum\UBL ;

$invoice = ( new UBL\Invoice ()) -> setCustomizationId ( 'urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0' ) -> setProfileId ( 'urn:fdc:peppol.eu:2017:poacc:billing:01:1.0' ) ->…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.