curl --request POST \
--url https://api.abacco.ai/v1/documents/batch \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"documents": [
{
"dte_type": {
"code": "33"
},
"date_issued": "2024-01-15",
"document_issuer": {
"rut": "12345678-9",
"business_name": "Mi Empresa SpA"
},
"document_receiver": {
"rut": "98765432-1",
"business_name": "Cliente Importante Ltda"
},
"details": [
{
"item_name": "Servicio de Consultoría",
"quantity": 1,
"unit_price": 100000
}
]
}
]
}
'import requests
url = "https://api.abacco.ai/v1/documents/batch"
payload = { "documents": [
{
"dte_type": { "code": "33" },
"date_issued": "2024-01-15",
"document_issuer": {
"rut": "12345678-9",
"business_name": "Mi Empresa SpA"
},
"document_receiver": {
"rut": "98765432-1",
"business_name": "Cliente Importante Ltda"
},
"details": [
{
"item_name": "Servicio de Consultoría",
"quantity": 1,
"unit_price": 100000
}
]
}
] }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
documents: [
{
dte_type: {code: '33'},
date_issued: '2024-01-15',
document_issuer: {rut: '12345678-9', business_name: 'Mi Empresa SpA'},
document_receiver: {rut: '98765432-1', business_name: 'Cliente Importante Ltda'},
details: [{item_name: 'Servicio de Consultoría', quantity: 1, unit_price: 100000}]
}
]
})
};
fetch('https://api.abacco.ai/v1/documents/batch', 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/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'documents' => [
[
'dte_type' => [
'code' => '33'
],
'date_issued' => '2024-01-15',
'document_issuer' => [
'rut' => '12345678-9',
'business_name' => 'Mi Empresa SpA'
],
'document_receiver' => [
'rut' => '98765432-1',
'business_name' => 'Cliente Importante Ltda'
],
'details' => [
[
'item_name' => 'Servicio de Consultoría',
'quantity' => 1,
'unit_price' => 100000
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.abacco.ai/v1/documents/batch"
payload := strings.NewReader("{\n \"documents\": [\n {\n \"dte_type\": {\n \"code\": \"33\"\n },\n \"date_issued\": \"2024-01-15\",\n \"document_issuer\": {\n \"rut\": \"12345678-9\",\n \"business_name\": \"Mi Empresa SpA\"\n },\n \"document_receiver\": {\n \"rut\": \"98765432-1\",\n \"business_name\": \"Cliente Importante Ltda\"\n },\n \"details\": [\n {\n \"item_name\": \"Servicio de Consultoría\",\n \"quantity\": 1,\n \"unit_price\": 100000\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.abacco.ai/v1/documents/batch")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"documents\": [\n {\n \"dte_type\": {\n \"code\": \"33\"\n },\n \"date_issued\": \"2024-01-15\",\n \"document_issuer\": {\n \"rut\": \"12345678-9\",\n \"business_name\": \"Mi Empresa SpA\"\n },\n \"document_receiver\": {\n \"rut\": \"98765432-1\",\n \"business_name\": \"Cliente Importante Ltda\"\n },\n \"details\": [\n {\n \"item_name\": \"Servicio de Consultoría\",\n \"quantity\": 1,\n \"unit_price\": 100000\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.abacco.ai/v1/documents/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"documents\": [\n {\n \"dte_type\": {\n \"code\": \"33\"\n },\n \"date_issued\": \"2024-01-15\",\n \"document_issuer\": {\n \"rut\": \"12345678-9\",\n \"business_name\": \"Mi Empresa SpA\"\n },\n \"document_receiver\": {\n \"rut\": \"98765432-1\",\n \"business_name\": \"Cliente Importante Ltda\"\n },\n \"details\": [\n {\n \"item_name\": \"Servicio de Consultoría\",\n \"quantity\": 1,\n \"unit_price\": 100000\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"batch_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "processing",
"created_at": "2024-01-15T10:30:00Z",
"documents": [
{
"index": 0,
"status": "created",
"document": {
"id": 12345,
"folio": "1",
"date_issued": "2024-01-15",
"amount_with_iva": 119000,
"receiver_id": 456,
"is_draft": false,
"can_be_issued": true,
"dte_type": {
"code": "33",
"description": "Factura Electrónica"
},
"sender": {
"id": 123,
"name": "Mi Empresa SpA",
"tax_id": "12345678-9"
},
"receiver": {
"id": 456,
"name": "Cliente Importante Ltda",
"tax_id": "98765432-1"
},
"items": [
{
"item_name": "Servicio de Consultoría",
"item_description": null,
"quantity": 1,
"unit_price": 100000,
"unit": "UN",
"item_code": null,
"item_type_code": null,
"discount_percent": null,
"other_tax": null
}
],
"document_total": {
"net_amount": 100000,
"iva_rate": 19,
"iva_amount": 19000,
"total_amount": 119000
},
"pdf_url": "https://s3.amazonaws.com/bucket/documento_12345.pdf?signature=...",
"pdf_download_url": "/api/master-entities/123/documents/12345/file/"
}
}
]
}{
"error": "Esta entidad no tiene credenciales SII válidas configuradas"
}{
"error": "VALIDATION_ERROR",
"message": "<string>"
}{
"error": "VALIDATION_ERROR",
"message": "<string>"
}Emisión masiva
Crea hasta 200 documentos en una sola llamada. La respuesta incluye información completa de cada documento creado, incluyendo PDF cuando está disponible. Los resultados también se enviarán por webhook si está configurado.
Permisos requeridos: La API Key debe tener el permiso document:create o permisos completos (*). Además, la entidad emisora debe tener credenciales SII válidas configuradas.
curl --request POST \
--url https://api.abacco.ai/v1/documents/batch \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"documents": [
{
"dte_type": {
"code": "33"
},
"date_issued": "2024-01-15",
"document_issuer": {
"rut": "12345678-9",
"business_name": "Mi Empresa SpA"
},
"document_receiver": {
"rut": "98765432-1",
"business_name": "Cliente Importante Ltda"
},
"details": [
{
"item_name": "Servicio de Consultoría",
"quantity": 1,
"unit_price": 100000
}
]
}
]
}
'import requests
url = "https://api.abacco.ai/v1/documents/batch"
payload = { "documents": [
{
"dte_type": { "code": "33" },
"date_issued": "2024-01-15",
"document_issuer": {
"rut": "12345678-9",
"business_name": "Mi Empresa SpA"
},
"document_receiver": {
"rut": "98765432-1",
"business_name": "Cliente Importante Ltda"
},
"details": [
{
"item_name": "Servicio de Consultoría",
"quantity": 1,
"unit_price": 100000
}
]
}
] }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
documents: [
{
dte_type: {code: '33'},
date_issued: '2024-01-15',
document_issuer: {rut: '12345678-9', business_name: 'Mi Empresa SpA'},
document_receiver: {rut: '98765432-1', business_name: 'Cliente Importante Ltda'},
details: [{item_name: 'Servicio de Consultoría', quantity: 1, unit_price: 100000}]
}
]
})
};
fetch('https://api.abacco.ai/v1/documents/batch', 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/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'documents' => [
[
'dte_type' => [
'code' => '33'
],
'date_issued' => '2024-01-15',
'document_issuer' => [
'rut' => '12345678-9',
'business_name' => 'Mi Empresa SpA'
],
'document_receiver' => [
'rut' => '98765432-1',
'business_name' => 'Cliente Importante Ltda'
],
'details' => [
[
'item_name' => 'Servicio de Consultoría',
'quantity' => 1,
'unit_price' => 100000
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.abacco.ai/v1/documents/batch"
payload := strings.NewReader("{\n \"documents\": [\n {\n \"dte_type\": {\n \"code\": \"33\"\n },\n \"date_issued\": \"2024-01-15\",\n \"document_issuer\": {\n \"rut\": \"12345678-9\",\n \"business_name\": \"Mi Empresa SpA\"\n },\n \"document_receiver\": {\n \"rut\": \"98765432-1\",\n \"business_name\": \"Cliente Importante Ltda\"\n },\n \"details\": [\n {\n \"item_name\": \"Servicio de Consultoría\",\n \"quantity\": 1,\n \"unit_price\": 100000\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.abacco.ai/v1/documents/batch")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"documents\": [\n {\n \"dte_type\": {\n \"code\": \"33\"\n },\n \"date_issued\": \"2024-01-15\",\n \"document_issuer\": {\n \"rut\": \"12345678-9\",\n \"business_name\": \"Mi Empresa SpA\"\n },\n \"document_receiver\": {\n \"rut\": \"98765432-1\",\n \"business_name\": \"Cliente Importante Ltda\"\n },\n \"details\": [\n {\n \"item_name\": \"Servicio de Consultoría\",\n \"quantity\": 1,\n \"unit_price\": 100000\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.abacco.ai/v1/documents/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"documents\": [\n {\n \"dte_type\": {\n \"code\": \"33\"\n },\n \"date_issued\": \"2024-01-15\",\n \"document_issuer\": {\n \"rut\": \"12345678-9\",\n \"business_name\": \"Mi Empresa SpA\"\n },\n \"document_receiver\": {\n \"rut\": \"98765432-1\",\n \"business_name\": \"Cliente Importante Ltda\"\n },\n \"details\": [\n {\n \"item_name\": \"Servicio de Consultoría\",\n \"quantity\": 1,\n \"unit_price\": 100000\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"batch_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "processing",
"created_at": "2024-01-15T10:30:00Z",
"documents": [
{
"index": 0,
"status": "created",
"document": {
"id": 12345,
"folio": "1",
"date_issued": "2024-01-15",
"amount_with_iva": 119000,
"receiver_id": 456,
"is_draft": false,
"can_be_issued": true,
"dte_type": {
"code": "33",
"description": "Factura Electrónica"
},
"sender": {
"id": 123,
"name": "Mi Empresa SpA",
"tax_id": "12345678-9"
},
"receiver": {
"id": 456,
"name": "Cliente Importante Ltda",
"tax_id": "98765432-1"
},
"items": [
{
"item_name": "Servicio de Consultoría",
"item_description": null,
"quantity": 1,
"unit_price": 100000,
"unit": "UN",
"item_code": null,
"item_type_code": null,
"discount_percent": null,
"other_tax": null
}
],
"document_total": {
"net_amount": 100000,
"iva_rate": 19,
"iva_amount": 19000,
"total_amount": 119000
},
"pdf_url": "https://s3.amazonaws.com/bucket/documento_12345.pdf?signature=...",
"pdf_download_url": "/api/master-entities/123/documents/12345/file/"
}
}
]
}{
"error": "Esta entidad no tiene credenciales SII válidas configuradas"
}{
"error": "VALIDATION_ERROR",
"message": "<string>"
}{
"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)
Headers
Previene lotes duplicados (≤ 256 caracteres, expira después de 24 h)
Si se establece como true, el sistema usará valores por defecto para campos no proporcionados:
- Fecha actual para date_issued
- Datos del emisor según configuración de la plataforma o primera actividad/dirección disponible
- Datos del receptor según configuración del cliente o primera actividad/dirección disponible
- Payment method = '2' (crédito) en el header del documento
Body
Lote de documentos a crear
Array de documentos a crear (máximo 200)
Show child attributes
Show child attributes
Response
Solicitud de creación de documentos aceptada. Los resultados se enviarán por webhook.
Identificador único del lote
Estado del batch
created, processing, completed, failed "processing"
Fecha y hora de creación del batch
Array de documentos procesados en el batch
Show child attributes
Show child attributes