Verifactu with SumUp: how to connect your payments with the Verifactu API

Verifacti has no official SumUp integration: your own service reads each transaction from the SumUp API and sends it to the Verifactu API as a simplified invoice, which returns the QR for the ticket you give the customer (SumUp's receipt doesn't include it). No XML to generate, no hash to compute and no digital certificate: Verifacti sends the invoicing record to the AEAT as a colaborador social. In Álava, Bizkaia and Gipuzkoa, the same pattern works with the TicketBAI API.

Test environment and test NIF included
Read the documentation

Which APIs you need for SumUp

Your connector uses two pieces: the submission API that matches the NIF (Verifactu API in common territory; TicketBAI API in Álava, Bizkaia and Gipuzkoa) and the NIF management API, integrated once to register the NIF, manage the representation form and receive webhooks. Each NIF uses one API or the other depending on where it is taxed.

Test environment and test NIF included

How to connect SumUp with the API

Flow: charge in SumUp (periodic query of the transaction history) → your service → Verifactu API or TicketBAI API → AEAT or foral treasury.

  1. Register the NIF with the NIF management API and sign the representation form. Each NIF has its own API key.
  2. Create a SumUp API key to read your transactions (with the merchant code in SUMUP_MERCHANT_CODE).
  3. SumUp doesn't notify each card-reader charge: query the history every few minutes (GET /v2.1/merchants/{merchant_code}/transactions/history) and, for each new successful charge, read the transaction (products with their VAT) and call POST /verifactu/create as a simplified invoice (F2).
  4. Use your own series with sequential numbering and store uuid and qr for the ticket.

SumUp doesn't number invoices: you set the number, the next one in your series.

Do you build software and want to offer Verifactu to your customers? See POS.

Example: from the charge to the record

A Node.js function that reads the SumUp transaction, converts the VAT rate (SumUp gives it as a fraction: 0.21), groups the products by rate and sends it as a simplified invoice, without the tip. A free-amount charge with no products has to be completed by hand.

sumup.js · Node.js
"use strict";
// Cobro en SumUp → API Verifactu como factura simplificada (Node.js 18+).
// Lee una transacción de la API de SumUp y la envía a Verifacti.
// Variables de entorno: SUMUP_API_KEY, SUMUP_MERCHANT_CODE, VERIFACTI_API_KEY.
const crypto = require('node:crypto');
const hoy = ()=>new Intl.DateTimeFormat('es-ES', {
        timeZone: 'Europe/Madrid',
        day: '2-digit',
        month: '2-digit',
        year: 'numeric'
    }).format(new Date()).replaceAll('/', '-');
function factura(tx, numero) {
    const porTipo = {};
    for (const p of tx.products){
        const tipo = String(Math.round(p.vat_rate * 10000) / 100); // SumUp da el tipo como fracción: 0.21 → 21
        porTipo[tipo] ??= {
            base: 0,
            cuota: 0
        };
        porTipo[tipo].base += p.total_price;
        porTipo[tipo].cuota += p.vat_amount;
    }
    return {
        serie: 'SUMUP-',
        numero,
        fecha_expedicion: hoy(),
        tipo_factura: 'F2',
        descripcion: 'Venta con SumUp',
        lineas: Object.entries(porTipo).map(([tipo, l])=>({
                base_imponible: l.base.toFixed(2),
                tipo_impositivo: tipo,
                cuota_repercutida: l.cuota.toFixed(2)
            })),
        importe_total: (tx.amount - (tx.tip_amount || 0)).toFixed(2)
    };
}
// numero: el siguiente de tu serie de facturas (correlativo y sin huecos)
async function registrarCobro(transactionCode, numero) {
    const sumup = await fetch(`https://api.sumup.com/v2.1/merchants/${process.env.SUMUP_MERCHANT_CODE}/transactions?transaction_code=${transactionCode}`, {
        headers: {
            Authorization: `Bearer ${process.env.SUMUP_API_KEY}`
        }
    });
    const tx = await sumup.json();
    if (tx.status !== 'SUCCESSFUL') return null;
    if (!tx.products?.length) return {
        status: null,
        error: 'Cobro sin productos: indica la base y el tipo de IVA a mano'
    };
    const cuerpo = JSON.stringify(factura(tx, numero));
    const r = await fetch('https://api.verifacti.com/verifactu/create', {
        method: 'POST',
        headers: {
            Authorization: `Bearer ${process.env.VERIFACTI_API_KEY}`,
            'Content-Type': 'application/json',
            'Idempotency-Key': `sumup-${transactionCode}-${crypto.createHash('sha256').update(cuerpo).digest('hex').slice(0, 12)}`
        },
        body: cuerpo
    });
    return {
        status: r.status,
        registro: await r.json()
    }; // guarda registro.uuid y registro.qr
}
module.exports = {
    registrarCobro
};

