ruby-on-railsrubyquickbooksqbxml

quickbooks api to add a payment against an invoice with RubyRails app


I am trying to mark an invoice mark as paid and as per my understanding I have to add a payment against the invoice. I am using qbwc gem and it is using qbxml v.13. I have found out few examples of creating the payment object here https://community-intuit.force.com/developer/s/article/QBO-REST-Apply-payments-to-invoice but the qbxml tag for creating payment is not clear to me.

Here are few xml tags that I have found in OSR ReceivePaymentAddRq, ItemPaymentAddRq etc

But I am still not sure how to create the payment object and which xml tags should be used and help is appreciated, thanks in advance.


Solution

  • A minimal qbXML example looks like this:

    <?xml version="1.0" encoding="utf-8"?>
    <?qbxml version="10.0"?>
    <QBXML>
        <QBXMLMsgsRq onError="stopOnError">
            <ReceivePaymentAddRq>
                <ReceivePaymentAdd>
                    <CustomerRef>
                        <ListID>F230000-1196864585</ListID>
                        <!--<FullName>Keith Palmer</FullName>--> <!-- You can specify either ListID or FullName -->
                    </CustomerRef>
    
                    <TxnDate>2007-12-14</TxnDate>
                    <RefNumber>00612361</RefNumber>
                    <TotalAmount>195.00</TotalAmount>
    
                    <!-- Specify the Invoice TxnID here, or see below for auto-apply... -->
                    <AppliedToTxnAdd>
                        <TxnID>12006-1196864828</TxnID>
                        <PaymentAmount>195.00</PaymentAmount>
                    </AppliedToTxnAdd>
        
                    <!-- If you don't want to apply payments manually to a particular transaction, use <IsAutoApply>true</IsAutoApply> -->
                    <!--   instead of the <AppliedToTxn> node. QuickBooks will make it's best guess how to apply the payment. -->
                </ReceivePaymentAdd>
            </ReceivePaymentAddRq>
        </QBXMLMsgsRq>
    </QBXML>