Ejemplos (VeriFactu)
Un cuerpo de petición completo por cada tipo de factura VeriFactu. Cada uno se ha enviado a Sandbox y ha devuelto 200.
Cada ejemplo es un cuerpo completo para POST /v1/verifactu/crear, salvo la subsanación y la anulación, que usan su propio endpoint. Copia el ejemplo que corresponda a la operación y sustituye emisor, destinatario, serie, número y fecha por los tuyos.
Todos los cuerpos de esta página se han enviado a Sandbox con la fecha updated de la cabecera y han devuelto 200. Los NIF y los importes son ficticios.
Las reglas de cada campo están en la referencia de VeriFactu. La versión TicketBAI de estos mismos casos está en Ejemplos (TicketBAI).
Factura completa (F1)
Una factura con destinatario identificado y una línea al 21 %. totales repite la cuota y el total tal como figuran en la factura.
curl -X POST https://sandbox.veribai.com/v1/verifactu/crear \
-H "x-api-key: TU_CLAVE" \
-H "Content-Type: application/json" \
-d '{
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12345",
"fechaExpedicion": "15-09-2026",
"tipoFactura": "F1",
"descripcion": "Servicios de consultoría"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"destinatario": {
"nif": "B11111119",
"nombre": "Cliente Ejemplo SL"
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": "1000.00",
"tipoImpositivo": "21.00",
"cuotaRepercutida": "210.00"
}
],
"totales": {
"cuotaTotal": "210.00",
"importeTotal": "1210.00"
}
}'
from datetime import date
from decimal import Decimal
import veribai
client = veribai.Client(api_key="TU_CLAVE", environment="test")
respuesta = client.verifactu.crear({
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12345",
"fechaExpedicion": date(2026, 9, 15),
"tipoFactura": "F1",
"descripcion": "Servicios de consultoría",
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL",
},
"destinatario": {
"nif": "B11111119",
"nombre": "Cliente Ejemplo SL",
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": Decimal("1000.00"),
"tipoImpositivo": Decimal("21.00"),
"cuotaRepercutida": Decimal("210.00"),
},
],
"totales": {
"cuotaTotal": Decimal("210.00"),
"importeTotal": Decimal("1210.00"),
},
})
print(respuesta["idFactura"], respuesta["estado"])
const respuesta = await fetch("https://sandbox.veribai.com/v1/verifactu/crear", {
method: "POST",
headers: {
"x-api-key": "TU_CLAVE",
"Content-Type": "application/json",
},
body: JSON.stringify({
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12345",
"fechaExpedicion": "15-09-2026",
"tipoFactura": "F1",
"descripcion": "Servicios de consultoría"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"destinatario": {
"nif": "B11111119",
"nombre": "Cliente Ejemplo SL"
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": "1000.00",
"tipoImpositivo": "21.00",
"cuotaRepercutida": "210.00"
}
],
"totales": {
"cuotaTotal": "210.00",
"importeTotal": "1210.00"
}
}),
});
if (!respuesta.ok) throw new Error(`VeriBai ${respuesta.status}`);
const datos = await respuesta.json();
Factura simplificada (F2)
Sin destinatario. La suma de bases y cuotas del desglose no puede superar los 3.000 €; ver el tope de las simplificadas.
curl -X POST https://sandbox.veribai.com/v1/verifactu/crear \
-H "x-api-key: TU_CLAVE" \
-H "Content-Type: application/json" \
-d '{
"version": "1.0",
"cabecera": {
"serie": "T",
"numero": "8001",
"fechaExpedicion": "15-09-2026",
"tipoFactura": "F2",
"descripcion": "Venta en tienda"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": "24.79",
"tipoImpositivo": "21.00",
"cuotaRepercutida": "5.21"
}
],
"totales": {
"cuotaTotal": "5.21",
"importeTotal": "30.00"
}
}'
from datetime import date
from decimal import Decimal
import veribai
client = veribai.Client(api_key="TU_CLAVE", environment="test")
respuesta = client.verifactu.crear({
"version": "1.0",
"cabecera": {
"serie": "T",
"numero": "8001",
"fechaExpedicion": date(2026, 9, 15),
"tipoFactura": "F2",
"descripcion": "Venta en tienda",
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL",
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": Decimal("24.79"),
"tipoImpositivo": Decimal("21.00"),
"cuotaRepercutida": Decimal("5.21"),
},
],
"totales": {
"cuotaTotal": Decimal("5.21"),
"importeTotal": Decimal("30.00"),
},
})
print(respuesta["idFactura"], respuesta["estado"])
const respuesta = await fetch("https://sandbox.veribai.com/v1/verifactu/crear", {
method: "POST",
headers: {
"x-api-key": "TU_CLAVE",
"Content-Type": "application/json",
},
body: JSON.stringify({
"version": "1.0",
"cabecera": {
"serie": "T",
"numero": "8001",
"fechaExpedicion": "15-09-2026",
"tipoFactura": "F2",
"descripcion": "Venta en tienda"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": "24.79",
"tipoImpositivo": "21.00",
"cuotaRepercutida": "5.21"
}
],
"totales": {
"cuotaTotal": "5.21",
"importeTotal": "30.00"
}
}),
});
if (!respuesta.ok) throw new Error(`VeriBai ${respuesta.status}`);
const datos = await respuesta.json();
Factura con varios tipos de IVA
Una línea de detalleDesglose por cada tipo impositivo. totales.cuotaTotal es la suma de las cuotas.
curl -X POST https://sandbox.veribai.com/v1/verifactu/crear \
-H "x-api-key: TU_CLAVE" \
-H "Content-Type: application/json" \
-d '{
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12346",
"fechaExpedicion": "15-09-2026",
"tipoFactura": "F1",
"descripcion": "Suministro de productos alimentarios y material"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"destinatario": {
"nif": "B11111119",
"nombre": "Cliente Ejemplo SL"
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": "500.00",
"tipoImpositivo": "21.00",
"cuotaRepercutida": "105.00"
},
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": "300.00",
"tipoImpositivo": "10.00",
"cuotaRepercutida": "30.00"
},
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": "200.00",
"tipoImpositivo": "4.00",
"cuotaRepercutida": "8.00"
}
],
"totales": {
"cuotaTotal": "143.00",
"importeTotal": "1143.00"
}
}'
from datetime import date
from decimal import Decimal
import veribai
client = veribai.Client(api_key="TU_CLAVE", environment="test")
respuesta = client.verifactu.crear({
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12346",
"fechaExpedicion": date(2026, 9, 15),
"tipoFactura": "F1",
"descripcion": "Suministro de productos alimentarios y material",
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL",
},
"destinatario": {
"nif": "B11111119",
"nombre": "Cliente Ejemplo SL",
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": Decimal("500.00"),
"tipoImpositivo": Decimal("21.00"),
"cuotaRepercutida": Decimal("105.00"),
},
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": Decimal("300.00"),
"tipoImpositivo": Decimal("10.00"),
"cuotaRepercutida": Decimal("30.00"),
},
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": Decimal("200.00"),
"tipoImpositivo": Decimal("4.00"),
"cuotaRepercutida": Decimal("8.00"),
},
],
"totales": {
"cuotaTotal": Decimal("143.00"),
"importeTotal": Decimal("1143.00"),
},
})
print(respuesta["idFactura"], respuesta["estado"])
const respuesta = await fetch("https://sandbox.veribai.com/v1/verifactu/crear", {
method: "POST",
headers: {
"x-api-key": "TU_CLAVE",
"Content-Type": "application/json",
},
body: JSON.stringify({
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12346",
"fechaExpedicion": "15-09-2026",
"tipoFactura": "F1",
"descripcion": "Suministro de productos alimentarios y material"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"destinatario": {
"nif": "B11111119",
"nombre": "Cliente Ejemplo SL"
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": "500.00",
"tipoImpositivo": "21.00",
"cuotaRepercutida": "105.00"
},
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": "300.00",
"tipoImpositivo": "10.00",
"cuotaRepercutida": "30.00"
},
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": "200.00",
"tipoImpositivo": "4.00",
"cuotaRepercutida": "8.00"
}
],
"totales": {
"cuotaTotal": "143.00",
"importeTotal": "1143.00"
}
}),
});
if (!respuesta.ok) throw new Error(`VeriBai ${respuesta.status}`);
const datos = await respuesta.json();
Factura exenta de IVA
La línea lleva operacionExenta con la causa en lugar de calificacionOperacion, y no lleva tipo ni cuota. E1 es la exención del artículo 20 de la LIVA (sanidad, educación, seguros, alquiler de vivienda).
curl -X POST https://sandbox.veribai.com/v1/verifactu/crear \
-H "x-api-key: TU_CLAVE" \
-H "Content-Type: application/json" \
-d '{
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12347",
"fechaExpedicion": "15-09-2026",
"tipoFactura": "F1",
"descripcion": "Curso de formación profesional"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"destinatario": {
"nif": "B11111119",
"nombre": "Cliente Ejemplo SL"
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"operacionExenta": "E1",
"baseImponible": "800.00"
}
],
"totales": {
"cuotaTotal": "0.00",
"importeTotal": "800.00"
}
}'
from datetime import date
from decimal import Decimal
import veribai
client = veribai.Client(api_key="TU_CLAVE", environment="test")
respuesta = client.verifactu.crear({
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12347",
"fechaExpedicion": date(2026, 9, 15),
"tipoFactura": "F1",
"descripcion": "Curso de formación profesional",
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL",
},
"destinatario": {
"nif": "B11111119",
"nombre": "Cliente Ejemplo SL",
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"operacionExenta": "E1",
"baseImponible": Decimal("800.00"),
},
],
"totales": {
"cuotaTotal": Decimal("0.00"),
"importeTotal": Decimal("800.00"),
},
})
print(respuesta["idFactura"], respuesta["estado"])
const respuesta = await fetch("https://sandbox.veribai.com/v1/verifactu/crear", {
method: "POST",
headers: {
"x-api-key": "TU_CLAVE",
"Content-Type": "application/json",
},
body: JSON.stringify({
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12347",
"fechaExpedicion": "15-09-2026",
"tipoFactura": "F1",
"descripcion": "Curso de formación profesional"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"destinatario": {
"nif": "B11111119",
"nombre": "Cliente Ejemplo SL"
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"operacionExenta": "E1",
"baseImponible": "800.00"
}
],
"totales": {
"cuotaTotal": "0.00",
"importeTotal": "800.00"
}
}),
});
if (!respuesta.ok) throw new Error(`VeriBai ${respuesta.status}`);
const datos = await respuesta.json();
Operación no sujeta
calificacionOperacion: "N1" declara una operación no sujeta por el artículo 7, 14 u otros de la LIVA. Sin tipo ni cuota.
curl -X POST https://sandbox.veribai.com/v1/verifactu/crear \
-H "x-api-key: TU_CLAVE" \
-H "Content-Type: application/json" \
-d '{
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12348",
"fechaExpedicion": "15-09-2026",
"tipoFactura": "F1",
"descripcion": "Indemnización por resolución de contrato"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"destinatario": {
"nif": "B11111119",
"nombre": "Cliente Ejemplo SL"
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "N1",
"baseImponible": "2500.00"
}
],
"totales": {
"cuotaTotal": "0.00",
"importeTotal": "2500.00"
}
}'
from datetime import date
from decimal import Decimal
import veribai
client = veribai.Client(api_key="TU_CLAVE", environment="test")
respuesta = client.verifactu.crear({
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12348",
"fechaExpedicion": date(2026, 9, 15),
"tipoFactura": "F1",
"descripcion": "Indemnización por resolución de contrato",
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL",
},
"destinatario": {
"nif": "B11111119",
"nombre": "Cliente Ejemplo SL",
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "N1",
"baseImponible": Decimal("2500.00"),
},
],
"totales": {
"cuotaTotal": Decimal("0.00"),
"importeTotal": Decimal("2500.00"),
},
})
print(respuesta["idFactura"], respuesta["estado"])
const respuesta = await fetch("https://sandbox.veribai.com/v1/verifactu/crear", {
method: "POST",
headers: {
"x-api-key": "TU_CLAVE",
"Content-Type": "application/json",
},
body: JSON.stringify({
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12348",
"fechaExpedicion": "15-09-2026",
"tipoFactura": "F1",
"descripcion": "Indemnización por resolución de contrato"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"destinatario": {
"nif": "B11111119",
"nombre": "Cliente Ejemplo SL"
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "N1",
"baseImponible": "2500.00"
}
],
"totales": {
"cuotaTotal": "0.00",
"importeTotal": "2500.00"
}
}),
});
if (!respuesta.ok) throw new Error(`VeriBai ${respuesta.status}`);
const datos = await respuesta.json();
Inversión del sujeto pasivo
calificacionOperacion: "S2": la operación está sujeta y el IVA lo ingresa el destinatario. La línea no lleva tipo ni cuota.
curl -X POST https://sandbox.veribai.com/v1/verifactu/crear \
-H "x-api-key: TU_CLAVE" \
-H "Content-Type: application/json" \
-d '{
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12349",
"fechaExpedicion": "15-09-2026",
"tipoFactura": "F1",
"descripcion": "Ejecución de obra. Inversión del sujeto pasivo, art. 84.Uno.2.f LIVA"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"destinatario": {
"nif": "B11111119",
"nombre": "Cliente Ejemplo SL"
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S2",
"baseImponible": "15000.00"
}
],
"totales": {
"cuotaTotal": "0.00",
"importeTotal": "15000.00"
}
}'
from datetime import date
from decimal import Decimal
import veribai
client = veribai.Client(api_key="TU_CLAVE", environment="test")
respuesta = client.verifactu.crear({
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12349",
"fechaExpedicion": date(2026, 9, 15),
"tipoFactura": "F1",
"descripcion": "Ejecución de obra. Inversión del sujeto pasivo, art. 84.Uno.2.f LIVA",
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL",
},
"destinatario": {
"nif": "B11111119",
"nombre": "Cliente Ejemplo SL",
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S2",
"baseImponible": Decimal("15000.00"),
},
],
"totales": {
"cuotaTotal": Decimal("0.00"),
"importeTotal": Decimal("15000.00"),
},
})
print(respuesta["idFactura"], respuesta["estado"])
const respuesta = await fetch("https://sandbox.veribai.com/v1/verifactu/crear", {
method: "POST",
headers: {
"x-api-key": "TU_CLAVE",
"Content-Type": "application/json",
},
body: JSON.stringify({
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12349",
"fechaExpedicion": "15-09-2026",
"tipoFactura": "F1",
"descripcion": "Ejecución de obra. Inversión del sujeto pasivo, art. 84.Uno.2.f LIVA"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"destinatario": {
"nif": "B11111119",
"nombre": "Cliente Ejemplo SL"
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S2",
"baseImponible": "15000.00"
}
],
"totales": {
"cuotaTotal": "0.00",
"importeTotal": "15000.00"
}
}),
});
if (!respuesta.ok) throw new Error(`VeriBai ${respuesta.status}`);
const datos = await respuesta.json();
Entrega intracomunitaria de bienes (B2B)
Entrega exenta a un empresario de otro Estado miembro: operacionExenta: "E5" y destinatario identificado con idOtro de tipo 02 (NIF-IVA). Ver destinatario extranjero.
curl -X POST https://sandbox.veribai.com/v1/verifactu/crear \
-H "x-api-key: TU_CLAVE" \
-H "Content-Type: application/json" \
-d '{
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12350",
"fechaExpedicion": "15-09-2026",
"tipoFactura": "F1",
"descripcion": "Entrega intracomunitaria de maquinaria"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"destinatario": {
"nombre": "Kunde GmbH",
"idOtro": {
"codigoPais": "DE",
"idType": "02",
"id": "DE123456789"
}
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"operacionExenta": "E5",
"baseImponible": "12000.00"
}
],
"totales": {
"cuotaTotal": "0.00",
"importeTotal": "12000.00"
}
}'
from datetime import date
from decimal import Decimal
import veribai
client = veribai.Client(api_key="TU_CLAVE", environment="test")
respuesta = client.verifactu.crear({
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12350",
"fechaExpedicion": date(2026, 9, 15),
"tipoFactura": "F1",
"descripcion": "Entrega intracomunitaria de maquinaria",
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL",
},
"destinatario": {
"nombre": "Kunde GmbH",
"idOtro": {
"codigoPais": "DE",
"idType": "02",
"id": "DE123456789",
},
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"operacionExenta": "E5",
"baseImponible": Decimal("12000.00"),
},
],
"totales": {
"cuotaTotal": Decimal("0.00"),
"importeTotal": Decimal("12000.00"),
},
})
print(respuesta["idFactura"], respuesta["estado"])
const respuesta = await fetch("https://sandbox.veribai.com/v1/verifactu/crear", {
method: "POST",
headers: {
"x-api-key": "TU_CLAVE",
"Content-Type": "application/json",
},
body: JSON.stringify({
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12350",
"fechaExpedicion": "15-09-2026",
"tipoFactura": "F1",
"descripcion": "Entrega intracomunitaria de maquinaria"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"destinatario": {
"nombre": "Kunde GmbH",
"idOtro": {
"codigoPais": "DE",
"idType": "02",
"id": "DE123456789"
}
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"operacionExenta": "E5",
"baseImponible": "12000.00"
}
],
"totales": {
"cuotaTotal": "0.00",
"importeTotal": "12000.00"
}
}),
});
if (!respuesta.ok) throw new Error(`VeriBai ${respuesta.status}`);
const datos = await respuesta.json();
Prestación de servicios intracomunitaria (B2B)
Servicio a un empresario de otro Estado miembro. La operación se localiza en destino y no está sujeta al IVA español: calificacionOperacion: "N2".
curl -X POST https://sandbox.veribai.com/v1/verifactu/crear \
-H "x-api-key: TU_CLAVE" \
-H "Content-Type: application/json" \
-d '{
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12351",
"fechaExpedicion": "15-09-2026",
"tipoFactura": "F1",
"descripcion": "Desarrollo de software a medida"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"destinatario": {
"nombre": "Client SARL",
"idOtro": {
"codigoPais": "FR",
"idType": "02",
"id": "FR12345678901"
}
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "N2",
"baseImponible": "6000.00"
}
],
"totales": {
"cuotaTotal": "0.00",
"importeTotal": "6000.00"
}
}'
from datetime import date
from decimal import Decimal
import veribai
client = veribai.Client(api_key="TU_CLAVE", environment="test")
respuesta = client.verifactu.crear({
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12351",
"fechaExpedicion": date(2026, 9, 15),
"tipoFactura": "F1",
"descripcion": "Desarrollo de software a medida",
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL",
},
"destinatario": {
"nombre": "Client SARL",
"idOtro": {
"codigoPais": "FR",
"idType": "02",
"id": "FR12345678901",
},
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "N2",
"baseImponible": Decimal("6000.00"),
},
],
"totales": {
"cuotaTotal": Decimal("0.00"),
"importeTotal": Decimal("6000.00"),
},
})
print(respuesta["idFactura"], respuesta["estado"])
const respuesta = await fetch("https://sandbox.veribai.com/v1/verifactu/crear", {
method: "POST",
headers: {
"x-api-key": "TU_CLAVE",
"Content-Type": "application/json",
},
body: JSON.stringify({
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12351",
"fechaExpedicion": "15-09-2026",
"tipoFactura": "F1",
"descripcion": "Desarrollo de software a medida"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"destinatario": {
"nombre": "Client SARL",
"idOtro": {
"codigoPais": "FR",
"idType": "02",
"id": "FR12345678901"
}
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "N2",
"baseImponible": "6000.00"
}
],
"totales": {
"cuotaTotal": "0.00",
"importeTotal": "6000.00"
}
}),
});
if (!respuesta.ok) throw new Error(`VeriBai ${respuesta.status}`);
const datos = await respuesta.json();
Venta a consumidor de otro Estado miembro (B2C)
Por debajo del umbral de 10.000 € anuales de ventas a distancia, la venta tributa en España con IVA español. El destinatario particular se identifica con idOtro de tipo 03 (pasaporte) o 04 (documento oficial de su país).
curl -X POST https://sandbox.veribai.com/v1/verifactu/crear \
-H "x-api-key: TU_CLAVE" \
-H "Content-Type: application/json" \
-d '{
"version": "1.0",
"cabecera": {
"serie": "W",
"numero": "5001",
"fechaExpedicion": "15-09-2026",
"tipoFactura": "F1",
"descripcion": "Venta en tienda online"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"destinatario": {
"nombre": "Anna Rossi",
"idOtro": {
"codigoPais": "IT",
"idType": "04",
"id": "CA12345AB"
}
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": "82.64",
"tipoImpositivo": "21.00",
"cuotaRepercutida": "17.36"
}
],
"totales": {
"cuotaTotal": "17.36",
"importeTotal": "100.00"
}
}'
from datetime import date
from decimal import Decimal
import veribai
client = veribai.Client(api_key="TU_CLAVE", environment="test")
respuesta = client.verifactu.crear({
"version": "1.0",
"cabecera": {
"serie": "W",
"numero": "5001",
"fechaExpedicion": date(2026, 9, 15),
"tipoFactura": "F1",
"descripcion": "Venta en tienda online",
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL",
},
"destinatario": {
"nombre": "Anna Rossi",
"idOtro": {
"codigoPais": "IT",
"idType": "04",
"id": "CA12345AB",
},
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": Decimal("82.64"),
"tipoImpositivo": Decimal("21.00"),
"cuotaRepercutida": Decimal("17.36"),
},
],
"totales": {
"cuotaTotal": Decimal("17.36"),
"importeTotal": Decimal("100.00"),
},
})
print(respuesta["idFactura"], respuesta["estado"])
const respuesta = await fetch("https://sandbox.veribai.com/v1/verifactu/crear", {
method: "POST",
headers: {
"x-api-key": "TU_CLAVE",
"Content-Type": "application/json",
},
body: JSON.stringify({
"version": "1.0",
"cabecera": {
"serie": "W",
"numero": "5001",
"fechaExpedicion": "15-09-2026",
"tipoFactura": "F1",
"descripcion": "Venta en tienda online"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"destinatario": {
"nombre": "Anna Rossi",
"idOtro": {
"codigoPais": "IT",
"idType": "04",
"id": "CA12345AB"
}
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": "82.64",
"tipoImpositivo": "21.00",
"cuotaRepercutida": "17.36"
}
],
"totales": {
"cuotaTotal": "17.36",
"importeTotal": "100.00"
}
}),
});
if (!respuesta.ok) throw new Error(`VeriBai ${respuesta.status}`);
const datos = await respuesta.json();
Venta a distancia en régimen OSS
Por encima del umbral, la venta tributa en el país del consumidor y se declara en la ventanilla única (OSS). La línea lleva claveRegimen: "17" y calificacionOperacion: "N2": la operación no está sujeta al IVA español. El IVA del país del consumidor no forma parte del registro: importeTotal es la base imponible y se cuadra contra el desglose.
curl -X POST https://sandbox.veribai.com/v1/verifactu/crear \
-H "x-api-key: TU_CLAVE" \
-H "Content-Type: application/json" \
-d '{
"version": "1.0",
"cabecera": {
"serie": "W",
"numero": "5002",
"fechaExpedicion": "15-09-2026",
"tipoFactura": "F1",
"descripcion": "Venta a distancia intracomunitaria, régimen OSS"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"destinatario": {
"nombre": "Anna Rossi",
"idOtro": {
"codigoPais": "IT",
"idType": "04",
"id": "CA12345AB"
}
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "17",
"calificacionOperacion": "N2",
"baseImponible": "100.00"
}
],
"totales": {
"cuotaTotal": "0.00",
"importeTotal": "100.00"
}
}'
from datetime import date
from decimal import Decimal
import veribai
client = veribai.Client(api_key="TU_CLAVE", environment="test")
respuesta = client.verifactu.crear({
"version": "1.0",
"cabecera": {
"serie": "W",
"numero": "5002",
"fechaExpedicion": date(2026, 9, 15),
"tipoFactura": "F1",
"descripcion": "Venta a distancia intracomunitaria, régimen OSS",
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL",
},
"destinatario": {
"nombre": "Anna Rossi",
"idOtro": {
"codigoPais": "IT",
"idType": "04",
"id": "CA12345AB",
},
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "17",
"calificacionOperacion": "N2",
"baseImponible": Decimal("100.00"),
},
],
"totales": {
"cuotaTotal": Decimal("0.00"),
"importeTotal": Decimal("100.00"),
},
})
print(respuesta["idFactura"], respuesta["estado"])
const respuesta = await fetch("https://sandbox.veribai.com/v1/verifactu/crear", {
method: "POST",
headers: {
"x-api-key": "TU_CLAVE",
"Content-Type": "application/json",
},
body: JSON.stringify({
"version": "1.0",
"cabecera": {
"serie": "W",
"numero": "5002",
"fechaExpedicion": "15-09-2026",
"tipoFactura": "F1",
"descripcion": "Venta a distancia intracomunitaria, régimen OSS"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"destinatario": {
"nombre": "Anna Rossi",
"idOtro": {
"codigoPais": "IT",
"idType": "04",
"id": "CA12345AB"
}
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "17",
"calificacionOperacion": "N2",
"baseImponible": "100.00"
}
],
"totales": {
"cuotaTotal": "0.00",
"importeTotal": "100.00"
}
}),
});
if (!respuesta.ok) throw new Error(`VeriBai ${respuesta.status}`);
const datos = await respuesta.json();
Exportación de bienes
Entrega a un país fuera de la Unión Europea: claveRegimen: "02" (exportación) y operacionExenta: "E2" (artículo 21 de la LIVA). El destinatario se identifica con idOtro.
curl -X POST https://sandbox.veribai.com/v1/verifactu/crear \
-H "x-api-key: TU_CLAVE" \
-H "Content-Type: application/json" \
-d '{
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12352",
"fechaExpedicion": "15-09-2026",
"tipoFactura": "F1",
"descripcion": "Exportación de componentes electrónicos"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"destinatario": {
"nombre": "Buyer Inc",
"idOtro": {
"codigoPais": "US",
"idType": "06",
"id": "US987654321"
}
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "02",
"operacionExenta": "E2",
"baseImponible": "45000.00"
}
],
"totales": {
"cuotaTotal": "0.00",
"importeTotal": "45000.00"
}
}'
from datetime import date
from decimal import Decimal
import veribai
client = veribai.Client(api_key="TU_CLAVE", environment="test")
respuesta = client.verifactu.crear({
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12352",
"fechaExpedicion": date(2026, 9, 15),
"tipoFactura": "F1",
"descripcion": "Exportación de componentes electrónicos",
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL",
},
"destinatario": {
"nombre": "Buyer Inc",
"idOtro": {
"codigoPais": "US",
"idType": "06",
"id": "US987654321",
},
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "02",
"operacionExenta": "E2",
"baseImponible": Decimal("45000.00"),
},
],
"totales": {
"cuotaTotal": Decimal("0.00"),
"importeTotal": Decimal("45000.00"),
},
})
print(respuesta["idFactura"], respuesta["estado"])
const respuesta = await fetch("https://sandbox.veribai.com/v1/verifactu/crear", {
method: "POST",
headers: {
"x-api-key": "TU_CLAVE",
"Content-Type": "application/json",
},
body: JSON.stringify({
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12352",
"fechaExpedicion": "15-09-2026",
"tipoFactura": "F1",
"descripcion": "Exportación de componentes electrónicos"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"destinatario": {
"nombre": "Buyer Inc",
"idOtro": {
"codigoPais": "US",
"idType": "06",
"id": "US987654321"
}
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "02",
"operacionExenta": "E2",
"baseImponible": "45000.00"
}
],
"totales": {
"cuotaTotal": "0.00",
"importeTotal": "45000.00"
}
}),
});
if (!respuesta.ok) throw new Error(`VeriBai ${respuesta.status}`);
const datos = await respuesta.json();
Prestación de servicios a un país tercero
Servicio a un empresario establecido fuera de la Unión Europea. Se localiza fuera del territorio de aplicación del impuesto: calificacionOperacion: "N2".
curl -X POST https://sandbox.veribai.com/v1/verifactu/crear \
-H "x-api-key: TU_CLAVE" \
-H "Content-Type: application/json" \
-d '{
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12353",
"fechaExpedicion": "15-09-2026",
"tipoFactura": "F1",
"descripcion": "Servicios de asesoría técnica"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"destinatario": {
"nombre": "Consulting Ltd",
"idOtro": {
"codigoPais": "GB",
"idType": "06",
"id": "GB123456789"
}
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "N2",
"baseImponible": "3200.00"
}
],
"totales": {
"cuotaTotal": "0.00",
"importeTotal": "3200.00"
}
}'
from datetime import date
from decimal import Decimal
import veribai
client = veribai.Client(api_key="TU_CLAVE", environment="test")
respuesta = client.verifactu.crear({
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12353",
"fechaExpedicion": date(2026, 9, 15),
"tipoFactura": "F1",
"descripcion": "Servicios de asesoría técnica",
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL",
},
"destinatario": {
"nombre": "Consulting Ltd",
"idOtro": {
"codigoPais": "GB",
"idType": "06",
"id": "GB123456789",
},
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "N2",
"baseImponible": Decimal("3200.00"),
},
],
"totales": {
"cuotaTotal": Decimal("0.00"),
"importeTotal": Decimal("3200.00"),
},
})
print(respuesta["idFactura"], respuesta["estado"])
const respuesta = await fetch("https://sandbox.veribai.com/v1/verifactu/crear", {
method: "POST",
headers: {
"x-api-key": "TU_CLAVE",
"Content-Type": "application/json",
},
body: JSON.stringify({
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12353",
"fechaExpedicion": "15-09-2026",
"tipoFactura": "F1",
"descripcion": "Servicios de asesoría técnica"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"destinatario": {
"nombre": "Consulting Ltd",
"idOtro": {
"codigoPais": "GB",
"idType": "06",
"id": "GB123456789"
}
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "N2",
"baseImponible": "3200.00"
}
],
"totales": {
"cuotaTotal": "0.00",
"importeTotal": "3200.00"
}
}),
});
if (!respuesta.ok) throw new Error(`VeriBai ${respuesta.status}`);
const datos = await respuesta.json();
Factura con recargo de equivalencia
Venta a un comerciante minorista en recargo de equivalencia. La línea S1 añade tipoRecargoEquivalencia y cuotaRecargoEquivalencia. totales.cuotaTotal suma IVA y recargo, e importeTotal los incluye.
curl -X POST https://sandbox.veribai.com/v1/verifactu/crear \
-H "x-api-key: TU_CLAVE" \
-H "Content-Type: application/json" \
-d '{
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12354",
"fechaExpedicion": "15-09-2026",
"tipoFactura": "F1",
"descripcion": "Suministro de mercancía a comercio minorista"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"destinatario": {
"nif": "12345678Z",
"nombre": "Comercio Minorista"
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": "1000.00",
"tipoImpositivo": "21.00",
"cuotaRepercutida": "210.00",
"tipoRecargoEquivalencia": "5.20",
"cuotaRecargoEquivalencia": "52.00"
}
],
"totales": {
"cuotaTotal": "262.00",
"importeTotal": "1262.00"
}
}'
from datetime import date
from decimal import Decimal
import veribai
client = veribai.Client(api_key="TU_CLAVE", environment="test")
respuesta = client.verifactu.crear({
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12354",
"fechaExpedicion": date(2026, 9, 15),
"tipoFactura": "F1",
"descripcion": "Suministro de mercancía a comercio minorista",
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL",
},
"destinatario": {
"nif": "12345678Z",
"nombre": "Comercio Minorista",
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": Decimal("1000.00"),
"tipoImpositivo": Decimal("21.00"),
"cuotaRepercutida": Decimal("210.00"),
"tipoRecargoEquivalencia": Decimal("5.20"),
"cuotaRecargoEquivalencia": Decimal("52.00"),
},
],
"totales": {
"cuotaTotal": Decimal("262.00"),
"importeTotal": Decimal("1262.00"),
},
})
print(respuesta["idFactura"], respuesta["estado"])
const respuesta = await fetch("https://sandbox.veribai.com/v1/verifactu/crear", {
method: "POST",
headers: {
"x-api-key": "TU_CLAVE",
"Content-Type": "application/json",
},
body: JSON.stringify({
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12354",
"fechaExpedicion": "15-09-2026",
"tipoFactura": "F1",
"descripcion": "Suministro de mercancía a comercio minorista"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"destinatario": {
"nif": "12345678Z",
"nombre": "Comercio Minorista"
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": "1000.00",
"tipoImpositivo": "21.00",
"cuotaRepercutida": "210.00",
"tipoRecargoEquivalencia": "5.20",
"cuotaRecargoEquivalencia": "52.00"
}
],
"totales": {
"cuotaTotal": "262.00",
"importeTotal": "1262.00"
}
}),
});
if (!respuesta.ok) throw new Error(`VeriBai ${respuesta.status}`);
const datos = await respuesta.json();
Factura con IGIC (Canarias)
Emisor establecido en Canarias. impuesto: "03" selecciona el IGIC, con sus propios tipos. claveRegimen es obligatoria también con IGIC.
curl -X POST https://sandbox.veribai.com/v1/verifactu/crear \
-H "x-api-key: TU_CLAVE" \
-H "Content-Type: application/json" \
-d '{
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12355",
"fechaExpedicion": "15-09-2026",
"tipoFactura": "F1",
"descripcion": "Servicios de mantenimiento"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"destinatario": {
"nif": "B11111119",
"nombre": "Cliente Ejemplo SL"
},
"detalleDesglose": [
{
"impuesto": "03",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": "1000.00",
"tipoImpositivo": "7.00",
"cuotaRepercutida": "70.00"
}
],
"totales": {
"cuotaTotal": "70.00",
"importeTotal": "1070.00"
}
}'
from datetime import date
from decimal import Decimal
import veribai
client = veribai.Client(api_key="TU_CLAVE", environment="test")
respuesta = client.verifactu.crear({
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12355",
"fechaExpedicion": date(2026, 9, 15),
"tipoFactura": "F1",
"descripcion": "Servicios de mantenimiento",
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL",
},
"destinatario": {
"nif": "B11111119",
"nombre": "Cliente Ejemplo SL",
},
"detalleDesglose": [
{
"impuesto": "03",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": Decimal("1000.00"),
"tipoImpositivo": Decimal("7.00"),
"cuotaRepercutida": Decimal("70.00"),
},
],
"totales": {
"cuotaTotal": Decimal("70.00"),
"importeTotal": Decimal("1070.00"),
},
})
print(respuesta["idFactura"], respuesta["estado"])
const respuesta = await fetch("https://sandbox.veribai.com/v1/verifactu/crear", {
method: "POST",
headers: {
"x-api-key": "TU_CLAVE",
"Content-Type": "application/json",
},
body: JSON.stringify({
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12355",
"fechaExpedicion": "15-09-2026",
"tipoFactura": "F1",
"descripcion": "Servicios de mantenimiento"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"destinatario": {
"nif": "B11111119",
"nombre": "Cliente Ejemplo SL"
},
"detalleDesglose": [
{
"impuesto": "03",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": "1000.00",
"tipoImpositivo": "7.00",
"cuotaRepercutida": "70.00"
}
],
"totales": {
"cuotaTotal": "70.00",
"importeTotal": "1070.00"
}
}),
});
if (!respuesta.ok) throw new Error(`VeriBai ${respuesta.status}`);
const datos = await respuesta.json();
Factura con IPSI (Ceuta y Melilla)
impuesto: "02" selecciona el IPSI. claveRegimen es opcional; si se omite, se transmite 01.
curl -X POST https://sandbox.veribai.com/v1/verifactu/crear \
-H "x-api-key: TU_CLAVE" \
-H "Content-Type: application/json" \
-d '{
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12356",
"fechaExpedicion": "15-09-2026",
"tipoFactura": "F1",
"descripcion": "Servicios de transporte local"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"destinatario": {
"nif": "B11111119",
"nombre": "Cliente Ejemplo SL"
},
"detalleDesglose": [
{
"impuesto": "02",
"calificacionOperacion": "S1",
"baseImponible": "1000.00",
"tipoImpositivo": "4.00",
"cuotaRepercutida": "40.00"
}
],
"totales": {
"cuotaTotal": "40.00",
"importeTotal": "1040.00"
}
}'
from datetime import date
from decimal import Decimal
import veribai
client = veribai.Client(api_key="TU_CLAVE", environment="test")
respuesta = client.verifactu.crear({
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12356",
"fechaExpedicion": date(2026, 9, 15),
"tipoFactura": "F1",
"descripcion": "Servicios de transporte local",
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL",
},
"destinatario": {
"nif": "B11111119",
"nombre": "Cliente Ejemplo SL",
},
"detalleDesglose": [
{
"impuesto": "02",
"calificacionOperacion": "S1",
"baseImponible": Decimal("1000.00"),
"tipoImpositivo": Decimal("4.00"),
"cuotaRepercutida": Decimal("40.00"),
},
],
"totales": {
"cuotaTotal": Decimal("40.00"),
"importeTotal": Decimal("1040.00"),
},
})
print(respuesta["idFactura"], respuesta["estado"])
const respuesta = await fetch("https://sandbox.veribai.com/v1/verifactu/crear", {
method: "POST",
headers: {
"x-api-key": "TU_CLAVE",
"Content-Type": "application/json",
},
body: JSON.stringify({
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12356",
"fechaExpedicion": "15-09-2026",
"tipoFactura": "F1",
"descripcion": "Servicios de transporte local"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"destinatario": {
"nif": "B11111119",
"nombre": "Cliente Ejemplo SL"
},
"detalleDesglose": [
{
"impuesto": "02",
"calificacionOperacion": "S1",
"baseImponible": "1000.00",
"tipoImpositivo": "4.00",
"cuotaRepercutida": "40.00"
}
],
"totales": {
"cuotaTotal": "40.00",
"importeTotal": "1040.00"
}
}),
});
if (!respuesta.ok) throw new Error(`VeriBai ${respuesta.status}`);
const datos = await respuesta.json();
Factura de autónomo con retención de IRPF
El registro VeriFactu no tiene campo para la retención. importeTotal es la base más el IVA, antes de descontar el IRPF: aquí 665.50, no 583.00. Un total con la retención descontada deja de cuadrar con el desglose y devuelve 400.
curl -X POST https://sandbox.veribai.com/v1/verifactu/crear \
-H "x-api-key: TU_CLAVE" \
-H "Content-Type: application/json" \
-d '{
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12357",
"fechaExpedicion": "15-09-2026",
"tipoFactura": "F1",
"descripcion": "Honorarios profesionales. Retención IRPF 15 %: 82,50 €"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"destinatario": {
"nif": "B11111119",
"nombre": "Cliente Ejemplo SL"
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": "550.00",
"tipoImpositivo": "21.00",
"cuotaRepercutida": "115.50"
}
],
"totales": {
"cuotaTotal": "115.50",
"importeTotal": "665.50"
}
}'
from datetime import date
from decimal import Decimal
import veribai
client = veribai.Client(api_key="TU_CLAVE", environment="test")
respuesta = client.verifactu.crear({
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12357",
"fechaExpedicion": date(2026, 9, 15),
"tipoFactura": "F1",
"descripcion": "Honorarios profesionales. Retención IRPF 15 %: 82,50 €",
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL",
},
"destinatario": {
"nif": "B11111119",
"nombre": "Cliente Ejemplo SL",
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": Decimal("550.00"),
"tipoImpositivo": Decimal("21.00"),
"cuotaRepercutida": Decimal("115.50"),
},
],
"totales": {
"cuotaTotal": Decimal("115.50"),
"importeTotal": Decimal("665.50"),
},
})
print(respuesta["idFactura"], respuesta["estado"])
const respuesta = await fetch("https://sandbox.veribai.com/v1/verifactu/crear", {
method: "POST",
headers: {
"x-api-key": "TU_CLAVE",
"Content-Type": "application/json",
},
body: JSON.stringify({
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12357",
"fechaExpedicion": "15-09-2026",
"tipoFactura": "F1",
"descripcion": "Honorarios profesionales. Retención IRPF 15 %: 82,50 €"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"destinatario": {
"nif": "B11111119",
"nombre": "Cliente Ejemplo SL"
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": "550.00",
"tipoImpositivo": "21.00",
"cuotaRepercutida": "115.50"
}
],
"totales": {
"cuotaTotal": "115.50",
"importeTotal": "665.50"
}
}),
});
if (!respuesta.ok) throw new Error(`VeriBai ${respuesta.status}`);
const datos = await respuesta.json();
Régimen especial de bienes usados (REBU)
claveRegimen: "03". La base imponible es el margen de beneficio, no el precio de venta, e importeTotal es el precio que paga el cliente. Con esta clave, totales no se cuadra contra el desglose.
curl -X POST https://sandbox.veribai.com/v1/verifactu/crear \
-H "x-api-key: TU_CLAVE" \
-H "Content-Type: application/json" \
-d '{
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12358",
"fechaExpedicion": "15-09-2026",
"tipoFactura": "F1",
"descripcion": "Venta de vehículo usado. Régimen especial de bienes usados"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"destinatario": {
"nif": "12345678Z",
"nombre": "María García López"
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "03",
"calificacionOperacion": "S1",
"baseImponible": "1652.89",
"tipoImpositivo": "21.00",
"cuotaRepercutida": "347.11"
}
],
"totales": {
"cuotaTotal": "347.11",
"importeTotal": "9000.00"
}
}'
from datetime import date
from decimal import Decimal
import veribai
client = veribai.Client(api_key="TU_CLAVE", environment="test")
respuesta = client.verifactu.crear({
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12358",
"fechaExpedicion": date(2026, 9, 15),
"tipoFactura": "F1",
"descripcion": "Venta de vehículo usado. Régimen especial de bienes usados",
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL",
},
"destinatario": {
"nif": "12345678Z",
"nombre": "María García López",
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "03",
"calificacionOperacion": "S1",
"baseImponible": Decimal("1652.89"),
"tipoImpositivo": Decimal("21.00"),
"cuotaRepercutida": Decimal("347.11"),
},
],
"totales": {
"cuotaTotal": Decimal("347.11"),
"importeTotal": Decimal("9000.00"),
},
})
print(respuesta["idFactura"], respuesta["estado"])
const respuesta = await fetch("https://sandbox.veribai.com/v1/verifactu/crear", {
method: "POST",
headers: {
"x-api-key": "TU_CLAVE",
"Content-Type": "application/json",
},
body: JSON.stringify({
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12358",
"fechaExpedicion": "15-09-2026",
"tipoFactura": "F1",
"descripcion": "Venta de vehículo usado. Régimen especial de bienes usados"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"destinatario": {
"nif": "12345678Z",
"nombre": "María García López"
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "03",
"calificacionOperacion": "S1",
"baseImponible": "1652.89",
"tipoImpositivo": "21.00",
"cuotaRepercutida": "347.11"
}
],
"totales": {
"cuotaTotal": "347.11",
"importeTotal": "9000.00"
}
}),
});
if (!respuesta.ok) throw new Error(`VeriBai ${respuesta.status}`);
const datos = await respuesta.json();
Factura emitida por un tercero
La factura la expide un tercero en nombre del emisor: especial.emitidaPor: "T" y sus datos en especial.tercero. Si se omite emitidaPor, se aplica el modelo de emisión de tu cuenta.
curl -X POST https://sandbox.veribai.com/v1/verifactu/crear \
-H "x-api-key: TU_CLAVE" \
-H "Content-Type: application/json" \
-d '{
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12359",
"fechaExpedicion": "15-09-2026",
"tipoFactura": "F1",
"descripcion": "Servicios de consultoría"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"destinatario": {
"nif": "B11111119",
"nombre": "Cliente Ejemplo SL"
},
"especial": {
"emitidaPor": "T",
"tercero": {
"nif": "B22222228",
"nombre": "Gestoría Tercera SL"
}
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": "1000.00",
"tipoImpositivo": "21.00",
"cuotaRepercutida": "210.00"
}
],
"totales": {
"cuotaTotal": "210.00",
"importeTotal": "1210.00"
}
}'
from datetime import date
from decimal import Decimal
import veribai
client = veribai.Client(api_key="TU_CLAVE", environment="test")
respuesta = client.verifactu.crear({
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12359",
"fechaExpedicion": date(2026, 9, 15),
"tipoFactura": "F1",
"descripcion": "Servicios de consultoría",
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL",
},
"destinatario": {
"nif": "B11111119",
"nombre": "Cliente Ejemplo SL",
},
"especial": {
"emitidaPor": "T",
"tercero": {
"nif": "B22222228",
"nombre": "Gestoría Tercera SL",
},
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": Decimal("1000.00"),
"tipoImpositivo": Decimal("21.00"),
"cuotaRepercutida": Decimal("210.00"),
},
],
"totales": {
"cuotaTotal": Decimal("210.00"),
"importeTotal": Decimal("1210.00"),
},
})
print(respuesta["idFactura"], respuesta["estado"])
const respuesta = await fetch("https://sandbox.veribai.com/v1/verifactu/crear", {
method: "POST",
headers: {
"x-api-key": "TU_CLAVE",
"Content-Type": "application/json",
},
body: JSON.stringify({
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12359",
"fechaExpedicion": "15-09-2026",
"tipoFactura": "F1",
"descripcion": "Servicios de consultoría"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"destinatario": {
"nif": "B11111119",
"nombre": "Cliente Ejemplo SL"
},
"especial": {
"emitidaPor": "T",
"tercero": {
"nif": "B22222228",
"nombre": "Gestoría Tercera SL"
}
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": "1000.00",
"tipoImpositivo": "21.00",
"cuotaRepercutida": "210.00"
}
],
"totales": {
"cuotaTotal": "210.00",
"importeTotal": "1210.00"
}
}),
});
if (!respuesta.ok) throw new Error(`VeriBai ${respuesta.status}`);
const datos = await respuesta.json();
Factura emitida por el destinatario
Autofactura: la expide el destinatario en nombre del emisor, con un acuerdo previo entre ambos. especial.emitidaPor: "D". Exige destinatario.
curl -X POST https://sandbox.veribai.com/v1/verifactu/crear \
-H "x-api-key: TU_CLAVE" \
-H "Content-Type: application/json" \
-d '{
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12360",
"fechaExpedicion": "15-09-2026",
"tipoFactura": "F1",
"descripcion": "Comisiones de intermediación"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"destinatario": {
"nif": "B11111119",
"nombre": "Cliente Ejemplo SL"
},
"especial": {
"emitidaPor": "D"
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": "1000.00",
"tipoImpositivo": "21.00",
"cuotaRepercutida": "210.00"
}
],
"totales": {
"cuotaTotal": "210.00",
"importeTotal": "1210.00"
}
}'
from datetime import date
from decimal import Decimal
import veribai
client = veribai.Client(api_key="TU_CLAVE", environment="test")
respuesta = client.verifactu.crear({
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12360",
"fechaExpedicion": date(2026, 9, 15),
"tipoFactura": "F1",
"descripcion": "Comisiones de intermediación",
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL",
},
"destinatario": {
"nif": "B11111119",
"nombre": "Cliente Ejemplo SL",
},
"especial": {
"emitidaPor": "D",
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": Decimal("1000.00"),
"tipoImpositivo": Decimal("21.00"),
"cuotaRepercutida": Decimal("210.00"),
},
],
"totales": {
"cuotaTotal": Decimal("210.00"),
"importeTotal": Decimal("1210.00"),
},
})
print(respuesta["idFactura"], respuesta["estado"])
const respuesta = await fetch("https://sandbox.veribai.com/v1/verifactu/crear", {
method: "POST",
headers: {
"x-api-key": "TU_CLAVE",
"Content-Type": "application/json",
},
body: JSON.stringify({
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12360",
"fechaExpedicion": "15-09-2026",
"tipoFactura": "F1",
"descripcion": "Comisiones de intermediación"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"destinatario": {
"nif": "B11111119",
"nombre": "Cliente Ejemplo SL"
},
"especial": {
"emitidaPor": "D"
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": "1000.00",
"tipoImpositivo": "21.00",
"cuotaRepercutida": "210.00"
}
],
"totales": {
"cuotaTotal": "210.00",
"importeTotal": "1210.00"
}
}),
});
if (!respuesta.ok) throw new Error(`VeriBai ${respuesta.status}`);
const datos = await respuesta.json();
Factura sin identificación del destinatario
Una F2 por encima de 3.000 € que el artículo 6.1.d del RD 1619/2012 permite expedir sin identificar al destinatario. especial.facturaSinIdentifDestinatarioArt61d: "S" la exime del tope de las simplificadas.
curl -X POST https://sandbox.veribai.com/v1/verifactu/crear \
-H "x-api-key: TU_CLAVE" \
-H "Content-Type: application/json" \
-d '{
"version": "1.0",
"cabecera": {
"serie": "T",
"numero": "8002",
"fechaExpedicion": "15-09-2026",
"tipoFactura": "F2",
"descripcion": "Venta sin identificación del destinatario, art. 6.1.d RD 1619/2012"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"especial": {
"facturaSinIdentifDestinatarioArt61d": "S"
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": "4000.00",
"tipoImpositivo": "21.00",
"cuotaRepercutida": "840.00"
}
],
"totales": {
"cuotaTotal": "840.00",
"importeTotal": "4840.00"
}
}'
from datetime import date
from decimal import Decimal
import veribai
client = veribai.Client(api_key="TU_CLAVE", environment="test")
respuesta = client.verifactu.crear({
"version": "1.0",
"cabecera": {
"serie": "T",
"numero": "8002",
"fechaExpedicion": date(2026, 9, 15),
"tipoFactura": "F2",
"descripcion": "Venta sin identificación del destinatario, art. 6.1.d RD 1619/2012",
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL",
},
"especial": {
"facturaSinIdentifDestinatarioArt61d": "S",
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": Decimal("4000.00"),
"tipoImpositivo": Decimal("21.00"),
"cuotaRepercutida": Decimal("840.00"),
},
],
"totales": {
"cuotaTotal": Decimal("840.00"),
"importeTotal": Decimal("4840.00"),
},
})
print(respuesta["idFactura"], respuesta["estado"])
const respuesta = await fetch("https://sandbox.veribai.com/v1/verifactu/crear", {
method: "POST",
headers: {
"x-api-key": "TU_CLAVE",
"Content-Type": "application/json",
},
body: JSON.stringify({
"version": "1.0",
"cabecera": {
"serie": "T",
"numero": "8002",
"fechaExpedicion": "15-09-2026",
"tipoFactura": "F2",
"descripcion": "Venta sin identificación del destinatario, art. 6.1.d RD 1619/2012"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"especial": {
"facturaSinIdentifDestinatarioArt61d": "S"
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": "4000.00",
"tipoImpositivo": "21.00",
"cuotaRepercutida": "840.00"
}
],
"totales": {
"cuotaTotal": "840.00",
"importeTotal": "4840.00"
}
}),
});
if (!respuesta.ok) throw new Error(`VeriBai ${respuesta.status}`);
const datos = await respuesta.json();
Rectificativa por sustitución
Una R1 con rectificativa.tipo: "S" sustituye por completo a la factura rectificada. El desglose y totales llevan los importes correctos definitivos, y rectificativa.importe los importes de la factura que se rectifica. Cuándo rectificar y cuándo subsanar: Rectificar y anular.
curl -X POST https://sandbox.veribai.com/v1/verifactu/crear \
-H "x-api-key: TU_CLAVE" \
-H "Content-Type: application/json" \
-d '{
"version": "1.0",
"cabecera": {
"serie": "R",
"numero": "301",
"fechaExpedicion": "22-09-2026",
"tipoFactura": "R1",
"descripcion": "Rectificativa por sustitución de la factura A-12345"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"destinatario": {
"nif": "B11111119",
"nombre": "Cliente Ejemplo SL"
},
"rectificativa": {
"tipo": "S",
"facturasRectificadas": [
{
"serie": "A",
"numero": "12345",
"fechaExpedicion": "15-09-2026"
}
],
"importe": {
"baseRectificada": "1000.00",
"cuotaRectificada": "210.00"
}
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": "900.00",
"tipoImpositivo": "21.00",
"cuotaRepercutida": "189.00"
}
],
"totales": {
"cuotaTotal": "189.00",
"importeTotal": "1089.00"
}
}'
from datetime import date
from decimal import Decimal
import veribai
client = veribai.Client(api_key="TU_CLAVE", environment="test")
respuesta = client.verifactu.crear({
"version": "1.0",
"cabecera": {
"serie": "R",
"numero": "301",
"fechaExpedicion": date(2026, 9, 22),
"tipoFactura": "R1",
"descripcion": "Rectificativa por sustitución de la factura A-12345",
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL",
},
"destinatario": {
"nif": "B11111119",
"nombre": "Cliente Ejemplo SL",
},
"rectificativa": {
"tipo": "S",
"facturasRectificadas": [
{
"serie": "A",
"numero": "12345",
"fechaExpedicion": date(2026, 9, 15),
},
],
"importe": {
"baseRectificada": Decimal("1000.00"),
"cuotaRectificada": Decimal("210.00"),
},
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": Decimal("900.00"),
"tipoImpositivo": Decimal("21.00"),
"cuotaRepercutida": Decimal("189.00"),
},
],
"totales": {
"cuotaTotal": Decimal("189.00"),
"importeTotal": Decimal("1089.00"),
},
})
print(respuesta["idFactura"], respuesta["estado"])
const respuesta = await fetch("https://sandbox.veribai.com/v1/verifactu/crear", {
method: "POST",
headers: {
"x-api-key": "TU_CLAVE",
"Content-Type": "application/json",
},
body: JSON.stringify({
"version": "1.0",
"cabecera": {
"serie": "R",
"numero": "301",
"fechaExpedicion": "22-09-2026",
"tipoFactura": "R1",
"descripcion": "Rectificativa por sustitución de la factura A-12345"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"destinatario": {
"nif": "B11111119",
"nombre": "Cliente Ejemplo SL"
},
"rectificativa": {
"tipo": "S",
"facturasRectificadas": [
{
"serie": "A",
"numero": "12345",
"fechaExpedicion": "15-09-2026"
}
],
"importe": {
"baseRectificada": "1000.00",
"cuotaRectificada": "210.00"
}
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": "900.00",
"tipoImpositivo": "21.00",
"cuotaRepercutida": "189.00"
}
],
"totales": {
"cuotaTotal": "189.00",
"importeTotal": "1089.00"
}
}),
});
if (!respuesta.ok) throw new Error(`VeriBai ${respuesta.status}`);
const datos = await respuesta.json();
Rectificativa por diferencias
Una R1 con rectificativa.tipo: "I" declara solo la diferencia respecto a la factura rectificada. Un descuento posterior o una devolución llevan importes negativos. No lleva rectificativa.importe.
curl -X POST https://sandbox.veribai.com/v1/verifactu/crear \
-H "x-api-key: TU_CLAVE" \
-H "Content-Type: application/json" \
-d '{
"version": "1.0",
"cabecera": {
"serie": "R",
"numero": "302",
"fechaExpedicion": "22-09-2026",
"tipoFactura": "R1",
"descripcion": "Abono parcial de la factura A-12345"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"destinatario": {
"nif": "B11111119",
"nombre": "Cliente Ejemplo SL"
},
"rectificativa": {
"tipo": "I",
"facturasRectificadas": [
{
"serie": "A",
"numero": "12345",
"fechaExpedicion": "15-09-2026"
}
]
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": "-100.00",
"tipoImpositivo": "21.00",
"cuotaRepercutida": "-21.00"
}
],
"totales": {
"cuotaTotal": "-21.00",
"importeTotal": "-121.00"
}
}'
from datetime import date
from decimal import Decimal
import veribai
client = veribai.Client(api_key="TU_CLAVE", environment="test")
respuesta = client.verifactu.crear({
"version": "1.0",
"cabecera": {
"serie": "R",
"numero": "302",
"fechaExpedicion": date(2026, 9, 22),
"tipoFactura": "R1",
"descripcion": "Abono parcial de la factura A-12345",
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL",
},
"destinatario": {
"nif": "B11111119",
"nombre": "Cliente Ejemplo SL",
},
"rectificativa": {
"tipo": "I",
"facturasRectificadas": [
{
"serie": "A",
"numero": "12345",
"fechaExpedicion": date(2026, 9, 15),
},
],
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": Decimal("-100.00"),
"tipoImpositivo": Decimal("21.00"),
"cuotaRepercutida": Decimal("-21.00"),
},
],
"totales": {
"cuotaTotal": Decimal("-21.00"),
"importeTotal": Decimal("-121.00"),
},
})
print(respuesta["idFactura"], respuesta["estado"])
const respuesta = await fetch("https://sandbox.veribai.com/v1/verifactu/crear", {
method: "POST",
headers: {
"x-api-key": "TU_CLAVE",
"Content-Type": "application/json",
},
body: JSON.stringify({
"version": "1.0",
"cabecera": {
"serie": "R",
"numero": "302",
"fechaExpedicion": "22-09-2026",
"tipoFactura": "R1",
"descripcion": "Abono parcial de la factura A-12345"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"destinatario": {
"nif": "B11111119",
"nombre": "Cliente Ejemplo SL"
},
"rectificativa": {
"tipo": "I",
"facturasRectificadas": [
{
"serie": "A",
"numero": "12345",
"fechaExpedicion": "15-09-2026"
}
]
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": "-100.00",
"tipoImpositivo": "21.00",
"cuotaRepercutida": "-21.00"
}
],
"totales": {
"cuotaTotal": "-21.00",
"importeTotal": "-121.00"
}
}),
});
if (!respuesta.ok) throw new Error(`VeriBai ${respuesta.status}`);
const datos = await respuesta.json();
Rectificativa por crédito incobrable (R3)
R3 corresponde al artículo 80.4 de la LIVA. Solo se admite cuando han pasado al menos seis meses desde cada factura rectificada. Con menos, la API responde 400 R3_TIMING_ERROR.
curl -X POST https://sandbox.veribai.com/v1/verifactu/crear \
-H "x-api-key: TU_CLAVE" \
-H "Content-Type: application/json" \
-d '{
"version": "1.0",
"cabecera": {
"serie": "R",
"numero": "303",
"fechaExpedicion": "22-09-2026",
"tipoFactura": "R3",
"descripcion": "Rectificativa por crédito incobrable de la factura A-11890"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"destinatario": {
"nif": "B11111119",
"nombre": "Cliente Ejemplo SL"
},
"rectificativa": {
"tipo": "I",
"facturasRectificadas": [
{
"serie": "A",
"numero": "11890",
"fechaExpedicion": "10-03-2026"
}
]
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": "-1000.00",
"tipoImpositivo": "21.00",
"cuotaRepercutida": "-210.00"
}
],
"totales": {
"cuotaTotal": "-210.00",
"importeTotal": "-1210.00"
}
}'
from datetime import date
from decimal import Decimal
import veribai
client = veribai.Client(api_key="TU_CLAVE", environment="test")
respuesta = client.verifactu.crear({
"version": "1.0",
"cabecera": {
"serie": "R",
"numero": "303",
"fechaExpedicion": date(2026, 9, 22),
"tipoFactura": "R3",
"descripcion": "Rectificativa por crédito incobrable de la factura A-11890",
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL",
},
"destinatario": {
"nif": "B11111119",
"nombre": "Cliente Ejemplo SL",
},
"rectificativa": {
"tipo": "I",
"facturasRectificadas": [
{
"serie": "A",
"numero": "11890",
"fechaExpedicion": date(2026, 3, 10),
},
],
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": Decimal("-1000.00"),
"tipoImpositivo": Decimal("21.00"),
"cuotaRepercutida": Decimal("-210.00"),
},
],
"totales": {
"cuotaTotal": Decimal("-210.00"),
"importeTotal": Decimal("-1210.00"),
},
})
print(respuesta["idFactura"], respuesta["estado"])
const respuesta = await fetch("https://sandbox.veribai.com/v1/verifactu/crear", {
method: "POST",
headers: {
"x-api-key": "TU_CLAVE",
"Content-Type": "application/json",
},
body: JSON.stringify({
"version": "1.0",
"cabecera": {
"serie": "R",
"numero": "303",
"fechaExpedicion": "22-09-2026",
"tipoFactura": "R3",
"descripcion": "Rectificativa por crédito incobrable de la factura A-11890"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"destinatario": {
"nif": "B11111119",
"nombre": "Cliente Ejemplo SL"
},
"rectificativa": {
"tipo": "I",
"facturasRectificadas": [
{
"serie": "A",
"numero": "11890",
"fechaExpedicion": "10-03-2026"
}
]
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": "-1000.00",
"tipoImpositivo": "21.00",
"cuotaRepercutida": "-210.00"
}
],
"totales": {
"cuotaTotal": "-210.00",
"importeTotal": "-1210.00"
}
}),
});
if (!respuesta.ok) throw new Error(`VeriBai ${respuesta.status}`);
const datos = await respuesta.json();
Rectificativa de una factura simplificada (R5)
Rectifica una F2. Como la simplificada, no lleva destinatario.
curl -X POST https://sandbox.veribai.com/v1/verifactu/crear \
-H "x-api-key: TU_CLAVE" \
-H "Content-Type: application/json" \
-d '{
"version": "1.0",
"cabecera": {
"serie": "RT",
"numero": "91",
"fechaExpedicion": "22-09-2026",
"tipoFactura": "R5",
"descripcion": "Devolución del ticket T-7990"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"rectificativa": {
"tipo": "I",
"facturasRectificadas": [
{
"serie": "T",
"numero": "7990",
"fechaExpedicion": "12-09-2026"
}
]
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": "-24.79",
"tipoImpositivo": "21.00",
"cuotaRepercutida": "-5.21"
}
],
"totales": {
"cuotaTotal": "-5.21",
"importeTotal": "-30.00"
}
}'
from datetime import date
from decimal import Decimal
import veribai
client = veribai.Client(api_key="TU_CLAVE", environment="test")
respuesta = client.verifactu.crear({
"version": "1.0",
"cabecera": {
"serie": "RT",
"numero": "91",
"fechaExpedicion": date(2026, 9, 22),
"tipoFactura": "R5",
"descripcion": "Devolución del ticket T-7990",
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL",
},
"rectificativa": {
"tipo": "I",
"facturasRectificadas": [
{
"serie": "T",
"numero": "7990",
"fechaExpedicion": date(2026, 9, 12),
},
],
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": Decimal("-24.79"),
"tipoImpositivo": Decimal("21.00"),
"cuotaRepercutida": Decimal("-5.21"),
},
],
"totales": {
"cuotaTotal": Decimal("-5.21"),
"importeTotal": Decimal("-30.00"),
},
})
print(respuesta["idFactura"], respuesta["estado"])
const respuesta = await fetch("https://sandbox.veribai.com/v1/verifactu/crear", {
method: "POST",
headers: {
"x-api-key": "TU_CLAVE",
"Content-Type": "application/json",
},
body: JSON.stringify({
"version": "1.0",
"cabecera": {
"serie": "RT",
"numero": "91",
"fechaExpedicion": "22-09-2026",
"tipoFactura": "R5",
"descripcion": "Devolución del ticket T-7990"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"rectificativa": {
"tipo": "I",
"facturasRectificadas": [
{
"serie": "T",
"numero": "7990",
"fechaExpedicion": "12-09-2026"
}
]
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": "-24.79",
"tipoImpositivo": "21.00",
"cuotaRepercutida": "-5.21"
}
],
"totales": {
"cuotaTotal": "-5.21",
"importeTotal": "-30.00"
}
}),
});
if (!respuesta.ok) throw new Error(`VeriBai ${respuesta.status}`);
const datos = await respuesta.json();
Factura en sustitución de simplificadas (F3)
El cliente pide una factura completa por compras que ya tienen ticket. La F3 identifica las simplificadas que sustituye en rectificativa.facturasSustituidas. No es una rectificativa: no lleva tipo ni facturasRectificadas.
curl -X POST https://sandbox.veribai.com/v1/verifactu/crear \
-H "x-api-key: TU_CLAVE" \
-H "Content-Type: application/json" \
-d '{
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12361",
"fechaExpedicion": "22-09-2026",
"tipoFactura": "F3",
"descripcion": "Factura en sustitución de los tickets T-8003 y T-8004"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"destinatario": {
"nif": "B11111119",
"nombre": "Cliente Ejemplo SL"
},
"rectificativa": {
"facturasSustituidas": [
{
"serie": "T",
"numero": "8003",
"fechaExpedicion": "15-09-2026"
},
{
"serie": "T",
"numero": "8004",
"fechaExpedicion": "16-09-2026"
}
]
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": "49.58",
"tipoImpositivo": "21.00",
"cuotaRepercutida": "10.42"
}
],
"totales": {
"cuotaTotal": "10.42",
"importeTotal": "60.00"
}
}'
from datetime import date
from decimal import Decimal
import veribai
client = veribai.Client(api_key="TU_CLAVE", environment="test")
respuesta = client.verifactu.crear({
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12361",
"fechaExpedicion": date(2026, 9, 22),
"tipoFactura": "F3",
"descripcion": "Factura en sustitución de los tickets T-8003 y T-8004",
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL",
},
"destinatario": {
"nif": "B11111119",
"nombre": "Cliente Ejemplo SL",
},
"rectificativa": {
"facturasSustituidas": [
{
"serie": "T",
"numero": "8003",
"fechaExpedicion": date(2026, 9, 15),
},
{
"serie": "T",
"numero": "8004",
"fechaExpedicion": date(2026, 9, 16),
},
],
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": Decimal("49.58"),
"tipoImpositivo": Decimal("21.00"),
"cuotaRepercutida": Decimal("10.42"),
},
],
"totales": {
"cuotaTotal": Decimal("10.42"),
"importeTotal": Decimal("60.00"),
},
})
print(respuesta["idFactura"], respuesta["estado"])
const respuesta = await fetch("https://sandbox.veribai.com/v1/verifactu/crear", {
method: "POST",
headers: {
"x-api-key": "TU_CLAVE",
"Content-Type": "application/json",
},
body: JSON.stringify({
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12361",
"fechaExpedicion": "22-09-2026",
"tipoFactura": "F3",
"descripcion": "Factura en sustitución de los tickets T-8003 y T-8004"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"destinatario": {
"nif": "B11111119",
"nombre": "Cliente Ejemplo SL"
},
"rectificativa": {
"facturasSustituidas": [
{
"serie": "T",
"numero": "8003",
"fechaExpedicion": "15-09-2026"
},
{
"serie": "T",
"numero": "8004",
"fechaExpedicion": "16-09-2026"
}
]
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": "49.58",
"tipoImpositivo": "21.00",
"cuotaRepercutida": "10.42"
}
],
"totales": {
"cuotaTotal": "10.42",
"importeTotal": "60.00"
}
}),
});
if (!respuesta.ok) throw new Error(`VeriBai ${respuesta.status}`);
const datos = await respuesta.json();
Subsanación de un registro
Corrige datos mal informados de un registro ya remitido sin cambiar la operación. El cuerpo es el de crear con los datos corregidos y la misma identidad (serie, numero, fechaExpedicion). Aquí se corrige el nombre del destinatario de la factura A-12345.
curl -X PUT https://sandbox.veribai.com/v1/verifactu/subsanar \
-H "x-api-key: TU_CLAVE" \
-H "Content-Type: application/json" \
-d '{
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12345",
"fechaExpedicion": "15-09-2026",
"tipoFactura": "F1",
"descripcion": "Servicios de consultoría"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"destinatario": {
"nif": "B11111119",
"nombre": "Cliente Ejemplo Sociedad Limitada"
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": "1000.00",
"tipoImpositivo": "21.00",
"cuotaRepercutida": "210.00"
}
],
"totales": {
"cuotaTotal": "210.00",
"importeTotal": "1210.00"
}
}'
from datetime import date
from decimal import Decimal
import veribai
client = veribai.Client(api_key="TU_CLAVE", environment="test")
respuesta = client.verifactu.subsanar({
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12345",
"fechaExpedicion": date(2026, 9, 15),
"tipoFactura": "F1",
"descripcion": "Servicios de consultoría",
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL",
},
"destinatario": {
"nif": "B11111119",
"nombre": "Cliente Ejemplo Sociedad Limitada",
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": Decimal("1000.00"),
"tipoImpositivo": Decimal("21.00"),
"cuotaRepercutida": Decimal("210.00"),
},
],
"totales": {
"cuotaTotal": Decimal("210.00"),
"importeTotal": Decimal("1210.00"),
},
})
const respuesta = await fetch("https://sandbox.veribai.com/v1/verifactu/subsanar", {
method: "PUT",
headers: {
"x-api-key": "TU_CLAVE",
"Content-Type": "application/json",
},
body: JSON.stringify({
"version": "1.0",
"cabecera": {
"serie": "A",
"numero": "12345",
"fechaExpedicion": "15-09-2026",
"tipoFactura": "F1",
"descripcion": "Servicios de consultoría"
},
"emisor": {
"nif": "B00000000",
"nombre": "Empresa Emisora SL"
},
"destinatario": {
"nif": "B11111119",
"nombre": "Cliente Ejemplo Sociedad Limitada"
},
"detalleDesglose": [
{
"impuesto": "01",
"claveRegimen": "01",
"calificacionOperacion": "S1",
"baseImponible": "1000.00",
"tipoImpositivo": "21.00",
"cuotaRepercutida": "210.00"
}
],
"totales": {
"cuotaTotal": "210.00",
"importeTotal": "1210.00"
}
}),
});
if (!respuesta.ok) throw new Error(`VeriBai ${respuesta.status}`);
const datos = await respuesta.json();
Anulación de una factura
Deja sin efecto un registro remitido. facturaAnulada identifica la factura original: serie, numero y fechaExpedicion deben coincidir exactamente con ella. Aquí se anula el ticket T-8001, la simplificada de esta página.
curl -X POST https://sandbox.veribai.com/v1/verifactu/anular \
-H "x-api-key: TU_CLAVE" \
-H "Content-Type: application/json" \
-d '{
"version": "1.0",
"facturaAnulada": {
"nifEmisor": "B00000000",
"serie": "T",
"numero": "8001",
"fechaExpedicion": "15-09-2026"
}
}'
from datetime import date
import veribai
client = veribai.Client(api_key="TU_CLAVE", environment="test")
respuesta = client.verifactu.anular({
"version": "1.0",
"facturaAnulada": {
"nifEmisor": "B00000000",
"serie": "T",
"numero": "8001",
"fechaExpedicion": date(2026, 9, 15),
},
})
const respuesta = await fetch("https://sandbox.veribai.com/v1/verifactu/anular", {
method: "POST",
headers: {
"x-api-key": "TU_CLAVE",
"Content-Type": "application/json",
},
body: JSON.stringify({
"version": "1.0",
"facturaAnulada": {
"nifEmisor": "B00000000",
"serie": "T",
"numero": "8001",
"fechaExpedicion": "15-09-2026"
}
}),
});
if (!respuesta.ok) throw new Error(`VeriBai ${respuesta.status}`);
const datos = await respuesta.json();