Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I add a line item to an existing Sales Order using QBXML

I'm able to pull up the sales order fine, and I think modifying the line items that are already there looks to make sense, but how would I go about adding an additional line item?

The OSR doesn't seem to make sense to me for this. https://developer-static.intuit.com/qbSDK-current/Common/newOSR/index.html

After I request my sales order, I get back this for the line items:

<SalesOrderLineRet>
<TxnLineID>15-1379092567</TxnLineID>
<ItemRef>
<ListID>80000002-1379090362</ListID>
<FullName>4684</FullName>
</ItemRef>
<Desc>tester</Desc>
<Quantity>3</Quantity>
<Rate>600.00</Rate>
<Amount>1800.00</Amount>
<SalesTaxCodeRef>
<ListID>80000002-1378850266</ListID>
<FullName>Non</FullName>
</SalesTaxCodeRef>
<Invoiced>0</Invoiced>
<IsManuallyClosed>false</IsManuallyClosed>
</SalesOrderLineRet>
<SalesOrderLineRet>
<TxnLineID>16-1379092567</TxnLineID>
<ItemRef>
<ListID>80000001-1378935144</ListID>
<FullName>Test Item</FullName>
</ItemRef>
<Desc>Shipment</Desc>
<Quantity>5</Quantity>
<Rate>5.00</Rate>
<Amount>25.00</Amount>
<SalesTaxCodeRef>
<ListID>80000002-1378850266</ListID>
<FullName>Non</FullName>
</SalesTaxCodeRef>
<Invoiced>0</Invoiced>
<IsManuallyClosed>false</IsManuallyClosed>
</SalesOrderLineRet>

Now that makes sense, so then I look at the qbxml for SalesOrderMod and for the line items section I see:

<SalesOrderLineMod> <!-- optional -->
<TxnLineID >IDTYPE</TxnLineID> <!-- required -->
<ItemRef> <!-- optional -->
<ListID >IDTYPE</ListID> <!-- optional -->
<FullName >STRTYPE</FullName> <!-- optional -->
</ItemRef>
<Desc >STRTYPE</Desc> <!-- optional -->
<Quantity >QUANTYPE</Quantity> <!-- optional -->
<UnitOfMeasure >STRTYPE</UnitOfMeasure> <!-- optional -->
<OverrideUOMSetRef> <!-- optional -->
<ListID >IDTYPE</ListID> <!-- optional -->
<FullName >STRTYPE</FullName> <!-- optional -->
</OverrideUOMSetRef>
<!-- BEGIN OR -->
<Rate >PRICETYPE</Rate> <!-- optional -->
<!-- OR -->
<RatePercent >PERCENTTYPE</RatePercent> <!-- optional -->
<!-- OR -->
<PriceLevelRef> <!-- optional -->
<ListID >IDTYPE</ListID> <!-- optional -->
<FullName >STRTYPE</FullName> <!-- optional -->
</PriceLevelRef>
<!-- END OR -->
<ClassRef> <!-- optional -->
<ListID >IDTYPE</ListID> <!-- optional -->
<FullName >STRTYPE</FullName> <!-- optional -->
</ClassRef>
<Amount >AMTTYPE</Amount> <!-- optional -->
<InventorySiteRef> <!-- optional -->
<ListID >IDTYPE</ListID> <!-- optional -->
<FullName >STRTYPE</FullName> <!-- optional -->
</InventorySiteRef>
<InventorySiteLocationRef> <!-- optional -->
<ListID >IDTYPE</ListID> <!-- optional -->
<FullName >STRTYPE</FullName> <!-- optional -->
</InventorySiteLocationRef>
<!-- BEGIN OR -->
<SerialNumber >STRTYPE</SerialNumber> <!-- optional -->
<!-- OR -->
<LotNumber >STRTYPE</LotNumber> <!-- optional -->
<!-- END OR -->
<SalesTaxCodeRef> <!-- optional -->
<ListID >IDTYPE</ListID> <!-- optional -->
<FullName >STRTYPE</FullName> <!-- optional -->
</SalesTaxCodeRef>
<IsManuallyClosed >BOOLTYPE</IsManuallyClosed> <!-- optional -->
<Other1 >STRTYPE</Other1> <!-- optional -->
<Other2 >STRTYPE</Other2> <!-- optional -->
</SalesOrderLineMod>

So it appears I can modify lines, but it's not clear that I can add new lines. Am I missing something? The fact that: IDTYPE is required for the line items, and it wouldn't exist for a new item makes me think this isn't supported.

like image 213
Kevin Korb Avatar asked Sep 17 '13 16:09

Kevin Korb


1 Answers

From the OSR - TxnLineID

TxnLineID Identification number of the transaction line. (TxnLineID is supported as of v2.0 of the SDK. With qbXML v1.0 and v1.1, TxnLineID is always returned as zero.)

If you need to add a new transaction line in a transaction Mod request, you can do so by setting the TxnLineID to -1.

So enter -1 to add a line.

<SalesOrderLineMod>
  <TxnLineID>-1</TxnLineID>
  ... the rest of your new line item details here ...
</SalesOrderLineMod>
like image 136
William Lorfing Avatar answered Dec 05 '22 22:12

William Lorfing