qbXML status code 3180

Error

QuickBooks refused to save the new record; the text after 'QuickBooks error message:' says why.

What QuickBooks says

There was an error when saving a %1. %4

QuickBooks fills in the marked parts when it answers: usually the value, the field, the kind of record and a longer explanation of its own.

It arrives on the response element as statusCode="3180" statusSeverity="Error", with this text in statusMessage.

What to do

Common causes: a transaction with no lines (or lines with no item), and an item with no posting account. Fix what the message names and send it again.

Seen from a real company file

  • Answering InvoiceAdd:

    There was an error when saving a Invoice. QuickBooks error message: The transaction is empty.

  • Answering JournalEntryAdd:

    There was an error when saving a General Journal transaction. QuickBooks error message: Transaction not in balance.

Things to know

  • An unbalanced journal entry is refused with 3180 on add and 3170 on mod, both ending "Transaction not in balance."

With QuBe Sync's API

QuBe Sync reads QuickBooks' response for you. When InvoiceAdd gets this code, your webhook receives this JSON:

Webhook state and error
{
  "error": {
    "debug_message": null,
    "error_code": 3180,
    "error_type": "quickbooks_business_error",
    "hresult": null,
    "message": "There was an error when saving a Invoice. QuickBooks error message: The transaction is empty.",
    "user_message": "QuickBooks couldn't save this record. QuickBooks said: There was an error when saving a Invoice. QuickBooks error message: The transaction is empty."
  },
  "state": "error"
}

Wording read from QuickBooks Enterprise Solutions 24.0 (R21_80).