Node.js 增加发票的税率

Node.js 增加发票的税率,node.js,typescript,stripe-payments,code-documentation,tax-rate,Node.js,Typescript,Stripe Payments,Code Documentation,Tax Rate,环境:节点 语言:类型脚本 我正在尝试将税率添加到我的InvoiceItems中,但条带包似乎没有遵循API文档 这是我的密码: newInvoiceItem = await this.stripe.invoiceItems.create({ customer: billingUser.billingData.customerID, currency: this.settings.currency.toLocaleLowerCase(), amou

环境:节点

语言:类型脚本

我正在尝试将税率添加到我的InvoiceItems中,但条带包似乎没有遵循API文档

这是我的密码:

newInvoiceItem = await this.stripe.invoiceItems.create({
        customer: billingUser.billingData.customerID,
        currency: this.settings.currency.toLocaleLowerCase(),
        amount: Math.round(transaction.stop.roundedPrice * 100),
        description: description,
        tax_rates: defaultTax
      }, {
        idempotency_key: idemPotencyKey.keyNewInvoiceItem
      });
表示有一个
税率
字段可用,但该字段不在Stripe包中

触发错误:

TS2769: No overload matches this call. 
Overload 1 of 2, '(data: InvoiceItemCreationOptions, options: HeaderOptions, response?: IResponseFn<InvoiceItem>): Promise<InvoiceItem>', gave the following error.     Argument of type '{ customer: string; currency: string; amount: number; description: string; tax_rates: ITaxRate; }' is not assignable to parameter of type 'InvoiceItemCreationOptions'.       Object literal may only specify known properties, and 'tax_rates' does not exist in type 'InvoiceItemCreationOptions'.   
Overload 2 of 2, '(data: InvoiceItemCreationOptions, response?: IResponseFn<InvoiceItem>): Promise<InvoiceItem>', gave the following error.     Argument of type '{ customer: string; currency: string; amount: number; description: string; tax_rates: ITaxRate; }' is not assignable to parameter of type 'InvoiceItemCreationOptions'.       Object literal may only specify known properties, and 'tax_rates' does not exist in type 'InvoiceItemCreationOptions'
我当前的条带模块版本是7.13.19(最新版本来自
npm i@types/Stripe


文档有误还是我做错了?

@types/stripe是社区维护的关于stripe API的TS定义,可能与最新的stripe API不符。Stripe经常使用新功能更新其API。然而,Stripe团队正在制定一个官方定义,该定义现在与最新的API版本相匹配。感谢您提供的信息。可以在我的TS项目中使用JS版本吗?当然可以在TypeScript项目中使用stripe节点。
amount?: number;
currency: string;
customer: string;
description?: string;
discountable?: boolean;
invoice?: string;
quantity?: number;
subscription?: string;
unit_amount?: number;