Skip to content

Conversation

@aschwartz91
Copy link
Collaborator

@aschwartz91 aschwartz91 commented Feb 5, 2026

Summary

  • When syncing invoices, ClassRef was always included in the SalesItemLineDetail payload, even when undefined. This caused QuickBooks to clear the item's default class to blank.
  • Changed to conditional spread (...(itemRef.classRef && { ClassRef: itemRef.classRef })) so ClassRef is only included when we have an actual value. This allows QB to apply its configured default class behavior on items.

Test plan

  • Sync an invoice where the QB item has a default class configured — verify the class is preserved on the invoice line item
  • Sync an invoice where the QB item has no class — verify no ClassRef is sent and behavior is unchanged
  • Sync an invoice with a mapped item that has a ClassRef — verify the class is correctly forwarded

🤖 Generated with Claude Code

…sRef when unset

When syncing invoices, we were always including ClassRef in the SalesItemLineDetail
payload, even when undefined. This caused QB to clear the item's default class.
Now we only include ClassRef when we have an actual value to send, allowing QB
to apply its configured default class behavior.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Feb 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
quickbooks-sync Error Error Feb 5, 2026 10:56pm

Request Review

When items are created or found by name in QB (rather than by mapped ID),
we had the qbItem with its ClassRef but weren't passing it through to the
invoice line item payload. QB's API does not auto-apply an item's default
class to invoice line items, so we must explicitly forward it.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@aschwartz91 aschwartz91 changed the title fix: preserve QB default class on invoice line items fix(OUT-3081): preserve QB default class on invoice line items Feb 5, 2026
@linear
Copy link

linear bot commented Feb 5, 2026

Copy link
Collaborator

@SandipBajracharya SandipBajracharya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementation lgtm. Since the deployment is failing in vercel, deployed same implementation from another branch. PR here.

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