Features
- Electronic Invoicing: Generate boletas and facturas with automatic numbering
- Document Validation: Validate DNI, RUC, and CE document numbers
- Tax Calculation: Automatic IGV (18%) calculation and subtotal breakdown
- Series Management: Auto-incrementing series numbers per branch (B001 for boletas, F001 for facturas)
- SUNAT Integration: Track SUNAT submission status
Authentication
Requires authentication and the following permissions:invoices:read- View invoicesinvoices:create- Create invoices
Base URL
Invoice Types
Boleta
Simple receipt for customers with DNI or CE. Uses series prefixB001.
Factura
Tax invoice for businesses. Requires RUC. Uses series prefixF001.
Document Types
dni- DNI (8 digits)ruc- RUC (11 digits, must start with 10 or 20)ce- Carnet de Extranjería (9-12 characters)
Create Invoice
Generate an invoice for an order with automatic tax calculation and series numbering.Endpoint
Request Body
UUID of the order to invoice
Invoice type:
boleta or facturaCustomer name (1-255 characters)
Document type:
dni, ruc, or ceDocument number meeting validation rules:
- DNI: exactly 8 digits
- RUC: exactly 11 digits starting with 10 or 20
- CE: 9-12 characters
Response
Whether invoice was created successfully
Invoice UUID
Order UUID
Organization UUID
Branch UUID
Invoice type (boleta or factura)
Invoice series (B001 or F001)
Sequential invoice number within the series
Customer name
Document type
Document number
Amount before tax (total / 1.18)
IGV tax amount (18%)
Total amount including tax
SUNAT submission status (default: “pending”)
Creation timestamp
Example Request
Example Response
List Invoices
Retrieve invoices for the current branch with optional filtering.Endpoint
Query Parameters
Filter by invoice type:
boleta or facturaFilter invoices created after this ISO 8601 date
Filter invoices created before this ISO 8601 date
Response
Returns up to 100 invoices ordered by creation date (newest first).Example Request
Get Invoice Details
Retrieve a specific invoice by ID.Endpoint
Path Parameters
Invoice UUID
Example Request
Validation Rules
DNI Validation
- Must be exactly 8 digits
- All numeric characters
RUC Validation
- Must be exactly 11 digits
- All numeric characters
- Must start with “10” or “20”
CE Validation
- Must be 9-12 characters
- Alphanumeric
Business Rules
- Facturas require RUC: Attempting to create a factura with DNI or CE will result in error
- Automatic tax calculation: IGV (18%) is calculated automatically
- Thread-safe numbering: Uses database row locking to ensure unique sequential numbers