0
votes

Trying to get a journal entry to save in QBO UK using TaxCodeRef but keep getting the same error message back. I have set the TaxApplicableOn correctly. I did a query of a manually entered journal entry and it shows the element TaxAmount however I don't know this value at runtime. How can I get a journal entry to save when setting a TaxCodeRef?

Here's my XML request and response.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<outgoing><?xml version="1.0" encoding="UTF-8"?>
  <JournalEntry xmlns:ns2="http://www.intuit.com/sb/cdm/qbo" xmlns="http://schema.intuit.com/finance/v3">
    <TxnDate>2014-03-05</TxnDate>
    <PrivateNote>Invoice</PrivateNote>
    <DocNumber>102</DocNumber>
    <Adjustment>false</Adjustment>
    <Line>
      <Desc>Credit Sales</Desc>
      <Amount>150</Amount>
      <DetailType>JournalEntryLineDetail</DetailType>
      <JournalEntryLineDetail>
        <PostingType>Credit</PostingType>
        <AccountRef>1</AccountRef>
        <ClassRef></ClassRef>
        <DepartmentRef></DepartmentRef>
        <BillableStatus></BillableStatus>
        <TaxCodeRef>3</TaxCodeRef>
        <TaxApplicableOn>Credit</TaxApplicableOn>
      </JournalEntryLineDetail>
    </Line>
    <Line>
      <Desc>Debit Accounts Receivable</Desc>
      <Amount>150.00</Amount>
      <DetailType>JournalEntryLineDetail</DetailType>
      <JournalEntryLineDetail>
        <PostingType>Debit</PostingType>
        <Entity>
          <Type>Customer</Type>
          <EntityRef>21</EntityRef>
        </Entity>
        <AccountRef>52</AccountRef>
        <ClassRef></ClassRef>
        <DepartmentRef></DepartmentRef>
        <BillableStatus></BillableStatus>
        <TaxCodeRef>3</TaxCodeRef>
        <TaxApplicableOn>Debit</TaxApplicableOn>
      </JournalEntryLineDetail>
    </Line>
  </JournalEntry>
</outgoing>
<returns><?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  <IntuitResponse xmlns="http://schema.intuit.com/finance/v3" time="2014-03-17T07:21:39.545-07:00">
    <Fault type="ValidationFault">
      <Error code="2270" element="TaxApplicableOn">
        <Message>TaxApplicableon missing or invalid</Message>
        <Detail>TaxApplicableOn null is required and valid values are Credit or Debit</Detail>
      </Error>
      <Error code="2270" element="TaxApplicableOn">
        <Message>TaxApplicableon missing or invalid</Message>
        <Detail>TaxApplicableOn null is required and valid values are Credit or Debit</Detail>
      </Error>
    </Fault>
  </IntuitResponse>
</returns>
1

1 Answers

1
votes

I created a Journal Entry from QBO UI and selected Sales Check box on the line item. Here is the response. Looks like the error message is wrong. Valid value is Sales or Purchase(if Sales box is not selected). Let me get some more details around this.

<JournalEntry domain="QBO" sparse="false">
  <Id>29</Id>
  <SyncToken>0</SyncToken>
  <MetaData>
    <CreateTime>2014-03-17T22:29:18-07:00</CreateTime>
    <LastUpdatedTime>2014-03-17T22:29:18-07:00</LastUpdatedTime>
  </MetaData>
  <DocNumber>DocNu2</DocNumber>
  <TxnDate>2014-03-18</TxnDate>
  <CurrencyRef name="British Pound Sterling">GBP</CurrencyRef>
  <ExchangeRate>1</ExchangeRate>
  <Line>
    <Id>0</Id>
    <Description>ff</Description>
    <Amount>24.00</Amount>
    <DetailType>JournalEntryLineDetail</DetailType>
    <JournalEntryLineDetail>
      <PostingType>Debit</PostingType>
      <Entity>
        <Type>Customer</Type>
        <EntityRef name="toto">1</EntityRef>
      </Entity>
      <AccountRef name="Debtors">50</AccountRef>
      <TaxCodeRef>3</TaxCodeRef>
      <TaxApplicableOn>Sales</TaxApplicableOn>
      <TaxAmount>4.80</TaxAmount>
    </JournalEntryLineDetail>
  </Line>
  <Line>
    <Id>1</Id>
    <Description>ff</Description>
    <Amount>28.80</Amount>
    <DetailType>JournalEntryLineDetail</DetailType>
    <JournalEntryLineDetail>
      <PostingType>Credit</PostingType>
      <Entity>
        <Type>Customer</Type>
        <EntityRef name="toto">1</EntityRef>
      </Entity>
      <AccountRef name="Savings">59</AccountRef>
      <TaxCodeRef>9</TaxCodeRef>
      <TaxApplicableOn>Sales</TaxApplicableOn>
      <TaxAmount>0.00</TaxAmount>
    </JournalEntryLineDetail>
  </Line>
  <TxnTaxDetail>
    <TaxLine>
      <Amount>4.80</Amount>
      <DetailType>TaxLineDetail</DetailType>
      <TaxLineDetail>
        <TaxRateRef>4</TaxRateRef>
        <PercentBased>true</PercentBased>
        <TaxPercent>20</TaxPercent>
        <NetAmountTaxable>24.00</NetAmountTaxable>
      </TaxLineDetail>
    </TaxLine>
    <TaxLine>
      <Amount>0</Amount>
      <DetailType>TaxLineDetail</DetailType>
      <TaxLineDetail>
        <TaxRateRef>15</TaxRateRef>
        <PercentBased>true</PercentBased>
        <TaxPercent>0</TaxPercent>
        <NetAmountTaxable>-28.80</NetAmountTaxable>
      </TaxLineDetail>
    </TaxLine>
  </TxnTaxDetail>
  <Adjustment>false</Adjustment>
</JournalEntry>

I see that the docs here- https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/030_entity_services_reference/journalentry

mention that it is a type of TaxApplicableOnEnum which has valid values as sales or purchase.