Issue electronic invoice
Service to issue SUNAT-valid electronic invoices. Invoices are used for B2B transactions.
Important usage rules
tipoIntegracion:OFFLINE→ your own ERP handles the correlative (series/number).ERP→ tefacturo handles the correlative.numero(indatosDocumento): it cannot be duplicated. If the number was already used, map/track the correlative so it is not resent.fechaEmision: an electronic document (CPE) can be declared with at most 3 days of backdating.- Replace the fixed example RUC with the issuer RUC used in the URL and token; all three must match.
- Response 200 values such as series, number, hash, signature, and identifier are illustrative; the API generates their actual values for each request.
https://jarvis.tefacturo.pe/factura-api/invoice2u/integracion/factura/{ruc}Service to issue electronic invoices. Replace {ruc} with the issuer RUC. The document will be digitally signed and automatically submitted to SUNAT.
Headers
| Header | Value | Description |
|---|---|---|
| Authorization | Bearer {token} | Authentication token obtained from the login endpoint. |
| Content-Type | application/json | Content type for the request body. |
Request Body
Send the full document payload. The right panel uses the same invoice cases shown on the JSON examples page: taxed invoice, credit invoice, exempt sale, and free transfer.
Successful Response (200)
When the invoice is issued successfully, the API returns the generated document metadata: signature, hash, identifier, series, number, total, observation, and document type. This confirms the invoice was digitally signed, sent to SUNAT, and accepted.
Price Record Type
The field tipoRegistro inside the close2u object defines how prices sent in the document detail are interpreted:
| Value | Description |
|---|---|
| PRECIOS_SIN_IGV | Prices sent in valorVentaUnitarioItem DO NOT include IGV. The system calculates IGV (18%) automatically over the sent value. |
| PRECIOS_CON_IGV | Prices sent already include IGV. The system splits the price to obtain taxable base and corresponding tax. |
IGV Calculation Note
Use the unit field according to the item's IGV affectation and close2u.tipoRegistro. The system completes the complementary sale value or sale price when it can be derived from the IGV rule.
| Case | Field to send | System interpretation |
|---|---|---|
| Gravado + PRECIOS_SIN_IGV | valorVentaUnitarioItem | Valor de venta sin IGV. El sistema calcula el IGV y obtiene el precio de venta. |
| Gravado + PRECIOS_CON_IGV | precioVentaUnitarioItem | Precio de venta con IGV. El sistema lo descompone para reemplazar/obtener el valor de venta y el impuesto. |
| Exonerado o inafecto | valorVentaUnitarioItem | No hay IGV por calcular. En ausencia de IGV, el sistema asume el valor enviado como base y lo usa como precio de venta. |
Field Reference
Complete table of request body fields:
close2u| Campo | Tipo | Requerido | Description |
|---|---|---|---|
| tipoIntegracion | string | Sí | Tipo de integración. Usar "OFFLINE" |
| tipoPlantilla | string | Sí | Plantilla del PDF. "01" es la plantilla estándar |
| tipoRegistro | string | Sí | PRECIOS_CON_IGV o PRECIOS_SIN_IGV |
datosDocumento| Campo | Tipo | Requerido | Description |
|---|---|---|---|
| serie | string | Sí | Serie del comprobante (ej: FFA6). Debe iniciar con "F" para facturas |
| numero | number | Sí | Document correlative number |
| moneda | string | Sí | Código de moneda ISO 4217. PEN (soles), USD (dólares) |
| fechaEmision | string | Sí | Fecha de emisión en formato YYYY-MM-DD |
| horaEmision | string | null | No | Hora de emisión en formato HH:mm:ss. Si es null, se usa la hora actual |
| formaPago | string | Sí | CONTADO o CREDITO |
| medioPago | string | No | Medio de pago: DEPOSITO_CUENTA, TRANSFERENCIA, EFECTIVO, etc. |
| condicionPago | string | No | Condicion de pago: CONTADO, CREDITO_30, CREDITO_60, etc. |
| ordencompra | string | null | No | Número de orden de compra asociada |
| glosa | string | No | Observaciones o notas adicionales del comprobante |
detalleDocumento| Campo | Tipo | Requerido | Description |
|---|---|---|---|
| codigoProducto | string | Sí | Código interno del producto o servicio |
| descripcion | string | Sí | Descripción detallada del producto o servicio |
| tipoAfectacion | string | Sí | Tipo de afectación IGV: GRAVADO_OPERACION_ONEROSA, EXONERADO_OPERACION_ONEROSA, INAFECTO_OPERACION_ONEROSA |
| unidadMedida | string | Sí | Unidad de medida: UNIDAD_BIENES, KILOGRAMO, SERVICIO, etc. |
| cantidad | string | Sí | Cantidad de unidades del producto |
| valorVentaUnitarioItem | number | Sí | Precio unitario. Depende del tipoRegistro (con o sin IGV) |
emisor| Campo | Tipo | Requerido | Description |
|---|---|---|---|
| correo | string | Sí | Correo electrónico del emisor |
| nombreComercial | string | Sí | Nombre comercial de la empresa emisora |
| nombreLegal | string | Sí | Razón social registrada en SUNAT |
| numeroDocumentoIdentidad | string | Sí | RUC del emisor (11 dígitos) |
| tipoDocumentoIdentidad | string | Sí | Tipo de documento: RUC |
receptor| Campo | Tipo | Requerido | Description |
|---|---|---|---|
| correo | string | Sí | Correo electrónico del cliente |
| correoCopia | string | No | Correo adicional para copia del comprobante |
| domicilioFiscal.direccion | string | No | Dirección fiscal del cliente |
| domicilioFiscal.ubigeo | string | No | Código de ubigeo INEI (6 dígitos) |
| nombreComercial | string | Sí | Nombre comercial del cliente |
| nombreLegal | string | Sí | Razón social del cliente |
| numeroDocumentoIdentidad | string | Sí | RUC o DNI del cliente |
| tipoDocumentoIdentidad | string | Sí | RUC, DNI, CE (carnet de extranjería), PASAPORTE |
informacionAdicional| Campo | Tipo | Requerido | Description |
|---|---|---|---|
| tipoOperacion | string | Sí | Tipo de operación SUNAT: VENTA_INTERNA, EXPORTACION, etc. |
| coVendedor | string | No | Código del vendedor asignado al comprobante |
Error Handling
| Code | Status | Description |
|---|---|---|
| 400 | Bad Request | Request body has validation errors. Check required fields and formats. |
| 401 | Unauthorized | Authentication token invalid, expired, or not provided. |
| 403 | Forbidden | You do not have permissions to issue documents for the provided RUC. |
| 404 | Not Found | The provided RUC is not registered in the system. |
| 500 | Internal Server Error | Internal server error. Try again or contact support. |