Skip to main content

Sendpayroll-TestSetId Sencilla

Método: POST
URL: https://apidian2024.oo/api/ubl2.1/payroll/8a92b8cc-b061-4af4-bc4e-4b63fe24833e

PRIMER ENVIO DE NOMINA ELECTRONICA

  • Si se instalo un dominio se debe utilizar de la siguiente manera:

http://midominio.com/api/ubl2.1/invoice

  • Requiere un token de autorizacion el cual fue devuelto al realizar el Paso 1 - Config Company, si este token se extravio, se puede consultar en la tabla de la base de datos de la API en la tabla users, en el campo API_TOKEN.

  • En URL el ultimo parametro corresponde al id del set de pruebas que la dian entrego al momento de registrar el modo de operacion software propio.

.../ubl2.1/invoice/iddelsetdepruebasdeladian

  • Este endpoint se puede utilizar de dos modos:
  1. Asincrono: .../ubl2.1/invoice/iddelsetdepruebasdeladian

  2. Sincrono: .../ubl2.1/invoice

  • El modo sincrono no afecta al set de pruebas, pero la respuesta de la DIAN incluye posibles errores de validacion y estado de la factura, valida o no valida.

  • El modo asincrono, afecta el set de pruebas y en la respuesta no se incluye el resultado de la factura, solo se entrega un ZIP_KEY el cual debe ser consultado mediante el endpoint:

.../ubl2.1/status/zip

  • Una vez habilitado el software propio, debera cambiar el entorno a produccion y realizar el envio de la factura sin el id del set de pruebas, es decir modo síncrono.

de la seccion 03 - Consultas de estado para asi poder establecer si la factura fue valida o no y los errores de validacion.

Autenticación

  • Tipo: Bearer Token
  • Header: Authorization: Bearer <TOKEN>

Headers

KeyValue
Content-Typeapplication/json
Acceptapplication/json

Body

{
"type_document_id": 9,
"establishment_name": "TORRE SOFTWARE",
"establishment_address": "CLL 11 NRO 21-73 BRR LA CABAÑA",
"establishment_phone": "3226563672",
"establishment_municipality": 600,
"resolution_number": 99,
"establishment_email": "alternate_email@alternate.com",
"head_note": "PRUEBA DE TEXTO LIBRE QUE DEBE POSICIONARSE EN EL ENCABEZADO DE PAGINA DE LA REPRESENTACION GRAFICA DE LA FACTURA ELECTRONICA VALIDACION PREVIA DIAN",
"foot_note": "PRUEBA DE TEXTO LIBRE QUE DEBE POSICIONARSE EN EL PIE DE PAGINA DE LA REPRESENTACION GRAFICA DE LA FACTURA ELECTRONICA VALIDACION PREVIA DIAN",
"novelty":{
"novelty": false,
"uuidnov": ""
},
"period":{
"admision_date": "2018-10-10",// Fecha ingreso (AAAA-MM-DD)
"settlement_start_date": "2021-07-01",// Inicio liquidación (AAAA-MM-DD)
"settlement_end_date": "2021-07-31",// Fin liquidación (AAAA-MM-DD)
"worked_time": "785.00",// Tiempo laborado en la empresa
"issue_date": "2021-07-28"// Fecha de emisión (AAAA-MM-DD)
},
"sendmail": false,
"sendmailtome": false,
"worker_code": "41946692",
"prefix": "NI",
"consecutive": 804,
"payroll_period_id": 4,// Periodicidad nómina (mensual, quincenal, etc.)
"notes": "PRUEBA DE ENVIO DE NOMINA ELECTRONICA",
"worker": {
"type_worker_id": 1,// Tipo de trabajador (ver tabla type_workers)
"sub_type_worker_id": 1,// Subtipo de trabajador (ver tabla sub_type_workers)
"payroll_type_document_identification_id": 3,// Tipo doc. ID (ver tabla correspondiente)
"municipality_id": 822,
"type_contract_id": 1,// Tipo de contrato (ver tabla type_contracts)
"high_risk_pension": false,// ¿Pensión alto riesgo? (true/false)
"identification_number": 41946692,
"surname": "CARDONA",
"second_surname": "VILLADA",
"first_name": "ELIZABETH",
"middle_name": null,
"address": "BRR LIMONAR MZ 6 CS 3 ET 1",
"integral_salarary": false,// ¿Salario integral? (true/false)
"salary": "1500000.00",
"email": "somemail@somehost.com"
},
"payment": {
"payment_method_id": 10,
"bank_name": "BANCO DAVIVIENDA",
"account_type": "AHORROS",
"account_number": "126070603280"
},
"payment_dates": [
{
"payment_date": "2021-03-10"
}
],
"accrued": {
"worked_days": 30,
"salary": "750000.00",
"transportation_allowance": "115000.00",
"accrued_total": "859000.00"
},
"deductions": {
"eps_type_law_deductions_id": 1,
"eps_deduction": "60000.00",
"pension_type_law_deductions_id": 5,
"pension_deduction": "60000.00",
"deductions_total": "120000.00"
}
}

