Search code examples
phpquickbooksquickbooks-online

QuickBooks IPP v3 getting error 3200 when adding Invoice


I've been using the QuickBooks PHP DevKit for some time now in production with no issues.

However, recently I've been getting the following error from my create_invoice ajax script when I spit out:

if($resp = $InvoiceService->add($Context, $realm, $Invoice)){ 
    //create invoice code here
} else 
{
    echo $InvoiceService->lastError();
}

I get the following error:

3200: [message=ApplicationAuthenticationFailed; errorCode=003200; statusCode=401, ]

The only documentation I can find about this error is that error code 3200 means "Outdated edit sequence" but I am creating an Invoice.

So why is this error all of a sudden appearing?

It seems to have started giving me this error since July 11th. Before then everything was working fine.

Do I need to refresh my access tokens, and how would I go about doing that?


Solution

  • The only documentation I can find about this error is that error code 3200 means "Outdated edit sequence" but I am creating an Invoice.

    Error code 3200 (for qbXML) is entirely separate from error code 003200 (for IPP/v3), so "outdated edit sequence" isn't really relevant here at all.

    So why is this error all of a sudden appearing?

    Generally a "401 Authentication Failed" error pretty much means exactly what it says - authentication against the app failed.

    This could be because of several reasons:

    • Your OAuth tokens expired (they expire after 6 months if you don't renew them)
    • Your OAuth tokens/connection were disconnected (this can be done from within the UI Intuit provides)
    • You're not sending the correct OAuth tokens anymore

    Did you check your OAuth tokens? Are they still valid? Are you sending the correct ones?

    Do I need to refresh my access tokens, and how would I go about doing that?

    Maybe.

    You can go back through the connection process (e.g. click the "Connect to QuickBooks" button again) to renew them.

    If they have expired (e.g. you didn't renew within 6 months) you should implement the reconnect call to avoid this in the future: