Create Sale
Customer’s RUT (Chilean tax ID). Must be valid format with verification digit (e.g., “12345678-9”).
SII document type code:
33: Factura Electrónica (Invoice)34: Factura Exenta (Exempt Invoice)39: Boleta Electrónica (Receipt)61: Nota de Crédito (Credit Note)
Array of payment methods used. Multiple payments supported (split payment).
ID of the payment method (see Payment Methods)
Amount paid with this method. Total of all payments must equal or exceed sale total.
Transaction authorization code (e.g., credit card voucher number)
Optional description or notes for the sale
Document references (required for adjustment documents: types 56, 61, 111, 112)
Referenced document type code (e.g., “33”, “801”, “52”)
Folio number of the referenced document
Date of referenced document (YYYY-MM-DD format)
SII reason code for the reference:
1: Anula documento (Cancels document)2: Corrige texto (Corrects text)3: Corrige monto (Corrects amount)
Unique sale ID
Fiscal folio number assigned from CAF (correlative per DTE type)
SII document type code
Document emission timestamp
Net amount (before tax)
VAT amount (19% of net amount)
Total amount (net + VAT)
Array of sale line items with product details and pricing
Transaction Flow
The sale creation endpoint executes the following atomic transaction:- Cash Session Validation: Verifies the seller has an active cash session open
- Customer Validation: Confirms customer exists in the system
- Reference Validation: For adjustment documents (56, 61, 111, 112), validates required references
- Product Validation: Checks each product exists and is active
- Stock Control: For products with stock control enabled:
- Validates sufficient stock available
- Decrements stock quantity
- Creates stock movement record (type: SALIDA, reason: VENTA)
- Payment Validation: Ensures total payments equal or exceed sale total
- Folio Assignment: Assigns next available folio from CAF (Código de Autorización de Folios)
- Internal Credit: If payment method is
CREDITO_INTERNO, increases customer’s balance - DTE Generation: Generates XML for electronic tax document
- Database Commit: Persists all changes atomically
Error Responses
List Sales
Number of records to skip for pagination (0-based offset)
Maximum number of records to return (1-200)
Get Sale PDF
ID of the sale to generate PDF for