PrestaShop Integration
Coming SoonOpen-Source E-Commerce mit E-Rechnung. Ideal für den europäischen Markt mit Factur-X und XRechnung Support.
PrestaShop Modul in Entwicklung
Unser offizielles PrestaShop Modul ist aktuell in Entwicklung. In der Zwischenzeit kannst du invoice-api.xhub über PrestaShop Hooks oder den Webservice integrieren.
Features
Open Source
Modul-Code verfügbar für individuelle Anpassungen
EU-verbreitet
Ideal für europäische E-Commerce Anforderungen
Multi-Shop
E-Rechnungen für alle PrestaShop Multi-Stores
Hook-basiert
Integration über das PrestaShop Hook-System
Hook Integration
Verfügbare Hooks
Nutze PrestaShop Hooks um E-Rechnungen basierend auf Shop-Events zu erstellen.
actionValidateOrderBestellung wurde validiert
actionOrderStatusUpdateBestellstatus geändert
actionPaymentConfirmationZahlung bestätigt
actionObjectOrderInvoiceAddAfterE-Rechnung erstellt
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
Alternativ kannst du den PrestaShop Webservice nutzen und mit n8n oder Make.com verbinden.
- 1
Webservice aktivieren
Admin → Erweiterte Parameter → Webservice
- 2
API-Schlüssel erstellen
Mit Zugriff auf Orders, Customers, Addresses
- 3
n8n Workflow erstellen
Webhook → Order abrufen → Transform → E-Rechnung
- 4
E-Rechnung erstellen
POST /api/v1/invoice/de/xrechnung/generate an 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};Anwendungsfälle
EU-Handel
E-Rechnungen für den europäischen B2B-Handel
- 1EU-Kunde mit USt-ID bestellt
- 2PrestaShop erkennt B2B-Kunde
- 3XRechnung/Factur-X erstellen
- 4Versand via Peppol EU-weit
Multi-Shop EU
Zentrale E-Rechnung für alle EU-Shops
- 1Bestellung in beliebigem Shop
- 2Länderspezifische Steuerdaten
- 3Einheitliches E-Rechnungsformat
- 4OSS-konforme Archivierung
Dropshipping
E-Rechnungen für Dropshipping-Modelle
- 1Kunde bestellt im Shop
- 2Supplier erhält Auftrag
- 3E-Rechnung an Endkunde
- 4Separate Supplier-Abrechnung