Skip to content

fix: accept customer ID strings in receipts-to-invoice inputs - #114

Merged
javorosas merged 3 commits into
mainfrom
fix/receipts-customer-id-typing
Sep 4, 2026
Merged

fix: accept customer ID strings in receipts-to-invoice inputs#114
javorosas merged 3 commits into
mainfrom
fix/receipts-customer-id-typing

Conversation

@javorosas

Copy link
Copy Markdown
Member

Summary

POST /receipts/to-invoice and POST /receipts/to-invoice/preview accept a customer that may be a customer ID or a full customer object (the API validates Joi.alternatives().try(Joi.string().hex().length(24), createCustomerSchema())), but ReceiptsToInvoiceInput.customer and PreviewReceiptsToInvoicePdfInput.customer only 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 build and pnpm run lint clean.
  • No runtime changes: the SDK already serialized the value as-is.

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
javorosas force-pushed the fix/receipts-customer-id-typing branch from f21a892 to 7f03288 Compare September 4, 2026 12:08
@javorosas javorosas self-assigned this Sep 4, 2026
@javorosas
javorosas merged commit a4f7388 into main Sep 4, 2026
6 checks passed
@javorosas
javorosas deleted the fix/receipts-customer-id-typing branch September 4, 2026 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants