n8n-nodes-sunat-peru 0.1.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,98 +1,133 @@
1
- # n8n-nodes-sunat-peru
1
+ # n8n-nodes-sunat-peru 🇵🇪
2
2
 
3
- ![SUNAT Perú](https://img.shields.io/badge/SUNAT-Perú-D91023)
4
- ![n8n](https://img.shields.io/badge/n8n-community--node-ff6d5a)
5
- ![License](https://img.shields.io/badge/license-MIT-blue)
3
+ **Peru Electronic Invoicing for n8n** - RUC/DNI validation, exchange rate, UIT.
6
4
 
7
- Nodo n8n para integración con **SUNAT Perú** (Superintendencia Nacional de Aduanas y de Administración Tributaria).
5
+ ![SUNAT Peru](https://img.shields.io/badge/SUNAT-Peru-red)
6
+ ![n8n](https://img.shields.io/badge/n8n-community--node-orange)
7
+ ![License](https://img.shields.io/badge/license-MIT-green)
8
8
 
9
- ## 🚀 Funcionalidades
9
+ ## Features
10
10
 
11
- ### RUC/DNI (Registro Único de Contribuyentes)
12
- - ✅ **Validar RUC** - Verifica formato y dígito verificador (11 dígitos)
13
- - ✅ **Validar DNI** - Verifica formato (8 dígitos)
14
- - ✅ **Formatear RUC** - Limpia y normaliza
15
- - ✅ **Consultar RUC** - Obtiene razón social (API pública)
11
+ - **Issue Invoices** to SUNAT (Invoice, Sales Receipt, Credit Note)
12
+ - ✅ **RUC/DNI Validation** - Verify, format, query SUNAT
13
+ - ✅ **Exchange Rate** - Dollar buy/sell from SBS (live data)
14
+ - ✅ **UIT Value** - Tax Unit
15
+ - ✅ **UIT Soles Conversion** automatic
16
+ - ✅ **Supports Nubefact and Efact**
16
17
 
17
- ### Indicadores Económicos (BCRP/SUNAT)
18
- - 💵 **Tipo de Cambio** - Dólar compra/venta SBS
19
- - 📊 **Valor UIT** - Unidad Impositiva Tributaria
20
- - 🔄 **Convertir UIT ↔ Soles**
18
+ ## 🚀 Installation
21
19
 
22
- ### Emisión Factura Electrónica (requiere proveedor)
23
- - 📄 **Factura** - 01
24
- - 📄 **Boleta de Venta** - 03
25
- - 📄 **Nota de Crédito** - 07
26
- - 📄 **Nota de Débito** - 08
20
+ ### n8n Cloud / Desktop
21
+ 1. Settings Community Nodes
22
+ 2. Search `n8n-nodes-sunat-peru`
23
+ 3. Install
27
24
 
28
- ## 📦 Instalación
29
-
30
- ### En n8n (recomendado)
31
- 1. Ve a **Settings** → **Community Nodes**
32
- 2. Clic en **Install**
33
- 3. Escribe: `n8n-nodes-sunat-peru`
34
- 4. Clic en **Install**
35
-
36
- ### Via npm
25
+ ### Self-hosted
37
26
  ```bash
38
27
  npm install n8n-nodes-sunat-peru
39
28
  ```
40
29
 
41
- ## ⚙️ Configuración
30
+ ## ⚙️ Configuration
42
31
 
43
- ### Sin credenciales (funciones locales)
44
- Las siguientes funciones NO requieren credenciales:
45
- - Validar/formatear RUC/DNI
46
- - Tipo de cambio (API pública)
47
- - Valor UIT
48
- - Conversiones
32
+ ### To issue invoices you need:
49
33
 
50
- ### Con credenciales (emisión facturas)
51
- Para emitir facturas electrónicas necesitas:
52
- - **Nubefact** - https://nubefact.com
53
- - **Efact** - https://efact.pe
34
+ | Provider | Free Plan | Link |
35
+ |----------|-----------|------|
36
+ | **Nubefact** | Yes (demo) | [nubefact.com](https://nubefact.com) |
37
+ | **Efact** | Yes (testing) | [efact.pe](https://efact.pe) |
54
38
 
55
- ## 📋 Ejemplos de Uso
39
+ 1. Create an account with one of the providers
40
+ 2. Get your API Key
41
+ 3. Configure credentials in n8n
56
42
 
57
- ### Validar RUC
58
- ```
59
- Recurso: RUC/DNI
60
- Operación: Validar RUC
61
- RUC: 20123456789
62
- ```
43
+ ### For local functions (RUC, Indicators):
44
+ No credentials needed - works without configuration.
63
45
 
64
- ### Obtener tipo de cambio
65
- ```
66
- Recurso: Indicadores
67
- Operación: Tipo de Cambio
46
+ ## 📖 Usage
47
+
48
+ ### Validate RUC
49
+
50
+ ```javascript
51
+ // Input: "20123456789"
52
+ // Output:
53
+ {
54
+ "valid": true,
55
+ "ruc": "20123456789",
56
+ "tipo": "Company",
57
+ "message": "Valid RUC"
58
+ }
68
59
  ```
69
60
 
70
- ### Convertir UIT a Soles
61
+ ### Get Exchange Rate
62
+
63
+ ```javascript
64
+ // Output:
65
+ {
66
+ "indicator": "Exchange Rate",
67
+ "buy": 3.73,
68
+ "sell": 3.77,
69
+ "date": "2024-01-15",
70
+ "source": "SUNAT/SBS"
71
+ }
71
72
  ```
72
- Recurso: Indicadores
73
- Operación: UIT a Soles
74
- Monto UIT: 10
73
+
74
+ ### Get UIT Value
75
+
76
+ ```javascript
77
+ // Output:
78
+ {
79
+ "indicator": "UIT",
80
+ "value": 5350,
81
+ "year": 2025,
82
+ "source": "SUNAT"
83
+ }
75
84
  ```
76
85
 
77
- ## 📊 Tipos de Comprobante
86
+ ## 🔧 Available Operations
87
+
88
+ ### 🔢 RUC/DNI
89
+ - Validate RUC
90
+ - Validate DNI
91
+ - Format RUC
92
+ - Query RUC (from SUNAT)
93
+
94
+ ### 💰 Indicators (live data)
95
+ - Exchange Rate (Dollar)
96
+ - UIT Value
97
+ - Convert UIT to Soles
98
+ - Convert Soles to UIT
99
+
100
+ ### 📄 Issue Invoice
101
+ - Invoice (Type 01)
102
+ - Sales Receipt (Type 03)
103
+ - Credit Note (Type 07)
104
+
105
+ ## 🌐 Supported Providers
106
+
107
+ ### Nubefact
108
+ - Popular in Peru
109
+ - Easy to use API
110
+ - [Documentation](https://nubefact.com/documentacion)
111
+
112
+ ### Efact
113
+ - Low cost plans
114
+ - Full SUNAT compliance
115
+ - [Documentation](https://efact.pe/docs)
78
116
 
79
- | Código | Tipo | Descripción |
80
- |--------|------|-------------|
81
- | 01 | Factura | Para empresas con RUC |
82
- | 03 | Boleta | Para consumidor final |
83
- | 07 | Nota Crédito | Anula/modifica factura |
84
- | 08 | Nota Débito | Cargo adicional |
117
+ ## 💡 Use Cases
85
118
 
86
- ## 🔗 APIs Utilizadas
119
+ - **E-commerce**: Automatically issue invoices
120
+ - **SaaS**: Generate automatic monthly invoices
121
+ - **Validation**: Verify customer RUC in forms
122
+ - **Accounting**: Get live exchange rates
123
+ - **Tax**: Calculate UIT amounts
87
124
 
88
- - **SUNAT** - Consulta RUC (pública)
89
- - **SBS** - Tipo de cambio oficial
90
- - **Nubefact / Efact** - Emisión facturas (requiere cuenta)
125
+ ## 📄 License
91
126
 
92
- ## 🤝 Contribuir
127
+ MIT License - see [LICENSE](LICENSE)
93
128
 
94
- Las contribuciones son bienvenidas. Por favor abre un issue o pull request.
129
+ ## 👨‍💻 Author
95
130
 
96
- ## 📄 Licencia
131
+ **Manu** - [LatamFlows](https://latamflows.com)
97
132
 
98
- MIT © Manuel Reyes Bravo
133
+ Automation for LATAM 🚀
@@ -4,22 +4,22 @@ exports.SunatPeruApi = void 0;
4
4
  class SunatPeruApi {
5
5
  constructor() {
6
6
  this.name = 'sunatPeruApi';
7
- this.displayName = 'SUNAT Perú / Facturación Electrónica';
7
+ this.displayName = 'SUNAT Peru / Electronic Invoicing';
8
8
  this.documentationUrl = 'https://nubefact.com/documentacion';
9
9
  this.properties = [
10
10
  {
11
- displayName: 'Proveedor de Facturación',
11
+ displayName: 'Invoicing Provider',
12
12
  name: 'provider',
13
13
  type: 'options',
14
14
  options: [
15
15
  { name: 'Nubefact', value: 'nubefact' },
16
16
  { name: 'Efact', value: 'efact' },
17
- { name: 'Solo Funciones Locales (sin emisión)', value: 'none' },
17
+ { name: 'Local Functions Only (no issuing)', value: 'none' },
18
18
  ],
19
19
  default: 'none',
20
20
  },
21
21
  {
22
- displayName: 'API Key Nubefact',
22
+ displayName: 'Nubefact API Key',
23
23
  name: 'nubefactApiKey',
24
24
  type: 'string',
25
25
  typeOptions: { password: true },
@@ -27,18 +27,18 @@ class SunatPeruApi {
27
27
  displayOptions: { show: { provider: ['nubefact'] } },
28
28
  },
29
29
  {
30
- displayName: 'Ambiente Nubefact',
30
+ displayName: 'Nubefact Environment',
31
31
  name: 'nubefactEnvironment',
32
32
  type: 'options',
33
33
  options: [
34
- { name: 'Demo (Pruebas)', value: 'demo' },
35
- { name: 'Producción', value: 'production' },
34
+ { name: 'Demo (Testing)', value: 'demo' },
35
+ { name: 'Production', value: 'production' },
36
36
  ],
37
37
  default: 'demo',
38
38
  displayOptions: { show: { provider: ['nubefact'] } },
39
39
  },
40
40
  {
41
- displayName: 'API Key Efact',
41
+ displayName: 'Efact API Key',
42
42
  name: 'efactApiKey',
43
43
  type: 'string',
44
44
  typeOptions: { password: true },
@@ -46,7 +46,7 @@ class SunatPeruApi {
46
46
  displayOptions: { show: { provider: ['efact'] } },
47
47
  },
48
48
  {
49
- displayName: 'RUC Emisor',
49
+ displayName: 'Issuer RUC',
50
50
  name: 'rucEmisor',
51
51
  type: 'string',
52
52
  default: '',
@@ -5,15 +5,15 @@ exports.SunatPeru = void 0;
5
5
  function validarRuc(ruc) {
6
6
  const rucLimpio = ruc.replace(/[-\s]/g, '');
7
7
  if (!/^\d{11}$/.test(rucLimpio)) {
8
- return { valido: false, ruc: rucLimpio, tipo: 'Desconocido', mensaje: 'RUC debe tener 11 dígitos' };
8
+ return { valid: false, ruc: rucLimpio, tipo: 'Unknown', message: 'RUC must have 11 digits' };
9
9
  }
10
- // Validar prefijo
10
+ // Validate prefix
11
11
  const prefijo = rucLimpio.substring(0, 2);
12
12
  const prefijosValidos = ['10', '15', '17', '20'];
13
13
  if (!prefijosValidos.includes(prefijo)) {
14
- return { valido: false, ruc: rucLimpio, tipo: 'Desconocido', mensaje: 'Prefijo de RUC inválido' };
14
+ return { valid: false, ruc: rucLimpio, tipo: 'Unknown', message: 'Invalid RUC prefix' };
15
15
  }
16
- // Calcular dígito verificador
16
+ // Calculate check digit
17
17
  const factores = [5, 4, 3, 2, 7, 6, 5, 4, 3, 2];
18
18
  let suma = 0;
19
19
  for (let i = 0; i < 10; i++) {
@@ -24,25 +24,25 @@ function validarRuc(ruc) {
24
24
  const dvFinal = dvCalculado === 10 ? 0 : dvCalculado === 11 ? 1 : dvCalculado;
25
25
  const dvIngresado = parseInt(rucLimpio.charAt(10));
26
26
  if (dvFinal !== dvIngresado) {
27
- return { valido: false, ruc: rucLimpio, tipo: 'Desconocido', mensaje: 'Dígito verificador inválido' };
27
+ return { valid: false, ruc: rucLimpio, tipo: 'Unknown', message: 'Invalid check digit' };
28
28
  }
29
- let tipo = 'Desconocido';
29
+ let tipo = 'Unknown';
30
30
  if (prefijo === '10')
31
- tipo = 'Persona Natural';
31
+ tipo = 'Individual';
32
32
  else if (prefijo === '20')
33
- tipo = 'Persona Jurídica';
33
+ tipo = 'Company';
34
34
  else if (prefijo === '15')
35
- tipo = 'Persona Natural sin negocio';
35
+ tipo = 'Individual without business';
36
36
  else if (prefijo === '17')
37
- tipo = 'Persona Natural no domiciliada';
38
- return { valido: true, ruc: rucLimpio, tipo, mensaje: 'RUC válido' };
37
+ tipo = 'Non-domiciled individual';
38
+ return { valid: true, ruc: rucLimpio, tipo, message: 'Valid RUC' };
39
39
  }
40
40
  function validarDni(dni) {
41
41
  const dniLimpio = dni.replace(/[-\s]/g, '');
42
42
  if (!/^\d{8}$/.test(dniLimpio)) {
43
- return { valido: false, dni: dniLimpio, mensaje: 'DNI debe tener 8 dígitos' };
43
+ return { valid: false, dni: dniLimpio, message: 'DNI must have 8 digits' };
44
44
  }
45
- return { valido: true, dni: dniLimpio, mensaje: 'DNI válido' };
45
+ return { valid: true, dni: dniLimpio, message: 'Valid DNI' };
46
46
  }
47
47
  function formatearRuc(ruc) {
48
48
  return ruc.replace(/[^0-9]/g, '');
@@ -61,15 +61,15 @@ async function consultarRuc(that, ruc) {
61
61
  catch {
62
62
  return {
63
63
  ruc: rucLimpio,
64
- mensaje: 'No se pudo consultar el RUC. Use API con token para consultas frecuentes.',
64
+ message: 'Could not query RUC. Use API with token for frequent queries.',
65
65
  };
66
66
  }
67
67
  }
68
- // Funciones Indicadores
68
+ // Indicator Functions
69
69
  async function obtenerTipoCambio(that) {
70
70
  var _a;
71
71
  try {
72
- // API tipo de cambio Perú
72
+ // Peru exchange rate API
73
73
  const response = await that.helpers.httpRequest({
74
74
  method: 'GET',
75
75
  url: 'https://api.apis.net.pe/v1/tipo-cambio-sunat',
@@ -77,15 +77,15 @@ async function obtenerTipoCambio(that) {
77
77
  });
78
78
  const data = response;
79
79
  return {
80
- indicador: 'Tipo de Cambio',
81
- compra: data.compra,
82
- venta: data.venta,
83
- fecha: data.fecha,
84
- fuente: 'SUNAT/SBS',
80
+ indicator: 'Exchange Rate',
81
+ buy: data.compra,
82
+ sell: data.venta,
83
+ date: data.fecha,
84
+ source: 'SUNAT/SBS',
85
85
  };
86
86
  }
87
87
  catch {
88
- // Fallback con API alternativa
88
+ // Fallback with alternative API
89
89
  try {
90
90
  const response = await that.helpers.httpRequest({
91
91
  method: 'GET',
@@ -95,33 +95,33 @@ async function obtenerTipoCambio(that) {
95
95
  const data = response;
96
96
  const pen = ((_a = data.rates) === null || _a === void 0 ? void 0 : _a.PEN) || 3.75;
97
97
  return {
98
- indicador: 'Tipo de Cambio',
99
- compra: pen - 0.02,
100
- venta: pen + 0.02,
101
- fecha: new Date().toISOString().split('T')[0],
102
- fuente: 'Exchange Rate API',
98
+ indicator: 'Exchange Rate',
99
+ buy: pen - 0.02,
100
+ sell: pen + 0.02,
101
+ date: new Date().toISOString().split('T')[0],
102
+ source: 'Exchange Rate API',
103
103
  };
104
104
  }
105
105
  catch {
106
106
  return {
107
- indicador: 'Tipo de Cambio',
108
- compra: 3.73,
109
- venta: 3.77,
110
- fecha: new Date().toISOString().split('T')[0],
111
- fuente: 'Estimado',
107
+ indicator: 'Exchange Rate',
108
+ buy: 3.73,
109
+ sell: 3.77,
110
+ date: new Date().toISOString().split('T')[0],
111
+ source: 'Estimated',
112
112
  };
113
113
  }
114
114
  }
115
115
  }
116
116
  async function obtenerUit(that) {
117
- // UIT 2025: S/ 5,350 (valor fijo anual)
117
+ // UIT 2025: S/ 5,350 (fixed annual value)
118
118
  const uit2025 = 5350;
119
119
  return {
120
- indicador: 'UIT',
121
- valor: uit2025,
122
- año: 2025,
123
- fuente: 'SUNAT',
124
- nota: 'Unidad Impositiva Tributaria vigente',
120
+ indicator: 'UIT',
121
+ value: uit2025,
122
+ year: 2025,
123
+ source: 'SUNAT',
124
+ note: 'Current Tax Unit',
125
125
  };
126
126
  }
127
127
  function convertirUitSoles(uit, valorUit) {
@@ -143,7 +143,7 @@ function convertirSolesUit(soles, valorUit) {
143
143
  // Función para emitir factura
144
144
  async function emitirFactura(that, provider, apiKey, tipoComprobante, datos) {
145
145
  if (provider === 'none') {
146
- throw new Error('Configura credenciales de Nubefact o Efact para emitir facturas');
146
+ throw new Error('Configure Nubefact or Efact credentials to issue invoices');
147
147
  }
148
148
  if (provider === 'nubefact') {
149
149
  const response = await that.helpers.httpRequest({
@@ -167,20 +167,20 @@ async function emitirFactura(that, provider, apiKey, tipoComprobante, datos) {
167
167
  });
168
168
  return response;
169
169
  }
170
- throw new Error(`Proveedor ${provider} no implementado`);
170
+ throw new Error(`Provider ${provider} not implemented`);
171
171
  }
172
172
  class SunatPeru {
173
173
  constructor() {
174
174
  this.description = {
175
- displayName: 'SUNAT Perú',
175
+ displayName: 'SUNAT Peru',
176
176
  name: 'sunatPeru',
177
177
  icon: 'file:sunat.svg',
178
178
  group: ['transform'],
179
179
  version: 1,
180
180
  subtitle: '={{$parameter["resource"] + ": " + $parameter["operation"]}}',
181
- description: 'Facturación Electrónica Perú - RUC/DNI, Tipo Cambio, UIT',
181
+ description: 'Peru Electronic Invoicing - RUC/DNI validation, exchange rate, UIT',
182
182
  defaults: {
183
- name: 'SUNAT Perú',
183
+ name: 'SUNAT Peru',
184
184
  },
185
185
  inputs: ['main'],
186
186
  outputs: ['main'],
@@ -192,29 +192,29 @@ class SunatPeru {
192
192
  ],
193
193
  properties: [
194
194
  {
195
- displayName: 'Recurso',
195
+ displayName: 'Resource',
196
196
  name: 'resource',
197
197
  type: 'options',
198
198
  noDataExpression: true,
199
199
  options: [
200
200
  { name: 'RUC/DNI', value: 'ruc' },
201
- { name: 'Indicadores', value: 'indicadores' },
202
- { name: 'Emitir Factura', value: 'factura' },
201
+ { name: 'Indicators', value: 'indicadores' },
202
+ { name: 'Issue Invoice', value: 'factura' },
203
203
  ],
204
204
  default: 'ruc',
205
205
  },
206
206
  // Operaciones RUC/DNI
207
207
  {
208
- displayName: 'Operación',
208
+ displayName: 'Operation',
209
209
  name: 'operation',
210
210
  type: 'options',
211
211
  noDataExpression: true,
212
212
  displayOptions: { show: { resource: ['ruc'] } },
213
213
  options: [
214
- { name: 'Validar RUC', value: 'validar_ruc', description: 'Validar formato de RUC', action: 'Validar RUC' },
215
- { name: 'Validar DNI', value: 'validar_dni', description: 'Validar formato de DNI', action: 'Validar DNI' },
216
- { name: 'Formatear RUC', value: 'formatear', description: 'Limpiar RUC', action: 'Formatear RUC' },
217
- { name: 'Consultar RUC', value: 'consultar', description: 'Obtener datos de SUNAT', action: 'Consultar RUC' },
214
+ { name: 'Validate RUC', value: 'validar_ruc', description: 'Validate RUC format', action: 'Validate RUC' },
215
+ { name: 'Validate DNI', value: 'validar_dni', description: 'Validate DNI format', action: 'Validate DNI' },
216
+ { name: 'Format RUC', value: 'formatear', description: 'Clean RUC', action: 'Format RUC' },
217
+ { name: 'Query RUC', value: 'consultar', description: 'Get data from SUNAT', action: 'Query RUC' },
218
218
  ],
219
219
  default: 'validar_ruc',
220
220
  },
@@ -238,28 +238,28 @@ class SunatPeru {
238
238
  },
239
239
  // Operaciones Indicadores
240
240
  {
241
- displayName: 'Operación',
241
+ displayName: 'Operation',
242
242
  name: 'operation',
243
243
  type: 'options',
244
244
  noDataExpression: true,
245
245
  displayOptions: { show: { resource: ['indicadores'] } },
246
246
  options: [
247
- { name: 'Tipo de Cambio', value: 'tipo_cambio', description: 'Dólar compra/venta SBS', action: 'Obtener tipo cambio' },
248
- { name: 'Valor UIT', value: 'uit', description: 'Unidad Impositiva Tributaria', action: 'Obtener UIT' },
249
- { name: 'UIT a Soles', value: 'uit_soles', description: 'Convertir UIT a Soles', action: 'Convertir UIT a Soles' },
250
- { name: 'Soles a UIT', value: 'soles_uit', description: 'Convertir Soles a UIT', action: 'Convertir Soles a UIT' },
247
+ { name: 'Exchange Rate', value: 'tipo_cambio', description: 'Dollar buy/sell SBS', action: 'Get exchange rate' },
248
+ { name: 'UIT Value', value: 'uit', description: 'Tax Unit', action: 'Get UIT' },
249
+ { name: 'UIT to Soles', value: 'uit_soles', description: 'Convert UIT to Soles', action: 'Convert UIT to Soles' },
250
+ { name: 'Soles to UIT', value: 'soles_uit', description: 'Convert Soles to UIT', action: 'Convert Soles to UIT' },
251
251
  ],
252
252
  default: 'tipo_cambio',
253
253
  },
254
254
  {
255
- displayName: 'Monto UIT',
255
+ displayName: 'UIT Amount',
256
256
  name: 'montoUit',
257
257
  type: 'number',
258
258
  default: 10,
259
259
  displayOptions: { show: { resource: ['indicadores'], operation: ['uit_soles'] } },
260
260
  },
261
261
  {
262
- displayName: 'Monto Soles',
262
+ displayName: 'Soles Amount',
263
263
  name: 'montoSoles',
264
264
  type: 'number',
265
265
  default: 50000,
@@ -267,33 +267,33 @@ class SunatPeru {
267
267
  },
268
268
  // Operaciones Factura
269
269
  {
270
- displayName: 'Operación',
270
+ displayName: 'Operation',
271
271
  name: 'operation',
272
272
  type: 'options',
273
273
  noDataExpression: true,
274
274
  displayOptions: { show: { resource: ['factura'] } },
275
275
  options: [
276
- { name: 'Factura', value: 'factura', description: 'Tipo 01', action: 'Emitir Factura' },
277
- { name: 'Boleta de Venta', value: 'boleta', description: 'Tipo 03', action: 'Emitir Boleta' },
278
- { name: 'Nota de Crédito', value: 'nota_credito', description: 'Tipo 07', action: 'Emitir Nota Credito' },
276
+ { name: 'Invoice', value: 'factura', description: 'Type 01', action: 'Issue Invoice' },
277
+ { name: 'Sales Receipt', value: 'boleta', description: 'Type 03', action: 'Issue Receipt' },
278
+ { name: 'Credit Note', value: 'nota_credito', description: 'Type 07', action: 'Issue Credit Note' },
279
279
  ],
280
280
  default: 'factura',
281
281
  },
282
282
  {
283
- displayName: 'Tipo Documento Cliente',
283
+ displayName: 'Customer Document Type',
284
284
  name: 'tipoDocCliente',
285
285
  type: 'options',
286
286
  options: [
287
287
  { name: 'RUC', value: '6' },
288
288
  { name: 'DNI', value: '1' },
289
- { name: 'Carnet Extranjería', value: '4' },
290
- { name: 'Pasaporte', value: '7' },
289
+ { name: 'Foreign ID', value: '4' },
290
+ { name: 'Passport', value: '7' },
291
291
  ],
292
292
  default: '6',
293
293
  displayOptions: { show: { resource: ['factura'] } },
294
294
  },
295
295
  {
296
- displayName: 'Número Documento',
296
+ displayName: 'Document Number',
297
297
  name: 'numDocCliente',
298
298
  type: 'string',
299
299
  default: '',
@@ -301,7 +301,7 @@ class SunatPeru {
301
301
  displayOptions: { show: { resource: ['factura'] } },
302
302
  },
303
303
  {
304
- displayName: 'Razón Social',
304
+ displayName: 'Business Name',
305
305
  name: 'razonSocial',
306
306
  type: 'string',
307
307
  default: '',
@@ -382,7 +382,7 @@ class SunatPeru {
382
382
  else if (resource === 'factura') {
383
383
  const credentials = await this.getCredentials('sunatPeruApi').catch(() => null);
384
384
  if (!credentials || credentials.provider === 'none') {
385
- throw new Error('Configura credenciales de Nubefact o Efact para emitir facturas');
385
+ throw new Error('Configure Nubefact or Efact credentials to issue invoices');
386
386
  }
387
387
  const tipoComp = operation === 'factura' ? '01' : operation === 'boleta' ? '03' : '07';
388
388
  const datos = {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "n8n-nodes-sunat-peru",
3
- "version": "0.1.0",
4
- "description": "Nodo n8n para integración con SUNAT Perú - Factura Electrónica, RUC/DNI, tipo cambio, UIT",
3
+ "version": "2.0.0",
4
+ "description": "n8n node for SUNAT Peru integration - Electronic invoicing, RUC/DNI validation, exchange rate, UIT",
5
5
  "keywords": [
6
6
  "n8n-community-node-package",
7
7
  "n8n",
@@ -9,8 +9,8 @@
9
9
  "peru",
10
10
  "ruc",
11
11
  "dni",
12
- "facturacion",
13
- "impuestos",
12
+ "invoicing",
13
+ "tax",
14
14
  "uit",
15
15
  "latam"
16
16
  ],