Verificar cliente enrolado
curl --request GET \
--url https://api.pruff.com/api/clients/datahub/isEnrolled/{identifier} \
--header 'x-api-key: <api-key>'import requests
url = "https://api.pruff.com/api/clients/datahub/isEnrolled/{identifier}"
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/isEnrolled/{identifier}', 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/isEnrolled/{identifier}",
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/isEnrolled/{identifier}"
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/isEnrolled/{identifier}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pruff.com/api/clients/datahub/isEnrolled/{identifier}")
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{
"identifier": "11111111-1",
"hasBeenEnrolled": true,
"active": true,
"paused": false,
"deactivatedAt": null
}Datahub
Verificar cliente enrolado
Indica si un cliente está enrolado en tu empresa: si lo estuvo alguna vez, si lo está ahora, si está pausado y, cuando corresponde, desde cuándo dejó de estar activo. Solo acepta RUT chileno.
GET
/
datahub
/
isEnrolled
/
{identifier}
Verificar cliente enrolado
curl --request GET \
--url https://api.pruff.com/api/clients/datahub/isEnrolled/{identifier} \
--header 'x-api-key: <api-key>'import requests
url = "https://api.pruff.com/api/clients/datahub/isEnrolled/{identifier}"
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/isEnrolled/{identifier}', 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/isEnrolled/{identifier}",
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/isEnrolled/{identifier}"
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/isEnrolled/{identifier}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pruff.com/api/clients/datahub/isEnrolled/{identifier}")
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{
"identifier": "11111111-1",
"hasBeenEnrolled": true,
"active": true,
"paused": false,
"deactivatedAt": null
}Parámetros de ruta
Respuesta
Estado de enrolamiento del cliente.
Si el cliente está activo en Pruff, es decir, si Pruff obtiene su información tributaria. false con deactivatedAt en null justo después de enrolar significa que la activación sigue en curso (CLP) o que el cliente se enroló con otra moneda, que no se activa automáticamente. false con deactivatedAt con fecha significa que el enrolamiento dejó de estar vigente, por ejemplo porque la clave del SII dejó de ser válida. Para un cliente CLP, vuelve a enrolarlo con POST /datahub/enroll y su clave vigente.