我正在使用 QBO IPP PHP SDK QuickBooks V3 API。 错误是
“6000:[处理您的请求时发生业务验证错误,业务验证错误:此操作所需的内容不再可用。其他用户可能已将其删除。请刷新屏幕以查看当前信息。]”
“6000:[处理您的请求时发生业务验证错误,业务验证错误:您一次只能添加或编辑一个名称。请重试。”
但是当我通过相同的 API 获取客户详细信息时,我会成功获取所有客户详细信息。
任何人都可以指导我。 抱歉,我忘记告诉您我正在使用加拿大版 Quick Books“https://ca.qbo.intuit.com”。
这是我添加客户的示例代码,但该错误对我来说仍然无法理解。
我正在使用 V3 API
$CustomerService = new QuickBooks_IPP_Service_Customer();
$Customer = new QuickBooks_IPP_Object_Customer();
$Customer->setTitle('MR');
$Customer->setGivenName('Abdul');
$Customer->setMiddleName('Hanan');
$Customer->setFamilyName('Cheema');
$Customer->setFullyQualifiedName('FullyQualifiedName cheema');
$Customer->setDisplayName('Abdul Hanan Cheema ' . mt_rand(0, 1000));
$Customer->setCompanyName('Seed Corporation');
$Customer->setPrintOnCheckName('PrintOnCheckName See');
$Customer->setActive('1');
$Customer->setDefaultTaxCodeRef('12');
$Customer->setTaxable('0');
$Customer->setJob('jobSee');
$Customer->setBillWithParent('0');
$Customer->setBalance('100');
$Customer->setBalanceWithJobs('0');
$Customer->setCurrencyRef('CAD');
$Customer->setPreferredDeliveryMethod('Email');
// $Customer->setJob('jobSee');
// Terms (e.g. Net 30, etc.)
$Customer->setSalesTermRef(4);
// Phone #
$PrimaryPhone = new QuickBooks_IPP_Object_PrimaryPhone();
$PrimaryPhone->setFreeFormNumber('860-532-0099');
$Customer->setPrimaryPhone($PrimaryPhone);
// Mobile #
$Mobile = new QuickBooks_IPP_Object_Mobile();
$Mobile->setFreeFormNumber('860-532-0099');
$Customer->setMobile($Mobile);
// Fax #
$Fax = new QuickBooks_IPP_Object_Fax();
$Fax->setFreeFormNumber('860-532-0099');
$Customer->setFax($Fax);
// Bill address
$BillAddr = new QuickBooks_IPP_Object_BillAddr();
$BillAddr->setLine1('Office#2 Ali Tower');
$BillAddr->setLine2('GUlburg3');
$BillAddr->setCity('Lahore');
$BillAddr->setCountrySubDivisionCode('PK');
$BillAddr->setPostalCode('44000');
$Customer->setBillAddr($BillAddr);
// Email
$PrimaryEmailAddr = new QuickBooks_IPP_Object_PrimaryEmailAddr();
$PrimaryEmailAddr->setAddress('<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="55262025253a272115363a3b263a393c372c21307b363a38" rel="noreferrer noopener nofollow">[email protected]</a>');
$Customer->setPrimaryEmailAddr($PrimaryEmailAddr);
if ($resp = $CustomerService->add($Context, $realm, $Customer))
{
print('Our new customer ID is: [' . $resp . '] (name "' . $Customer->getDisplayName() . '")');
}
else
{
print($CustomerService->lastError($Context));
}
提前致谢
最佳答案
对于此错误:
"6000: [A business validation error has occurred while processing your request, Business Validation Error: Something this action required is no longer available. Another user may have deleted it. Please refresh your screen to see the current information.]"
您需要检查您所引用的所有内容(SalesTerm、TaxCode)并确保它们确实存在。其中之一没有。
对于此错误:
"6000: [A business validation error has occurred while processing your request, Business Validation Error: You can only add or edit one name at a time. Please try again."
确保一次仅添加/编辑一件事。
关于php - 在美国版 QuickBooks Online 中成功添加客户,但在加拿大版 QBO 中通过 PHP 中的 Intuit API 出现验证错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24973350/