Skip to content

Delete Sales

Through this entry point, SDH will receive the cancellation of an invoice.
It includes the following steps:

  • Validation of the relevant administration rules.
  • For TicketBAI: sending 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.Interfaces.List<IResult> results = client.DeleteSales(series, number);
curl -X POST https://apitest.solmicrosdh.com/v2.0/Invoicing/DeleteSales \
--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

*VeriFactu

For this regulation, the invoice remains pending delivery to the administration service, and SDH will deliver it later.
The response is a result list (List<IResult>) with a VeriFactuResult item containing the following information:

  • SalesInvoiceId: Unique identifier of the invoice in SDH’s database.
  • Hash: Invoice fingerprint.
  • DateAndTime: Date the invoice was issued.
  • 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 response services.
VeriFactuResult result = results.OfType<VeriFactuResult>().FirstOrDefault();
if (result is not null)
{
    result.SalesInvoiceId
    result.Hash
    result.DateAndTime
    result.PreviousSeries
    result.PreviousNumber
    result.PreviousDateAndTime
    result.DestinationStateDateAndTime
    ...
}
[
    {
        "SalesInvoiceId": "string",
        "Hash": "string",
        "DateAndTime": "datetime",
        "PreviousSeries": "string",
        "PreviousNumber": "string",
        "PreviousDateAndTime": "datetime",
        "DestinationStateDateAndTime": "datetime",
        ...
    }
]

TicketBAI

For this regulation, the invoice is delivered directly to the administration service.
The response is a result list (List<IResult>) with a TicketBAIResult item containing the following information:

TicketBAIResult result = results.OfType<TicketBAIResult>().FirstOrDefault();
if (result is not null)
{
    result.SalesInvoiceId
    ...
}
[
    {
        "SalesInvoiceId": "string",
        ...
    }
]