All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
- New fields for the Invoice object:
received_payment_ids
andtarget_invoice_ids
, used to track payments and PPD invoices.
- Added try/catch to conditional import and define "stream" as external.
- Fix conditional import on web environments.
- Fix bug in Node.js environment in which the library was not returning the right kind of stream on download methods.
- Fix bug in which body params were not being sent in the request.
- Compatibility with browser environments and React Native. Now you can use Facturapi in the browser or in React Native, as long as you have a Fetch API compatible environment.
- Types for webhooks responses.
- Add
organizations.me
method to get the organization information.
- Name of validateSignature parameter "signature".
- Add types for all method responses. Method parameters are still not typed.
- List Live Api Keys:
listLiveApiKeys
for organizations - Delete Live Api Keys:
deleteLiveApiKey
for organizations - Validate webhooks responses:
validateSignature
for webhooks
- Fix optional
params
for invoice
- Fix
organization.createSeriesGroup
andorganization.updateSeriesGroup
. Thanks to @pastine
- Methods for CRUD of series
- Create method for series:
organization.createSeriesGroup
- Read method for your organization series:
organization.listSeriesGroup
- Update method for an specific series:
organization.updateSeriesGroup
- Delete method for an specific series:
organization.deleteSeriesGroup
- Remove deprecated method
products.keys
in favor ofcatalogs.searchProducts
. - Remove deprecated method
products.units
in favor ofcatalogs.searchUnits
. - Corrected the name of the method
invoices.editDraft
toinvoices.updateDraft
. - The rest of the changes are internal and should not affect the public API.
- We rewrote the the library in TypeScript and now it's partially typed. Most request parameters and responses are not typed yet, but we plan to add more types in future releases.
- We export all type definitions, so you can use them in your TypeScript projects.
- New method to copy invoices to a new draft:
invoices.copyToDraft
.
- New method to delete certificates from the organization:
organizations.deleteCertificate
. - New query param
async
in create invoice method:. - New methods for draft invoices:
invoices.editDraft
,invoices.stampDraft
. - New method to update invoice status with the latest value from the SAT:
invoices.updateStatus
.
- Webhooks API
- Add
invoices.downloadCancellationReceiptPdf
.
- Add
invoices.downloadCancellationReceiptXml
,receipts.sendByEmail
andreceipts.downloadPdf
.
Note: Although this update includes a breaking change, only the minor version will be bumped, since we haven't officially announced the new API version yet.
- Remove
organizations.getApiKeys
.
- Add
organizations.getTestApiKey
,organizations.renewTestApiKey
andorganizations.renewLiveApiKey
.
- Allow setting the API version in the client constructor.
- Change API version to point to /v2, in order to support CFDI 4.0
- Support sending params to
invoices.cancel
method.
- Stop logging request config
- New endpoint:
tools.validateTaxId
.
- Support for Retentions API
- Updated dependencies to address potential vulnerabilities.
- New method on receipts API:
createGlobalInvoice
facturapi.organizations.uploadCertificate
only acceptedFileStream
s. Now it supports any kind of readableStream
, as well asBuffer
.
- Support for receipts API
- Edit organization's receipts settings
- Check domain availability
- Select organization's domain
- Use correct endpoint for
catalogs.searchProducts
- Catalogs API
- Search product keys using
catalogs.searchProducts
. - Search unit keys using
catalogs.searchUnits
.
- Search product keys using
- Updated all dependencies to clear security warnings
- Previously swallowing messages from non-axios errors
product.keys
andproduct.units
are deprecated in favor of the new catalogs API, and will be removed on the next major release.
- Now you must create the Facturapi instance using the
new
keyword every time.
Before:
// This was allowed
const facturapi = Facturapi('YOUR_API_KEY');
Now:
// Now you must always use new
const facturapi = new Facturapi('YOUR_API_KEY');
- Reject with an Error, not with an object
- Support Organizations API
- Search
product_key
s usingfacturapi.products.keys('your search')
- Search
unit_key
s usingfacturapi.products.units('your search')
- Constants for PaymentMethod, InvoiceType, InvoiceUse, InvoiceRelation
- Now contants should be accessed as static properties from the Facturapi class, instead of from the instance.
Before:
const facturapi = new Facturapi('YOUR_API_KEY');
console.log(facturapi.TaxType.IVA); // > IVA
Now:
console.log(Facturapi.TaxType.IVA); // > IVA
- Protocol should be HTTPS
- First release
- Wrapper methods for:
- Customers
- Products
- Invoices
- Added README file