Reputation: 3856
I am working on Quickbooks web connector and Customer Add works very well. Now I want to modify my customer and here is my xml.
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<CustomerModRq requestID="'.$requestID.'">
<CustomerMod>
<ListID>ConsoliBYTE, LLC (13912179)</ListID>
<EditSequence>1365684445</EditSequence>
<Name>Test Customer UPDATED</Name>
</CustomerMod>
</CustomerModRq>
</QBXMLMsgsRq>
</QBXML>
The logged error is
3000: The given object ID "ConsoliBYTE, LLC (13912179)" in the field "list id" is invalid.
What is the list id and how do i get it?
Upvotes: 0
Views: 567
Reputation: 11752
Summarizing:
<ListID>13912179</ListID>
<EditSequence>1565684445</EditSequence>
You can see all fields possible in CustomerModRq
here
Both ListID & EditSequence are crucial to perform an update.
You need to download the Customer before an update in QB to see the current EditSequence value. Also you need to give the exact value you got from your getCustomer query in EditSequence
. Otherwise CustomerModRq
has no effect.
Upvotes: 1
Reputation: 27962
A <ListID>
is an internal identifier (e.g. primary key) used by QuickBooks to identify a record.
An <EditSequence>
is a value which indicates when the last change was made to the record. Every time the record is updated (regardless of whether this happens through the UI, or API/SDK), the EditSequence
value changes. To update a record, you must provide the very latest EditSequence
value.
The value you provided for ListID
is definitely not correct. You provided a customer name, not a ListID.
Whenever you add or query for a customer, the ListID
value and the EditSequence
value will will be returned.
To do an update, you should query for the customer first (to get the latest EditSequence
value from QuickBooks) and then do your CustomerMod
request using those latest values.
If you're using this open-source QuickBooks PHP DevKit:
Then you should have request/response functions written to query for customers and update customers. Queue up a QUICKBOOKS_QUERY_CUSTOMER
and when you get back the response, queue up your QUICKBOOKS_MOD_CUSTOMER
request then, either storing the ListID
and EditSequence
in $extra
or in your own database somewhere.
Upvotes: 2