// Documentos electrónicos
Reemplazar nómina
Corrige una nómina aceptada con una nota de ajuste que la reemplaza por la versión corregida completa.
/api/v1/payroll/adjustmentsEn esta página
Una nómina aceptada no se modifica. Si te equivocaste en un valor o faltó un concepto, emites una nota de ajuste de reemplazo (tipo 1, XML 103): envías la nómina completa y corregida, y esa pasa a ser la vigente del trabajador en el mes.
Para dejar sin efecto la nómina, usa Eliminar nómina.
Reglas
- Ajusta siempre el documento vigente. El
predecessor_iddebe estar aceptado y no puede tener ya otro ajuste. En la consulta, es el que tienecurrent: true. - Mismo trabajador y mismo mes que la nómina original.
- Se envía todo, no solo lo que cambió. La nómina corregida reemplaza a la anterior completa.
- Una nómina eliminada no se puede ajustar.
Headers
| Header | Obligatorio | Valor |
|---|---|---|
nestfac-api-key |
Sí | Tu API key. Ver Autenticación. |
nestfac-idempotency-key |
Sí | Un valor único por ajuste. Ver Idempotencia. |
Content-Type |
Sí | application/json |
Ejemplo: faltó una bonificación
La nómina NEP1 de septiembre se transmitió sin una bonificación no salarial de $300.000. El neto pasa de $2.825.095 a $3.125.095.
curl -X POST "https://api-sandbox.nestfac.co/api/v1/payroll/adjustments" \
-H "nestfac-api-key: $NESTFAC_API_KEY" \
-H "nestfac-idempotency-key: NOM-2026-09-1075234567-AJ1" \
-H "Content-Type: application/json" \
-d '{
"adjustment_type": "1",
"predecessor_id": "90994cdd-0563-4749-ac15-983fbf193f0c",
"payroll": {
"billing_account_id": "3f6c2a9e-5b1d-4c7e-9a2f-8d1e0b4c6a71",
"establishment_id": "a2d4f6b8-1c3e-4a5b-9d7f-0e2c4b6a8d10",
"reference_code": "NOM-2026-09-1075234567-AJ1",
"period": {
"settlement_start": "2026-09-01",
"settlement_end": "2026-09-30",
"payroll_period_code": "5",
"payment_dates": [
"2026-09-30"
]
},
"employee": {
"document_identity_type_code": "13",
"document_identification_number": "1075234567",
"first_name": "Laura",
"other_names": "Marcela",
"first_surname": "Perdomo",
"second_surname": "Trujillo",
"worker_type": "01",
"worker_subtype": "00",
"contract_type": "2",
"salary": 2800000,
"hire_date": "2026-09-01",
"work_location": {
"country_code": "CO",
"municipality_code": "41001",
"address": "Calle 10 # 5-20"
}
},
"payment": {
"form_code": "1",
"method_code": "10"
},
"accruals": [
{
"concept": "BASIC",
"quantity": 30,
"amount": 2800000
},
{
"concept": "TRANSPORT_AID",
"amount": 249095
},
{
"concept": "BONUS",
"non_salary_amount": 300000
}
],
"deductions": [
{
"concept": "HEALTH",
"percent": 4,
"amount": 112000
},
{
"concept": "PENSION",
"percent": 4,
"amount": 112000
}
]
}
}'// Node.js 18+ (fetch nativo). Corre en TU servidor: la API key nunca va al navegador.
const body = {
"adjustment_type": "1",
"predecessor_id": "90994cdd-0563-4749-ac15-983fbf193f0c",
"payroll": {
"billing_account_id": "3f6c2a9e-5b1d-4c7e-9a2f-8d1e0b4c6a71",
"establishment_id": "a2d4f6b8-1c3e-4a5b-9d7f-0e2c4b6a8d10",
"reference_code": "NOM-2026-09-1075234567-AJ1",
"period": {
"settlement_start": "2026-09-01",
"settlement_end": "2026-09-30",
"payroll_period_code": "5",
"payment_dates": [
"2026-09-30"
]
},
"employee": {
"document_identity_type_code": "13",
"document_identification_number": "1075234567",
"first_name": "Laura",
"other_names": "Marcela",
"first_surname": "Perdomo",
"second_surname": "Trujillo",
"worker_type": "01",
"worker_subtype": "00",
"contract_type": "2",
"salary": 2800000,
"hire_date": "2026-09-01",
"work_location": {
"country_code": "CO",
"municipality_code": "41001",
"address": "Calle 10 # 5-20"
}
},
"payment": {
"form_code": "1",
"method_code": "10"
},
"accruals": [
{
"concept": "BASIC",
"quantity": 30,
"amount": 2800000
},
{
"concept": "TRANSPORT_AID",
"amount": 249095
},
{
"concept": "BONUS",
"non_salary_amount": 300000
}
],
"deductions": [
{
"concept": "HEALTH",
"percent": 4,
"amount": 112000
},
{
"concept": "PENSION",
"percent": 4,
"amount": 112000
}
]
}
};
const res = await fetch("https://api-sandbox.nestfac.co/api/v1/payroll/adjustments", {
method: "POST",
headers: {
"nestfac-api-key": process.env.NESTFAC_API_KEY,
"nestfac-idempotency-key": "NOM-2026-09-1075234567-AJ1",
"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 = {
"adjustment_type": "1",
"predecessor_id": "90994cdd-0563-4749-ac15-983fbf193f0c",
"payroll": {
"billing_account_id": "3f6c2a9e-5b1d-4c7e-9a2f-8d1e0b4c6a71",
"establishment_id": "a2d4f6b8-1c3e-4a5b-9d7f-0e2c4b6a8d10",
"reference_code": "NOM-2026-09-1075234567-AJ1",
"period": {
"settlement_start": "2026-09-01",
"settlement_end": "2026-09-30",
"payroll_period_code": "5",
"payment_dates": ["2026-09-30"],
},
"employee": {
"document_identity_type_code": "13",
"document_identification_number": "1075234567",
"first_name": "Laura",
"other_names": "Marcela",
"first_surname": "Perdomo",
"second_surname": "Trujillo",
"worker_type": "01",
"worker_subtype": "00",
"contract_type": "2",
"salary": 2800000,
"hire_date": "2026-09-01",
"work_location": {
"country_code": "CO",
"municipality_code": "41001",
"address": "Calle 10 # 5-20",
},
},
"payment": {
"form_code": "1",
"method_code": "10",
},
"accruals": [
{
"concept": "BASIC",
"quantity": 30,
"amount": 2800000,
},
{
"concept": "TRANSPORT_AID",
"amount": 249095,
},
{
"concept": "BONUS",
"non_salary_amount": 300000,
},
],
"deductions": [
{
"concept": "HEALTH",
"percent": 4,
"amount": 112000,
},
{
"concept": "PENSION",
"percent": 4,
"amount": 112000,
},
],
},
}
res = requests.post(
"https://api-sandbox.nestfac.co/api/v1/payroll/adjustments",
headers={
"nestfac-api-key": os.environ["NESTFAC_API_KEY"],
"nestfac-idempotency-key": "NOM-2026-09-1075234567-AJ1",
},
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 = [
'adjustment_type' => '1',
'predecessor_id' => '90994cdd-0563-4749-ac15-983fbf193f0c',
'payroll' => [
'billing_account_id' => '3f6c2a9e-5b1d-4c7e-9a2f-8d1e0b4c6a71',
'establishment_id' => 'a2d4f6b8-1c3e-4a5b-9d7f-0e2c4b6a8d10',
'reference_code' => 'NOM-2026-09-1075234567-AJ1',
'period' => [
'settlement_start' => '2026-09-01',
'settlement_end' => '2026-09-30',
'payroll_period_code' => '5',
'payment_dates' => ['2026-09-30'],
],
'employee' => [
'document_identity_type_code' => '13',
'document_identification_number' => '1075234567',
'first_name' => 'Laura',
'other_names' => 'Marcela',
'first_surname' => 'Perdomo',
'second_surname' => 'Trujillo',
'worker_type' => '01',
'worker_subtype' => '00',
'contract_type' => '2',
'salary' => 2800000,
'hire_date' => '2026-09-01',
'work_location' => [
'country_code' => 'CO',
'municipality_code' => '41001',
'address' => 'Calle 10 # 5-20',
],
],
'payment' => [
'form_code' => '1',
'method_code' => '10',
],
'accruals' => [
[
'concept' => 'BASIC',
'quantity' => 30,
'amount' => 2800000,
],
[
'concept' => 'TRANSPORT_AID',
'amount' => 249095,
],
[
'concept' => 'BONUS',
'non_salary_amount' => 300000,
],
],
'deductions' => [
[
'concept' => 'HEALTH',
'percent' => 4,
'amount' => 112000,
],
[
'concept' => 'PENSION',
'percent' => 4,
'amount' => 112000,
],
],
],
];
$ch = curl_init('https://api-sandbox.nestfac.co/api/v1/payroll/adjustments');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'nestfac-api-key: ' . getenv('NESTFAC_API_KEY'),
'nestfac-idempotency-key: NOM-2026-09-1075234567-AJ1',
'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/payroll/adjustments");
request.Headers.Add("nestfac-api-key", Environment.GetEnvironmentVariable("NESTFAC_API_KEY"));
request.Headers.Add("nestfac-idempotency-key", "NOM-2026-09-1075234567-AJ1");
var json = """
{
"adjustment_type": "1",
"predecessor_id": "90994cdd-0563-4749-ac15-983fbf193f0c",
"payroll": {
"billing_account_id": "3f6c2a9e-5b1d-4c7e-9a2f-8d1e0b4c6a71",
"establishment_id": "a2d4f6b8-1c3e-4a5b-9d7f-0e2c4b6a8d10",
"reference_code": "NOM-2026-09-1075234567-AJ1",
"period": {
"settlement_start": "2026-09-01",
"settlement_end": "2026-09-30",
"payroll_period_code": "5",
"payment_dates": [
"2026-09-30"
]
},
"employee": {
"document_identity_type_code": "13",
"document_identification_number": "1075234567",
"first_name": "Laura",
"other_names": "Marcela",
"first_surname": "Perdomo",
"second_surname": "Trujillo",
"worker_type": "01",
"worker_subtype": "00",
"contract_type": "2",
"salary": 2800000,
"hire_date": "2026-09-01",
"work_location": {
"country_code": "CO",
"municipality_code": "41001",
"address": "Calle 10 # 5-20"
}
},
"payment": {
"form_code": "1",
"method_code": "10"
},
"accruals": [
{
"concept": "BASIC",
"quantity": 30,
"amount": 2800000
},
{
"concept": "TRANSPORT_AID",
"amount": 249095
},
{
"concept": "BONUS",
"non_salary_amount": 300000
}
],
"deductions": [
{
"concept": "HEALTH",
"percent": 4,
"amount": 112000
},
{
"concept": "PENSION",
"percent": 4,
"amount": 112000
}
]
}
}
""";
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 = """
{
"adjustment_type": "1",
"predecessor_id": "90994cdd-0563-4749-ac15-983fbf193f0c",
"payroll": {
"billing_account_id": "3f6c2a9e-5b1d-4c7e-9a2f-8d1e0b4c6a71",
"establishment_id": "a2d4f6b8-1c3e-4a5b-9d7f-0e2c4b6a8d10",
"reference_code": "NOM-2026-09-1075234567-AJ1",
"period": {
"settlement_start": "2026-09-01",
"settlement_end": "2026-09-30",
"payroll_period_code": "5",
"payment_dates": [
"2026-09-30"
]
},
"employee": {
"document_identity_type_code": "13",
"document_identification_number": "1075234567",
"first_name": "Laura",
"other_names": "Marcela",
"first_surname": "Perdomo",
"second_surname": "Trujillo",
"worker_type": "01",
"worker_subtype": "00",
"contract_type": "2",
"salary": 2800000,
"hire_date": "2026-09-01",
"work_location": {
"country_code": "CO",
"municipality_code": "41001",
"address": "Calle 10 # 5-20"
}
},
"payment": {
"form_code": "1",
"method_code": "10"
},
"accruals": [
{
"concept": "BASIC",
"quantity": 30,
"amount": 2800000
},
{
"concept": "TRANSPORT_AID",
"amount": 249095
},
{
"concept": "BONUS",
"non_salary_amount": 300000
}
],
"deductions": [
{
"concept": "HEALTH",
"percent": 4,
"amount": 112000
},
{
"concept": "PENSION",
"percent": 4,
"amount": 112000
}
]
}
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api-sandbox.nestfac.co/api/v1/payroll/adjustments"))
.header("nestfac-api-key", System.getenv("NESTFAC_API_KEY"))
.header("nestfac-idempotency-key", "NOM-2026-09-1075234567-AJ1")
.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 := `{
"adjustment_type": "1",
"predecessor_id": "90994cdd-0563-4749-ac15-983fbf193f0c",
"payroll": {
"billing_account_id": "3f6c2a9e-5b1d-4c7e-9a2f-8d1e0b4c6a71",
"establishment_id": "a2d4f6b8-1c3e-4a5b-9d7f-0e2c4b6a8d10",
"reference_code": "NOM-2026-09-1075234567-AJ1",
"period": {
"settlement_start": "2026-09-01",
"settlement_end": "2026-09-30",
"payroll_period_code": "5",
"payment_dates": [
"2026-09-30"
]
},
"employee": {
"document_identity_type_code": "13",
"document_identification_number": "1075234567",
"first_name": "Laura",
"other_names": "Marcela",
"first_surname": "Perdomo",
"second_surname": "Trujillo",
"worker_type": "01",
"worker_subtype": "00",
"contract_type": "2",
"salary": 2800000,
"hire_date": "2026-09-01",
"work_location": {
"country_code": "CO",
"municipality_code": "41001",
"address": "Calle 10 # 5-20"
}
},
"payment": {
"form_code": "1",
"method_code": "10"
},
"accruals": [
{
"concept": "BASIC",
"quantity": 30,
"amount": 2800000
},
{
"concept": "TRANSPORT_AID",
"amount": 249095
},
{
"concept": "BONUS",
"non_salary_amount": 300000
}
],
"deductions": [
{
"concept": "HEALTH",
"percent": 4,
"amount": 112000
},
{
"concept": "PENSION",
"percent": 4,
"amount": 112000
}
]
}
}`
req, _ := http.NewRequest("POST", "https://api-sandbox.nestfac.co/api/v1/payroll/adjustments", strings.NewReader(body))
req.Header.Set("nestfac-api-key", os.Getenv("NESTFAC_API_KEY"))
req.Header.Set("nestfac-idempotency-key", "NOM-2026-09-1075234567-AJ1")
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/payroll/adjustments", {
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);{
"success": true,
"message": "Payroll replace adjustment received",
"data": {
"payroll_id": "54568e69-3eb5-419c-962c-d30f13874d60",
"predecessor_id": "90994cdd-0563-4749-ac15-983fbf193f0c",
"adjustment_type": "1",
"full_number": "NAP2",
"cune": "96fd60e5255dfc31737d15d996ab8b5c87454240dbb07d275ffca5fe0b9ff0a2981590ee3054c43757c6343c7698f43b",
"status": "PENDING",
"net_total": "3125095.00"
}
}El payroll_id de la respuesta es el nuevo documento. Consúltalo hasta que la DIAN responda; cuando quede aceptado, la nómina original pasa a current: false.
Campos
Body
- adjustment_typestringobligatorio
1reemplazar.1- predecessor_idstring (uuid)obligatorio
- La nómina vigente que se reemplaza.
- payrollobjectobligatorio
La nómina corregida, con todos los campos de Crear nómina, incluidos
billing_account_idyestablishment_id.
// Revisado contra la API el 24 de octubre de 2026.