facturapi-es6
Version:
FacturAPI makes it easy for developers to generate valid Invoices in Mexico (known as Factura Electrónica or CFDI).
162 lines (161 loc) • 4.63 kB
TypeScript
declare class Wrapper {
client: any;
t: any;
constructor(apiKey: string);
listCustomers(params: {}): any;
/**
* Gets a single customer object
* @param {string} id
*/
retrieveCustomer(id: string): any;
/**
* Creates a new customer in your organization
* @param {Object} data
*/
createCustomer(data: any): any;
/**
* Updates a customer
* @param {string} id
* @param {Object} data
*/
updateCustomer(id: string, data: any): any;
/**
* Permanently removes a customer from your organization.
* @param {string} id
*/
removeCustomer(id: string): any;
/**
* Gets a paginated list of products that belong to your organization
* @param {Object} params
*/
listProducts(params: {}): any;
/**
* Gets a single product object
* @param {string} id
*/
retrieveProduct(id: string): any;
/**
* Creates a new product in your organization
* @param {Object} data
*/
createProduct(data: any): any;
/**
* Updates a product
* @param {string} id
* @param {object} data
*/
updateProduct(id: string, data: any): any;
/**
* Permanently removes a product from your organization
* @param {string} id
*/
removeProduct(id: string): any;
/**
* Searches product keys by criteria "q"
* @param {string} q
*/
keys(q: any): any;
/**
* Searches product units by criteria "q"
* @param {string} q
*/
units(q: any): any;
/**
* Gets a paginated list of invoices created by your organization
* @param {Object} params
*/
listInvoices(params: {}): any;
/**
* Gets a single invoice object
* @param {string} id
* @returns {Promise<Object>} Invoice object
*/
retrieveInvoice(id: string): any;
/**
* Creates a new valid invoice (CFDI).
* @param {Object} data
*/
createInvoice(data: any): any;
/**
* Cancels an invoice. The invoice will not be valid anymore and will change its status to canceled.
* @param {string} id
*/
cancelInvoice(id: string): any;
/**
* Sends the invoice to the customer's email
* @param {string} id Invoice Id
* @param {Object} data
* @param {string} data.email Email address to send the invoice to
*/
sendInvoiceByEmail(id: string, data: any): any;
/**
* Downloads the specified invoice in PDF format
* @param {string} id Invoice Id
* @returns {Promise<ReadStream>} PDF file in a stream
*/
downloadPdf(id: string): any;
/**
* Downloads the specified invoice in XML format
* @param {string} id Invoice Id
* @returns {Promise<ReadStream>} XML file in a stream
*/
downloadXml(id: string): any;
/**
* Downloads the specified invoice in a ZIP package containing both PDF and XML files
* @param {string} id Invoice Id
* @returns {Promise<ReadStream>} ZIP file in a stream
*/
downloadZip(id: string): any;
/**
* Creates a new organization in your account
* @param {Object} data
*/
createOrganization(data: any): any;
/**
* Gets a paginated list of organizations that belong to your account
* @param {Object} params
*/
listOrganizations(params: {}): any;
/**
* Gets a single organization object
* @param {string} id
*/
retrieveOrganization(id: string): any;
/**
* Gets the api keys for an organization
* @param {string} id
*/
getOrganizationApiKeys(id: string): any;
/**
* Permanently removes an organization from your account.
* @param {string} id
*/
removeOrganization(id: string): any;
/**
* Updates the organization's legal information
* @param {string} id
* @param {object} data
*/
updateOrganizationLegal(id: string, data: any): any;
/**
* Updates the organization's customization information
* @param {string} id
* @param {object} data
*/
updateOrganizationCustomization(id: string, data: any): any;
/**
* Uploads the organization's logo
* @param {string} id
* @param {ReadableStream} file
*/
uploadOrganizationLogo(id: string, file: any): any;
/**
* Uploads the organization's certificate (CSD)
* @param {string} id
* @param {ReadableStream} cerFile
* @param {ReadableStream} keyFile
* @param {string} password
*/
uploadOrganizationCertificate(id: string, cerFile: any, keyFile: any, password: any): any;
}
export default Wrapper;