Intuit合作伙伴平台 - API v3 QBO英国。
我正在将实体正确设置为现有客户,但日记帐分录将无法保存。第2行我正在使用Debtor帐户并将EntityId设置为有效客户。
<?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>
</JournalEntryLineDetail>
</Line>
<Line>
<Desc>Debit Accounts Receivable</Desc>
<Amount>150.00</Amount>
<DetailType>JournalEntryLineDetail</DetailType>
<JournalEntryLineDetail>
<PostingType>Debit</PostingType>
<AccountRef>52</AccountRef>
<ClassRef></ClassRef>
<DepartmentRef></DepartmentRef>
<BillableStatus></BillableStatus>
<EntityRef>
<EntityRef>21</EntityRef>
<Type>Customer</Type>
</EntityRef>
</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-13T09:22:10.585-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: When you use Debtors, you must choose a customer in the Name field.</Detail>
</Error>
</Fault>
</IntuitResponse>
</returns>
答案 0 :(得分:1)
您是否可以共享此问题的响应XML。 (如果您正在使用devkit,那么请将记录器设置为DEBUG模式,以获取原始请求和响应XML)
PFB一个工作的JE反应。
<JournalEntry domain="QBO" sparse="false">
<Id>6</Id>
<SyncToken>0</SyncToken>
<MetaData>
<CreateTime>2014-03-10T21:10:17-07:00</CreateTime>
<LastUpdatedTime>2014-03-10T21:10:17-07:00</LastUpdatedTime>
</MetaData>
<DocNumber>1</DocNumber>
<TxnDate>2014-03-11</TxnDate>
<CurrencyRef name="United States Dollar">USD</CurrencyRef>
<Line>
<Id>0</Id>
<Description>Debit</Description>
<Amount>100.00</Amount>
<DetailType>JournalEntryLineDetail</DetailType>
<JournalEntryLineDetail>
<PostingType>Debit</PostingType>
<Entity>
<Type>Customer</Type>
<EntityRef name="Customer123">2</EntityRef>
</Entity>
<AccountRef name="Accounts Receivable (A/R)">48</AccountRef>
<ClassRef name="CLASS-1">3000000000000199718</ClassRef>
</JournalEntryLineDetail>
</Line>
<Line>
<Id>1</Id>
<Description>Credit</Description>
<Amount>100.00</Amount>
<DetailType>JournalEntryLineDetail</DetailType>
<JournalEntryLineDetail>
<PostingType>Credit</PostingType>
<AccountRef name="Sales">1</AccountRef>
</JournalEntryLineDetail>
</Line>
<Adjustment>false</Adjustment>
</JournalEntry>
QBO UI(美国公司)
感谢
而不是
<EntityRef>
<EntityRef>21</EntityRef>
<Type>Customer</Type>
</EntityRef>
请尝试(从回复中得到)
<Entity>
<Type>Customer</Type>
<EntityRef name="Right Way Cleaners">21</EntityRef>
</Entity>
您在复合标记中使用了两次EntityRef。
答案 1 :(得分:0)
我的标签错了。它应该是实体,我有EntityRef。搞定了。谢谢你的帮助。