QBO-V3-使用物料和税收创建采购订单

时间:2013-10-21 21:23:47

标签: intuit-partner-platform

我正在尝试使用以下XML

创建采购订单
    <?xml version="1.0"?>
    <PurchaseOrder xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schema.intuit.com/finance/v3">
      <DocNumber>4</DocNumber>
      <TxnDate>2013-10-22T06:45:16.327227</TxnDate>
      <Line>
        <Id>3</Id>
        <Description>test</Description>
        <Amount>15.4</Amount>
        <DetailType>ItemBasedExpenseLineDetail</DetailType>
        <ItemBasedExpenseLineDetail>
          <ItemRef name="Ext Prod 2">4</ItemRef>
          <UnitPrice>7</UnitPrice>
          <Qty>2</Qty>
          <TaxCodeRef type="TaxCode" name="GST on non-capital">2</TaxCodeRef>
        </ItemBasedExpenseLineDetail>
      </Line>
      <VendorRef name="Ext Sup 1">9</VendorRef>
    </PurchaseOrder>

但是我收到以下错误

    <IntuitResponse xmlns="http://schema.intuit.com/finance/v3" time="2013-10-21T14:17:31.468-07:00">
        <Fault type="ValidationFault">
            <Error code="6000" element="">
                <Message>A business validation error has occurred while processing your request</Message>
                <Detail>Business Validation Error: We're sorry, QuickBooks encountered an error while calculating tax. Try reselecting the tax rate or reentering the product/service item and saving the form again. &lt;a href='https://support.qbo.intuit.com/support/help-article.cfm?faq_id=5558&amp;locale=en_AU' target="_blank" title="Help"&gt;Please click here for more information&lt;/a&gt;</Detail>
            </Error>
        </Fault>
    </IntuitResponse>

有人可以帮助我吗?创建Invoice的XML非常相似。

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <Invoice xmlns="http://schema.intuit.com/finance/v3">
        <DocNumber>b2980</DocNumber>
        <TxnDate>2013-09-05</TxnDate>
        <Line>
            <Id>3</Id>
            <Description>test</Description>
            <Amount>10000</Amount>
            <DetailType>SalesItemLineDetail</DetailType>
            <SalesItemLineDetail>
                <ItemRef name="Ext Prod 2">4</ItemRef>
                <UnitPrice>7</UnitPrice>
                <Qty>2</Qty>
                <TaxCodeRef name="Input tax">6</TaxCodeRef>
            </SalesItemLineDetail>
        </Line>
        <CustomerRef name="TestDataCustomer620d5Sample1">1</CustomerRef>
    </Invoice>

非常感谢使用项目,数量和税金创建采购订单的工作XML示例。

更新2

尝试在行中指定TxnTaxDetail而不是tax,但得到了错误

    <IntuitResponse xmlns="http://schema.intuit.com/finance/v3" time="2013-10-22T00:14:45.815-07:00">
      <Fault type="ValidationFault">
        <Error code="6000" element="">
          <Message>A business validation error has occurred while processing your request</Message>
          <Detail>Business Validation Error: One or more charge lines do not have a tax code associated with it. Please assign a tax code for those lines.</Detail>
        </Error>
      </Fault>
    </IntuitResponse>

为了完整性,这是我测试的请求

<?xml version="1.0"?>
<PurchaseOrder xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schema.intuit.com/finance/v3">
  <DocNumber>5</DocNumber>
  <TxnDate>2013-10-22T12:33:01.117104</TxnDate>
  <PrivateNote />
  <Line>
    <Amount>15</Amount>
    <DetailType>ItemBasedExpenseLineDetail</DetailType>
    <ItemBasedExpenseLineDetail>
      <ItemRef name="Ext Prod 2">4</ItemRef>
      <UnitPrice>5</UnitPrice>
      <Qty>3</Qty>
    </ItemBasedExpenseLineDetail>
  </Line>
  <VendorRef name="Ext Sup 1">9</VendorRef>
  <TotalAmt>15</TotalAmt>
  <GlobalTaxCalculation>TaxExcluded</GlobalTaxCalculation>
  <SalesTermRef>4</SalesTermRef>
  <DueDate>2013-12-21T12:33:01.117104</DueDate>
  <TxnTaxDetail>
    <DefaultTaxCodeRef name="GST on non-capital">2</DefaultTaxCodeRef>
  <TotalTax>0</TotalTax>
  </TxnTaxDetail>
</PurchaseOrder>

“非资本消费税”是澳大利亚版本自动创建的税。但我也尝试过手动创建税收。

1 个答案:

答案 0 :(得分:0)

您是否在此检查了IPP提供的xml- https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/v3/030_entity_services_reference/purchaseorder

它有请求和响应。

您是否可以包含TxnTaxDetail行而不是为每个项添加。如果支持与否,我将不得不与工程团队核实。