1
votes

I want to send customers and invoices to the quickbooks online account using the consolibyte quickbooks php devkit. I've managed to do that, but i can't set up my custom IDs for the customers and invoices because the library unset them from objects.

Does anybody know if this is achievable or if quickbooks API allows this?

The alternative would be to store a quickbooks_id in my database, which i was trying to avoid.

Thanks!

Edit: some code

$IPP->version(QuickBooks_IPP_IDS::VERSION_3);

$CustomerService = new QuickBooks_IPP_Service_Customer();

$Customer = new QuickBooks_IPP_Object_Customer();
$Customer->setId(101); // this is the ID i want to set
$Customer->setTitle('Mr');
$Customer->setGivenName('John');
$Customer->setFamilyName('Doe');
1
Post your code. There isn't any such thing as a "Custom ID" in QuickBooks. Do you mean a "Custom Field"? - Keith Palmer Jr.
Also, you SHOULD be storing QuickBooks's Id values in your database unless you know you can query by some other field to find the object you want immediately. Intuit only allows querying by a very few specific fields (your Id values won't be one of them) so you're going to need to store the QuickBooks Id values so that you can query/match things up by the Id. - Keith Palmer Jr.
so it's a QB API thing, their documentation developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/… is vague at best. - Bobby Tables
Answered below - think of it just like a database - you insert a record, you get back a unique Id value. You can't invent your own Ids. - Keith Palmer Jr.

1 Answers

1
votes

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.