Mapping Bills, BillPayments and VendorCredits

36 Views Asked by At

I'm trying to map Bills, BillPayments and VendorCredits into one table using QBXML. Something like Bill Payment Stub (see below).

I tried to do it based on TxnDate, but some of the bills are apparently mapped based on amount or some other field.

I tried all types of queries. Separate queries BillQueryRq, BillPaymentCheckQueryRq, VendorCreditQueryRq (see below), but there is no relation between data from this queries. Combided queries, such as TransactionQueryRq (see below).

What is the relation between these 3 tables (Bills, BillPayments, VengorCredits)? Is there a foreign key/constraint that I can use to map them together? Maybe there is another query that can solve this problem? (I tried all queries from here to no avail https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/accountadd)

Bill Payment Stub

TransactionQuery

1

There are 1 best solutions below

0
kostinalex On

Ok. After 5 days of search I couldn't find an answer. No linking element. But... I found the query that links bills to credits and payments. All you've got to do is to include <IncludeLinkedTxns>true</IncludeLinkedTxns> into the bill query. For some reason, this parameter is set to false by default.

The whole query looks like this.

<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="13.0"?>
<QBXML>
    <QBXMLMsgsRq onError="stopOnError">
        <BillQueryRq requestID="xyz">
            <MaxReturned >10000</MaxReturned>
            <TxnDateRangeFilter>
                <FromTxnDate >2022-02-01</FromTxnDate>
            </TxnDateRangeFilter>
            <IncludeLinkedTxns>true</IncludeLinkedTxns>
        </BillQueryRq>
    </QBXMLMsgsRq>
</QBXML>