quickbooks - Intuit Anywhere API 告诉我某个字段在已指定时为必填字段

标签 quickbooks intuit-partner-platform

我正在尝试在 Windows 版 QB 中创建发票。这是 XML:

<?xml version='1.0' encoding='utf-8'?>
<Add xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.intuit.com/sb/cdm/v2" xsi:schemaLocation="http://www.intuit.com/sb/cdm/V2./RestDataFilter.xsd " RequestId="1836474224e142c9ad9b7dd6cb0eaa41" FullResponse="true">
  <OfferingId>ipp</OfferingId>
  <ExternalRealmId>596059545</ExternalRealmId>
  <Invoice>
    <Header>
      <TxnDate>2013-01-30</TxnDate>
      <DiscountAmt>0</DiscountAmt>
      <ARAccountName>Sales - Support and Maintenance</ARAccountName>
      <DiscountAccountName>Discounts/Refunds</DiscountAccountName>
      <DueDate>2013-02-17</DueDate>
      <Currency>USD</Currency>
      <CustomerId>4</CustomerId>
    </Header>
    <Line>
      <Qty>1</Qty>
      <UnitPrice>7.00</UnitPrice>
      <Desc>Follow-up Test, Instant for Person138-Org3 Person138-Org3</Desc>
    </Line>
  </Invoice>
</Add>

这是回复:

-2001:  cvc-complex-type.2.4.a: Invalid content was found starting with element 'ARAccountName'. One of '{"http://www.intuit.com/sb/cdm/v2":DiscountAccountId, "http://www.intuit.com/sb/cdm/v2":DiscountAccountName, "http://www.intuit.com/sb/cdm/v2":DiscountTaxable, "http://www.intuit.com/sb/cdm/v2":TxnId}' is expected.

我不明白,因为我已经指定了 DiscountAccountName。我还尝试使用更像 create example 的东西(与上面相同,但删除了 ARAccountName 和 DiscountAccountName)并得到了类似的响应。预先感谢您的帮助。

最佳答案

Intuit XML 请求由 XSD 验证,并且通过 XSD 验证 XML,您提供的标签的顺序很重要。

这意味着,如果文档 ( https://ipp.developer.intuit.com/0010_Intuit_Partner_Platform/0050_Data_Services/0500_QuickBooks_Windows/0600_Object_Reference/Invoice ) 规定 ARAccountName 位于 DiscountAmt 之前,那么您必须将 ARAccountName 置于 DiscountAmt 之前。

切换 XML 标记的顺序以匹配文档中显示的顺序,然后一切就完成了。

关于quickbooks - Intuit Anywhere API 告诉我某个字段在已指定时为必填字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14611054/

相关文章:

c# - QuickBooks: Unresolved SDK 引用?

asp.net-mvc-4 - 如何使用 MVC 4 实现三足 OAuth?

quickbooks - 缺少 QBWC WSDL

jquery - Intuit IPP 在 IE 中摧毁 jQuery

enterprise - QBXML 查询 50000 个客户不起作用

c# - 从 C# 代码集成 quickbooks 的最佳方法是什么?

soap - 使用 QuickBooks Web 连接器的身份验证问题 : Object reference not set to an instance of an object

c# - QBO/.NET SDK [Quickbooks Online] - 如何删除空发票行项目?

c# - IPP .NET SDK for QuickBooks v3.0 创建发票错误 - 错误请求

karate - 如何在Karate Framework中设置代理