[QODBC-Online] - Inserting Foreign Currency Transactions: Why ExchangeRate Is Required in QODBC Online (But Not QODBC Desktop)
Problem Description:
When inserting records into QuickBooks Online (QBO) via QODBC Online using a foreign currency - for example, creating a BillExpenseLine, InvoiceLine, or SalesReceiptLine in USD while the company's home currency is CAD - the INSERT may fail with an error such as:
Error
"No exchange rate" or "Business rule violation" when inserting a foreign currency transaction.
This occurs because QuickBooks Online's API requires an explicit ExchangeRate value for every foreign currency transaction, even though QuickBooks Desktop can infer the rate from vendor or account setup.
Affected products: QODBC Online, QuickBooks Online Expected outcome: After adding both CurrencyRefListID and ExchangeRate to INSERT statements for foreign currency transactions, all inserts succeed.
Symptoms:
- An INSERT statement that includes a foreign currency field (e.g.,
CurrencyRefListID = 'USD') fails with "no exchange rate" or "business rule violation."
- The same insert works fine on QODBC Desktop / QuickBooks Desktop without the
ExchangeRate field - because Desktop can infer the rate from vendor or account currency setup.
- Multi-currency is enabled in QuickBooks Online (Gear icon → Account and Settings → Advanced → Currency → Multicurrency: On), and the transaction currency (e.g., USD, EUR) has been activated in QBO.
- The customer queries for exchange rates via a QODBC table and finds no "Currency" or "ExchangeRate" table available through QODBC Online.
Cause:
QuickBooks Online API design differs from QuickBooks Desktop SDK:
- Desktop SDK can infer the exchange rate from the vendor or account's configured currency when you insert a transaction.
- QBO API requires the
ExchangeRate to be explicitly provided for every foreign currency transaction. QBO does not automatically look up the rate even if the vendor and accounts are set to the same currency.
- The exchange rate lookup table is not exposed through the QuickBooks Online API, meaning there is no QODBC table you can query to retrieve current or historical exchange rates. You must supply this value yourself.
Environment:
| Product | Version / Detail |
| QODBC Online |
All versions (when inserting foreign currency transactions) |
| QuickBooks Online |
All plans with multi-currency enabled |
| Foreign currencies |
USD, EUR, GBP, CAD, AUD, NZD, JPY, and any activated QBO currency |
Solution:
Include both CurrencyRefListID (or CurrencyRefFullName) and ExchangeRate in all INSERT statements for foreign currency transactions.
- Add ExchangeRate to your INSERT statement. For example, when creating a Bill Expense Line in USD from a CAD home currency:
INSERT INTO BillExpenseLine (VendorRefListID, APAccountRefListID, CurrencyRefListID, ExchangeRate, TxnDate, Memo, ExpenseLineMemo, ExpenseLineAmount, ExpenseLineAccountRefListID, FQSaveToCache) VALUES ('41', '33', 'USD', 1.3500, {d'2026-05-19'}, 'Test Bill', 'Testing', 200, '14', 0)
Replace the ExchangeRate value (1.3500) with the actual CAD-to-USD rate on the transaction date.
- Determine the correct exchange rate for the transaction date. Use your bank's published rate, a financial data source (e.g., Xe.com, OANDA), or your accounting records. The rate must match the effective date of the transaction.
- Apply ExchangeRate to all foreign currency transactions: This includes
BillExpenseLine, InvoiceLine, SalesReceiptLine, PurchaseOrderLine, and any other QBO transaction type that supports multi-currency.
- If your application needs exchange rates, implement an external lookup (bank feed, financial API, or manual entry). QODBC Online does not expose a QBO currency/exchange rate table.
SQL Examples:
Bill Expense in foreign currency:
INSERT INTO BillExpenseLine (VendorRefListID, APAccountRefListID, CurrencyRefListID, ExchangeRate, TxnDate, Memo, ExpenseLineAmount, FQSaveToCache) VALUES ('41', '33', 'EUR', 1.0850, {d'2026-05-20'}, 'Supplier Invoice - EUR', 500, 0)
Invoice in foreign currency:
INSERT INTO InvoiceLine (CustomerRefListID, TxnDate, RefNumber, CurrencyRefListID, ExchangeRate, InvoiceLineItemRefListID, InvoiceLineDesc, InvoiceLineRate, InvoiceLineQuantity, FQSaveToCache) VALUES ('10', {d'2026-05-19'}, '114455', 'USD', 1.3500, '13', 'Consulting Services', 173.53, 6, 0)
Example Scenarios:
Scenario 1 - CAD company billing a US vendor:
A Canadian company (home currency: CAD) receives an invoice from a US supplier in USD. The application needs to create a Bill in QBO via QODBC Online. Without ExchangeRate, the insert fails. Adding CurrencyRefListID = 'USD' and ExchangeRate = 1.3500 (the rate on the invoice date) allows the bill to be created successfully.
Scenario 2 - Migrating from QODBC Desktop to QODBC Online:
A user with an existing QODBC Desktop application that inserts bills without specifying ExchangeRate discovers that the same SQL fails on QODBC Online. The fix is to audit all INSERT statements and add CurrencyRef + ExchangeRate for any foreign currency transactions.
Additional Notes:
- No QODBC currency table: QuickBooks Online does not expose the exchange rate lookup table through its API. You cannot query it via QODBC Online. Obtain rates from your bank, a financial data provider, or your internal accounting records.
- Home currency transactions do not need ExchangeRate: If the transaction currency matches the home currency, no CurrencyRef or ExchangeRate is needed.
- Exchange rate accuracy: Use the rate effective on the transaction date, not the current rate. Different dates may have different rates.
- Multi-currency must be enabled: Before inserting foreign currency transactions, ensure multi-currency is enabled in QBO (Gear → Account and Settings → Advanced → Currency) and the specific currency has been activated.
- Desktop vs. Online difference: This requirement is specific to QODBC Online / QuickBooks Online. QODBC Desktop does not require ExchangeRate because the Desktop SDK infers it from vendor setup. If your application runs on both, you need conditional logic to include ExchangeRate only for QODBC Online inserts.
Related Articles:
QODBC Online SUBSTRING Function Bug (B01871) Slow Query Performance After Upgrading QODBC How to Deactivate QODBC Online License How to Activate QODBC Online License
Keywords:
Foreign Currency ExchangeRate CurrencyRefListID Multi-currency QODBC Online QuickBooks Online API BillExpenseLine InvoiceLine No Exchange Rate Error Business Rule Violation CAD to USD Desktop vs Online Currency Table Not Available INSERT Foreign Currency
Support Tickets: WJN-566-76878
|