创建项目类别类型throw" 6000:处理您的请求时出现业务验证错误"错误

时间:2018-03-29 00:55:15

标签: php api quickbooks

我正在使用v3-php-sdk,创建非类别类型的项目效果很好。

问题是当该项目被用作类别时,例如

Array
(
    [Name] => Item
    [FullyQualifiedName] => Item
    [Type] => Category
)

然后我打电话

Item::create($arrayItem)

它生成了这样的对象。

QuickBooksOnline\API\Data\IPPItem Object
        (
            [Name] => Item
            [Sku] => 
            [Description] => 
            [Active] => 
            [SubItem] => 
            [ParentRef] => 
            [Level] => 
            [FullyQualifiedName] => Item
            [Taxable] => 
            [SalesTaxIncluded] => 
            [PercentBased] => 
            [UnitPrice] => 
            [RatePercent] => 
            [Type] => QuickBooksOnline\API\Data\IPPCustomFieldTypeEnum Object
                (
                    [value] => Category
                )

            [PaymentMethodRef] => 
            [UOMSetRef] => 
            [IncomeAccountRef] => 
            [PurchaseDesc] => 
            [PurchaseTaxIncluded] => 
            [PurchaseCost] => 
            [ExpenseAccountRef] => 
            [COGSAccountRef] => 
            [AssetAccountRef] => 
            [PrefVendorRef] => 
            [AvgCost] => 
            [TrackQtyOnHand] => 
            [QtyOnHand] => 
            [QtyOnPurchaseOrder] => 
            [QtyOnSalesOrder] => 
            [ReorderPoint] => 
            [ManPartNum] => 
            [DepositToAccountRef] => 
            [SalesTaxCodeRef] => 
            [PurchaseTaxCodeRef] => 
            [InvStartDate] => 
            [BuildPoint] => 
            [PrintGroupedItems] => 
            [SpecialItem] => 
            [SpecialItemType] => 
            [ItemGroupDetail] => 
            [ItemAssemblyDetail] => 
            [AbatementRate] => 
            [ReverseChargeRate] => 
            [ServiceType] => 
            [ItemCategoryType] => 
            [ItemEx] => 
            [Id] => 
            [SyncToken] => 
            [MetaData] => 
            [CustomField] => 
            [AttachableRef] => 
            [domain] => 
            [status] => 
            [sparse] => 
        )

然而,它总是会抛出这个对象的错误,在我的研究中他们说我们不应该传递0或负数例如。 unitprice或其他字段,但如果是这样的话,那么sdk是生成这个对象的那个,我只提供我拥有的数据。

有关于此的任何想法吗?

2 个答案:

答案 0 :(得分:1)

"对于Sandbox,默认情况下不启用类别。您需要转到此链接以在沙盒上启用它:https://sandbox.qbo.intuit.com/app/categorymigration

尝试创建一个免费试用制作公司,一切都应该正常工作"

根据Hao_Lu(Intuit开发者组织)

点击此link了解详情。

答案 1 :(得分:0)

那是因为[UnitPrice] =>是空的。如果这是你得到的错误信息,你将需要传递一些正值

Array
(
    [Name] => Item
    [FullyQualifiedName] => Item
    [Type] => Category
    [UnitPrice] => 1
)