VeriFactu on PrestaShop.
A confirmed payment triggers the invoice at the AEAT.

PrestaShop 1.7 · PrestaShop 8

PrestaShop is the second most used platform in Spain and the one that raises the most VeriFactu questions, because its native invoices do not comply. Cofactu has no module in Addons; it has a webhook, and PrestaShop's actionPaymentConfirmation hook is the natural place to call it.

No Addons module · webhook live. Today there is no Cofactu module to install from PrestaShop Addons, and no date for one. What works is the universal webhook, called from a minimal module of your own like the one below or from Make.

See how it connects ↓

No Addons module · webhook live

What can you connect today
between PrestaShop and Cofactu?

Today there is no Cofactu module to install from PrestaShop Addons, and no date for one. What works is the universal webhook, called from a minimal module of your own like the one below or from Make.

Status of the PrestaShop integration, checked against the Cofactu code
RouteTodayWhat it does
Cofactu plugin, module or app on PrestaShop AddonsNot availableIt does not exist and has no date. There is nothing from Cofactu to install in the store.
Universal webhookAvailableInvoices every order you send and files it with the AEAT using your certificate. It needs an API key: from the SME plan or during the 30-day trial.
Direct catalogue connectionNot availableIt only exists for WooCommerce and Shopify.
Make or ZapierAvailableWith their HTTP module against the webhook. Cofactu has no app of its own in Make or Zapier.

Checked on 26 October 2026 · What is not available has no date

Order-to-AEAT flow

From a paid order in PrestaShop
to a registered invoice.

  1. 01

    Order paid in your store

    PrestaShop fires its payment event, as it already does today.

  2. 02

    One POST to the Cofactu webhook

    From the native hook or from Make. Normalised JSON, API key in the header.

  3. 03

    Chained invoice

    Cofactu numbers it, computes the chained SHA-256 fingerprint and generates the PDF with a QR code.

  4. 04

    Registered with the AEAT

    With your certificate, the record goes to the AEAT (the Spanish Tax Agency) in the background and the response CSV is stored.

Scroll
With code · the native hook

actionPaymentConfirmation

It fires when the order moves to an accepted-payment status. A minimal module that registers this hook is enough; you do not need to touch the core or any overrides.

php
<?php
// modules/cofactuverifactu/cofactuverifactu.php
class CofactuVerifactu extends Module
{
    public function install(): bool
    {
        return parent::install() && $this->registerHook('actionPaymentConfirmation');
    }

    public function hookActionPaymentConfirmation(array $params): void
    {
        $order    = new Order((int) $params['id_order']);
        $customer = new Customer((int) $order->id_customer);
        $address  = new Address((int) $order->id_address_invoice);
        $lines    = [];
        foreach ($order->getProducts() as $p) {
            $lines[] = [
                'descripcion'    => $p['product_name'],
                'cantidad'       => (float) $p['product_quantity'],
                'precioUnitario' => (float) $p['unit_price_tax_excl'],
                'tipoIva'        => (float) $p['tax_rate'],
            ];
        }
        $ch = curl_init('https://api.cofactu.com/api/webhooks/ecommerce-orders');
        curl_setopt_array($ch, [
            CURLOPT_POST           => true,
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_HTTPHEADER     => [
                'Authorization: Bearer ' . Configuration::get('COFACTU_API_KEY'),
                'Content-Type: application/json',
            ],
            CURLOPT_POSTFIELDS => json_encode([
                'platform'        => 'prestashop',
                'externalOrderId' => $order->reference,
                'client'          => $address->dni ? [
                    'nif'          => $address->dni,
                    'nombre'       => $address->company ?: $customer->firstname . ' ' . $customer->lastname,
                    'email'        => $customer->email,
                    'direccion'    => $address->address1,
                    'codigoPostal' => $address->postcode,
                    'ciudad'       => $address->city,
                    'pais'         => Country::getIsoById((int) $address->id_country),
                ] : null,                                       // simplified F2 invoice
                'lines' => $lines,
            ]),
        ]);
        curl_exec($ch);
        curl_close($ch);
    }
}
No code

