当我查询类型为 "Cost of Goods Sold" 的帐户时,我该如何 return ExpenseAccountRef?

When I Query an Account with Type "Cost of Goods Sold" how do I return ExpenseAccountRef?

我目前还需要两个必填字段来 创建非库存项目:
ExpenseAccountRef.valueExpenseAccountRef.name

我已针对 AccountType = 'Cost of Goods Sold'

发出查询

Account.Id = ExpenseAccountRef.value吗?
Account.Name = ExpenseAccount.name?

Use Account.Id and Account.Name from that object for ExpenseAccountRef.value and ExpenseAccountRef.name, respectively.

请求URL:

GET /v3/company/4620816365171303340/query?query=select * from Account where AccountType = 'Cost of Goods Sold'&minorversion=59

Content type:text/plain
Production Base URL:https://quickbooks.api.intuit.com
Sandbox Base URL:https://sandbox-quickbooks.api.intuit.com

查询:

select * from Account where AccountType = 
'Cost of Goods Sold'

Returns:

{
 "QueryResponse": {
  "Account": [
   {
    "Name": "Cost of Goods Sold",
    "SubAccount": false,
    "FullyQualifiedName": "Cost of Goods Sold",
    "Active": true,
    "Classification": "Expense",
    "AccountType": "Cost of Goods Sold",
    "AccountSubType": "SuppliesMaterialsCogs",
    "CurrentBalance": 0,
    "CurrentBalanceWithSubAccounts": 0,
    "CurrencyRef": {
     "value": "USD",
     "name": "United States Dollar"
    },
    "domain": "QBO",
    "sparse": false,
    "Id": "80",
    "SyncToken": "0",
    "MetaData": {
     "CreateTime": "2021-05-01T10:36:04-07:00",
     "LastUpdatedTime": "2021-05-01T10:36:04-07:00"
    }
   },
   {
    "Name": "MyJobs_test",
    "SubAccount": false,
    "FullyQualifiedName": "MyJobs_test",
    "Active": true,
    "Classification": "Expense",
    "AccountType": "Cost of Goods Sold",
    "AccountSubType": "CostOfLaborCos",
    "CurrentBalance": 0,
    "CurrentBalanceWithSubAccounts": 0,
    "CurrencyRef": {
     "value": "USD",
     "name": "United States Dollar"
    },
    "domain": "QBO",
    "sparse": false,
    "Id": "91",
    "SyncToken": "0",
    "MetaData": {
     "CreateTime": "2021-07-13T14:31:01-07:00",
     "LastUpdatedTime": "2021-07-13T14:31:01-07:00"
    }
   }
  ],
  "startPosition": 1,
  "maxResults": 2
 },
 "time": "2021-07-15T13:21:57.267-07:00"
}

官方 Intuit 开发者文档中的 ExpenseAccountRef 信息
"参考用于向供应商支付该项目费用的费用帐户。
必须是科目类型为销货成本的科目。
查询帐户名称列表资源以确定此引用的适当帐户对象。
使用该对象中的 Account.Id 和 Account.Name 分别用于 ExpenseAccountRef.value 和 ExpenseAccountRef.name。“
https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/item#create-an-item

是的,你没看错!

正如您引用的文档所说:

"Use Account.Id ... for ExpenseAccountRef.value

和:

"Account.Name ... for ExpenseAccountRef.name"

你在这里的问题是正确的陈述!

Does Account.Id = ExpenseAccountRef.value?

Does Account.Name = ExpenseAccount.name?

您回答了自己的问题。哇哦!去你的! :-)