简体   繁体   English

在发票专列项中的在线Quickbooks中创建产品/服务

[英]Creating product/Service in Quickbooks Online in an Invoice line item

I'm trying to create the service/product type in the invoice line item. 我正在尝试在发票订单项中创建服务/产品类型。 It returns an error saying bad request, is my ItemRef phrased correctly. 它返回一个错误,指出错误的请求,是我的ItemRef用正确的措词。 My service/product is created in qbo already, its called Subscription Fee, it's the 3rd in the dropdown list. 我的服务/产品已经在qbo中创建,它称为“订阅费”,它是下拉列表中的第3个。

line.AnyIntuitObject = new Intuit.Ipp.Data.SalesItemLineDetail()
                            {
                                ItemRef = new Intuit.Ipp.Data.ReferenceType()
                                {
                                    Value = "3",
                                    type = "Item",
                                    name = "Subscription Fee"
                                },
                                ItemElementName = Intuit.Ipp.Data.ItemChoiceType.UnitPrice,
                                AnyIntuitObject = (decimal)item.Rate, // Line item rate
                                Qty = (decimal)item.Quantity,
                                QtySpecified = true,
                                ServiceDate = DateTime.Now.Date,
                                ServiceDateSpecified = true,
                                TaxCodeRef = new Intuit.Ipp.Data.ReferenceType()
                                {
                                    Value = taxCode0ZR.Id,
                                    type = Enum.GetName(typeof(Intuit.Ipp.Data.objectNameEnumType), Intuit.Ipp.Data.objectNameEnumType.TaxRate),
                                    name = taxCode0ZR.Name
                                },
                            };

What am i creating wrongly please help. 我在错误地创建什么,请提供帮助。

You cannot create an Item within an invoice or rather any entity within an entity. 您不能在发票内创建实体,也不能在实体内创建任何实体。 QBO v3 does not supports creating entities on the fly. QBO v3不支持动态创建实体。 You first need to do a create Item. 您首先需要执行一个创建项目。 Get the Id of that Item and refer it in your Invoice. 获取该项目的ID,并在您的发票中引用它。

Also, enable request/response log to get the details of the errors in log files- https://developer.intuit.com/docs/0025_quickbooksapi/0055_devkits/0150_ipp_.net_devkit_3.0/0002_configuration/override_configuration 另外,启用请求/响应日志以获取日志文件中错误的详细信息-https ://developer.intuit.com/docs/0025_quickbooksapi/0055_devkits/0150_ipp_.net_devkit_3.0/0002_configuration/override_configuration

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM