Enviar nota de ajuste

Modo producción

Enviar nota de ajuste

POST https://isv.aliaddo.net/api/v1/public/documents/support/adjustments

Enviar una nota de ajuste en modo producción a la DIAN.

Path Parameters

Name
Type
Description

version

string

Versión de la API

Headers

Name
Type
Description

x-api-key

string

Token generado previamente para autorizarse

Request Body

Name
Type
Description

isvNoteAdjustments

object

Objeto de la nota de ajuste

{
	"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 RestSharp;
using System;
using Newtonsoft.Json;

class Program
{
    public static void Main()
    {
        /**
            - Enviar una nota de ajuste en modo producción
            - Instale RestSharp via Nuget: Install-Package RestSharp -Version 106.6.10
            - Instale Newtonsoft via Nuget: Install-Package Newtonsoft.Json
        */

        // Realizar request por metodo POST
        var request = new RestRequest("/support", 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 nota de ajuste con resolución ejemplo
        var isvNote = new
        {
            format = "Estandar",
            concept = "1",
            consecutive = 6,
            externalNumber = "",
            currencyCode = "COP",
            currencyRate = 0,
            date = "2020-1-18",
            dateStart = "2020-1-18",
            dateEnd = "2020-1-20",
            notes = new [
                "string"
            ],
            supportDocumentPrefix= "inv",
            supportDocumentConsecutive = 990004331,
            supportDocumentCuds= "aa2a047694318e5035cd93b3ffd5a12b829654c144b7cac0ac85ca5c0cb0430cfa3b477c4f7a75cf73f03f002f169162",
            supportDocumentDate = "2020-1-18",
            branch = new
            {
                name = "Sucursal",
                address = "KR con CLL",
                phone = "000000",
                countryCode = "CO",
                countryName = "COLOMBIA",
                departamentCode = "25",
                departamentName = "Cundinamarca",
                cityCode = "25178",
                cityName = "Chipaque"
            },
            supplier = new
            {
                companyName = "Customer",
                personType = "1",
                firstName = "Customer",
                lastName = "Customer",
                identification = "000000001",
                digitCheck = "8",
                identificationTypeCode = "13",
                email = "[email protected]",
                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 = ""
            },
            supportDocumentAdjustmentDetails = new[]
            {
                new
                {
                    standardType = "",
                    standardCode = "",
                    itemCode = "0001",
                    itemName = "Item",
                    itemModel = "",
                    description = "Item prueba",
                    brandName = "",
                    itemCodeSupplier = "",
                    isPresent = false, 
                    isRemmitance: true,
                    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 = "",
                            type = "V",
                            rate = 10,
                            amount = 10
                        }
                    },
                    taxes = new[]
                    {
                        new
                        {
                            name = "Iva",
                            code = "01",
                            type = "P",
                            rate = 19,
                            amount = 6.46
                        }
                    },
                    withholdings = new[]
                    {
                        new
                        {
                            name = "ReteFuente",
                            code = "06",
                            type = "P",
                            rate = 10,
                            amount = 3.4
                        }
                    },
                    isvMandante = new
                    {
                        name = "Mandante",
                        identification = "001",
                        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
                }
            }
        };
        request.AddParameter("application/json", JsonConvert.SerializeObject(isvNote), 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?