Enviar documento soporte en modo pruebas
Modo pruebas
Enviar documento soporte
POST
https://isv.aliaddo.net/api/v1/public/documents/support/test
Enviar un documento soporte a la DIAN en modo pruebas.
Path Parameters
Name
Type
Description
version
string
Versión de la API
Headers
Name
Type
Description
x-api-key
string
Token generado previamente para autenticarse
Request Body
Name
Type
Description
isvSupportDocument
string
Objeto del documento
{
"id": "string",
"cuds": "string",
"qr": "string",
"urlPdf": "string",
"urlPdf": "string",
"dianState": "string", // Procesando, Aprobada o Rechazada
"dianStateDate": "0001-01-01T00:00:00"",
"dianStateReason": "string",
"issueDate": "0001-01-01T00:00:00"
}
Código de ejemplo
using System;
using Newtonsoft.Json;
using RestSharp;
public class Program
{
public static void Main()
{
/**
- Enviar una documento soporte a la DIAN, en modo pruebas
- Instale RestSharp via Nuget: Install-Package RestSharp -Version 106.6.10
- Instale Newtonsoft via Nuget: Install-Package Newtonsoft.Json
*/
var request = new RestRequest("support/test", Method.POST);
// Limpiar parametros
request.Parameters.Clear();
// Adicionar cabeceras de autenticación con token Bearer generado en el panel izquierdo
request.AddHeader("x-api-key", "{{x-api-key}}");
// Tipo de requerimiento formato json
request.AddHeader("content-type", "application/json");
request.AddHeader("cache-control", "no-cache");
request.AddHeader("accept", "application/json");
request.RequestFormat = DataFormat.Json;
// Adicionando objeto con resolución ejemplo
var isvSupportDocument = new
{
code = "01",
format = "Estandar",
emailSender = "[email protected]",
consecutive = 990004332,
externalNumber = "54554",
currencyCode = "COP",
currencyRate = 0,
date = "2020-1-18",
dateDue = "2020-1-18",
dateStart = "2020-1-18",
dateEnd = "2020-1-20",
typeOfOperation = "10",
incoterms = "",
terms = "",
remark = "",
observation = "",
termDay = 0,
paymentMeanCode = "48",
branch = new {
name = "branch",
address = "Cl6 Cra 66",
phone = "7649813",
countryCode = "CO",
countryName = "Colombia",
departamentCode = "25",
departamentName = "Cundinamarca",
cityCode = "11001",
cityname = "Bogotá, D.c."
},
resolution = new
{
resolutionKey = "fc8eac422eba16e22ffd8c6f94b3f40a6e38162c",
resolutionPrefix = "SETT",
resolutionNumber = 18760000001,
resolutionRangeInitial = 990000000,
resolutionRangeFinal = 995000000,
resolutionValidFrom = "2019-01-19",
resolutionValidUntil = "2030-01-19"
},
supplier= new
{
companyName = "Customer",
personType = "1",
regimeType = "04",
firstName = "Customer",
lastName = "Customer",
identification = "000000001",
digitCheck = "8",
identificationTypeCode = "13",
email = "",
phone = "0000001",
merchantRegistration = "",
responsibleFor: "ZZ",
responsibilities = "R-99-PN",
economicActivities = "2817;3092",
billingAddress = "KR con Calle",
billingCountryName = "Colombia",
billingCountryCode = "CO",
billingRegionName = "Cundinamarca",
billingRegionCode = "25",
billingCityName = "Chipaque",
billingCityCode = "25178",
billingPostalCode = "",
billingNeighborhood = "",
billingPhone = "",
billingContactName = "",
shippingAddress = "",
shippingCountryName = "",
shippingCountryCode = "",
shippingRegionName = "",
shippingRegionCode = "",
shippingCityName = "",
shippingCityCode = "",
shippingPostalCode = "",
shippingNeighborhood = "",
shippingPhone = "",
shippingContactName = ""
},
supportDocumentDetails= new[]{
new {
standardType = "",
standardCode = "",
itemCode = "0001",
itemName = "Item",
itemModel = "",
description = "Item prueba",
brandName = "",
itemCodeSupplier = "",
isPresent = false,
isRemmitance: false,
remmitanceNumber: "",
remmitanceConsecutive: "",
remmitanceValue: 0,
remmitanceQuantityValue: 0,
remmitanceMeasurementUnit: "",
unitMeasurementCode = "NIU",
unitMeasurementName = "",
price = 25,
quantity = 2,
discounts = new[]{
new {
name = "",
type = "V",
rate = 1,
amount = 1
}
},
charges = new[]{
new {
name = "",
code = "01",
type = "V",
rate = 10,
amount = 10
}
},
taxes = new[]{
new {
name = "Iva",
code = "01",
type = "P",
rate = 20,
amount = 6.46
}
},
withholdings = new[]{
new {
name = "ReteFuente",
code = "06",
type = "P",
rate = 10,
amount = 3.4
}
},
isvMandante = new
{
name = "Mandante",
identification = "000001",
digitCheck = "8",
identificationTypeCode = "13"
}
}
},
totals = new
{
amount = 68,
prepaymentAmount = 0
},
discounts = new[]
{
new {
name = "",
type = "",
rate = 0,
amount = 0
}
},
charges = new[]
{
new {
name = "",
type = "V",
rate = 10,
amount = 10
}
},
customFields = new[]
{
new KeyValuePair<string, string>("NombreCampo", "ValorCampo")
}
};
request.AddParameter("application/json", JsonConvert.SerializeObject(isvSupportDocument ), ParameterType.RequestBody);
// Ejecutar request
var client = new RestClient("https://isv.aliaddo.net/api/v1/public/documents");
var response = client.Execute(request);
// Mostrar respuesta
Console.WriteLine((int) response.StatusCode);
Console.WriteLine(response.Content);
}
}
}
Última actualización
¿Te fue útil?