QuickBooks IPP v3 添加发票时出现错误 3200

问题描述:

我已经在生产中使用 QuickBooks PHP DevKit 一段时间了,没有出现任何问题.

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

但是,最近当我吐出时,我的 create_invoice ajax 脚本出现以下错误:

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();
}

我收到以下错误:

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

我能找到的关于此错误的唯一文档是错误代码 3200 表示过时的编辑序列",但我正在创建发票.

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?

它似乎从 7 月 11 日开始给我这个错误.在此之前,一切正常.

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?

我能找到的关于此错误的唯一文档是错误代码 3200 表示过时的编辑序列",但我正在创建发票.

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

错误代码 3200(对于 qbXML)与错误代码 003200(对于 IPP/v3)完全不同,因此过时的编辑序列"在这里根本不相关.

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?

通常,401 身份验证失败"错误几乎完全符合它所说的 - 对应用程序的身份验证失败.

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

这可能有几个原因:

  • 您的 OAuth 令牌已过期(如果您不续订,它们将在 6 个月后过期)
  • 您的 OAuth 令牌/连接已断开(这可以从 Intuit 提供的 UI 内完成)
  • 您不再发送正确的 OAuth 令牌

您是否检查过您的 OAuth 令牌?它们仍然有效吗?你发送的是正确的吗?

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?

也许吧.

您可以返回连接过程(例如再次单击连接到 QuickBooks"按钮)以更新它们.

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

如果它们已过期(例如,您在 6 个月内没有续订),您应该实施重新连接调用以避免将来发生这种情况:

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/

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