I am using the Consolibytes QuickBooks Library; it's very helpful. Here is the link.
I noticed that, when pulling lists of customers, the ID number of the customer is surrounded by brackets and a hyphen.
Why is this the case?
Even in the supplied example that lists customers (example_customer_query.php), ID numbers are listed with brackets and a hyphen.
Would it be alright if I modified buildIDType() method within IDS.php and omitted the brackets and hyphen from the code?
The v3 APIs can communicate with two different platforms:
QuickBooks for Windows
QuickBooks Online
For QuickBooks for Windows, all of the Id values have two parts:
For QuickBooks Online, the Id values only have one part:
To keep things consistent across both platforms, we have elected to make the library return a bracketed version of the Id values that gives you both the domain and the id value, so that regardless of whether you're talking to QuickBooks desktop or QuickBooks Online, the representation of the Ids is the same.
You can strip the {-}
stuff off with this method:
$Id = '{-15}';
$my_int = QuickBooks_IPP_IDS::usableIDType($Id);
print($my_int); // prints just 15
You could certainly modify the code (it's all open-source after all) but it's not recommended as it will break your upgrade path. Also, note that if you ever start to offer QuickBooks for Windows syncing via v3 (or v4 or v5 or etc. etc. etc. when they are released) you're going to have to revert all of your changes.