Facturas
Consulta una factura
get/sales/invoices/{id}
Request
- Base URL: https://api.datil.com (the document declares no server; this is the origin it was published from)
- URL: https://api.datil.com/sales/invoices/{id}
- Auth: none declared
Path parameters
idstring required
Identificador único del documento, generado por Dátil.
Response
OK
Example response
{
"id": "81wxc0qk5cgz4a7z3550a3art3",
"issue_date": "2026-10-07T17:29:46Z",
"number": "F001-1",
"currency": {
"code": "PEN",
"name": "Soles Peruanos",
"symbol": "S/."
},
"country": {
"code": "PE",
"name": "Perú"
},
"type": "pe/sales-invoice",
"operation_type": "01",
"tax_clearance": {
"void_requests": [
{
"id": "81wxc0qk5cgz4a7z3550a3art3",
"type": "pe/void-request",
"series": "RA-20210315",
"sequence": 1,
"number": "RA-20210315-3",
"tax_clearance": {
"status": "cleared",
"status_description": "ACEPTADO",
"status_code": "0",
"ticket": "1234567890",
"date": "1791394186",
"message": "El documento ha sido aceptado.",
"ack_xml": "<xml></xml>",
"qr_data": "20602224886|6|F002|F002-29|1800.00|11800.00|02/10/2020|6|20877294591|",
"xml": "https://api.datil.com/documents/1234/xml",
"pdf": "https://api.datil.com/p/1234",
"warnings": [
{
"status_code": "0000",
"message": "Documento de pruebas"
}
]
}
}
],
"status": "cleared",
"status_description": "ACEPTADO",
"status_code": "0",
"ticket": "1234567890",
"date": "1791394186",
"message": "El documento ha sido aceptado.",
"ack_xml": "<xml></xml>",
"qr_data": "20602224886|6|F002|F002-29|1800.00|11800.00|02/10/2020|6|20877294591|",
"xml": "https://api.datil.com/documents/1234/xml",
"pdf": "https://api.datil.com/p/1234",
"warnings": [
{
"status_code": "0000",
"message": "Documento de pruebas"
}
]
},
"due_date": "2026-10-07T17:29:46Z",
"series": "F001",
"sequence": 1,
"customer_legal_name": "Jose Mario",
"customer_commercial_name": "Jose Mario",
"customer_tax_id": "20601595665",
"customer_tax_id_type": {
"type": "pe-ruc",
"code": "6",
"name": "RUC"
},
"customer_email": "prueba@prueba.com",
"customer_telephone": "1234567890",
"customer_address": {
"line_1": "Calle A",
"locality": "Lima",
"administrative_district_level_1": "Miraflores",
"administrative_district_level_2": "Lima",
"city": "Lima",
"province": "Lima",
"tax_code": "0000",
"country": {
"code": "PE",
"name": "Perú"
}
},
"customer_code": "1234",
"waybill_number": "1234",
"waybill_code": "1234",
"sales_order_number": "1234",
"purchase_order_number": "1234",
"vendor_legal_name": "Jose Mario",
"vendor_commercial_name": "Jose Mario",
"vendor_tax_id": "20601595665",
"vendor_tax_id_type": {
"type": "pe-ruc",
"code": "6",
"name": "RUC"
},
"vendor_address": {
"line_1": "Calle A",
"locality": "Lima",
"administrative_district_level_1": "Miraflores",
"administrative_district_level_2": "Lima",
"city": "Lima",
"province": "Lima",
"tax_code": "0000",
"country": {
"code": "PE",
"name": "Perú"
}
},
"line_items": [
{
"tax": 18,
"tax_included_unit_price": 118,
"unit_price": 100,
"quantity": 1,
"subtotal": 100,
"subtotal_without_discount": 100,
"tax_lines": [
{
"exemption_reason_code": "10",
"taxable_amount": 18,
"amount": 18,
"tax_rate": {
"type": "pe-igv",
"name": "IGV",
"category-code": "VAT",
"code": "1000",
"percentage": 18
}
}
],
"sku": "A001",
"item_classification_code": "1234",
"tariff_heading": "1234",
"description": "Servicio ABC",
"price_type_code": "01",
"unit_of_measurement": "KG",
"unit_code": "1",
"custom_fields": [
{
"name": "Cedula del Pasajero",
"value": "1234556",
"code": "3001"
}
]
}
],
"tax_lines": [
{
"exemption_reason_code": "10",
"taxable_amount": 18,
"amount": 18,
"tax_rate": {
"type": "pe-igv",
"name": "IGV",
"category-code": "VAT",
"code": "1000",
"percentage": 18
}
}
],
"subtotal": 100,
"subtotal_discount_code": "00",
"tax": 18,
"gratuity": 5,
"total": 118,
"total_in_words": "Ciento dieciocho soles.",
"advance_payments_total": 100,
"advance_payments_subtotal": 84.75,
"advance_payments_discount_code": "05",
"note": "Gracias por tu compra.",
"payment_terms": [
{
"code": "Contado",
"currency": {
"code": "PEN",
"name": "Soles Peruanos",
"symbol": "S/."
},
"amount": 100,
"due_date": "1791394186",
"description": "Pago a 90 días."
}
],
"credit_notes": [
{
"total": 10,
"id": "123456",
"number": "NC001-1",
"issue_date": "1791394186",
"tax_clearance_status": "cleared"
}
],
"void_requests": [
{
"id": "81wxc0qk5cgz4a7z3550a3art3",
"issue_date": "2022-01-01T00:00:00Z",
"series": "F001",
"number": "F001-1",
"currency": {
"code": "PEN",
"name": "Soles Peruanos",
"symbol": "S/."
},
"country": {
"code": "PE",
"name": "Perú"
},
"type": "pe/sales-invoice",
"recipient_legal_name": "Jose Mario",
"recipient_tax_id": "20601595665",
"recipient_tax_id_type": {
"type": "pe-ruc",
"code": "6",
"name": "RUC"
},
"recipient_email": "prueba@prueba.com",
"recipient_address": {
"line_1": "Calle A",
"locality": "Lima",
"administrative_district_level_1": "Miraflores",
"administrative_district_level_2": "Lima",
"city": "Lima",
"province": "Lima",
"tax_code": "0000",
"country": {
"code": "PE",
"name": "Perú"
}
},
"vendor_legal_name": "Jose Mario",
"vendor_commercial_name": "Jose Mario",
"vendor_tax_id": "20601595665",
"vendor_tax_id_type": {
"type": "pe-ruc",
"code": "6",
"name": "RUC"
},
"vendor_address": {
"line_1": "Calle A",
"locality": "Lima",
"administrative_district_level_1": "Miraflores",
"administrative_district_level_2": "Lima",
"city": "Lima",
"province": "Lima",
"tax_code": "0000",
"country": {
"code": "PE",
"name": "Perú"
}
},
"tax_clearance": {
"void_requests": [
{
"id": "81wxc0qk5cgz4a7z3550a3art3",
"type": "pe/void-request",
"series": "RA-20210315",
"sequence": 1,
"number": "RA-20210315-3",
"tax_clearance": {
"status": "cleared",
"status_description": "ACEPTADO",
"status_code": "0",
"ticket": "1234567890",
"date": "1791394186",
"message": "El documento ha sido aceptado.",
"ack_xml": "<xml></xml>",
"qr_data": "20602224886|6|F002|F002-29|1800.00|11800.00|02/10/2020|6|20877294591|",
"xml": "https://api.datil.com/documents/1234/xml",
"pdf": "https://api.datil.com/p/1234",
"warnings": [
{
"status_code": "0000",
"message": "Documento de pruebas"
}
]
}
}
],
"status": "cleared",
"status_description": "ACEPTADO",
"status_code": "0",
"ticket": "1234567890",
"date": "1791394186",
"message": "El documento ha sido aceptado.",
"ack_xml": "<xml></xml>",
"qr_data": "20602224886|6|F002|F002-29|1800.00|11800.00|02/10/2020|6|20877294591|",
"xml": "https://api.datil.com/documents/1234/xml",
"pdf": "https://api.datil.com/p/1234",
"warnings": [
{
"status_code": "0000",
"message": "Documento de pruebas"
}
]
},
"void_reason": "Error al emitir el documento."
}
],
"detraction": {
"bank_account": "123",
"code": "001",
"payment_means_code": "001",
"rate": 9,
"amount": 1000
},
"export": {
"freight_charge": 100,
"insurance_charge": 100,
"other_charges": 100,
"shipping_method": "Marítimo",
"port_of_loading": "Callao - Perú",
"port_of_destination": "Barranquilla - Colombia",
"country_of_origin": "Perú",
"gross_weight_unit": "Kg"
},
"custom_fields": [
{
"name": "Cedula del Pasajero",
"value": "1234556",
"code": "3001"
}
],
"notes": [
{
"text": "Documento tributario",
"code": "2008"
}
],
"advance_payments": [
{
"document_number": "E001-196",
"document_type_code": "ANTICIPO",
"document_status_code": "1",
"currency": {
"code": "PEN",
"name": "Soles Peruanos",
"symbol": "S/."
},
"total": 118,
"subtotal": 100
}
],
"withholdings": [
{
"code": "62",
"rate": 0.03,
"amount": 1133.42,
"base_amount": 37780.81
}
]
}Changes
No recorded changes to this operation across all 1 revision of this API.