Search code examples
phpquickbooksquickbooks-online

Quickbook-Online PHP integration


I just downloaded quickbooks-php from GitHub and setup connection which is working perfect but when I run "example_customer_add.php" page, it doesn't give me any error nor it save data to my quickbook.

Add Customer Code :

$CustomerService = new QuickBooks_IPP_Service_Customer();

$Customer = new QuickBooks_IPP_Object_Customer();
$Customer->setTitle('Ms');
$Customer->setGivenName('Shannon');
$Customer->setMiddleName('B');
$Customer->setFamilyName('Palmer');
$Customer->setDisplayName('Shannon B Palmer ' . mt_rand(0, 1000));
$CustomerService->add($Context, $realm, $Customer) 

Output : Our new customer ID is: [{-67}] (name "Shannon B Palmer 711")

Do I have to change anything else in the configuration or file location etc. If someone used that code, please help me.


Solution

  • The fact that you're getting this as output:

    Output : Our new customer ID is: [{-67}] (name "Shannon B Palmer 711")

    Means that your data did get saved to QuickBooks. That 67 value there is the internal QuickBooks Id value of your new customer.

    First, I would recommend that you make sure you are logged into your SANDBOX QuickBooks account, and NOT your LIVE QuickBooks account. The example by default connects to your SANDBOX QuickBooks account, and will not push data to live QuickBooks accounts without modification (changing $sandbox to false).

    Second, I would recommend that you log out of QuickBooks, or refresh the page, and look for the customer again. If you still can't find it, please post a screenshot of where you're searching in QuickBooks.