Obtener detalle de una orden de compra
curl --request GET \
--url https://api.pruff.com/api/clients/datahub/publicMarket/purchaseOrders/{code} \
--header 'x-api-key: <api-key>'import requests
url = "https://api.pruff.com/api/clients/datahub/publicMarket/purchaseOrders/{code}"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.pruff.com/api/clients/datahub/publicMarket/purchaseOrders/{code}', 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/datahub/publicMarket/purchaseOrders/{code}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.pruff.com/api/clients/datahub/publicMarket/purchaseOrders/{code}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<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.pruff.com/api/clients/datahub/publicMarket/purchaseOrders/{code}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pruff.com/api/clients/datahub/publicMarket/purchaseOrders/{code}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"code": "2097-241-SE26",
"name": "Compra de insumos médicos",
"description": "Guantes de procedimiento",
"type": "SE",
"statusCode": 12,
"status": "Recepción Conforme",
"currency": "CLP",
"netTotal": 100000,
"ivaPercentage": 19,
"taxes": 19000,
"total": 119000,
"shippingType": "Despachar a Dirección de envío",
"paymentType": "30 días contra la recepción conforme",
"tenderCode": "1234-56-LE26",
"creationDate": "2026-03-10T12:00:00-03:00",
"shippingDate": "2026-03-11T12:00:00-03:00",
"acceptanceDate": "2026-03-12T12:00:00-03:00",
"cancellationDate": null,
"buyer": {
"identifier": "61111111-8",
"name": "Hospital Ejemplo"
},
"supplier": {
"identifier": "76111111-6",
"name": "Proveedor Ejemplo SpA"
},
"buyerUnit": {
"code": "1234",
"name": "Abastecimiento"
},
"supplierUnit": null,
"items": [
{
"correlativeId": 1,
"category": "Insumos médicos",
"productName": "Guantes",
"buyerSpecification": "Guantes de nitrilo talla M",
"quantity": 100,
"unit": "Caja",
"currency": "CLP",
"netPrice": 1000,
"totalCharges": 0,
"totalDiscounts": 0,
"totalTaxes": 19000,
"total": 100000
}
]
}
}{
"message": "invalid_format",
"displayMessage": "El código no es válido",
"data": {
"errors": [
{
"path": "code",
"message": "El código no es válido",
"code": "invalid_format"
}
]
}
}{
"message": "Unauthorized: Invalid API Key"
}{
"message": "Purchase order not found",
"displayMessage": "No se encontró la orden de compra"
}{
"message": "Rate limit exceeded: 301 requests in the current 3600s window, limit is 300. Retry in 1200s.",
"displayMessage": "Superaste el límite de 300 solicitudes cada 3600 segundos. Vuelve a intentarlo en 1200 segundos.",
"data": {
"code": "RATE_LIMIT_EXCEEDED",
"scope": "All API keys of your company share this budget.",
"limit": 300,
"used": 301,
"windowSeconds": 3600,
"retryAfterSeconds": 1200,
"resetAt": "2026-03-10T16:00:00.000Z",
"hint": "Wait until resetAt (or honor the Retry-After header) before retrying. Avoid repeating identical requests: reuse responses you already fetched, use filters and larger pageSize values instead of one request per item, and cap your client concurrency."
}
}{
"message": "Internal server error"
}{
"message": "request_timeout",
"displayMessage": "La solicitud excedió el tiempo máximo permitido"
}Mercado Público
Obtener detalle de una orden de compra
Devuelve el detalle de una orden de compra de Mercado Público (ChileCompra) a partir de su código: montos e impuestos, comprador, proveedor, unidades, licitación de origen y todos sus ítems. La cuota de 300 solicitudes por hora por empresa se comparte con los demás endpoints de Mercado Público y con otras consultas de Datahub de tu empresa.
GET
/
datahub
/
publicMarket
/
purchaseOrders
/
{code}
Obtener detalle de una orden de compra
curl --request GET \
--url https://api.pruff.com/api/clients/datahub/publicMarket/purchaseOrders/{code} \
--header 'x-api-key: <api-key>'import requests
url = "https://api.pruff.com/api/clients/datahub/publicMarket/purchaseOrders/{code}"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.pruff.com/api/clients/datahub/publicMarket/purchaseOrders/{code}', 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/datahub/publicMarket/purchaseOrders/{code}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.pruff.com/api/clients/datahub/publicMarket/purchaseOrders/{code}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<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.pruff.com/api/clients/datahub/publicMarket/purchaseOrders/{code}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pruff.com/api/clients/datahub/publicMarket/purchaseOrders/{code}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"code": "2097-241-SE26",
"name": "Compra de insumos médicos",
"description": "Guantes de procedimiento",
"type": "SE",
"statusCode": 12,
"status": "Recepción Conforme",
"currency": "CLP",
"netTotal": 100000,
"ivaPercentage": 19,
"taxes": 19000,
"total": 119000,
"shippingType": "Despachar a Dirección de envío",
"paymentType": "30 días contra la recepción conforme",
"tenderCode": "1234-56-LE26",
"creationDate": "2026-03-10T12:00:00-03:00",
"shippingDate": "2026-03-11T12:00:00-03:00",
"acceptanceDate": "2026-03-12T12:00:00-03:00",
"cancellationDate": null,
"buyer": {
"identifier": "61111111-8",
"name": "Hospital Ejemplo"
},
"supplier": {
"identifier": "76111111-6",
"name": "Proveedor Ejemplo SpA"
},
"buyerUnit": {
"code": "1234",
"name": "Abastecimiento"
},
"supplierUnit": null,
"items": [
{
"correlativeId": 1,
"category": "Insumos médicos",
"productName": "Guantes",
"buyerSpecification": "Guantes de nitrilo talla M",
"quantity": 100,
"unit": "Caja",
"currency": "CLP",
"netPrice": 1000,
"totalCharges": 0,
"totalDiscounts": 0,
"totalTaxes": 19000,
"total": 100000
}
]
}
}{
"message": "invalid_format",
"displayMessage": "El código no es válido",
"data": {
"errors": [
{
"path": "code",
"message": "El código no es válido",
"code": "invalid_format"
}
]
}
}{
"message": "Unauthorized: Invalid API Key"
}{
"message": "Purchase order not found",
"displayMessage": "No se encontró la orden de compra"
}{
"message": "Rate limit exceeded: 301 requests in the current 3600s window, limit is 300. Retry in 1200s.",
"displayMessage": "Superaste el límite de 300 solicitudes cada 3600 segundos. Vuelve a intentarlo en 1200 segundos.",
"data": {
"code": "RATE_LIMIT_EXCEEDED",
"scope": "All API keys of your company share this budget.",
"limit": 300,
"used": 301,
"windowSeconds": 3600,
"retryAfterSeconds": 1200,
"resetAt": "2026-03-10T16:00:00.000Z",
"hint": "Wait until resetAt (or honor the Retry-After header) before retrying. Avoid repeating identical requests: reuse responses you already fetched, use filters and larger pageSize values instead of one request per item, and cap your client concurrency."
}
}{
"message": "Internal server error"
}{
"message": "request_timeout",
"displayMessage": "La solicitud excedió el tiempo máximo permitido"
}