SendISupportDocument -TestSetId Sencilla No Residente (Proveedor Extranjero)
Método: POST
URL: http://apidian2023.oo/api/ubl2.1/support-document
PRIMER ENVIO DE DOCUMENTO SOPORTE
- 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:
-
Asincrono: .../ubl2.1/invoice/iddelsetdepruebasdeladian
-
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
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
| Key | Value |
|---|---|
Content-Type | application/json |
Accept | application/json |
Body
{
"number": 5,
"type_document_id": 11,
"date": "2022-08-22",
"time": "12:09:38",
"notes": "SIN OBSERVACIONES",
"foot_note": "Modalidad de Emision de Facturas Electronicas: SOFTWARE PROPIO - Fabricante Software: TORRE SOFTWARE - Nit: 89008003-2",
"sendmail": true,
"sendmailtome": true,
"resolution_number": "18764031884389",
"prefix": "DS",
"establishment_name": "ALEXANDER OBANDO LONDOÑO",
"type_operation_id": 24,
"seller": {
"identification_number": "899212809099911",
"dv": "0",
"name": "BLANCA NUBIA ALVAREZ ALZATE ",
"phone": "3148931130",
"address": "CR 14 BIS 31 B 37 BRR SAN NICOLAS",
"email": "blancanubiaa@hotmail.com",
"merchant_registration": "0000-00",
"type_document_identification_id": 8,
"type_organization_id": 2,
"country_id": 65,
"municipality_name": "MIAMI",
"state_name": "FLORIDA",
"type_liability_id": 117,
"type_regime_id": 2,
"postal_zone_code": "630001"
},
"payment_form": {
"payment_form_id": 2,
"payment_method_id": 10,
"payment_due_date": "2022-09-12",
"duration_measure": "30"
},
"allowance_charges": [
{
"discount_id": 10,
"charge_indicator": false,
"allowance_charge_reason": "DESCUENTO GENERAL",
"amount": "0.00",
"base_amount": "200.00"
}
],
"legal_monetary_totals": {
"line_extension_amount": "200.00",
"tax_exclusive_amount": "200.00",
"tax_inclusive_amount": "200.00",
"allowance_total_amount": "0.00",
"charge_total_amount": "0.00",
"payable_amount": "200.00"
},
"tax_totals": [
{
"tax_id": 1,
"tax_amount": "0.00",
"percent": "0",
"taxable_amount": "200.00"
}
],
"invoice_lines": [
{
"unit_measure_id": 70,
"invoiced_quantity": "2.00",
"line_extension_amount": "200.00",
"free_of_charge_indicator": false,
"allowance_charges": [
{
"charge_indicator": false,
"allowance_charge_reason": "DESCUENTO GENERAL",
"amount": "0.00",
"base_amount": "200.00"
}
],
"tax_totals": [
{
"tax_id": 1,
"tax_amount": "0.00",
"percent": "0.00",
"taxable_amount": "200.00"
}
],
"description": "ARTICULO DE PRUEBAS",
"notes": "",
"code": "PRUEBA",
"type_item_identification_id": 4,
"price_amount": "100.00",
"base_quantity": "2.00",
"type_generation_transmition_id": 1,
"start_date": "2022-08-22"
}
]
}
Ejemplo cURL
curl -X POST "http://apidian2023.oo/api/ubl2.1/support-document" \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
--data-raw '{
"number": 5,
"type_document_id": 11,
"date": "2022-08-22",
"time": "12:09:38",
"notes": "SIN OBSERVACIONES",
"foot_note": "Modalidad de Emision de Facturas Electronicas: SOFTWARE PROPIO - Fabricante Software: TORRE SOFTWARE - Nit: 89008003-2",
"sendmail": true,
"sendmailtome": true,
"resolution_number": "18764031884389",
"prefix": "DS",
"establishment_name": "ALEXANDER OBANDO LONDOÑO",
"type_operation_id": 24,
"seller": {
"identification_number": "899212809099911",
"dv": "0",
"name": "BLANCA NUBIA ALVAREZ ALZATE ",
"phone": "3148931130",
"address": "CR 14 BIS 31 B 37 BRR SAN NICOLAS",
"email": "blancanubiaa@hotmail.com",
"merchant_registration": "0000-00",
"type_document_identification_id": 8,
"type_organization_id": 2,
"country_id": 65,
"municipality_name": "MIAMI",
"state_name": "FLORIDA",
"type_liability_id": 117,
"type_regime_id": 2,
"postal_zone_code": "630001"
},
"payment_form": {
"payment_form_id": 2,
"payment_method_id": 10,
"payment_due_date": "2022-09-12",
"duration_measure": "30"
},
"allowance_charges": [
{
"discount_id": 10,
"charge_indicator": false,
"allowance_charge_reason": "DESCUENTO GENERAL",
"amount": "0.00",
"base_amount": "200.00"
}
],
"legal_monetary_totals": {
"line_extension_amount": "200.00",
"tax_exclusive_amount": "200.00",
"tax_inclusive_amount": "200.00",
"allowance_total_amount": "0.00",
"charge_total_amount": "0.00",
"payable_amount": "200.00"
},
"tax_totals":
[
{
"tax_id": 1,
"tax_amount": "0.00",
"percent": "0",
"taxable_amount": "200.00"
}
],
"invoice_lines":
[
{
"unit_measure_id": 70,
"invoiced_quantity": "2.00",
"line_extension_amount": "200.00",
"free_of_charge_indicator": false,
"allowance_charges": [{
"charge_indicator": false,
"allowance_charge_reason": "DESCUENTO GENERAL",
"amount": "0.00",
"base_amount": "200.00"
}
],
"tax_totals":
[{
"tax_id": 1,
"tax_amount": "0.00",
"percent": "0.00",
"taxable_amount": "200.00"
}],
"description": "ARTICULO DE PRUEBAS",
"notes": "",
"code": "PRUEBA",
"type_item_identification_id": 4,
"price_amount": "100.00",
"base_quantity": "2.00",
"type_generation_transmition_id": 1,
"start_date": "2022-08-22"
}
]
}'