Search code examples
quickbooksqbxml

TxnNumber vs RefNumber in ReceivePaymentQuery - QBXML


What is the difference between TxnNumber and RefNumber when I query receive payments?

And how can I get payment date? I'm seeing three TxnDate field in ReceivePaymentRet.

...
<ReceivePaymentRet> <!-- optional, may repeat -->
    ...
    <TxnNumber >INTTYPE</TxnNumber> <!-- optional -->
    ...
    <TxnDate >DATETYPE</TxnDate> <!-- payment date? -->
    ...
    <RefNumber >INTTYPE</RefNumber> <!-- optional -->
    ...
    <AppliedToTxnRet> 
        <TxnDate >DATETYPE</TxnDate> <!-- payment date? -->

        <LinkedTxn> <!-- optional, may repeat -->
            <TxnDate >DATETYPE</TxnDate> <!-- payment date? -->
        </LinkedTxn>
    </AppliedToTxnRet> 
    ...
</ReceivePaymentRet>

Solution

  • Details:

    • TxnNumber - this is QuickBooks' internal transaction #, not really useful for anything that you do
    • TxnDate - this is the date entered into the QuickBooks UI on the payment (generally the date the payment was received)
    • RefNumber - this is the reference # entered into the QuickBooks UI on the payment (usually a check # for checks, and a transaction ID for credit card transactions)
    • AppliedToTxnRet/TxnDate - this is the date of the invoice that the payment was applied to
    • AppliedToTxnRet/LinkedTxn - this is an array of other related transactions linked to the payment (e.g. they might be credit memos, etc.)
    • AppliedToTxnRet/LinkedTxn/TxnDate - this is the date entered into the QuickBooks UI of those related transactions linked to the payment

    What is the difference between TxnNumber and RefNumber when I query receive payments?

    RefNumber is the one you want - it's the one that shows up in the UI.

    And how can I get payment date?

    The base-level TxnDate is the payment date you want.