Credit Notes Guide
Document Type: Credit Note
Document Type ID: 7 (verify with /document-type)
Overviewβ
Credit Notes are documents that:
- β©οΈ Reverse sales (full or partial)
- π AFFECT stock (inbound/return)
- πΈ Generate credit in favor of customer
- π§Ύ Official fiscal document
- β Correct or cancel invoices
When to Useβ
- β Product returns
- β Invoice error correction
- β Sale cancellation
- β Post-sale discount
Credit Note Characteristicsβ
| Characteristic | Value | Description |
|---|---|---|
| Affects Stock | β Yes | Stock inbound |
| Requires Refund | β οΈ Depends | May generate credit |
| Can be Closed | β Yes | Mandatory finalization |
| Fiscal Validation | β Yes | Official fiscal document |
| Allows Editing | β οΈ Limited | Only before closing |
| Invoice Reference | β οΈ Recommended | Should reference invoice |
Types of Credit Notesβ
1. Full Returnβ
Customer returns entire purchase.
POST /api/v1/invoices
Content-Type: application/json
Authorization: Bearer {token}
{
"serieId": 3,
"documentTypeId": 7,
"entityKeyId": "CLI001",
"entityDescription": "Example Client, Ltd",
"obs": "Full return - defective product",
"docReference": "INV A/123", // Original invoice
"documentBodies": [
{
"itemKeyId": "PROD001",
"itemDescription": "Product 1",
"quantity": -2.0, // NEGATIVE quantity
"retailPrice": 50.00, // Original price
"taxId": 1,
"paymentType": 1,
"stockFlow": -1, // Stock INBOUND
"stockBehavior": 1,
"destinationWarehouse": 1,
"secondTaxId": 0
}
]
}
Negative Quantity
Use negative quantity (-2.0) and stockFlow = -1 for stock inbound.
2. Partial Returnβ
Customer returns only part of the purchase.
{
"serieId": 3,
"documentTypeId": 7,
"entityKeyId": "CLI001",
"obs": "Partial return - 1 of 2 units",
"docReference": "INV A/123",
"documentBodies": [
{
"itemKeyId": "PROD001",
"quantity": -1.0, // Only 1 unit
"retailPrice": 50.00,
"taxId": 1,
"paymentType": 1,
"stockFlow": -1,
"stockBehavior": 1,
"destinationWarehouse": 1,
"secondTaxId": 0
}
]
}
3. Value Correctionβ
Correct price error without physical return.
{
"serieId": 3,
"documentTypeId": 7,
"entityKeyId": "CLI001",
"obs": "Price correction - billing error",
"docReference": "INV A/123",
"documentBodies": [
{
"itemKeyId": "PYMT001", // Generic correction item
"itemDescription": "Value correction",
"quantity": -1.0,
"retailPrice": 10.00, // Value difference
"taxId": 1,
"paymentType": 1,
"stockFlow": 0, // Does NOT affect stock
"stockBehavior": 0,
"secondTaxId": 0
}
]
}
4. Full Cancellationβ
Cancel invoice completely (without physical return).
{
"serieId": 3,
"documentTypeId": 7,
"entityKeyId": "CLI001",
"obs": "Cancellation of invoice INV A/123 - issued by mistake",
"docReference": "INV A/123",
"documentBodies": [
{
"itemKeyId": "PROD001",
"quantity": -2.0,
"retailPrice": 50.00,
"taxId": 1,
"paymentType": 1,
"stockFlow": -1, // Stock inbound
"stockBehavior": 1,
"destinationWarehouse": 1,
"secondTaxId": 0
}
]
}
Refund Managementβ
Scenario 1: Immediate Refundβ
- Create credit note
- Issue negative receipt (if applicable)
- Record treasury outflow
Scenario 2: Credit for Future Purchasesβ
- Create credit note
- Record credit in accounting system
- Customer uses credit on next purchase
Scenario 3: Discount on Future Invoiceβ
- Create credit note
- Next invoice: include credit as discount
Important Validationsβ
Required Dataβ
- β
documentTypeId = 7- Credit Note - β
docReference- Reference to original invoice - β
Negative
quantity- Value to credit - β
stockFlow = -1- Stock inbound (if physical return)
Business Validationsβ
- β CN value β€ Original invoice value
- β Returned quantity β€ Sold quantity
- β Original invoice exists and is closed
- β Customer is the same as original invoice
Best Practicesβ
β Recommendedβ
- Always reference original invoice in
docReference - Include detailed reason in
obsfield - Validate values before issuing
- Close credit note immediately
- Photograph returned products (physical return)
- Coordinate with finance department
β Avoidβ
- Issuing CN without linked invoice
- Values higher than original invoice
- Forgetting to register stock inbound
- Leaving CN open
- CN for trivial reasons (discount β use discounted invoice)
Practical Scenariosβ
Return Due to Defectβ
Situation: Defective product, customer wants full refund.
Steps:
- Verify original invoice
- Create CN with physical return (stockFlow = -1)
- Process refund
- Send defective product to supplier/quality
Billing Errorβ
Situation: Wrong price on invoice.
Steps:
- Create CN with value correction
- Don't affect stock (stockFlow = 0)
- Issue new correct invoice (if needed)
Post-Sale Commercial Discountβ
Situation: Customer negotiated discount after invoice.
Steps:
- Create CN with discount value
- Don't affect stock
- Register in accounts receivable
Differences vs Invoicesβ
| Aspect | Invoice | Credit Note |
|---|---|---|
| Quantity | Positive | Negative |
| Stock | Outbound | Inbound |
| Revenue | Increases | Decreases |
| Purpose | Sale | Correction/Return |
| Reference | Optional | Required |
Invoice Integrationβ
Complete Flowβ
graph LR
A[Invoice Issued] --> B{Problem?}
B -->|Yes| C[Create Credit Note]
C --> D[Process Return]
D --> E[Refund/Credit]
B -->|No| F[End]
Reports and Analysisβ
Important Metricsβ
- Return rate by product
- Total CN value per period
- Most common return reasons
- Customers with most returns
Query CNsβ
GET /api/v1/invoices?documentTypeId=7&fromDate=2025-01-01&toDate=2025-12-31
Authorization: Bearer {token}
Next Stepsβ
- Invoices Guide - Issue invoices
- Receipts Guide - Payment management
- Usage Guide - General API information
Last Updated: December 2, 2025