Skip to content

Correct Delete Sales

Through this entry point, SDH will receive the correction of the cancellation of an invoice that previously received a rejection.
It includes the following steps:

  • Validation of the relevant administration rules.
  • For TicketBAI: sending the Zuzendu to the administration and processing the response.
    For Veri*Factu: invoice chaining and deferred delivery.

Call

The required data for this operation are the invoice series and number.

InvoicingClient client = new InvoicingClient();

...

Solmicro.DigitalHub.Global.Dtos.OutEngineContainer result = client.CorrectDeleteSales(series, number);
curl -X POST https://apitest.solmicrosdh.com/invoicing/correctdeletesales \
--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"
}'

Result

Veri*Factu

For this regulation, the invoice remains pending delivery to the administration service and SDH will deliver it later.
The result will be an object of type VeriFactuResult containing the following information:

  • SalesInvoiceId: Unique identifier of the invoice in SDH’s database.
  • Hash: Invoice hash.
  • DateAndTime: Invoice issue date.
  • PreviousSeries: Series of the invoice used for chaining.
  • PreviousNumber: Number of the invoice used for chaining.
  • PreviousDateAndTime: Date of the invoice used for chaining.
  • DestinationStateDateAndTime: Date when it was processed in SDH.
  • For the rest of the fields see the result information.
if (result.ErrorMessages.Count() > 0) 
{
    // Iterate through the list and handle the errors

    return;
}
VeriFactuResult vfResult = result.OfType<VeriFactuResult>().FirstOrDefault();
if (vfResult is not null)
{
    vfResult.SalesInvoiceId;
    vfResult.Hash;
    vfResult.DateAndTime;
    vfResult.PreviousSeries;
    vfResult.PreviousNumber;
    vfResult.PreviousDateAndTime;
    vfResult.DestinationStateDateAndTime;
    ...
}
{
    "ContainerId": "string",
    "Results": [],
    "ErrorMessages": [
        {
            "Code": "string",
            "Text": "string"
        }
    ]
}

Veri*Factu

{
    "SalesInvoiceId": "string",
    "Hash": "string",
    "DateAndTime": "datetime",
    "PreviousSeries": "string",
    "PreviousNumber": "string",
    "PreviousDateAndTime": "datetime",
    "DestinationStateDateAndTime": "datetime",
    ...
}