Getting DataExtRet from QuickBooks SDK - quickbooks

I am performing an invoice query using the QuickBooks SDK and I'd like to pull back custom fields at the item level as well. The request I am sending is:
<?xml version="1.0" ?>
<?qbxml version="8.0"?>
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<InvoiceQueryRq>
<RefNumber>8</RefNumber>
<IncludeLineItems>true</IncludeLineItems>
<OwnerID>0</OwnerID>
</InvoiceQueryRq>
</QBXMLMsgsRq>
</QBXML>
I get a successful response, however, there are no <DataExtRet> elements with my custom field information. I can get this data if I do an item query with the <OwnerID> element however, according to IDN, I should be able to get these custom fields in an invoice query as well. I am testing my queries using SDK Tester Plus 3. Any suggestions?

The template being used did not contain the "Serial Number" UDF I was looking for. Adding this to the invoice template and then calling InvoicequeryRq pulled back the information I was looking for.

Related

XML Error while Modifying Sales Order in QB Desktop

I am trying to modify a sales order created in QB Desktop. But it gives me XML error
0x80040400: QuickBooks found an error when parsing the provided XML text stream.
Here is my XML Request
<?xml version="1.0" encoding="ISO-8859-1"?>
<?qbxml version="11.0"?>
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<SalesOrderModRq>
<SalesOrderMod>
<TxnID>1-1672737866</TxnID>
<EditSequence>1672737866</EditSequence>
<CustomerRef>
<FullName>156004 Loose Bee Ln</FullName>
</CustomerRef>
<TxnDate>2023-01-03</TxnDate>
<BillAddress>
<Addr1>123</Addr1>
<Addr2></Addr2>
<City>Gity</City>
<State>Ritham</State>
<PostalCode>5555</PostalCode>
<Country>Universe</Country>
</BillAddress>
<PONumber>4444444</PONumber>
<Other>Southshore Bay</Other>
<SalesOrderLineMod>
<TxnID>3-1672737866</TxnID
<ItemRef>
<FullName>Single Family - One Story</FullName>
</ItemRef>
<Desc>Foundation</Desc>
<Quantity>1</Quantity>
<Amount>85.00</Amount>
<DataExtMod>
<OwnerID>0</OwnerID>
<DataExtName>Lot</DataExtName>
<DataExtValue>8/98</DataExtValue>
</DataExtMod>
<DataExtMod>
<OwnerID>0</OwnerID>
<DataExtName>Address</DataExtName>
<DataExtValue>156004 Loose Bee Ln</DataExtValue>
</DataExtMod>
</SalesOrderLineMod>
</SalesOrderMod>
</SalesOrderModRq>
</QBXMLMsgsRq>
</QBXML>
Any help is highly appreciatable..
Whenever you get this error:
0x80040400: QuickBooks found an error when parsing the provided XML text stream
It means you used an XML tag incorrectly, an unsupported XML tag, or an XML tag in the wrong order.
You can refer to the documentation to see what supported tags, their order, etc. are:
https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/salesordermod
At least at first glance, I can see that TxnID inside SalesOrderLineMod is not correct (maybe you meant TxnLineID instead?):
<SalesOrderLineMod>
<TxnID>3-1672737866</TxnID
It may also be worth double-checking those DataExtMod tags too.

How can I get "Time/Costs" account IDs with QBXML?

I'm running this query:
<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="14.0"?>
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<InvoiceQueryRq>
<IncludeLineItems>1</IncludeLineItems>
<IncludeLinkedTxns>1</IncludeLinkedTxns>
</InvoiceQueryRq>
</QBXMLMsgsRq>
</QBXML>
And I get this invoice line which is an expense created with the "Add Time/Costs" button in Quickbooks Desktop.
<InvoiceLineRet>
<TxnLineID>8E-1343336207</TxnLineID>
<Desc>License and Title</Desc>
<Rate>315</Rate>
<Amount>315.00</Amount>
<ServiceDate>2012-07-26</ServiceDate>
<SalesTaxCodeRef>
<ListID>80000002-1343060273</ListID>
<FullName>Non</FullName>
</SalesTaxCodeRef>
</InvoiceLineRet>
With most invoice lines, there's an item associated with it and I can get the account(s) associated with the item. I want to get the account ListID that's associated with this invoice line, as with other invoice lines. I can get the account name with a GeneralDetailReportQuery, but not the ID, and that report is much harder to work with as I'm importing Quickbooks data into another system.
How can I find the accountID for lines like this?

