Payroll Invoice
A Payroll Invoice, also known as a payroll receipt, is used to provide evidence of payment under labor legislation. This type of CFDI must be issued for each payment made for the concept of salary and similar remunerations, and its purpose is to formalize the relationship between employer and employee, as well as to comply with the tax regulations imposed by law.
They're used to prove employer contributions made to the Mexican Social Security Institute (IMSS), the National Housing Fund Institute for Workers (INFONAVIT), as well as the payment of payroll tax.
The payroll CFDI can be identified as a document with type "N".
Examples
To fully understand all the available options when creating an invoice, detailed descriptions of each field, and the most commonly used catalogs, please refer to the Create Invoice API Reference, and then click on the Nómina invoice type.
Invoice issued to cover the service provided by an employee
In this scenario, an invoice is issued to prove the service provided by an employee during a specific period.
- Node.js
- C#
- PHP
- cURL
const Facturapi = require('facturapi');
const facturapi = new Facturapi('sk_test_API_KEY');
const invoice = await facturapi.invoices.create({
type: 'N',
folio_number: 1580,
series: 'N',
customer: {
legal_name: 'SAUL EUSEBIO LOPEZ GARCIA',
tax_id: 'ABCD990714A23',
tax_system: '605',
address: {
country: 'MEX',
zip: '31066',
},
},
complements: [
{
type: 'nomina',
data: {
fecha_pago: "2023-08-31T17:07:35.690Z",
fecha_inicial_pago: '2023-08-28T06:00:00.000Z',
fecha_final_pago: '2023-09-03T06:00:00.000Z',
num_dias_pagados: 7,
emisor: {
curp: "DCBA531412HSACAP01",
registro_patronal: "A7025105103",
rfc_patron_origen: "DCBA531412AP0"
},
receptor: {
curp: "ABCD990714HSRABS06",
tipo_contrato: "01",
tipo_regimen: "02",
num_empleado: "021",
periodicidad_pago: "02",
clave_ent_fed: "HID",
num_seguridad_social: "72826484110",
fecha_inicio_rel_laboral: "2023-07-03T06:00:00.000Z",
tipo_jornada: "01",
departamento: "CONTABILIDAD",
puesto: "ASISTENTE DE CONTADOR",
riesgo_puesto: "2",
salario_diario_integrado: 228.16,
antiguedad: true
},
percepciones: {
percepcion: {
tipo_percepcion: "001",
clave: "5400-001",
importe_gravado: 1522.08,
importe_exento: 0
}
},
deducciones: [
{
tipo_deduccion: "002",
clave: "1450-002",
importe: 92.58
},
{
tipo_deduccion: "021",
clave: "1450-021",
importe: 37.93
}
],
otros_pagos: [
{
tipo_otro_pago: "002",
clave: "1350-002",
importe: 58.38,
subsidio_causado: 58.38,
concepto: "Subsidio para el empleo (efectivamente entregado al trabajador)."
}
]
}
}
]
});
var facturapi = new Facturapi.Client("sk_test_API_KEY");
var invoice = await facturapi.Invoice.CreateAsync(new Dictionary<string, object>
{
["type"] = "N",
["folio_number"] = 1580,
["series"] = "N",
["customer"] = new Dictionary<string, object>
{
["legal_name"] = "SAUL EUSEBIO LOPEZ GARCIA",
["tax_id"] = "ABCD990714A23",
["tax_system"] = "605",
["address"] = new Dictionary<string, object>
{
["country"] = "MEX",
["zip"] = "31066"
}
},
["complements"] = new List<Dictionary<string, object>>
{
new Dictionary<string, object>
{
["type"] = "nomina",
["data"] = new Dictionary<string, object>
{
["fecha_pago"] = "2023-08-31T17:07:35.690Z",
["fecha_inicial_pago"] = "2023-08-28T06:00:00.000Z",
["fecha_final_pago"] = "2023-09-03T06:00:00.000Z",
["num_dias_pagados"] = 7,
["emisor"] = new Dictionary<string, object>
{
["curp"] = "DCBA531412HSACAP01",
["registro_patronal"] = "A7025105103",
["rfc_patron_origen"] = "DCBA531412AP0"
},
["receptor"] = new Dictionary<string, object>
{
["curp"] = "ABCD990714HSRABS06",
["tipo_contrato"] = "01",
["tipo_regimen"] = "02",
["num_empleado"] = "021",
["periodicidad_pago"] = "02",
["clave_ent_fed"] = "HID",
["num_seguridad_social"] = "72826484110",
["fecha_inicio_rel_laboral"] = "2023-07-03T06:00:00.000Z",
["tipo_jornada"] = "01",
["departamento"] = "CONTABILIDAD",
["puesto"] = "ASISTENTE DE CONTADOR",
["riesgo_puesto"] = "2",
["salario_diario_integrado"] = 228.16,
["antiguedad"] = true
},
["percepciones"] = new Dictionary<string, object>
{
["percepcion"] = new Dictionary<string, object>
{
["tipo_percepcion"] = "001",
["clave"] = "5400-001",
["importe_gravado"] = 1522.08,
["importe_exento"] = 0
}
},
["deducciones"] = new List<Dictionary<string, object>>
{
new Dictionary<string, object>
{
["tipo_deduccion"] = "002",
["clave"] = "1450-002",
["importe"] = 92.58
},
new Dictionary<string, object>
{
["tipo_deduccion"] = "021",
["clave"] = "1450-021",
["importe"] = 37.93
}
},
["otros_pagos"] = new List<Dictionary<string, object>>
{
new Dictionary<string, object>
{
["tipo_otro_pago"] = "002",
["clave"] = "1350-002",
["importe"] = 58.38,
["subsidio_causado"] = 58.38,
["concepto"] = "Subsidio para el empleo (efectivamente entregado al trabajador)."
}
}
}
}
}
});
$facturapi = new Facturapi("sk_test_API_KEY");
$invoice = $facturapi->Invoices->create([
"type" => "N",
"folio_number" => 1580,
"series" => "N",
"customer" => [
"legal_name" => "SAUL EUSEBIO LOPEZ GARCIA",
"tax_id" => "ABCD990714A23",
"tax_system" => "605",
"address" => [
"country" => "MEX",
"zip" => "31066",
],
],
"complements" => [
[
"type" => "nomina",
"data" => [
"fecha_pago" => "2023-08-31T17:07:35.690Z",
"fecha_inicial_pago" => "2023-08-28T06:00:00.000Z",
"fecha_final_pago" => "2023-09-03T06:00:00.000Z",
"num_dias_pagados" => 7,
"emisor" => [
"curp" => "DCBA531412HSACAP01",
"registro_patronal" => "A7025105103",
"rfc_patron_origen" => "DCBA531412AP0"
],
"receptor" => [
"curp" => "ABCD990714HSRABS06",
"tipo_contrato" => "01",
"tipo_regimen" => "02",
"num_empleado" => "021",
"periodicidad_pago" => "02",
"clave_ent_fed" => "HID",
"num_seguridad_social" => "72826484110",
"fecha_inicio_rel_laboral" => "2023-07-03T06:00:00.000Z",
"tipo_jornada" => "01",
"departamento" => "CONTABILIDAD",
"puesto" => "ASISTENTE DE CONTADOR",
"riesgo_puesto" => "2",
"salario_diario_integrado" => 228.16,
"antiguedad" => true
],
"percepciones" => [
"percepcion" => [
"tipo_percepcion" => "001",
"clave" => "5400-001",
"importe_gravado" => 1522.08,
"importe_exento" => 0
]
],
"deducciones" => [
[
"tipo_deduccion" => "002",
"clave" => "1450-002",
"importe" => 92.58
],
[
"tipo_deduccion" => "021",
"clave" => "1450-021",
"importe" => 37.93
]
],
"otros_pagos" => [
[
"tipo_otro_pago" => "002",
"clave" => "1350-002",
"importe" => 58.38,
"subsidio_causado" => 58.38,
"concepto" => "Subsidio para el empleo (efectivamente entregado al trabajador)."
]
]
]
]
]
]);
curl https://www.facturapi.io/v2/invoices \
-H "Authorization: Bearer sk_test_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "N",
"folio_number": 1580,
"series": "N",
"customer": {
"legal_name": "SAUL EUSEBIO LOPEZ GARCIA",
"tax_id": "ABCD990714A23",
"tax_system": "605",
"address": {
"country": "MEX",
"zip": "31066"
}
},
"complements": [
{
"type": "nomina",
"data": {
"fecha_pago": "2023-08-31T17:07:35.690Z",
"fecha_inicial_pago": "2023-08-28T06:00:00.000Z",
"fecha_final_pago": "2023-09-03T06:00:00.000Z",
"num_dias_pagados": 7,
"emisor": {
"curp": "DCBA531412HSACAP01",
"registro_patronal": "A7025105103",
"rfc_patron_origen": "DCBA531412AP0"
},
"receptor": {
"curp": "ABCD990714HSRABS06",
"tipo_contrato": "01",
"tipo_regimen": "02",
"num_empleado": "021",
"periodicidad_pago": "02",
"clave_ent_fed": "HID",
"num_seguridad_social": "72826484110",
"fecha_inicio_rel_laboral": "2023-07-03T06:00:00.000Z",
"tipo_jornada": "01",
"departamento": "CONTABILIDAD",
"puesto": "ASISTENTE DE CONTADOR",
"riesgo_puesto": "2",
"salario_diario_integrado": 228.16,
"antiguedad": true
},
"percepciones": {
"percepcion": {
"tipo_percepcion": "001",
"clave": "5400-001",
"importe_gravado": 1522.08,
"importe_exento": 0
}
},
"deducciones": [
{
"tipo_deduccion": "002",
"clave": "1450-002",
"importe": 92.58
},
{
"tipo_deduccion": "021",
"clave": "1450-021",
"importe": 37.93
}
],
"otros_pagos": [
{
"tipo_otro_pago": "002",
"clave": "1350-002",
"importe": 58.38,
"subsidio_causado": 58.38,
"concepto": "Subsidio para el empleo (efectivamente entregado al trabajador)."
}
]
}
}
]
}'