fix: accept customer ID strings in receipts-to-invoice inputs - #114
Merged
Conversation
The API resolves the customer field of POST /receipts/to-invoice and /receipts/to-invoice/preview from either a customer ID or a full customer object, but the input types only covered the object form.
Calls GET /invoices/{id}/payment-summary, which returns the related
document object needed to build a payment complement (complemento de
pago): installment from the payment history, previous balance, and the
invoice tax breakdown prorated to the paid amount.
Incorporates the 4.20.0 release state (ZIP request methods and property_tax_account typing) that was published but never merged back to main, and adds the 4.21.0 changelog for this release.
javorosas
force-pushed
the
fix/receipts-customer-id-typing
branch
from
September 4, 2026 12:08
f21a892 to
7f03288
Compare
raul-facturapi
approved these changes
Sep 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
POST /receipts/to-invoiceandPOST /receipts/to-invoice/previewaccept acustomerthat may be a customer ID or a full customer object (the API validatesJoi.alternatives().try(Joi.string().hex().length(24), createCustomerSchema())), butReceiptsToInvoiceInput.customerandPreviewReceiptsToInvoicePdfInput.customeronly typed the object form, forcing integrators to cast when passing an ID.Both fields are now
string | Record<string, any>(preview keeps its| null).Testing
pnpm run buildandpnpm run lintclean.