Overview
Debit Notes (Notas de Débito) are used to increase the total amount of a previously issued invoice or boleta. Common use cases include interest charges, penalties, or additional services.Service Layer Only: Debit notes are currently implemented in the
DocumentService class but do not yet have REST API endpoints exposed. To use this functionality, you’ll need to interact directly with the service layer in your Laravel application. REST API endpoints are planned for a future release.Prerequisites
- An existing invoice or boleta to modify
- Configured company and branch
- Valid reason code for the debit note
Reason Codes
SUNAT defines specific codes for debit note reasons:| Code | Description | Use Case |
|---|---|---|
01 | Interest on arrears | Late payment interest |
02 | Penalty increase | Contract penalties |
03 | Expenses incurred by seller | Additional costs |
10 | Adjustment - Value increase | Price correction upward |
11 | Adjustment - Other concepts | Other valid adjustments |
Creating a Debit Note
Success Response
Required Fields
Company ID issuing the debit note
Branch ID (must belong to company)
Debit note series (max 4 characters)
- Invoices: “FD01”, “FD02”, etc.
- Boletas: “BD01”, “BD02”, etc.
Issue date (YYYY-MM-DD)
Affected document type:
01: Invoice (Factura)03: Boleta
Complete number of affected document (e.g., “F001-00000123”)
Reason code:
01, 02, 03, 10, or 11Reason description (max 250 characters)
Currency:
PEN or USD (must match original)Details Array
Product/service code for the additional charge
Clear description of the charge
Unit of measure (typically “ZZ” for services)
Quantity (typically 1 for charges)
Unit value of the additional charge
Tax affectation type (usually
10 for taxable)Sending to SUNAT
Debit notes are sent using the same process as invoices:Success Response
Downloading Documents
Download XML
Download CDR
Download PDF
Querying Debit Notes
Query Parameters
company_id: Filter by companybranch_id: Filter by branchestado_sunat: Filter by SUNAT statusfecha_desde: Start datefecha_hasta: End dateper_page: Items per page
Advanced Features
Custom Legends
Add custom text to appear on the document:The API automatically generates the standard amount legend (code 1000) with the total in words.
Additional Data
Include extra information for internal use:Implementation Details
Fromapp/Services/DocumentService.php:1000-1114, the debit note creation process:
- Validates company and branch relationship
- Creates or retrieves client (must match original)
- Generates automatic correlative number
- Processes details and calculates totals
- Generates automatic legends
- Stores with status
PENDIENTE
Automatic Calculations
The API handles:- Line item calculations (quantity × unit value)
- IGV calculation per item
- Subtotals by tax category
- Total IGV
- Final amount
Common Errors
| Error | Cause | Solution |
|---|---|---|
| Referenced document not found | Invalid num_doc_afectado | Verify original document exists |
| Client mismatch | Different client than original | Use exact client from original |
| Invalid reason code | Wrong cod_motivo | Use valid code: 01, 02, 03, 10, 11 |
| Currency mismatch | Different currency than original | Match original document currency |
| Invalid document type | Wrong tipo_doc_afectado | Only 01 (Invoice) or 03 (Boleta) |
Best Practices
- Provide clear descriptions - Explain the reason for the additional charge
- Reference complete document numbers - Include series (e.g., “F001-00000123”)
- Match client exactly - Use same client data as original document
- Document the business reason - Keep detailed records of why debit note was issued
- Verify original is accepted - Original document must be ACEPTADO by SUNAT
- Use appropriate reason codes - Choose the code that best matches the situation
Use Case Examples
Late Payment Interest Calculation
Penalty for Contract Breach
Additional Shipping Costs
Validation Rules
- Serie: Required, max 4 characters
tipo_doc_afectado: Must be01or03onlycod_motivo: Must be01,02,03,10, or11- Client document type: Must be 0, 1, 4, or 6
- Details: At least 1 item required
- All amounts: Must be ≥ 0
Differences from Credit Notes
| Aspect | Debit Note | Credit Note |
|---|---|---|
| Purpose | Increase amount | Decrease amount |
| Reason codes | 01, 02, 03, 10, 11 | 01-13 |
| Affect types | 01, 03 only | 01, 03, 07, 08 |
| Common use | Interest, penalties | Returns, corrections |
| Effect | Adds to debt | Reduces debt |
Next Steps
Credit Notes
Learn about credit notes for amount reductions
PDF Generation
Customize debit note PDF templates
