curl --request GET \
--url https://api.abacco.ai/v1/documents/{document_id} \
--header 'Authorization: <api-key>'import requests
url = "https://api.abacco.ai/v1/documents/{document_id}"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.abacco.ai/v1/documents/{document_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.abacco.ai/v1/documents/{document_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.abacco.ai/v1/documents/{document_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.abacco.ai/v1/documents/{document_id}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.abacco.ai/v1/documents/{document_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": 123,
"folio": "<string>",
"date_issued": "2023-12-25",
"amount_with_iva": 123,
"dte_type_code": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"has_trace": true,
"latest_trace_info": {
"has_acknowledgments": true,
"has_claims": true,
"is_more_than_eight_days": true,
"is_rejected": true,
"date_reception": "2023-11-07T05:31:56Z",
"events_count": 123
},
"amount_iva": 123,
"amount_without_iva": 123,
"currency": "CLP",
"sender_id": 123,
"sender_name": "<string>",
"sender_tax_id": "<string>",
"receiver_id": "<string>",
"receiver_name": "<string>",
"receiver_tax_id": "<string>",
"has_credit_note": true,
"is_paid": true,
"json_param": {},
"traces": [
{
"date_reception": "2023-11-07T05:31:56Z",
"has_receiver_access": true,
"has_issuer_access": true,
"has_holder_access": true,
"is_paid_cash": true,
"has_claims": true,
"is_more_than_eight_days": true,
"has_acknowledgments": true,
"has_guide_reference": true,
"is_rejected": true,
"days_until_executive_merit": 123,
"executive_merit_alert_level": "none",
"events": [
{
"event_code": "ACD",
"event_description": "Acepta Contenido del Documento",
"event_date": "2023-11-07T05:31:56Z",
"responsable_rut": 123,
"responsable_dv": "<string>"
}
]
}
],
"trace_update_log": {},
"document_states": [
{
"label": "<string>",
"description": "<string>",
"state_type": "<string>"
}
],
"vat_withheld": true,
"exchange_rate": "<string>",
"original_amount": "<string>",
"state": "<string>",
"dte_type_description": "<string>",
"pdf": "<string>",
"xml": "<string>",
"xml_error": "<string>",
"references": [
{
"reference_folio": 123,
"reference_date": "2023-12-25",
"dte_type_code": "<string>",
"reference_reason": "ANULA DOCUMENTO DE LA REFERENCIA"
}
],
"details": [
{
"item_name": "<string>",
"quantity": 123,
"unit_price": 1,
"item_description": "<string>",
"discount_percent": 123,
"item_code": "<string>",
"unit": "<string>",
"other_tax": 123,
"item_type_code": 123
}
],
"header": {
"purchase_transaction_type": "<string>",
"sale_transaction_type": "<string>",
"payment_method": "1",
"due_date": "2023-12-25",
"vat_withheld": false,
"retention_type": "RETRECEPTOR",
"purchase_type": "1"
},
"document_issuer": {
"rut": "<string>",
"business_name": "<string>",
"phone_number": "<string>",
"email": "<string>",
"business_activity": "<string>",
"activity_code": 123,
"sii_branch_code": "<string>",
"address": "<string>",
"district": "<string>",
"city": "<string>"
},
"document_receiver": {
"rut": "<string>",
"business_name": "<string>",
"contact": "<string>",
"business_activity": "<string>",
"address": "<string>",
"district": "<string>",
"city": "<string>"
}
}{
"error": "VALIDATION_ERROR",
"message": "<string>"
}{
"error": "VALIDATION_ERROR",
"message": "<string>"
}{
"error": "No tienes acceso a este documento"
}{
"error": "VALIDATION_ERROR",
"message": "<string>"
}Detalle de un documento
Obtiene toda la información completa de un documento tributario específico, incluyendo:
- PDF y XML cuando están disponibles (el PDF siempre se incluye en la respuesta, campo
pdf_url) - Detalles (productos/líneas) del documento (campo
details) - Header completo con información de transacción, pago y tipo de compra (campo
header) - Información del emisor completa (campo
document_issuer) - Información del receptor completa (campo
document_receiver) - Referencias a otros documentos, como notas de crédito (campo
references)
Este endpoint es útil para consultar detalles completos de un documento ya emitido o recibido.
Seguridad: El usuario solo puede acceder al documento si es emisor (sender) o receptor (receiver) del documento. Si el usuario no tiene acceso, se retorna un error 403 Forbidden.
curl --request GET \
--url https://api.abacco.ai/v1/documents/{document_id} \
--header 'Authorization: <api-key>'import requests
url = "https://api.abacco.ai/v1/documents/{document_id}"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.abacco.ai/v1/documents/{document_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.abacco.ai/v1/documents/{document_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.abacco.ai/v1/documents/{document_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.abacco.ai/v1/documents/{document_id}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.abacco.ai/v1/documents/{document_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": 123,
"folio": "<string>",
"date_issued": "2023-12-25",
"amount_with_iva": 123,
"dte_type_code": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"has_trace": true,
"latest_trace_info": {
"has_acknowledgments": true,
"has_claims": true,
"is_more_than_eight_days": true,
"is_rejected": true,
"date_reception": "2023-11-07T05:31:56Z",
"events_count": 123
},
"amount_iva": 123,
"amount_without_iva": 123,
"currency": "CLP",
"sender_id": 123,
"sender_name": "<string>",
"sender_tax_id": "<string>",
"receiver_id": "<string>",
"receiver_name": "<string>",
"receiver_tax_id": "<string>",
"has_credit_note": true,
"is_paid": true,
"json_param": {},
"traces": [
{
"date_reception": "2023-11-07T05:31:56Z",
"has_receiver_access": true,
"has_issuer_access": true,
"has_holder_access": true,
"is_paid_cash": true,
"has_claims": true,
"is_more_than_eight_days": true,
"has_acknowledgments": true,
"has_guide_reference": true,
"is_rejected": true,
"days_until_executive_merit": 123,
"executive_merit_alert_level": "none",
"events": [
{
"event_code": "ACD",
"event_description": "Acepta Contenido del Documento",
"event_date": "2023-11-07T05:31:56Z",
"responsable_rut": 123,
"responsable_dv": "<string>"
}
]
}
],
"trace_update_log": {},
"document_states": [
{
"label": "<string>",
"description": "<string>",
"state_type": "<string>"
}
],
"vat_withheld": true,
"exchange_rate": "<string>",
"original_amount": "<string>",
"state": "<string>",
"dte_type_description": "<string>",
"pdf": "<string>",
"xml": "<string>",
"xml_error": "<string>",
"references": [
{
"reference_folio": 123,
"reference_date": "2023-12-25",
"dte_type_code": "<string>",
"reference_reason": "ANULA DOCUMENTO DE LA REFERENCIA"
}
],
"details": [
{
"item_name": "<string>",
"quantity": 123,
"unit_price": 1,
"item_description": "<string>",
"discount_percent": 123,
"item_code": "<string>",
"unit": "<string>",
"other_tax": 123,
"item_type_code": 123
}
],
"header": {
"purchase_transaction_type": "<string>",
"sale_transaction_type": "<string>",
"payment_method": "1",
"due_date": "2023-12-25",
"vat_withheld": false,
"retention_type": "RETRECEPTOR",
"purchase_type": "1"
},
"document_issuer": {
"rut": "<string>",
"business_name": "<string>",
"phone_number": "<string>",
"email": "<string>",
"business_activity": "<string>",
"activity_code": 123,
"sii_branch_code": "<string>",
"address": "<string>",
"district": "<string>",
"city": "<string>"
},
"document_receiver": {
"rut": "<string>",
"business_name": "<string>",
"contact": "<string>",
"business_activity": "<string>",
"address": "<string>",
"district": "<string>",
"city": "<string>"
}
}{
"error": "VALIDATION_ERROR",
"message": "<string>"
}{
"error": "VALIDATION_ERROR",
"message": "<string>"
}{
"error": "No tienes acceso a este documento"
}{
"error": "VALIDATION_ERROR",
"message": "<string>"
}Authorizations
API Key para autenticación. Debe proporcionarse en el header Authorization con el formato: 'Api-Key YOUR-API-KEY' (incluye el prefijo 'Api-Key ' seguido de tu API key)
Path Parameters
ID único del documento a consultar (entero)
Response
Documento obtenido exitosamente con toda la información completa: PDF, XML, detalles (productos), header, información del emisor y receptor, y referencias
ID único del documento
Número de folio del documento
Fecha de emisión del documento
Monto total con IVA
Código del tipo de DTE (ej: "33" para Factura Electrónica)
Fecha de creación del registro (ISO 8601)
Fecha de última actualización (ISO 8601)
true si el documento tiene al menos una traza registrada del SII.
Resumen liviano de la última traza del documento. Siempre se incluye en las respuestas de listado y detalle (es null cuando el documento no tiene trazas).
Show child attributes
Show child attributes
Monto del IVA
Monto sin IVA
Moneda del documento
CLP, UF, USD, EUR "CLP"
ID de la entidad emisora
Nombre de la entidad emisora
RUT de la entidad emisora
ID de la entidad receptora (como string, puede ser null para algunos tipos de documentos)
Nombre de la entidad receptora
RUT de la entidad receptora
Indica si el documento tiene una nota de crédito asociada
Indica si el documento está marcado como pagado
Parámetros JSON almacenados del documento
Array de trazas del documento en el SII, cada una con su lista de events. En el endpoint de detalle siempre se incluye; en el endpoint de listado solo se incluye cuando se pasa include_trace_events=true.
Show child attributes
Show child attributes
Log de actualización de trazas
Array de estados del documento (rechazado, con NC, acuse, pagado, mérito ejecutivo)
Show child attributes
Show child attributes
Indica si se retuvo IVA
Tipo de cambio para facturas internacionales
Monto original en moneda extranjera para facturas internacionales
Estado del documento (draft, issued, etc.)
Descripción del tipo de DTE
URL presignada al PDF del documento (válida por tiempo limitado, generalmente 1 hora)
Contenido completo del XML del documento tributario electrónico
Mensaje de error si no se pudo obtener el XML (null si está disponible)
Array de documentos referenciados (para notas de crédito, etc.)
Show child attributes
Show child attributes
Array de productos/líneas del documento
Show child attributes
Show child attributes
Información del encabezado del documento (transacción, pago, etc.)
Show child attributes
Show child attributes
Información completa del emisor del documento
Show child attributes
Show child attributes
Información completa del receptor del documento
Show child attributes
Show child attributes