PrestaShop Integration
Coming SoonOpen-source e-commerce with e-invoicing. Ideal for the European market with Factur-X and XRechnung support.
PrestaShop Module in Development
Our official PrestaShop Module is currently in development. In the meantime, you can integrate Invoice-api.xhub via PrestaShop Hooks or the Webservice.
Features
Open Source
Module code available for individual customization
EU-Widespread
Ideal for European e-commerce requirements
Multi-Shop
E-invoices for all PrestaShop multi-stores
Hook-Based
Integration via the PrestaShop hook system
Hook Integration
Available Hooks
Use PrestaShop hooks to create e-invoices based on shop events.
actionValidateOrderOrder validated
actionOrderStatusUpdateOrder status changed
actionPaymentConfirmationPayment confirmed
actionObjectOrderInvoiceAddAfterInvoice created
1<?php2// PrestaShop Modul für E-Rechnung3// modules/xhubeinvoice/xhubeinvoice.php4 5class XhubEInvoice extends Module6{7 public function __construct()8 {9 $this->name = 'xhubeinvoice';10 $this->version = '1.0.0';11 $this->author = 'invoice-api.xhub';12 parent::__construct();13 }14 15 public function install()16 {17 return parent::install()18 && $this->registerHook('actionPaymentConfirmation')19 && $this->registerHook('actionOrderStatusUpdate');20 }21 22 public function hookActionPaymentConfirmation($params)23 {24 $order = new Order($params['id_order']);25 $customer = new Customer($order->id_customer);26 $address = new Address($order->id_address_invoice);27 28 // Nur für B2B mit USt-ID29 if (empty($address->vat_number)) {30 return;31 }32 33 $this->createEInvoice($order, $customer, $address);34 }35 36 private function createEInvoice($order, $customer, $address)37 {38 $invoiceData = [39 'type' => 'xrechnung-3.0',40 'seller' => $this->getSellerData(),41 'buyer' => [42 'name' => $address->company ?: $customer->firstname . ' ' . $customer->lastname,43 'vatId' => $address->vat_number,44 'address' => [45 'street' => $address->address1,46 'city' => $address->city,47 'zip' => $address->postcode,48 'country' => Country::getIsoById($address->id_country)49 ]50 ],51 'items' => $this->getOrderItems($order),52 'reference' => $order->reference53 ];54 55 // API Call zu Invoice-api.xhub56 $this->callXhubApi($invoiceData);57 }58}Webservice Integration
Alternatively, you can use the PrestaShop Webservice and connect with n8n or Make.com.
- 1
Enable Webservice
Admin → Advanced Parameters → Webservice
- 2
Create API Key
With access to Orders, Customers, Addresses
- 3
Create n8n Workflow
Webhook → Fetch order → Transform → E-invoice
- 4
Create E-Invoice
POST /api/v1/invoice/de/xrechnung/generate to Invoice-api.xhub API
1// PrestaShop Webservice → n8n → Invoice-api.xhub2// Alternative: PrestaShop REST API nutzen3 4// 1. PrestaShop Webservice aktivieren5// Admin → Erweiterte Parameter → Webservice6 7// 2. API-Schlüssel mit Order-Zugriff erstellen8 9// 3. n8n Workflow:10// - Trigger: Webhook von PrestaShop11// - HTTP Request: Order-Details abrufen12// - Transform: PrestaShop → Invoice-api.xhub Format13// - HTTP Request: E-Rechnung erstellen14 15const prestashopOrder = await fetch(16 `${PS_URL}/api/orders/${orderId}?output_format=JSON`,17 { headers: { Authorization: `Basic ${PS_API_KEY}` }}18).then(r => r.json());19 20const invoiceData = {21 type: "zugferd-2.1",22 seller: {23 name: shopConfig.PS_SHOP_NAME,24 vatId: shopConfig.PS_SHOP_VAT,25 address: {26 street: shopConfig.PS_SHOP_ADDR1,27 city: shopConfig.PS_SHOP_CITY,28 zip: shopConfig.PS_SHOP_CODE,29 country: shopConfig.PS_SHOP_COUNTRY30 }31 },32 buyer: {33 name: prestashopOrder.order.associations.customer.company34 || `${prestashopOrder.order.associations.customer.firstname} ${prestashopOrder.order.associations.customer.lastname}`,35 vatId: prestashopOrder.order.associations.address_invoice.vat_number,36 address: {37 street: prestashopOrder.order.associations.address_invoice.address1,38 city: prestashopOrder.order.associations.address_invoice.city,39 zip: prestashopOrder.order.associations.address_invoice.postcode,40 country: prestashopOrder.order.associations.address_invoice.id_country41 }42 },43 items: prestashopOrder.order.associations.order_rows.map(row => ({44 description: row.product_name,45 quantity: parseInt(row.product_quantity),46 unitPrice: parseFloat(row.unit_price_tax_excl),47 vat: 1948 })),49 reference: prestashopOrder.order.reference50};Use Cases
EU Trade
E-invoices for European B2B trade
- 1EU customer with VAT ID orders
- 2PrestaShop detects B2B customer
- 3Create XRechnung/Factur-X
- 4Delivery via Peppol EU-wide
Multi-Shop EU
Central e-invoice for all EU shops
- 1Order in any shop
- 2Country-specific tax data
- 3Unified e-invoice format
- 4OSS-compliant archiving
Dropshipping
E-invoices for dropshipping models
- 1Customer orders in shop
- 2Supplier receives order
- 3E-invoice to end customer
- 4Separate supplier billing