我正在尝试使用.NET SDK在QuickBooks在线支付对象上执行sparse update。出于某种原因,一旦我尝试在更新请求中指定<Line>
元素,我就会得到一个需要CustomerRef的ValidationError。
请求:
<?xml version="1.0"?>
<Payment xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" sparse="true" xmlns="http://schema.intuit.com/finance/v3">
<Id>1060</Id>
<SyncToken>3</SyncToken>
<TxnDate>2014-11-25</TxnDate>
<PrivateNote />
<Line>
<Amount>390.0000</Amount>
<LinkedTxn>
<TxnId>1308</TxnId>
<TxnType>Invoice</TxnType>
</LinkedTxn>
</Line>
<TotalAmt>390.0000</TotalAmt>
</Payment>
响应:
{"Fault": {
"Error": [{
"Message":"Required param missing, need to supply the required value for the API",
"Detail":"Required parameter CustomerRef is missing in the request",
"code":"2020",
"element":"Payment"}],
"type":"ValidationFault"},
"time":"2015-01-20T07:20:15.191-08:00"}
我认为稀疏更新意味着您未指定的任何内容与原始实体保持一致。我在documentation中看不到任何说法。我是否需要从当前实体获取CustomerRef以将其反馈给API并保持高兴,或者我只是做错了什么?
答案 0 :(得分:0)
虽然这是稀疏更新,但我认为必须使用customerref,作为对客户&#39;的验证检查。发送更新请求时需要。需要进行此项检查以验证CustomerRef for Updated付款是否与Invoice的CustomerRef相同。所以,你应该在你的请求中发送它。