douweng5420 2014-07-26 16:53
浏览 255

在美国版本的QuickBooks Online中成功添加客户,但通过PHP中的Intuit API在加拿大版本的QBO中获得验证错误

I am using QBO IPP PHP SDK QuickBooks V3 API. The errors are

"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.]"

"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."

But When I get Customer Detail through same API then I get successfully All the customer details.

Any one can guide me. sorry, I forget to tell that I am using Canadian version Quick Books "https://ca.qbo.intuit.com".

Here is my Sample code for Add customer But the error is still not understandable for me.

I am using 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('support@consolibyte.com');
$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));
}

Thanks in Advance

  • 写回答

4条回答 默认 最新

  • doushuzd3033 2014-07-27 08:47
    关注

    When you do an update, you need to do a read first to get the latest metadata and synctoken for the entity. Then you should use that to do an update. Full or Sparse. suspect that you are not sending the Id or correct synctoken for update. Please paste your request/response xmls here.

    评论

报告相同问题?

悬赏问题

  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?
  • ¥15 matlab(相关搜索:紧聚焦)
  • ¥15 基于51单片机的厨房煤气泄露检测报警系统设计
  • ¥15 Arduino无法同时连接多个hx711模块,如何解决?