This is definitely not do-able:
$Customer->setId(101); // this is the ID i want to set
You can't just invent your own Id
values. These are QuickBooks's Id
values - essentially their primary key within QuickBooks Online itself.
If you do a query for objects, you'll get back Id
values for all of them. If you create a new object, you'll get back an Id
value from Intuit for the newly created object. Think of it just like an SQL database's AUTO_INCREMENT PRIMARY KEY
. You do an insert, you get back a unique Id
value.
This is not a limitation of the PHP code itself - it's how the actual QuickBooks API works. The Id
values are not your Id
values, they are QuickBooks' Id
values. They are not set-able values.
You should be storing the Id
values in your own database. Even if you could set those Id
values, you have to remember that you're not the only one with access to the QuickBooks data - if you could set them, then so could any other app that connects to QuickBooks essentially overwriting any value you set.