ChrisF
ChrisF

Reputation: 3

PHP Quickbooks SDK - AddInvoice XML problems

I'm trying to add an invoice now using a template which works by default. But the moment I add Other1 and Other2 to the XML it returns:

Handled error: 0x80040400: QuickBooks found an error when parsing the provided XML text stream. (handler returned: )

Here is the XML I am sending through that is generating the Error:

<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="2.0"?>
<QBXML>
     <QBXMLMsgsRq onError="stopOnError">
           <InvoiceAddRq>
                   <InvoiceAdd>
                         <CustomerRef>
                              <ListID>{customer_id}</ListID>
                         </CustomerRef>
                         <TxnDate>'.date('Y-m-d').'</TxnDate>
                         <RefNumber>'.$ID.'</RefNumber>           
                         <Memo>Generated via Sys</Memo>
                         <InvoiceLineAdd>
                              <ItemRef>
                                   <FullName>Purchase</FullName>
                              </ItemRef>
                              <Desc>Rental of 3 Days</Desc>
                              <Quantity>3</Quantity>
                              <Rate>200</Rate>
                              <Other1 >STRTYPE</Other1>
                              <Other2 >STRTYPE</Other2>
                         </InvoiceLineAdd>

                   </InvoiceAdd>
           </InvoiceAddRq>
     </QBXMLMsgsRq>
</QBXML>

No matter what I put into Other1 and Other2 it does not work. But the second I remove them then it creates the invoice no problem. (Im using a Mac to develop and team viewer to test, so do you know of a XML validator for Mac by any chance?)

Upvotes: 0

Views: 118

Answers (1)

Keith Palmer Jr.
Keith Palmer Jr.

Reputation: 27962

If you look at the QuickBooks OSR:

You'll see that the Other1 and Other2 fields are not supported until qbXML version 6.0:

enter image description here

And you're using version:

<?qbxml version="2.0"?>

Change the version you're using.

Also, go download a free VM tool and install Windows in a VM on your Mac. Then install the QuickBooks SDK. Then you'll have access to the XML Validator tool, which can tell you exactly what's wrong in cases like this.

Upvotes: 1

Related Questions