Registrar endpoint de webhook firmado (HMAC-SHA256)
curl --request POST \
--url https://dte.ia-erp.cl/v1/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"descripcion": "<string>",
"eventos": [
"<string>"
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: '<string>', descripcion: '<string>', eventos: ['<string>']})
};
fetch('https://dte.ia-erp.cl/v1/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://dte.ia-erp.cl/v1/webhooks"
payload = {
"url": "<string>",
"descripcion": "<string>",
"eventos": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://dte.ia-erp.cl/v1/webhooks",
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([
'url' => '<string>',
'descripcion' => '<string>',
'eventos' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"creado_en": "2023-11-07T05:31:56Z",
"eventos": [
"<string>"
],
"id": "<string>",
"modo": "<string>",
"secret": "<string>",
"url": "<string>",
"$schema": "https://dte.ia-erp.cl/schemas/CrearWebhookOutputBody.json",
"descripcion": "<string>"
}{
"$schema": "https://dte.ia-erp.cl/schemas/ErrorModel.json",
"code": "rut_invalido",
"detail": "receptor.rut es obligatorio y debe ser un RUT chileno válido",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "urn:uuid:75acf40d-e49d-4267-9199-fdb9a0f98264",
"status": 400,
"title": "Datos del DTE inválidos",
"type": "urn:ia-erp:api:rut_invalido"
}Webhooks
Registrar endpoint de webhook firmado (HMAC-SHA256)
Registra una URL HTTPS para recibir notificaciones firmadas (X-IAERP-Signature) de eventos DTE. El secreto whsec_ se entrega una sola vez en esta respuesta.
POST
/
v1
/
webhooks
Registrar endpoint de webhook firmado (HMAC-SHA256)
curl --request POST \
--url https://dte.ia-erp.cl/v1/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"descripcion": "<string>",
"eventos": [
"<string>"
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: '<string>', descripcion: '<string>', eventos: ['<string>']})
};
fetch('https://dte.ia-erp.cl/v1/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://dte.ia-erp.cl/v1/webhooks"
payload = {
"url": "<string>",
"descripcion": "<string>",
"eventos": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://dte.ia-erp.cl/v1/webhooks",
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([
'url' => '<string>',
'descripcion' => '<string>',
'eventos' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"creado_en": "2023-11-07T05:31:56Z",
"eventos": [
"<string>"
],
"id": "<string>",
"modo": "<string>",
"secret": "<string>",
"url": "<string>",
"$schema": "https://dte.ia-erp.cl/schemas/CrearWebhookOutputBody.json",
"descripcion": "<string>"
}{
"$schema": "https://dte.ia-erp.cl/schemas/ErrorModel.json",
"code": "rut_invalido",
"detail": "receptor.rut es obligatorio y debe ser un RUT chileno válido",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "urn:uuid:75acf40d-e49d-4267-9199-fdb9a0f98264",
"status": 400,
"title": "Datos del DTE inválidos",
"type": "urn:ia-erp:api:rut_invalido"
}Authorizations
Body
application/json
Response
Created