【问题标题】:Intuit anywhere API telling me that a field is required when it's already specifiedIntuit Anywhere API 告诉我一个字段在已经指定时是必需的
【发布时间】:2013-01-31 02:51:24
【问题描述】:

我正在尝试在 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)并得到了类似的响应。提前感谢您的帮助。

【问题讨论】:

标签: quickbooks intuit-partner-platform


【解决方案1】:

Intuit XML 请求由 XSD 验证,而 XML 由 XSD 验证,您提供的标签的顺序很重要

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

切换您的 XML 标记的顺序以匹配文档中显示的顺序,您就可以完成所有设置。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-09-29
    • 1970-01-01
    • 2018-08-06
    • 1970-01-01
    相关资源
    最近更新 更多