Skip to content

First Invoice in 5 Minutes

This guide walks you through emitting your first factura (invoice) using the SUIT API. Make sure you have completed the registration steps first.

  • An active SUIT API Key (sk_live_xxx...)
  • SUNAT certificate uploaded
  • SOL credentials configured

Send a POST request to /api/invoices with your invoice data:

Terminal window
curl -X POST https://api.suit.pe/api/invoices \
-H "Authorization: Bearer sk_live_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"series": "F001",
"correlative": 1,
"issueDate": "2026-02-20",
"dueDate": "2026-03-20",
"currencyCode": "PEN",
"customer": {
"identityType": "6",
"identityNumber": "20100047218",
"name": "Empresa Cliente SAC",
"address": "Av. Javier Prado 1234, San Isidro"
},
"items": [
{
"code": "SRV-001",
"description": "Servicio de consultoria",
"quantity": 1,
"unitCode": "ZZ",
"unitPrice": 1000.00,
"igvType": "10"
}
]
}'

A successful response returns HTTP 201 Created:

{
"id": "cm3abc123",
"documentId": "20123456789-01-F001-00000001",
"status": "ACCEPTED",
"cdrResponseCode": "0",
"cdrDescription": "La Factura numero F001-00000001, ha sido aceptada",
"ticket": null
}
FieldDescription
idInternal SUIT document ID
documentIdSUNAT document identifier (RUC-TYPE-SERIES-CORRELATIVE)
statusDocument status (see below)
cdrResponseCodeSUNAT CDR response code (0 = accepted)
cdrDescriptionHuman-readable description from SUNAT
ticketOnly present for async documents (voided documents)
StatusDescription
SIGNEDXML signed, ready to send
SENTSent to SUNAT
ACCEPTEDAccepted by SUNAT (CDR code 0)
REJECTEDRejected by SUNAT
OBSERVEDAccepted with observations
SIGN_ERRORSigning failed
SUNAT_ERRORSUNAT server error (retryable)
ERRORGeneric error

Boletas use the same structure but with a B series prefix and different customer identity types:

Terminal window
curl -X POST https://api.suit.pe/api/receipts \
-H "Authorization: Bearer sk_live_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"series": "B001",
"correlative": 1,
"issueDate": "2026-02-20",
"currencyCode": "PEN",
"customer": {
"identityType": "1",
"identityNumber": "12345678",
"name": "Juan Perez"
},
"items": [
{
"code": "SRV-002",
"description": "Corte de cabello premium",
"quantity": 1,
"unitCode": "ZZ",
"unitPrice": 50.00,
"igvType": "10"
}
]
}'

When you call the API, SUIT performs these steps automatically:

  1. Validates your input data using Zod schemas
  2. Generates the XML UBL 2.1 document
  3. Signs the XML with your SUNAT certificate
  4. Sends the signed XML to SUNAT via SOAP
  5. Parses the CDR (response from SUNAT)
  6. Stores the document, XML, and CDR in the database
  7. Generates a PDF of the document
  8. Creates an accounts receivable (CxC) entry if accepted