Open
Description
Hello!
I was wondering if you might be able to help, my program is trying to add an invoice but it can't because it can't find an item reference. So I'm trying to add an item, here is an XML that I've done. How to send it to QuickBooks?
<?xml version="1.0"?> <?qbxml version="13.0"?><QBXML><QBXMLMsgsRq onError="continueOnError"><ItemInventoryAddRq><ItemInventoryAdd><Name>Marat</Name><ClassRef><ListID>MAR00610-SD</ListID><FullName> Marat</FullName></ClassRef></ItemInventoryAdd></ItemInventoryAddRq></QBXMLMsgsRq></QBXML>
Here is my Java code that creates the XML:
public String addItem(String itemRefName) throws QBDB.DbException, JAXBException, URISyntaxException, IOException, ClassNotFoundException {
String[] itemData = itemRefName.split(":", 2);
System.out.println("=> item name" + itemData[0]);
System.out.println("=> item ref" + itemData[1]);
String xml = "";
QBXML qbXML = new QBXML();
QBXMLMsgsRq xmlMsgRq = new QBXMLMsgsRq();
xmlMsgRq.setOnError("continueOnError");
qbXML.setQBXMLMsgsRq(xmlMsgRq);
List<Object> reqList = xmlMsgRq.getHostQueryRqOrCompanyQueryRqOrCompanyActivityQueryRq();
ItemInventoryAddRqType itemAddRq = new ItemInventoryAddRqType();
reqList.add(itemAddRq);
ItemInventoryAdd item = new ItemInventoryAdd();
itemAddRq.setItemInventoryAdd(item);
item.setName(itemData[0]);
ClassRef classRef = new ClassRef();
classRef.setFullName(itemData[0]);
classRef.setListID(itemData[1]);
item.setClassRef(classRef);
xml = getRequestXml(qbXML);
return xml;
}
Error from invoice: InvoiceQueryRsType: A query request did not find a matching object in QuickBooks
Metadata
Metadata
Assignees
Labels
No labels