curl --request POST \
--url https://api.pruff.com/api/clients/invoices/search \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"invoices": [
{
"businessIdentifier": "76111111-6",
"folio": "1333",
"code": "33"
},
{
"businessIdentifier": "76111111-6",
"folio": "3213"
},
{
"businessIdentifier": "76111111-6",
"folio": "9999"
}
]
}
'import requests
url = "https://api.pruff.com/api/clients/invoices/search"
payload = { "invoices": [
{
"businessIdentifier": "76111111-6",
"folio": "1333",
"code": "33"
},
{
"businessIdentifier": "76111111-6",
"folio": "3213"
},
{
"businessIdentifier": "76111111-6",
"folio": "9999"
}
] }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
invoices: [
{businessIdentifier: '76111111-6', folio: '1333', code: '33'},
{businessIdentifier: '76111111-6', folio: '3213'},
{businessIdentifier: '76111111-6', folio: '9999'}
]
})
};
fetch('https://api.pruff.com/api/clients/invoices/search', 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.pruff.com/api/clients/invoices/search",
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([
'invoices' => [
[
'businessIdentifier' => '76111111-6',
'folio' => '1333',
'code' => '33'
],
[
'businessIdentifier' => '76111111-6',
'folio' => '3213'
],
[
'businessIdentifier' => '76111111-6',
'folio' => '9999'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.pruff.com/api/clients/invoices/search"
payload := strings.NewReader("{\n \"invoices\": [\n {\n \"businessIdentifier\": \"76111111-6\",\n \"folio\": \"1333\",\n \"code\": \"33\"\n },\n {\n \"businessIdentifier\": \"76111111-6\",\n \"folio\": \"3213\"\n },\n {\n \"businessIdentifier\": \"76111111-6\",\n \"folio\": \"9999\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<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.pruff.com/api/clients/invoices/search")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"invoices\": [\n {\n \"businessIdentifier\": \"76111111-6\",\n \"folio\": \"1333\",\n \"code\": \"33\"\n },\n {\n \"businessIdentifier\": \"76111111-6\",\n \"folio\": \"3213\"\n },\n {\n \"businessIdentifier\": \"76111111-6\",\n \"folio\": \"9999\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pruff.com/api/clients/invoices/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"invoices\": [\n {\n \"businessIdentifier\": \"76111111-6\",\n \"folio\": \"1333\",\n \"code\": \"33\"\n },\n {\n \"businessIdentifier\": \"76111111-6\",\n \"folio\": \"3213\"\n },\n {\n \"businessIdentifier\": \"76111111-6\",\n \"folio\": \"9999\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "3f2b8a3e-5d1c-4c7e-9a52-0d6f1c2b7a10",
"businessIdentifier": "76111111-6",
"stakeholderIdentifier": "96111111-0",
"businessName": "Cliente Ejemplo SpA",
"stakeholderName": "Pagador Ejemplo SpA",
"paymentType": null,
"issuedDate": "2024-11-15T00:00:00.000Z",
"receiptDate": "2024-11-16T00:00:00.000Z",
"amount": 4123123,
"status": "Transable",
"issuer": true,
"code": "33",
"folio": "1333",
"creditNoteAmount": 250000,
"debitNoteAmount": 0,
"creditNotes": [
{
"folio": "1201",
"code": "61",
"issuedDate": "2024-11-20",
"amount": 250000
}
],
"cessionary": "--",
"cessionaries": [],
"lastCessionDate": null,
"confirmDate": "2024-11-18T00:00:00.000Z",
"cancelDate": null,
"enforceableTitle": true,
"currency": "CLP",
"lastUpdate": "2024-11-21T13:05:00.000Z"
},
{
"id": "9c1d7e42-6b0a-4f3d-8e15-2a4b9d6c3f21",
"businessIdentifier": "76111111-6",
"stakeholderIdentifier": "96111111-0",
"businessName": "Cliente Ejemplo SpA",
"stakeholderName": "Pagador Ejemplo SpA",
"paymentType": null,
"issuedDate": "2024-11-10T00:00:00.000Z",
"receiptDate": "2024-11-11T00:00:00.000Z",
"amount": 3748500,
"status": "Cedida",
"issuer": true,
"code": "33",
"folio": "3213",
"creditNoteAmount": 0,
"debitNoteAmount": 0,
"creditNotes": [],
"cessionary": "Factoring Ejemplo SpA",
"cessionaries": [
{
"giver": "Cliente Ejemplo SpA",
"giverIdentifier": "76111111-6",
"cessionary": "Factoring Ejemplo SpA",
"cessionaryIdentifier": "77222222-K",
"cessionDate": "2024-11-12T15:36:00.000Z"
}
],
"lastCessionDate": "2024-11-12T15:36:00.000Z",
"confirmDate": null,
"cancelDate": null,
"enforceableTitle": true,
"currency": "CLP",
"lastUpdate": "2024-11-21T13:05:00.000Z"
}
],
"notFound": [
{
"businessIdentifier": "76111111-6",
"folio": "9999",
"code": "33"
}
]
}Consultar varias facturas
Busca hasta 500 facturas en un solo llamado, cada una por RUT del emisor, folio y tipo de DTE. Úsalo en vez de llamar a GET /invoices una vez por factura: cada llamado cuenta para el rate limit.
Solo lee lo que ya está en Pruff; no consulta al SII durante el llamado. Cada factura encontrada viene con los mismos campos que en GET /invoices más lastUpdate: la fecha y hora desde la que Pruff tiene al día con el SII tanto la factura como su estado de cesión. Si te parece antigua, pide una sincronización de tu cliente con POST /syncronizations/execute/{scrapingType}/{businessIdentifier} y vuelve a consultar cuando termine.
data respeta el orden en que enviaste las facturas. Si repites una factura en el body, viene una sola vez. Las facturas que no existen en Pruff vienen en notFound, tal como las enviaste y con code completado.
curl --request POST \
--url https://api.pruff.com/api/clients/invoices/search \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"invoices": [
{
"businessIdentifier": "76111111-6",
"folio": "1333",
"code": "33"
},
{
"businessIdentifier": "76111111-6",
"folio": "3213"
},
{
"businessIdentifier": "76111111-6",
"folio": "9999"
}
]
}
'import requests
url = "https://api.pruff.com/api/clients/invoices/search"
payload = { "invoices": [
{
"businessIdentifier": "76111111-6",
"folio": "1333",
"code": "33"
},
{
"businessIdentifier": "76111111-6",
"folio": "3213"
},
{
"businessIdentifier": "76111111-6",
"folio": "9999"
}
] }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
invoices: [
{businessIdentifier: '76111111-6', folio: '1333', code: '33'},
{businessIdentifier: '76111111-6', folio: '3213'},
{businessIdentifier: '76111111-6', folio: '9999'}
]
})
};
fetch('https://api.pruff.com/api/clients/invoices/search', 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.pruff.com/api/clients/invoices/search",
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([
'invoices' => [
[
'businessIdentifier' => '76111111-6',
'folio' => '1333',
'code' => '33'
],
[
'businessIdentifier' => '76111111-6',
'folio' => '3213'
],
[
'businessIdentifier' => '76111111-6',
'folio' => '9999'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.pruff.com/api/clients/invoices/search"
payload := strings.NewReader("{\n \"invoices\": [\n {\n \"businessIdentifier\": \"76111111-6\",\n \"folio\": \"1333\",\n \"code\": \"33\"\n },\n {\n \"businessIdentifier\": \"76111111-6\",\n \"folio\": \"3213\"\n },\n {\n \"businessIdentifier\": \"76111111-6\",\n \"folio\": \"9999\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<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.pruff.com/api/clients/invoices/search")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"invoices\": [\n {\n \"businessIdentifier\": \"76111111-6\",\n \"folio\": \"1333\",\n \"code\": \"33\"\n },\n {\n \"businessIdentifier\": \"76111111-6\",\n \"folio\": \"3213\"\n },\n {\n \"businessIdentifier\": \"76111111-6\",\n \"folio\": \"9999\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pruff.com/api/clients/invoices/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"invoices\": [\n {\n \"businessIdentifier\": \"76111111-6\",\n \"folio\": \"1333\",\n \"code\": \"33\"\n },\n {\n \"businessIdentifier\": \"76111111-6\",\n \"folio\": \"3213\"\n },\n {\n \"businessIdentifier\": \"76111111-6\",\n \"folio\": \"9999\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "3f2b8a3e-5d1c-4c7e-9a52-0d6f1c2b7a10",
"businessIdentifier": "76111111-6",
"stakeholderIdentifier": "96111111-0",
"businessName": "Cliente Ejemplo SpA",
"stakeholderName": "Pagador Ejemplo SpA",
"paymentType": null,
"issuedDate": "2024-11-15T00:00:00.000Z",
"receiptDate": "2024-11-16T00:00:00.000Z",
"amount": 4123123,
"status": "Transable",
"issuer": true,
"code": "33",
"folio": "1333",
"creditNoteAmount": 250000,
"debitNoteAmount": 0,
"creditNotes": [
{
"folio": "1201",
"code": "61",
"issuedDate": "2024-11-20",
"amount": 250000
}
],
"cessionary": "--",
"cessionaries": [],
"lastCessionDate": null,
"confirmDate": "2024-11-18T00:00:00.000Z",
"cancelDate": null,
"enforceableTitle": true,
"currency": "CLP",
"lastUpdate": "2024-11-21T13:05:00.000Z"
},
{
"id": "9c1d7e42-6b0a-4f3d-8e15-2a4b9d6c3f21",
"businessIdentifier": "76111111-6",
"stakeholderIdentifier": "96111111-0",
"businessName": "Cliente Ejemplo SpA",
"stakeholderName": "Pagador Ejemplo SpA",
"paymentType": null,
"issuedDate": "2024-11-10T00:00:00.000Z",
"receiptDate": "2024-11-11T00:00:00.000Z",
"amount": 3748500,
"status": "Cedida",
"issuer": true,
"code": "33",
"folio": "3213",
"creditNoteAmount": 0,
"debitNoteAmount": 0,
"creditNotes": [],
"cessionary": "Factoring Ejemplo SpA",
"cessionaries": [
{
"giver": "Cliente Ejemplo SpA",
"giverIdentifier": "76111111-6",
"cessionary": "Factoring Ejemplo SpA",
"cessionaryIdentifier": "77222222-K",
"cessionDate": "2024-11-12T15:36:00.000Z"
}
],
"lastCessionDate": "2024-11-12T15:36:00.000Z",
"confirmDate": null,
"cancelDate": null,
"enforceableTitle": true,
"currency": "CLP",
"lastUpdate": "2024-11-21T13:05:00.000Z"
}
],
"notFound": [
{
"businessIdentifier": "76111111-6",
"folio": "9999",
"code": "33"
}
]
}