首页 > 解决方案 > 如何获取发票字段以在快速手册中进行映射?

问题描述

我正在使用npm quickbooks。我想获取发票字段以与我的本地字段进行映射。但是找不到任何相同的 API 或函数,或者我可能不在轨道上。那么任何人都可以请逐步解释如何使用快速书籍发票映射我们的本地字段

我可以使用getInvoice但问题是我必须在其中传递快速书籍发票 ID。

.getInvoice("150", (err, data) => {
    if (err) {
      return reject(err);
    } else {
      return resolve(data);
    }
  });

但我只需要映射字段。

标签: node.jsreactjsquickbooksquickbooks-online

解决方案


QuickBooks Online API 本身无法获取可用字段的列表。

您将获得的最接近方法是手动下载和解析.XSDIntuit 为 API 定义的文档。

您可以在.XSD此处下载文件:

这将为您提供如下数据:

<xs:element name="CustomerRef" type="ReferenceType"
                                minOccurs="0">
                        <xs:annotation>
                            <xs:documentation>
                                Product: ALL
                                Description: Reference to a Customer or job.
                                Filterable: QBW
                                InputType: ReadWrite
                                BusinessRules: QBW: CustomerRef is mandatory for some SalesTransactions like
                                Invoice
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>

然后您可以解析并确定哪些字段可用于哪种对象类型。

这将是超级复杂的,对你来说超级耗时。

就像其他评论者已经告诉您的那样,仅参考 Intuit 的开发人员文档可能会更好:


推荐阅读