Is it possible to create an invoice with one-off items or to generate the missing items on-demand, without parsing the QBXMLMsgsRs
return value?
I am trying to transmit invoices to QuickBooks through the QuickBooks Web Connector, I cannot ensure that the items already exist. I knew that QuickBooks itself is able to create items on-demand.
I’ll get following return message:
QBXMLMsgsRs:
There is an invalid reference to QuickBooks Item "1000000000" in the Invoice line. QuickBooks error message: Invalid argument. The specified record does not exist in the list.
As fallback, I would parse the return value, create the item and submit the invoice again, but I am looking for an existing implementation. I already checked the Onscreen Reference (InvoiceAdd), without any helpful information.
Here is an example of my QBXML
:
<?xml version="1.0" encoding="us-ascii"?>
<?qbxml version="13.0"?>
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<InvoiceAddRq requestID="bd4a0a4d-81ea-4f95-ae09-150f15a12423">
<InvoiceAdd>
<CustomerRef>
<ListID>80000004-1434444973</ListID>
<FullName>University of North Carolina</FullName>
</CustomerRef>
<TxnDate>1999-01-21</TxnDate>
<RefNumber>9668</RefNumber>
<BillAddress>
<Addr1>University of North Carolina</Addr1>
<Addr2>University City Blvd</Addr2>
<Addr3 />
<City>Charlotte</City>
<State>NC</State>
<PostalCode>9201</PostalCode>
<Country>United States</Country>
</BillAddress>
<InvoiceLineAdd>
<ItemRef>
<FullName>1000000000</FullName>
</ItemRef>
<Desc>Item 1 Description Goes Here</Desc>
<Quantity>1</Quantity>
<Rate>295</Rate>
</InvoiceLineAdd>
<InvoiceLineAdd>
<ItemRef>
<FullName>1000000001</FullName>
</ItemRef>
<Desc>Item 2 Description Goes Here</Desc>
<Quantity>5</Quantity>
<Rate>25</Rate>
</InvoiceLineAdd>
</InvoiceAdd>
</InvoiceAddRq>
</QBXMLMsgsRq>
</QBXML>