tefacturo

Get started

Follow these 4 steps to issue your first electronic document with tefacturo.

1

Get your credentials

To use the API you need three values provided by Close2u:

RUC

Company RUC number

Email

Email registered on the platform

Password

API access password

For testing, you can create a trial account at /registro.

For production, contact Close2u to receive production credentials.

2

Generate token

Send a POST request to the login endpoint to get a JWT token.

POSThttps://jarvis.tefacturo.pe/tokenapi/secure/v2/login/token

Request body:

Request Body
{
    "aplicacion": {
        "codigo": "1"
    },
    "clave": "{{CLAVE}}",
    "mail": "{{USUARIO}}",
    "ruc": {{RUC}}
}

The response includes a field c2uToken which is a JWT valid for 8 hours. Use this token in all subsequent requests.

For trial accounts in this docs portal, renew your token at most every 1 hour.

Response example:

Response 200 OK
{
    "c2uToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    "fechaExpiracion": "2025-01-15T08:00:00.000+00:00",
    "ruc": "20123456789",
    "razonSocial": "MI EMPRESA S.A.C.",
    "estado": "ACTIVO"
}
3

Use the token in your requests

Include the following headers in each API request.

Required headers
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
Content-Type: application/json

Authorization

Bearer followed by the value of c2uToken

Content-Type

Always application/json

4

Issue your first document

With an active token, send a PUT request to the invoice endpoint. Replace {ruc} with the issuer RUC.

PUT/factura-api/invoice2u/integracion/factura/{ruc}
Invoice request example
PUT https://jarvis.tefacturo.pe/factura-api/invoice2u/integracion/factura/{ruc}
Authorization: Bearer {token}
Content-Type: application/json

{
    "close2u": {
        "tipoIntegracion": "OFFLINE",
        "tipoPlantilla": "01",
        "tipoRegistro": "PRECIOS_SIN_IGV"
    },
    "datosDocumento": {
        "serie": "FFA6",
        "numero": 1,
        "moneda": "PEN",
        "fechaEmision": "2025-04-16",
        "horaEmision": null,
        "formaPago": "CONTADO",
        "medioPago": "DEPOSITO_CUENTA",
        "condicionPago": "CONTADO",
        "ordencompra": null,
        "glosa": "observaciones"
    },
    "detalleDocumento": [
        {
            "codigoProducto": "ABC123",
            "descripcion": "PRODUCTO GRAVADO A",
            "tipoAfectacion": "GRAVADO_OPERACION_ONEROSA",
            "unidadMedida": "UNIDAD_BIENES",
            "cantidad": "1",
            "valorVentaUnitarioItem": 100
        },
        {
            "codigoProducto": "ABC124",
            "descripcion": "PRODUCTO GRAVADO B",
            "tipoAfectacion": "GRAVADO_OPERACION_ONEROSA",
            "unidadMedida": "UNIDAD_BIENES",
            "cantidad": "1",
            "valorVentaUnitarioItem": 200
        }
    ],
    "emisor": {
        "correo": "pruebasintegraciontest@gmail.com",
        "nombreComercial": "ALFA PLUS SAC",
        "nombreLegal": "ALFA PLUS S.A.C.",
        "numeroDocumentoIdentidad": "20133795724",
        "tipoDocumentoIdentidad": "RUC"
    },
    "informacionAdicional": {
        "tipoOperacion": "VENTA_INTERNA",
        "coVendedor": "AARROYO"
    },
    "receptor": {
        "correo": "pruebatest@gmail.com",
        "correoCopia": "andreatest768@gmail.com",
        "domicilioFiscal": {
            "direccion": "AV. PTE PIEDRA NRO. 386 - PRO - LIMA LIMA PUENTE PIEDRA",
            "ubigeo": "150101"
        },
        "nombreComercial": "AIR SERVICE PUCALLPA TOURS",
        "nombreLegal": "AIR SERVICE PUCALLPA TOURS E.I.R.L.",
        "numeroDocumentoIdentidad": "20393663988",
        "tipoDocumentoIdentidad": "RUC"
    }
}

These are basic cases only. Check the complete invoice documentation to see all available fields and invoice cases. For other document types, check the API reference.