Enviar nota crédito para set de pruebas

Modo habilitación

Enviar nota crédito

POST https://isv.aliaddo.net/api/v1/public/documents/notes-cr/habilitation/{testSetId}

Enviar una nota crédito para set de pruebas, en modo habilitación.

Path Parameters

Name
Type
Description

testSetId

string

(UUID) Id de set de pruebas proporcionado por la DIAN para enviar documentos de prueba en modo habilitación para ser facturador electrónico

version

string

Versión de la API

Query Parameters

Name
Type
Description

isvInvoiceNoteCr

object

Objeto de la nota crédito

Headers

Name
Type
Description

x-api-key

string

Token generado previamente para autorizarse

{
	"id": "string",
	"mode": "string",
	"format": "string",
	"emailSender": "string",
	"testSetId": "string",
	"concept": "string",
	"prefix": "string",
	"consecutive": 0.0,
	"sequence": "string",
	"externalNumber": "string",
	"currencyCode": "string",
	"currencyRate": 0.0,
	"date": "2020-01-30T00:00:00",
	"dateStart": "2020-01-30T00:00:00",
	"dateEnd": "2020-01-31T00:00:00",
	"typeOfOperation": "string",
	"terms": "string",
	"remark": "string",
	"observation": "string",
	"cufe": "string",
	"qr": "string",
	"urlPdf": "string",
	"urlXmlDocument": "string",
	"urlXmlDocumentZip": "string",
	"urlXmlApplicationResponse": "string",
	"urlXmlAttachedDocument": "string",
	"UrlPdfEncoded": "string",
	"UrlXmlEncoded": "string",
	"dianDeliveryStatus": "string",
	"dianState": "string",
	"dianStateReason": "string",
	"sentEmail": false,
	"sentEmailAt": "0001-01-01T00:00:00",
	"invoicePrefix": "string",
	"invoiceConsecutive": 990005331,
	"invoiceCufe": "string",
	"invoiceDate": "2020-01-18T00:00:00",
	"branch": {
		"name": "string",
		"address": "string",
		"phone": "string",
		"countryCode": "string",
		"countryName": "string",
		"departamentCode": "string",
		"departamentName": "string",
		"cityCode": "string",
		"cityName": "string"
	},
	"resolution": {
		"resolutionKey": "string",
		"resolutionPrefix": "string",
		"resolutionNumber": 0.0,
		"resolutionRangeInitial": 0.0,
		"resolutionRangeFinal": 0.0,
		"resolutionValidFrom": "2019-01-19T00:00:00",
		"resolutionValidUntil": "2030-01-19T00:00:00"
	},
	"customer": {
		"companyName": "string",
		"personType": "string",
		"regimeType": "string",
		"firstName": "string",
		"lastName": "string",
		"identification": "string",
		"digitCheck": "string",
		"identificationTypeCode": "string",
		"email": "string",
		"phone": "string",
		"merchantRegistration": "string",
		"responsibilities": "string",
		"economicActivities": "string",
		"billingAddress": "string",
		"billingCountryName": "string",
		"billingCountryCode": "string",
		"billingRegionName": "string",
		"billingRegionCode": "string",
		"billingCityName": "string",
		"billingCityCode": "string",
		"billingPostalCode": "string",
		"billingNeighborhood": "string",
		"billingPhone": "string",
		"billingContactName": "string",
		"shippingAddress": "string",
		"shippingCountryName": "string",
		"shippingCountryCode": "string",
		"shippingRegionName": "string",
		"shippingRegionCode": "string",
		"shippingCityName": "string",
		"shippingCityCode": "string",
		"shippingPostalCode": "string",
		"shippingNeighborhood": "string",
		"shippingPhone": "string",
		"shippingContactName": "string"
	},
	"invoiceNoteDetails": [{
		"standardType": "string",
		"standardCode": "string",
		"itemCode": "string",
		"itemName": "string",
		"itemModel": "string",
		"description": "string",
		"brandName": "string",
		"itemCodeSupplier": "string",
		"isPresent": false,
		"unitMeasurementCode": "string",
		"unitMeasurementName": "string",
		"price": 0.0,
		"quantity": 0.0,
		"discountAmount": 0.0,
		"chargeAmount": 0.0,
		"subTotal": 0.0,
		"priceWithAllowanceCharge": 0.0,
		"totalWithAllowanceCharge": 0.0,
		"discounts": [{
			"name": "string",
			"type": "string",
			"rate": 0.0,
			"amount": 0.0
		}],
		"charges": [{
			"name": "string",
			"type": "string",
			"rate": 0.0,
			"amount": 0.0
		}],
		"taxes": [{
			"name": "string",
			"code": "string",
			"type": "string",
			"rate": 0.0,
			"amount": 0.0,
			"base": 0.0
		}],
		"withholdings": [{
			"name": "string",
			"code": "string",
			"type": "string",
			"rate": 0.0,
			"amount": 0.0,
			"base": 0.0
		}],
		"isvMandante": {
			"name": "string",
			"identification": "string",
			"digitCheck": "string",
			"identificationTypeCode": "string"
		}
	}],
	"totals": {
		"amount": 0.0,
		"prepaymentAmount": 0.0,
		"taxesAmount": 0.0,
		"withholdingAmount": 0.0,
		"discountsAmount": 0.0,
		"chargesAmount": 0.0
	},
	"discounts": [{
		"name": "string",
		"type": "string",
		"rate": 0.0,
		"amount": 0.0
	}],
	"charges": [{
		"name": "string",
		"type": "string",
		"rate": 0.0,
		"amount": 0.0
	}],
	"customFields": [{
		"key": "string",
		"value": "string"
	}],
	"invoiceConsecutiveWithPrefix": "string"
}

