UNPKG

facturapi

Version:

SDK oficial de Facturapi para Node.js y navegadores. Integra facturación electrónica en México (CFDI) de forma simple y obtén una perspectiva fiscal completa de tu operación, con búsquedas indexadas, envío de documentos y trazabilidad.

58 lines (57 loc) 1.99 kB
import { BinaryDownload, GenericResponse, Retention, SearchResult, SendEmailBody } from '../types'; import { WrapperClient } from '../wrapper'; export default class Retentions { client: WrapperClient; constructor(client: WrapperClient); /** * Creates a new valid retention (CFDI). * @param data * @returns */ create(data: Record<string, any>): Promise<Retention>; /** * Gets a paginated list of retentions created by the organization * @param params - Search parameters * @returns */ list(params?: Record<string, any> | null): Promise<SearchResult<Retention>>; /** * Gets a single retention object * @param id * @returns */ retrieve(id: string): Promise<Retention>; /** * Cancels a retention. * @param id * @param params - Optional cancellation parameters (e.g., motive, substitution) * @returns */ cancel(id: string, params?: Record<string, any>): Promise<Retention>; /** * Sends a retention to the customer's email * @param id Retention Id * @param data Additional arguments * @param data.email Email address to send the retention to * @returns */ sendByEmail(id: string, data?: SendEmailBody): Promise<GenericResponse>; /** * Downloads the specified retention in PDF format * @param id Retention Id * @returns PDF file in a stream (Node.js) or Blob (browser) */ downloadPdf(id: string): Promise<BinaryDownload>; /** * Downloads the specified retention in XML format * @param id Retention Id * @returns XML file in a stream (Node.js) or Blob (browser) */ downloadXml(id: string): Promise<BinaryDownload>; /** * Downloads the specified retention in a ZIP package containing both PDF and XML files * @param id Retention Id * @returns ZIP file in a stream (Node.js) or Blob (browser) */ downloadZip(id: string): Promise<BinaryDownload>; }