node.js - 如何获取发票字段以在快速手册中进行映射?
问题描述
我正在使用npm quickbooks。我想获取发票字段以与我的本地字段进行映射。但是找不到任何相同的 API 或函数,或者我可能不在轨道上。那么任何人都可以请逐步解释如何使用快速书籍发票映射我们的本地字段?
我可以使用getInvoice但问题是我必须在其中传递快速书籍发票 ID。
.getInvoice("150", (err, data) => {
if (err) {
return reject(err);
} else {
return resolve(data);
}
});
但我只需要映射字段。
解决方案
QuickBooks Online API 本身无法获取可用字段的列表。
您将获得的最接近方法是手动下载和解析.XSD
Intuit 为 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 的开发人员文档可能会更好:
推荐阅读
- python - 如何实现一个函数来获取一个元素在复杂数据结构中的位置?
- jquery - 如何在jsTree中禁用多选?
- session - 我们可以在 MQTT 架构中复制 HTTP SESSION 的想法吗?
- python-3.x - 使用 OOP 解决此问题的最佳方法是什么?
- pyomo - 与后续实例化相比,Pyomo 内核第一个求解器实例化需要很长时间?
- laravel-8 - 为什么我在使用带有 Laravel V8 的 pusher V6 时会看到错误
- laravel - EC-2 突然停止发送 smtp.gmail.com 邮件 - 连接超时
- javascript - 如何获取单选按钮值并清除表中选中的单选按钮
- android - Retrofit2 :- 如果添加了自定义拦截器,我是否需要关闭连接?
- ios - 如何快速剪辑圆圈的外部区域?