Skip to content

Check New Sales

Through this entry point, SDH will receive a new invoice for creation in order to validate the administration’s validation rules prior to the invoice being registered.

This entry point can be used to verify that the invoice data is valid before performing the invoice chaining and sending it to the administration.

Call

Depending on the destination regulation of the invoice, the required fields of the SalesInvoice class must be filled in.
Each regulation specifies which fields are required for a correct conversion of the format.

InvoicingClient client = new InvoicingClient();

...

SalesInvoice si = new()
{
    Number = "", 
    Series = "", 
    DateAndTime = DateTime.Parse(""), 
    ...
};
Solmicro.DigitalHub.Global.Dtos.OutEngineContainer result = client.CheckNewSales(si);
curl -X POST https://apitest.solmicrosdh.com/invoicing/checknewsales \
--cert /ruta/al/certificado.pfx \
--cert-type P12 \
--pass mypfxpassword \
-H "Content-Type: application/json" \
-H "CompanyId: guid-unico-empresa" \
-H "InstallationId: guid-unico-instalacion" \
-d '{ 
    "series": "string",
    "number": "string",
    "dateAndTime": "datetime",
    ...
}'

Result

if (result.ErrorMessages.Count() > 0) 
{
    // Iterate through the list and handle the errors

    return;
}
{
    "ContainerId": "string",
    "Results": [],
    "ErrorMessages": [
        {
            "Code": "string",
            "Text": "string"
        }
    ]
}