我发送了下一个对象:
{
"TxnDate": "2020-05-05",
"DocNumber": "Test123",
"Line": [{
"Description": "Test FBA Fees",
"Amount": 100,
"DetailType": "JournalEntryLineDetail",
"JournalEntryLineDetail": {
"PostingType": "Credit",
"Entity": {
"Type": "Customer",
"EntityRef": {
"value": 1
}
},
"AccountRef": {
"value": 128
}
}
}, {
"Description": "Test",
"Amount": 100,
"DetailType": "JournalEntryLineDetail",
"JournalEntryLineDetail": {
"PostingType": "Debit",
"AccountRef": {
"value": 52
}
}
}]
}
但收到错误消息:
Passed array has no key for 'Value' when contructing an ReferenceType
.
请告诉我我的请求有什么问题?
您需要在JournalEntryLineDetail
下使用JournalEntryEntity
而不是Entity
,如下所示:
{
"TxnDate": "2020-05-05",
"DocNumber": "Test123",
"Line": [{
"Description": "Test FBA Fees",
"Amount": 100,
"DetailType": "JournalEntryLineDetail",
"JournalEntryLineDetail": {
"PostingType": "Credit",
"JournalEntryEntity": {
"Type": "Customer",
"EntityRef": {
"value": 1
}
},
"AccountRef": {
"value": 128
}
}
}, {
"Description": "Test",
"Amount": 100,
"DetailType": "JournalEntryLineDetail",
"JournalEntryLineDetail": {
"PostingType": "Debit",
"AccountRef": {
"value": 52
}
}
}]
}