user2631610
user2631610

Reputation: 1

Write xml into QuickBooks using API fails. "Cannot consume content-type"

I can read data from QB using API without problems, however, any attempt to write / update object in QB causes "Cannot consume content-type". The same XML submitted using QB's playground works fine. Below are the examples of XMLs:

Posting this:

<pre>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <PurchaseOrder xmlns="http://schema.intuit.com/finance/v3">
    <Line>
    <Id>1</Id>
    <Amount>4.00</Amount>
    <DetailType>ItemBasedExpenseLineDetail</DetailType>
    <ItemBasedExpenseLineDetail>
    <ItemRef>21</ItemRef>
    <UnitPrice>2.00</UnitPrice>
    <Qty>2</Qty>
    </ItemBasedExpenseLineDetail>
    </Line>
    <Line>
    <Id>2</Id>
    <Amount>150.00</Amount>
    <DetailType>ItemBasedExpenseLineDetail</DetailType>
    <ItemBasedExpenseLineDetail>
    <ItemRef>18</ItemRef>
    <UnitPrice>30.00</UnitPrice>
    <Qty>5</Qty>
    </ItemBasedExpenseLineDetail>
    </Line>
    <VendorRef>2</VendorRef>
    <TotalAmt>154.00</TotalAmt>
    <ShipAddr>
    <Line1>My address</Line1>
    <Line2>State College, PA 16801</Line2>
    </ShipAddr>
    <POStatus>Open</POStatus>
</PurchaseOrder>
</pre>

Getting back this:

<pre>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<IntuitResponse xmlns="http://schema.intuit.com/finance/v3" time="2014-05-07T09:44:07.876-07:00">
<Fault type="SystemFault">
<Error code="10000">
<Message>An application error has occurred while processing your request</Message>
<Detail>System Failure Error: Cannot consume content type</Detail>
</Error></Fault></IntuitResponse>
</pre>

Have been searching for solution for a few days, no result. Would appreciate any pointers.

Upvotes: 0

Views: 710

Answers (1)

Keith Palmer Jr.
Keith Palmer Jr.

Reputation: 27962

Are you setting a Content-Type in your HTTP request headers?

What is it set to? $5 says it's not set, or set to something other than application/xml like it should be.

Upvotes: 1

Related Questions