How to create an invoice for a sales order Quickbooks Desktop

I have a customer in Quickbook Desktop, so that I have generated a slaes order for the particular customer, now for the customer sales order I have to generate a invoice. . When I tried it I got the following error. How to link a quickbook desktop customer sales order to a invoice?
I tried using IDTYPE attribute. What is wrong here? Kindly help
0x80040400: QuickBooks found an error when parsing the provided XML text stream.
Parsing response.
Processing response.
Job 'create_invoice' received response: ''.
This is my sales order xml response.
{"xml_attributes"=>{},
"txn_id"=>"75-1640702627",
"time_created"=>"2021-12-28T14:43:47+00:00",
"time_modified"=>"2021-12-28T14:43:47+00:00",
"edit_sequence"=>"1640702627",
"txn_number"=>37,
"customer_ref"=>{"xml_attributes"=>{}, "list_id"=>"80000001-1640593593", "full_name"=>"Test Customer"},
"template_ref"=>{"xml_attributes"=>{}, "list_id"=>"80000008-1640593060", "full_name"=>"Custom Sales Order"},
"txn_date"=>"2021-12-28",
"ref_number"=>"18",
"bill_address"=>{"xml_attributes"=>{}, "addr1"=>"212 W. Chskskss St.", "addr2"=>"Ste.100", "addr3"=>"wqw, Parròquia d'Encamp www", "addr4"=>"Andorra"},
"bill_address_block"=>{"xml_attributes"=>{}, "addr1"=>"212 W. Chskskss St.", "addr2"=>"Ste.100", "addr3"=>"wqw, Parròquia d'Encamp www", "addr4"=>"Andorra"},
"due_date"=>"2021-12-28",
"ship_date"=>"2021-12-28",
"subtotal"=>1.0,
"sales_tax_percentage"=>0.0,
"sales_tax_total"=>0.0,
"total_amount"=>1.0,
"is_manually_closed"=>false,
"is_fully_invoiced"=>false,
"is_to_be_printed"=>true,
"is_to_be_emailed"=>false}
Trying to generate invoice for this particular sales order
Here is my invoice XML attributes that I am sending to Quickbook Desktop
xml = '<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="7.0"?>
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<InvoiceAddRq >
<InvoiceAdd>
<CustomerRef>
<FullName>Test Customer</FullName >
</CustomerRef>
<BillAddress>
<Addr1>212 W. Chskskss St.</Addr1>
<Addr2>Ste.100</Addr2>
<City>wqw</City>
<State>Parròquia d'Encamp www</State>
<PostalCode>06268</PostalCode>
<Country>Andorra</Country>
</BillAddress>
<InvoiceLineAdd>
<ItemRef>
<FullName >Inspection Request</FullName>
</ItemRef>
<Desc >plants</Desc>
<Quantity >1</Quantity>
<Amount >50.00</Amount>
</InvoiceLineAdd>
<LinkToTxnID>75-1640702627<LinkToTxnID>
</InvoiceAdd>
</InvoiceAddRq>
</QBXMLMsgsRq>
</QBXML>'
First thing coming to my mind is: "Where is your closing QBXML tag?"
</QBXML>
Beside that. The SDK includes an XML Validator tool which you can use to validate the XML structure. Try to use this to see where your structure probably does not meet the requirements.

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.
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>

how to add payment method to quickbooks through qbxml?

I'm using consolibyte php with web connector.I'm trying to create payment method add request using following xml.But i'm getting following error.but in quickbooks with that name no term existed.can you help any one?
3100: The name "cashondelivery" of the list element is already in use.
$xml='<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="8.0"?>
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<PaymentMethodAddRq>
<PaymentMethodAdd>
<Name>cashondelivery</Name>
<IsActive>true</IsActive>
<PaymentMethodType>AmericanExpress</PaymentMethodType>
</PaymentMethodAdd>
</PaymentMethodAddRq>
</QBXMLMsgsRq>
</QBXML>';
return $xml;
That means that cashondelivery is already in QB.
Look for deleted entries as well. You might need to check the other lists and see if it is there.

Resources