user2929814
user2929814

Reputation: 11

QuickBooks Online API Diagnostics.php ERROR

I am testing QuickBooks Online API by using the source code from the following URL: https://github.com/consolibyte/quickbooks-php

When I test the diagnostics.php http://mydomain.info/qb/docs/example_app_ipp_v3/diagnostics.php

I got the following error: Warning: array_merge(): Argument #2 is not an array in /home/mydomain.info/public_html/qb/docs/example_app_ipp_v3/diagnostics.php on line 15

The connection is fine.

Please advise

Upvotes: 1

Views: 175

Answers (1)

Keith Palmer Jr.
Keith Palmer Jr.

Reputation: 27952

If $creds is empty, it means that you have not yet established a valid OAuth connection to Intuit's servers.

You need to do that before anything is going to work. If you're just trying to get rid of the error, just cast $creds to an array.

To establish a connection, click the "Connect to QuickBooks" button that's shown on the /index.php script when you visit it in a browser. You'll be walked through the OAuth setup process (make sure you've changed the URLs, app token, and OAuth credentials in config.php first, and configured your URLs in your IPP app as well on Intuit's site).

Regarding your other questions:

  • $the_username and $the_tenant can be left at their defaults for testing.

  • In production, you will likely NEVER use $the_username (it's used only in very specific special circumstances). $the_tenant should be set to your unique tenant identifier within your SaaS app (or, if you're not a SaaS app, just leave it at it's default).

Upvotes: 2

Related Questions