Skip to content

Facturas (01)

Facturas are the standard commercial invoice in Peru, used for B2B transactions. They require the customer to have a valid RUC (identity type 6).

POST /api/invoices

Authorization: Bearer sk_live_YOUR_API_KEY or Authorization: Bearer JWT_TOKEN

{
"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"
}
],
"observations": "Factura por servicios de febrero 2026",
"purchaseOrder": "OC-2026-0042",
"paymentTerms": "Credito 30 dias",
"detraction": {
"code": "022",
"percentage": 12,
"amount": 141.60,
"bankAccount": "00-123-456789"
}
}
FieldTypeRequiredDescription
seriesstringYesInvoice series. Must match pattern F\d{3} (e.g., F001)
correlativenumberNoSequential number. Auto-assigned if omitted
issueDatestringYesIssue date in YYYY-MM-DD format
dueDatestringNoDue date in YYYY-MM-DD format
currencyCodestringNoISO 4217 currency code. Default: PEN. Accepts PEN or USD
customerobjectYesCustomer data (see below)
itemsarrayYesLine items (minimum 1)
observationsstringNoFree-text observations
purchaseOrderstringNoPurchase order reference
paymentTermsstringNoPayment terms description
detractionobjectNoDetraction data (see below)
FieldTypeRequiredDescription
identityTypestringYesIdentity document type code
identityNumberstringYesIdentity document number (RUC for facturas)
namestringYesCustomer legal name
addressstringNoCustomer address

Identity types:

CodeType
6RUC (required for Facturas)
1DNI
4Carnet de Extranjeria
7Pasaporte
0Otros
FieldTypeRequiredDescription
codestringYesProduct/service code
descriptionstringYesDescription of the item
quantitynumberYesQuantity (must be positive)
unitCodestringYesUnit of measure code
unitPricenumberYesUnit price before tax
igvTypestringNoIGV tax type. Default: 10
discountnumberNoDiscount amount
iscRatenumberNoISC rate (0-1)
iscSystemTypestringNoISC system type

IGV types:

CodeDescriptionRate
10Gravado (con IGV)18%
20Exonerado0%
30Inafecto0%

Common unit codes:

CodeDescription
NIUUnidad (item)
ZZServicio
KGMKilogramo
LTRLitro
MTRMetro
FieldTypeRequiredDescription
codestringYesDetraction code (SUNAT catalog)
percentagenumberYesDetraction percentage
amountnumberYesDetraction amount
bankAccountstringYesBank of the Nation account number
{
"id": "cm3abc123",
"documentId": "20123456789-01-F001-00000001",
"status": "ACCEPTED",
"cdrResponseCode": "0",
"cdrDescription": "La Factura numero F001-00000001, ha sido aceptada",
"ticket": null
}
{
"statusCode": 400,
"error": "Bad Request",
"message": "Validation error: series must match pattern F\\d{3}"
}
MethodEndpointDescription
GET/api/documentsList all documents (paginated)
GET/api/documents/:idGet document by ID
GET/api/documents/:id/pdfDownload PDF
GET/api/documents/:id/xmlDownload signed XML
GET/api/documents/:id/cdrDownload CDR response
POST/api/documents/:id/retryRetry failed document