Without touching PHP: Make

  1. Step 1

    Create an API key in Cofactu (Settings → API keys) with permission to create invoices. The API is included from the SME plan and during the 30-day trial.

  2. Step 2

    In Make, use the “PrestaShop → Watch Orders” module (it uses the PrestaShop webservice; switch it on under Advanced parameters → Webservice).

  3. Step 3

    HTTP module: POST to https://api.cofactu.com/api/webhooks/ecommerce-orders with Authorization: Bearer vf_live_….

  4. Step 4

    Map reference to externalOrderId and the order lines to lines using unit_price_tax_excl and tax_rate.

The JSON Cofactu expects

One format for every store

POST https://api.cofactu.com/api/webhooks/ecommerce-orders with Authorization: Bearer vf_live_…. Prices exclude VAT and each line carries its tipoIva (VAT rate); client: null issues a simplified F2 invoice; externalOrderId makes the call idempotent. From Settings → Integrations → Ecommerce you can send a test order, which stays as a draft; real orders show up in Invoices with their AEAT status.

Settings → Integrations → Ecommerce ↗
json
{
  "platform": "prestashop",
  "externalOrderId": "2026-000123",
  "client": {
    "nif": "B12345678",
    "nombre": "Tienda Ejemplo SL",
    "email": "compras@ejemplo.com",
    "direccion": "C/ Mayor 1",
    "codigoPostal": "28001",
    "ciudad": "Madrid",
    "pais": "ES"
  },
  "lines": [
    {
      "descripcion": "Zapatillas running 42",
      "cantidad": 1,
      "precioUnitario": 79.34,
      "tipoIva": 21
    },
    {
      "descripcion": "Gastos de envío",
      "cantidad": 1,
      "precioUnitario": 4.13,
      "tipoIva": 21
    }
  ],
  "autoSubmit": true
}
Frequently asked questions

PrestaShop and VeriFactu, in short

Do the invoices PrestaShop generates comply with VeriFactu?

No. PrestaShop numbers and generates a PDF, but it does not compute the chained hash, print the verification QR code or register anything with the AEAT. From 2027 that invoice is not valid as an invoicing record; the shop can stay on PrestaShop, and the invoice is issued by a VeriFactu system.

Is there a Cofactu module in PrestaShop Addons?

No, and there is no date. The minimal module on this page (one hook and one POST) is what a published module would do, and Make replaces it with no code.

Does it work on PrestaShop 1.6?

The actionPaymentConfirmation hook exists since 1.5, so the same module should work. But 1.6 has had no security support since 2019, and the example on this page is written for 1.7 and 8.

Which PrestaShop field is the NIF?

The dni of the billing address, which PrestaShop asks for depending on the country. If it is empty, send client: null and Cofactu issues a simplified F2 invoice.

Is the invoice duplicated if the hook runs twice?

No: the webhook is idempotent by platform + externalOrderId, and the PrestaShop order reference is unique. The JSON is the same for all four stores: platform, externalOrderId, client (or null for a simplified F2 invoice) and lines with a price excluding VAT and a tipoIva (VAT rate) per line.

Other platforms

Other platforms

  1. 01 Magento VeriFactu on Magento
  2. 02 Shopify VeriFactu on Shopify
  3. 03 WooCommerce VeriFactu on WooCommerce
  4. 04 Ecommerce Full ecommerce comparison
  5. 05 VeriFactu VeriFactu guide
Start with a test order

Your store stays on PrestaShop.
The invoice, VeriFactu.

30 days with all of Cofactu, API included and no card, and a test order to see the first chained invoice. After that, the API starts at the SME plan.

See pricing ↗

(Start today)

Invoice with VeriFactu, file with the AEAT and keep your books in the same account. Start free: no card, nothing to install.

Your first invoice

  • Unlimited VeriFactu invoices with QR
  • No card needed
  • Full export of your data