The code groups the lines by VAT rate and always sends a simplified invoice (F2); if the customer asks for a full invoice, issue an exchange invoice (F3). It sends the Idempotency-Key header with the transaction identifier plus a digest of the body: an identical retry never duplicates the invoice and, if you fix the data after an error, the key changes. The response carries the uuid, the state (Pendiente: the submission to the AEAT is queued), the verification URL, the QR in Base64 and the hash: store them with the invoice.

More code in the Verifactu tutorials. For TicketBAI, the call goes to POST /ticketbai/create with the foral NIF's API key: the fields, in the TicketBAI API documentation.

Special cases in SumUp

Special cases when invoicing from SumUp
CaseWhat to doRead more
NumberingUse your own series per POS, sequential and gap-freeVerifactu requirements
Customer without a NIFSimplified invoice (F2), without nif or nombre. The API rejects an F2 above €3,000 (vf-verifactu-f2_limite_3000)Simplified invoice
Return or refundCorrective invoice: R5 if the original was simplified; R1–R4 if it was a full invoiceCorrective invoices
Customer asks for a full invoice laterExchange invoice (F3) replacing the simplified oneExchange invoice
Canary Islands, Ceuta and MelillaIGIC or IPSI in the lines (impuesto field), not VATIGIC · IPSI
Products without VATCheck whether they are exempt (operacion_exenta) or not subject (calificacion_operacion): they are not sent at rate 0Exempt invoice
CancellationOnly for invoices that should never have been issued: POST /verifactu/cancelCancellation
Sale to another EU countryIt depends on whether the customer is a business and on the distance-selling thresholdIntra-EU examples
Several companies or shopsOne NIF per company, each with its own API keyNIF management API

Dates

The first row only applies if you build the connector to sell it: then you sell invoicing software. For those who invoice, the Verifactu dates are published in the BOE and the postponement to October 2028 is announced with no rule published. In Álava, Bizkaia and Gipuzkoa, TicketBAI is in force.

Producers and resellers of invoicing softwareSince 29 Jul 2025
RDL 15/2025 did not change this date.
In force
Corporate Income Tax payers1 Jan 2027
Published in the BOE, future date
Everyone else, including the self-employed1 Jul 2027
Published in the BOE, future date
Postponement of the pending obligationsOct 2028
The note does not specify the scope for businesses invoicing over €8M.
Announced, no rule published
TicketBAI in Álava: foral taxpayersSince 1 Dec 2022
Phased from 1 April 2022; all other taxpayers since 1 December 2022.
In force
Batuz in Bizkaia (TicketBAI and LROE): all taxpayersSince 1 Jan 2026
Companies that are not SMEs since 1 January 2024; everyone else in windows on 1 July 2024, 1 January 2025, 1 July 2025 and 1 January 2026.
In force
TicketBAI in Gipuzkoa: foral taxpayersSince 1 Jun 2023
Phased by activity from 1 July 2022.
In force

This is not advice: each taxpayer determines what applies to them with their adviser.

More detail in Verifactu dates and TicketBAI.

Pricing

Public tariff of the Verifactu API and the TicketBAI API: you pay per NIF active in production, VAT excluded. Custom per-NIF pricing is available for volume.

From

€14.99

per month for the first NIF active in production, VAT excluded

See all pricing
  • The price per NIF goes down with every tier.
  • Free test environment and test NIF.
  • Annual plan with a 10% discount, no setup fees.
  • Up to 3,000 invoicing records per month per NIF.
  • Startup plan for companies under 12 months old, with under €100,000 in revenue and under €200,000 in funding.
  • Same price with the Verifactu API and the TicketBAI API: each NIF uses one or the other depending on where it is taxed.
  • Online signing of the representation form: €2.90 + VAT per signature.

Questions about Verifactu and SumUp

More questions about Verifactu

Is there an integration from Verifacti for SumUp?

No. Verifacti is an API: SumUp connects to it with the code on this page, in your own development.

Does SumUp comply with Verifactu on its own?

SumUp takes the payment, but it does not generate invoicing records or send them to the AEAT: your invoicing system does, for example with the Verifactu API. Whoever invoices needs a system that generates the invoicing records and sends them to the AEAT. Which obligation each business has depends on its case: who Verifactu applies to.

Does it work for TicketBAI too?

Yes. If the NIF is taxed in Álava, Bizkaia or Gipuzkoa, the flow is the same with the TicketBAI API: the endpoint (/ticketbai/create), the invoice fields and the API key change.

Do I need a digital certificate?

No. Verifacti is an AEAT social collaborator and submits with its own certificate once the taxpayer signs the representation form, the same one for the AEAT and the foral treasuries. It can be signed online, without a certificate.

How much does it cost?

From €14.99 per month for the first NIF active in production, VAT excluded, with the Verifactu API or the TicketBAI API. The test environment and test NIF are free. Every plan, in pricing.

Connect SumUp in the test environment

Create your free account and try the API with a test NIF before going to production.

Test environment and test NIF includedRead the documentation