2025-09-12 – Invoice Pricing and QuickBooks Integration Fixes
Critical Invoice Pricing Corrections
- Fixed invoice pricing logic to prevent charging retail prices instead of cost prices
- Updated invoice API to prioritize:
wholesale_price(raffle stickers) →variant cost_price→blank_price + print_price→ fallback to $0 - Removed retail price fallback that was incorrectly charging customers full retail amounts
- Fixed product save API to preserve
wholesale_priceandflat_shipping_chargevalues when not explicitly provided
QuickBooks Integration Improvements
- Resolved “Object Not Found” (610) errors in QuickBooks invoice creation
- Updated
intuit-invoice.tsto properly handle shipping line items and respectquickbooks_line_item_idfrom database - Fixed ItemRef mapping to use correct QuickBooks item IDs for different line item types
- Improved error handling for inactive QuickBooks items
Invoice Creation Workflow
- Fixed two-step process for automatic QuickBooks sending: Modified invoice creation API to properly handle “Automatically send to QuickBooks” option
- Root cause identified: QuickBooks sending was happening within the same database transaction, causing failures when trying to query invoice relationships that weren’t fully committed yet
- Solution implemented: QuickBooks sending now happens AFTER database transaction is committed, using fresh database connections
- Technical changes: Moved QuickBooks integration logic to post-transaction phase in
/api/invoicesroute - UI updates: Enhanced success messaging to properly handle both invoice creation and QuickBooks sending results
- Testing status: Ready for testing during next invoice creation cycle (current invoices already processed)
Impact
- Mixed orders now correctly charge cost prices for inventory items and wholesale prices for raffle stickers
- QuickBooks integration errors resolved for proper invoice synchronization
- Pricing accuracy restored across all invoice types