Ejemplo cURL

curl -X POST "https://apidian2024.oo/api/ubl2.1/payroll/8a92b8cc-b061-4af4-bc4e-4b63fe24833e" \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
--data-raw '{
"type_document_id": 9,
"establishment_name": "TORRE SOFTWARE",
"establishment_address": "CLL 11 NRO 21-73 BRR LA CABAÑA",
"establishment_phone": "3226563672",
"establishment_municipality": 600,
"resolution_number": 99,
"establishment_email": "alternate_email@alternate.com",
"head_note": "PRUEBA DE TEXTO LIBRE QUE DEBE POSICIONARSE EN EL ENCABEZADO DE PAGINA DE LA REPRESENTACION GRAFICA DE LA FACTURA ELECTRONICA VALIDACION PREVIA DIAN",
"foot_note": "PRUEBA DE TEXTO LIBRE QUE DEBE POSICIONARSE EN EL PIE DE PAGINA DE LA REPRESENTACION GRAFICA DE LA FACTURA ELECTRONICA VALIDACION PREVIA DIAN",
"novelty":{
"novelty": false,
"uuidnov": ""
},
"period":{
"admision_date": "2018-10-10",// Fecha ingreso (AAAA-MM-DD)
"settlement_start_date": "2021-07-01",// Inicio liquidación (AAAA-MM-DD)
"settlement_end_date": "2021-07-31",// Fin liquidación (AAAA-MM-DD)
"worked_time": "785.00",// Tiempo laborado en la empresa
"issue_date": "2021-07-28"// Fecha de emisión (AAAA-MM-DD)
},
"sendmail": false,
"sendmailtome": false,
"worker_code": "41946692",
"prefix": "NI",
"consecutive": 804,
"payroll_period_id": 4,// Periodicidad nómina (mensual, quincenal, etc.)
"notes": "PRUEBA DE ENVIO DE NOMINA ELECTRONICA",
"worker": {
"type_worker_id": 1,// Tipo de trabajador (ver tabla type_workers)
"sub_type_worker_id": 1,// Subtipo de trabajador (ver tabla sub_type_workers)
"payroll_type_document_identification_id": 3,// Tipo doc. ID (ver tabla correspondiente)
"municipality_id": 822,
"type_contract_id": 1,// Tipo de contrato (ver tabla type_contracts)
"high_risk_pension": false,// ¿Pensión alto riesgo? (true/false)
"identification_number": 41946692,
"surname": "CARDONA",
"second_surname": "VILLADA",
"first_name": "ELIZABETH",
"middle_name": null,
"address": "BRR LIMONAR MZ 6 CS 3 ET 1",
"integral_salarary": false,// ¿Salario integral? (true/false)
"salary": "1500000.00",
"email": "somemail@somehost.com"
},
"payment": {
"payment_method_id": 10,
"bank_name": "BANCO DAVIVIENDA",
"account_type": "AHORROS",
"account_number": "126070603280"
},
"payment_dates": [
{
"payment_date": "2021-03-10"
}
],
"accrued": {
"worked_days": 30,
"salary": "750000.00",
"transportation_allowance": "115000.00",
"accrued_total": "859000.00"
},
"deductions": {
"eps_type_law_deductions_id": 1,
"eps_deduction": "60000.00",
"pension_type_law_deductions_id": 5,
"pension_deduction": "60000.00",
"deductions_total": "120000.00"
}
}'

Probar endpoint

POST
Enviar Nómina (opcional TestSetId)
BASE URL
Se guarda localmente en tu navegador.
BEARER TOKEN
Se guarda solo en esta sesión/pestaña.
PATH PARAMS
TestSetId (opcional)
URL FINAL
/api/ubl2.1/payroll
BODY JSON
RESPUESTA
Envía la solicitud para ver la respuesta aquí.