Código de ejemplo

using RestSharp;
using System;
using Newtonsoft.Json;

class Program
{
    public static void Main()
    {
        /**
            /notes-cr/habilitation/{testSetId}:
            - Enviar una nota crédito para set de pruebas, en modo habilitación
            - Instale RestSharp via Nuget: Install-Package RestSharp -Version 106.6.10
            - Instale Newtonsoft via Nuget: Install-Package Newtonsoft.Json
        */

        // Realizar request con TestId ejemplo 4bf6673a-7a71-496e-8cfd-f7246067e4ca, cambie este TestId por el que usted generó en la DIAN para habilitarse como facturador electrónico, si va realizar pruebas de conexión a la API puede realizarlo con el que esta en este ejemplo
        // Realizar request por metodo POST
        var request = new RestRequest("/notes-cr/habilitation/4bf6673a-7a71-496e-8cfd-f7246067e4ca", 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 débito con resolución ejemplo
        var isvInvoiceNoteCr = new
        {
            format = "Estandar",
            emailSender = "",
            concept = "1",
            consecutive = 6,
            externalNumber = "",
            currencyCode = "COP",
            currencyRate = 0,
            date = "2020-1-18",
            dateStart = "2020-1-18",
            dateEnd = "2020-1-20",
            typeOfOperation = "01",
            terms = "",
            remark = "",
            observation = "",
            invoicePrefix = "inv",
            invoiceConsecutive = 990004331,
            invoiceCufe = "aa2a047694318e5035cd93b3ffd5a12b829654c144b7cac0ac85ca5c0cb0430cfa3b477c4f7a75cf73f03f002f169162",
            invoiceDate = "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"
            },
            resolution = new
            {
                resolutionKey = "fc8eac422eba16e22ffd8c6f94b3f40a6e38162c",
                resolutionPrefix = "SETT",
                resolutionNumber = 18760000001,
                resolutionRangeInitial = 990000000,
                resolutionRangeFinal = 995000000,
                resolutionValidFrom = "2019-01-19",
                resolutionValidUntil = "2030-01-19"
            },
            customer = new
            {
                companyName = "Customer",
                personType = "1",
                regimeType = "04",
                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 = "",
                shippingAddress = "",
                shippingCountryName = "",
                shippingCountryCode = "",
                shippingRegionName = "",
                shippingRegionCode = "",
                shippingCityName = "",
                shippingCityCode = "",
                shippingPostalCode = "",
                shippingNeighborhood = "",
                shippingPhone = "",
                shippingContactName = ""
            },
            invoiceNoteDetails = new[]
            {
                new
                {
                    standardType = "",
                    standardCode = "",
                    itemCode = "0001",
                    itemName = "Item",
                    itemModel = "",
                    description = "Item prueba",
                    brandName = "",
                    itemCodeSupplier = "",
                    isPresent = false,
                    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
                }
            },
            customFields = new[]
            {
                new KeyValuePair<string, string>("NombreCampo", "ValorCampo")
            }
        };
        request.AddParameter("application/json", JsonConvert.SerializeObject(isvInvoiceNoteCr),
            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?