问题
I have attempted to submit a Purchase as Check to QBD using PHP SDK with the below XML request content:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:Purchase xmlns:ns0="http://schema.intuit.com/finance/v3" domain="QB">
<ns0:TxnDate>2014-02-21</ns0:TxnDate>
<ns0:PrivateNote>Test for QBD Purchase Check</ns0:PrivateNote>
<ns0:Line>
<ns0:Description>E1</ns0:Description>
<ns0:Amount>10.00</ns0:Amount>
<ns0:DetailType>AccountBasedExpenseLineDetail</ns0:DetailType>
<ns0:AccountBasedExpenseLineDetail>
<ns0:ClassRef name="Coffee and tea">QB:8</ns0:ClassRef>
<ns0:AccountRef name="Computer and Internet Expenses">QB:10</ns0:AccountRef>
<ns0:BillableStatus>NotBillable</ns0:BillableStatus>
<ns0:TaxCodeRef>NON</ns0:TaxCodeRef>
</ns0:AccountBasedExpenseLineDetail>
</ns0:Line>
<ns0:Line>
<ns0:Description>E2</ns0:Description>
<ns0:Amount>15.00</ns0:Amount>
<ns0:DetailType>AccountBasedExpenseLineDetail</ns0:DetailType>
<ns0:AccountBasedExpenseLineDetail>
<ns0:CustomerRef name="Arnold Schwarzenegger">QB:3</ns0:CustomerRef>
<ns0:ClassRef name="Alcoholic beverages">QB:2</ns0:ClassRef>
<ns0:AccountRef name="Computer and Internet Expenses">QB:10</ns0:AccountRef>
<ns0:BillableStatus>NotBillable</ns0:BillableStatus>
<ns0:TaxCodeRef>NON</ns0:TaxCodeRef>
</ns0:AccountBasedExpenseLineDetail>
</ns0:Line>
<ns0:AccountRef name="My Bank Account">QB:30</ns0:AccountRef>
<ns0:PaymentType>Check</ns0:PaymentType>
<ns0:EntityRef name="Herry Pilor">QB:9</ns0:EntityRef>
<ns0:TotalAmt>25.00</ns0:TotalAmt>
</ns0:Purchase>
Since both lines have been marked BillableStatus=NotBillable, however, the first line comes without CustomerRef.
Submit that content should get this response message:
http://schema.intuit.com/finance/v3" time="2014-02-21T09:04:42.972Z">Operation failed with errors:
Operation not supported: Expense with BillableStatus should have CustomerRef for AccountBasedExpenseLineDetail Line in Purchase </Message></Error></Fault></IntuitResponse>
So the question is that why it requires Customer when BillableStatus=NotBillable?
But in the previous Java API version, there was no Customer expected when NotBillable
Please advice. Thanks
回答1:
BillableStatus must be excluded from the request if CustomerRef is not specified. This is a known issue.
来源:https://stackoverflow.com/questions/21985486/operation-not-supported-expense-with-billablestatus-should-have-customerref-for