【问题标题】:How to query an account to get only single object in quickbooks?如何查询帐户以仅获取快速手册中的单个对象?
【发布时间】:2020-10-13 19:40:34
【问题描述】:

我正在调用此函数以获取具有特定名称的帐户详细信息

  const getAccount = async ({ realmId, auth }) => {
    const postBody = {
      url: `https://sandbox-quickbooks.api.intuit.com/v3/company/${realmId}/query?query=select * from Account where Name='Sales of Product Income'`,
      headers: {
        Accept: "application/json",
        "Content-Type": "application/x-www-form-urlencoded",
        Authorization: "Bearer " + auth
      }
    };
    const data = await rp.get(postBody);
    return JSON.parse(data);
  };

但是它给了我一个数组中的数据

{
  Account: [
    {
      Name: 'Sales of Product Income',
      SubAccount: false,
      FullyQualifiedName: 'Sales of Product Income',
      Active: true,
      Classification: 'Revenue',
      AccountType: 'Income',
      AccountSubType: 'SalesOfProductIncome',
      CurrentBalance: 0,
      CurrentBalanceWithSubAccounts: 0,
      CurrencyRef: [Object],
      domain: 'QBO',
      sparse: false,
      Id: '79',
      SyncToken: '0',
      MetaData: [Object]
    }
  ],
  startPosition: 1,
  maxResults: 1
}

所以我需要知道是否有任何 api 可以在快速手册中获取单个对象而不是数组,或者我可以传递一些参数来获取对象吗?

【问题讨论】:

    标签: node.js quickbooks quickbooks-online


    【解决方案1】:

    这个问题对于 quickbooks api 来说是非常具体的。我以前从没用过这个API,但是按照文档,他们提供了像SQL这样的过滤数据查询

    所以,我认为您可以使用相同的 api 并更改查询。类似SELECT * FROM your_table WHERE id = your_book_id

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-03-14
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多