// RADIAN
Emitir evento
Emite sobre una factura recibida el acuse de recibo (030), el recibo del bien o servicio (032), la aceptación expresa (033) o un reclamo (031).
POST
/api/v1/received-invoices/{id}/eventsPrimero registra la factura; con su id emites los eventos, uno por petición y en el orden de Cómo funciona RADIAN.
Headers
| Header | Obligatorio | Valor |
|---|---|---|
nestfac-api-key |
Sí | Tu API key. Ver Autenticación. |
nestfac-idempotency-key |
Sí | Un valor único por evento (por ejemplo, número de factura + código). Si reintentas tras un corte, no se emite dos veces. |
Content-Type |
Sí | application/json |
Parámetros de ruta
Path
- idstring (uuid)obligatorio
- El
idde la factura recibida.
Ejemplo: acuse de recibo (030)
curl -X POST "https://api-sandbox.nestfac.co/api/v1/received-invoices/e3841f4c-1be8-4e14-9e47-ccd82f7a0226/events" \
-H "nestfac-api-key: $NESTFAC_API_KEY" \
-H "nestfac-idempotency-key: FEV8812-030" \
-H "Content-Type: application/json" \
-d '{
"billing_account_id": "3f6c2a9e-5b1d-4c7e-9a2f-8d1e0b4c6a71",
"event_code": "030",
"received_by": {
"document_type_code": "13",
"document_identification_number": "1075234567",
"first_name": "Laura",
"family_name": "Perdomo",
"job_title": "Auxiliar contable",
"organization_department": "Contabilidad"
}
}'// Node.js 18+ (fetch nativo). Corre en TU servidor: la API key nunca va al navegador.
const body = {
"billing_account_id": "3f6c2a9e-5b1d-4c7e-9a2f-8d1e0b4c6a71",
"event_code": "030",
"received_by": {
"document_type_code": "13",
"document_identification_number": "1075234567",
"first_name": "Laura",
"family_name": "Perdomo",
"job_title": "Auxiliar contable",
"organization_department": "Contabilidad"
}
};
const res = await fetch("https://api-sandbox.nestfac.co/api/v1/received-invoices/e3841f4c-1be8-4e14-9e47-ccd82f7a0226/events", {
method: "POST",
headers: {
"nestfac-api-key": process.env.NESTFAC_API_KEY,
"nestfac-idempotency-key": "FEV8812-030",
"Content-Type": "application/json",
},
body: JSON.stringify(body),
});
const json = await res.json();
if (!res.ok) throw new Error(`${json.code ?? res.status}: ${json.message ?? JSON.stringify(json.errors)}`);
console.log(json.data);import os
import requests
payload = {
"billing_account_id": "3f6c2a9e-5b1d-4c7e-9a2f-8d1e0b4c6a71",
"event_code": "030",
"received_by": {
"document_type_code": "13",
"document_identification_number": "1075234567",
"first_name": "Laura",
"family_name": "Perdomo",
"job_title": "Auxiliar contable",
"organization_department": "Contabilidad",
},
}
res = requests.post(
"https://api-sandbox.nestfac.co/api/v1/received-invoices/e3841f4c-1be8-4e14-9e47-ccd82f7a0226/events",
headers={
"nestfac-api-key": os.environ["NESTFAC_API_KEY"],
"nestfac-idempotency-key": "FEV8812-030",
},
json=payload,
timeout=30,
)
data = res.json()
if not res.ok:
raise RuntimeError(f"{data.get('code', res.status_code)}: {data.get('message') or data.get('errors')}")
print(data["data"])<?php
$payload = [
'billing_account_id' => '3f6c2a9e-5b1d-4c7e-9a2f-8d1e0b4c6a71',
'event_code' => '030',
'received_by' => [
'document_type_code' => '13',
'document_identification_number' => '1075234567',
'first_name' => 'Laura',
'family_name' => 'Perdomo',
'job_title' => 'Auxiliar contable',
'organization_department' => 'Contabilidad',
],
];
$ch = curl_init('https://api-sandbox.nestfac.co/api/v1/received-invoices/e3841f4c-1be8-4e14-9e47-ccd82f7a0226/events');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'nestfac-api-key: ' . getenv('NESTFAC_API_KEY'),
'nestfac-idempotency-key: FEV8812-030',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode($payload, JSON_UNESCAPED_UNICODE),
]);
$response = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($status >= 400) {
throw new RuntimeException(($response['code'] ?? $status) . ': ' . ($response['message'] ?? json_encode($response['errors'] ?? null)));
}
print_r($response['data']);// .NET 7+
using System.Net.Http;
using System.Text;
using var http = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api-sandbox.nestfac.co/api/v1/received-invoices/e3841f4c-1be8-4e14-9e47-ccd82f7a0226/events");
request.Headers.Add("nestfac-api-key", Environment.GetEnvironmentVariable("NESTFAC_API_KEY"));
request.Headers.Add("nestfac-idempotency-key", "FEV8812-030");
var json = """
{
"billing_account_id": "3f6c2a9e-5b1d-4c7e-9a2f-8d1e0b4c6a71",
"event_code": "030",
"received_by": {
"document_type_code": "13",
"document_identification_number": "1075234567",
"first_name": "Laura",
"family_name": "Perdomo",
"job_title": "Auxiliar contable",
"organization_department": "Contabilidad"
}
}
""";
request.Content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await http.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
if (!response.IsSuccessStatusCode) throw new Exception($"{(int)response.StatusCode}: {result}");
Console.WriteLine(result);// Java 15+ (java.net.http)
import java.net.URI;
import java.net.http.*;
String json = """
{
"billing_account_id": "3f6c2a9e-5b1d-4c7e-9a2f-8d1e0b4c6a71",
"event_code": "030",
"received_by": {
"document_type_code": "13",
"document_identification_number": "1075234567",
"first_name": "Laura",
"family_name": "Perdomo",
"job_title": "Auxiliar contable",
"organization_department": "Contabilidad"
}
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api-sandbox.nestfac.co/api/v1/received-invoices/e3841f4c-1be8-4e14-9e47-ccd82f7a0226/events"))
.header("nestfac-api-key", System.getenv("NESTFAC_API_KEY"))
.header("nestfac-idempotency-key", "FEV8812-030")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString(json))
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() >= 400) throw new RuntimeException(response.body());
System.out.println(response.body());package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
body := `{
"billing_account_id": "3f6c2a9e-5b1d-4c7e-9a2f-8d1e0b4c6a71",
"event_code": "030",
"received_by": {
"document_type_code": "13",
"document_identification_number": "1075234567",
"first_name": "Laura",
"family_name": "Perdomo",
"job_title": "Auxiliar contable",
"organization_department": "Contabilidad"
}
}`
req, _ := http.NewRequest("POST", "https://api-sandbox.nestfac.co/api/v1/received-invoices/e3841f4c-1be8-4e14-9e47-ccd82f7a0226/events", strings.NewReader(body))
req.Header.Set("nestfac-api-key", os.Getenv("NESTFAC_API_KEY"))
req.Header.Set("nestfac-idempotency-key", "FEV8812-030")
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(out))
}// La API key NUNCA va en el navegador. React llama a TU backend,
// que agrega la key y la llave de idempotencia (pestaña Node.js).
async function enviar(datos) {
const res = await fetch("/api/nestfac/received-invoices/e3841f4c-1be8-4e14-9e47-ccd82f7a0226/events", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(datos),
});
const json = await res.json();
if (!res.ok) throw new Error(json.message ?? json.code);
return json.data;
}
// const resultado = await enviar(datosDeLaVenta);202 Accepted
{
"success": true,
"message": "Radian event received",
"data": {
"radian_event_id": "eaf5c00e-be58-4e2f-bef5-78e598ad7308",
"event_code": "030",
"status": "PENDING"
}
}Guarda el radian_event_id y consulta el evento hasta que la DIAN responda.
Los demás eventos
032 · recibo del bien o servicio
{
"billing_account_id": "3f6c2a9e-5b1d-4c7e-9a2f-8d1e0b4c6a71",
"event_code": "032",
"received_by": {
"document_type_code": "13",
"document_identification_number": "1075234567",
"first_name": "Laura",
"family_name": "Perdomo"
}
}033 · aceptación expresa
{
"billing_account_id": "3f6c2a9e-5b1d-4c7e-9a2f-8d1e0b4c6a71",
"event_code": "033"
}031 · reclamo
{
"billing_account_id": "3f6c2a9e-5b1d-4c7e-9a2f-8d1e0b4c6a71",
"event_code": "031",
"claim_concept": "03",
"note": "Llegaron 40 de las 50 cajas facturadas"
}Campos
Body
- billing_account_idstring (uuid)obligatorio
- Tu cuenta.
- event_codestringobligatorio
El evento. El
034lo emite el vendedor: ver Aceptación tácita.030031032033- received_byobjectobligatorio en 030 y 032
Quién recibió la factura (
030) o la mercancía (032).- document_type_codestringobligatorio
13cédula,22cédula de extranjería,31NIT…- document_identification_numberstringobligatorio
- Número de documento.
- dvstringobligatorio si el tipo es 31
- Dígito de verificación.
- first_namestringobligatorio
- Nombres.
- family_namestringobligatorio
- Apellidos.
- job_titlestring
- Cargo.
- organization_departmentstring
- Área.
- claim_conceptstringobligatorio en 031
Motivo del reclamo:
01documento con inconsistencias ·02mercancía no entregada totalmente ·03mercancía no entregada parcialmente ·04servicio no prestado.01020304- notestring
- Observaciones.
// Revisado contra la API el 24 de octubre de 2026.