Skip to content

Commit 2a3ea7f

Browse files
committed
Version 4.0.124
1 parent 98cbb40 commit 2a3ea7f

File tree

4 files changed

+97
-2
lines changed

4 files changed

+97
-2
lines changed

Abstractions/IInvoiceService.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ namespace Fiscalapi.Abstractions
99
/// </summary>
1010
public interface IInvoiceService : IFiscalApiService<Invoice>
1111
{
12-
1312
// Cancel any type of invoice
1413
Task<ApiResponse<CancelInvoiceResponse>> CancelAsync(CancelInvoiceRequest requestModel);
1514

@@ -21,5 +20,9 @@ public interface IInvoiceService : IFiscalApiService<Invoice>
2120

2221
// Send invoice to the email
2322
Task<ApiResponse<bool>> SendAsync(SendInvoiceRequest requestModel);
23+
24+
25+
// Get invoice status
26+
Task<ApiResponse<InvoiceStatusResponse>> GetStatusAsync(InvoiceStatusRequest requestModel);
2427
}
2528
}

Models/Invoice.cs

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System;
33
using System.Collections.Generic;
44
using Fiscalapi.Common;
5+
using System.ComponentModel.DataAnnotations;
56

67
namespace Fiscalapi.Models
78
{
@@ -263,4 +264,89 @@ public enum FileType
263264
CertificateCsd,
264265
PrivateKeyCsd,
265266
}
267+
268+
269+
/// <summary>
270+
/// Modelo para consultar el estado de facturas (CFDI)
271+
/// Permite consultar por referencias (usando id) o por valores (usando los demás campos)
272+
/// </summary>
273+
public class InvoiceStatusRequest
274+
{
275+
/// <summary>
276+
/// Id de la factura a consultar. Obligatorio cuando se consulta por referencias.
277+
/// </summary>
278+
279+
public string Id { get; set; }
280+
281+
/// <summary>
282+
/// RFC Emisor de la factura. Obligatorio cuando se consulta por valores.
283+
/// </summary>
284+
285+
public string IssuerTin { get; set; }
286+
287+
/// <summary>
288+
/// RFC Receptor de la factura. Obligatorio cuando se consulta por valores.
289+
/// </summary>
290+
291+
public string RecipientTin { get; set; }
292+
293+
/// <summary>
294+
/// Total de la factura. Obligatorio cuando se consulta por valores.
295+
/// </summary>
296+
297+
public decimal InvoiceTotal { get; set; }
298+
299+
/// <summary>
300+
/// Folio fiscal de la factura a consultar. Obligatorio tanto para consultas por referencias como por valores.
301+
/// </summary>
302+
303+
public string InvoiceUuid { get; set; }
304+
305+
/// <summary>
306+
/// Últimos ocho caracteres del sello digital del emisor. Obligatorio cuando se consulta por valores.
307+
/// </summary>
308+
309+
public string Last8DigitsIssuerSignature { get; set; }
310+
}
311+
312+
/// <summary>
313+
/// Modelo de respuesta de consulta de estado de facturas
314+
/// Contiene la información del estado de una factura consultada
315+
/// </summary>
316+
public class InvoiceStatusResponse
317+
{
318+
/// <summary>
319+
/// Código de estatus retornado por el SAT.
320+
/// </summary>
321+
public string StatusCode { get; set; }
322+
323+
/// <summary>
324+
/// Estado actual de la factura.
325+
/// Posibles valores: 'Vigente' | 'Cancelado' | 'No Encontrado'
326+
/// </summary>
327+
public string Status { get; set; }
328+
329+
/// <summary>
330+
/// Indica si la factura es cancelable.
331+
/// Posibles valores: 'Cancelable con aceptación' | 'No cancelable' | 'Cancelable sin aceptación'
332+
/// </summary>
333+
public string CancelableStatus { get; set; }
334+
335+
/// <summary>
336+
/// Detalle del estatus de cancelación.
337+
/// Posibles valores: null | 'En proceso' | 'Plazo vencido' | 'Solicitud rechazada' |
338+
/// 'Cancelado sin aceptación' | 'Cancelado con aceptación'
339+
/// </summary>
340+
341+
public string CancellationStatus { get; set; }
342+
343+
/// <summary>
344+
/// Codigo que indica si el RFC Emisor se encuentra dentro de la lista negra de
345+
/// Empresas que Facturan Operaciones Simuladas (EFOS).
346+
/// Posible valores:
347+
/// 100: El RFC Emisor se encuentra dentro de la lista de EFOS.
348+
/// 200: El RFC Emisor no se encuentra dentro de la lista de EFOS.
349+
/// </summary>
350+
public string EfosValidation { get; set; }
351+
}
266352
}

Services/InvoiceService.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,5 +78,11 @@ public Task<ApiResponse<bool>> SendAsync(SendInvoiceRequest requestModel)
7878
// POST /api/v4/invoices/send
7979
return HttpClient.PostAsync<bool>(BuildEndpoint("send"), requestModel);
8080
}
81+
82+
public Task<ApiResponse<InvoiceStatusResponse>> GetStatusAsync(InvoiceStatusRequest requestModel)
83+
{
84+
// POST /api/v4/invoices/status
85+
return HttpClient.PostAsync<InvoiceStatusResponse>(BuildEndpoint("status"), requestModel);
86+
}
8187
}
8288
}

fiscalapi-net.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFrameworks>netstandard2.0;net461;net48;netcoreapp3.1;net5.0;net6.0;net8.0</TargetFrameworks>
5-
<Version>4.0.120</Version>
5+
<Version>4.0.124</Version>
66
<AssemblyVersion>$(Version)</AssemblyVersion>
77
<FileVersion>$(Version)</FileVersion>
88
<PackageVersion>$(Version)</PackageVersion>

0 commit comments

Comments
 (0)