Obtener documento específico
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>"
}Documentos
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.
GET
/
documents
/
{document_id}
Obtener documento específico
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 línea a línea, totales y eventos de la traza SII.
Authorizations
Response
Documento obtenido exitosamente con toda la información completa: PDF, XML, detalles (productos), header, información del emisor y receptor, y referencias