QBXML : Can there be multiple credit/debit line items in a journal entry query response?

831 views Asked by At

I am retrieving the journal entries and trying to determine whether there will only ever be one JournalCreditLine node and one JournalDebitLine node per JournalEntryRet or if there could be multiple line entries.

EDIT:

I have added multiple journal entries in one place with the same timestamp, but I always get multiple <JournalEntryRet> and never multiple <JournalDebitLine> or <JournalCreditLine>

Query I am sending:

<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="11.0"?>
<QBXML>
  <QBXMLMsgsRq onError="stopOnError">
    <JournalEntryQueryRq requestID="[request id from DB]"> 
    <IncludeLineItems>1</IncludeLineItems>
    </JournalEntryQueryRq>
    </QBXMLMsgsRq>
</QBXML>';

Example Response (with all customer data removed):

[data] [data] [data] [data] [data] [data] [data] [data] [data] [data] [data] [data] [data] [data] [data] [data] [data] [data]

        <JournalEntryRet>
            <TxnID>[data]</TxnID>
            <TimeCreated>[data]</TimeCreated>
            <TimeModified>[data]</TimeModified>
            <EditSequence>[data]</EditSequence>
            <TxnNumber>[data]</TxnNumber>
            <TxnDate>[data]</TxnDate>
            <RefNumber>[data]</RefNumber>
            <IsAdjustment>[data]</IsAdjustment>
            <JournalDebitLine>
                <TxnLineID>[data]</TxnLineID>
                <AccountRef>
                    <ListID>[data]</ListID>
                    <FullName>[data]</FullName>
                </AccountRef>
                <Amount>[data]</Amount>
                <Memo>[data]</Memo>
            </JournalDebitLine>
            <JournalCreditLine>
                <TxnLineID>[data]</TxnLineID>
                <AccountRef>
                    <ListID>[data]</ListID>
                    <FullName>[data]</FullName>
                </AccountRef>
                <Amount>[data]</Amount>
                <Memo>[data]</Memo>
            </JournalCreditLine>
        </JournalEntryRet>

        <!-- more JournalEntryRet nodes -->
        </JournalEntryQueryRs>
    </QBXMLMsgsRs>
</QBXML>
1

There are 1 answers

2
Keith Palmer Jr. On

There could be multiple journal credit lines, and multiple journal debit lines, in a single JournalEntry object. This mirrors the behavior of the QuickBooks GUI.

The business rule is that the sum of all credit lines must equal the sum of all debit lines.