QuickBooks IPP v3 getting error 3200 when adding I

2019-07-03 16:35发布

问题:

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?

回答1:

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:

  • https://github.com/consolibyte/quickbooks-php/blob/master/docs/partner_platform/example_app_ipp_v3/reconnect.php

  • https://github.com/consolibyte/quickbooks-php/blob/master/docs/partner_platform/example_app_ipp_v3/

  • https://github.com/consolibyte/quickbooks-php