我无法在 quickbooks/v3-php-sdk 中的 JournalEntryLineDetail 实体中正确设置 Customer 参数?



我发送了下一个对象:

{
"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
}
}
}]
}

最新更新