You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何正确使用Stripe CLI的override参数?触发事件报错排查

问题原因与解决方法

你操作的问题在于:billing_reason 是发票的派生属性,它由发票的生成场景决定(比如订阅创建、订阅周期续费等),无法通过直接覆盖 invoice:billing_reason 来修改。Stripe CLI 在触发 invoice.payment_succeeded 事件时,默认会生成手动创建的发票,所以 billing_reason 为 manual;直接传递该参数会被 API 判定为未知参数,从而报错。

正确的做法是让 Stripe CLI 模拟「订阅创建生成发票」的场景,使用 --with-subscription 参数触发事件,这样生成的发票自然会带有 subscription_create 的 billing_reason:

stripe trigger invoice.payment_succeeded --with-subscription

如果需要自定义订阅相关的参数,还可以结合 --override 对订阅属性进行修改,比如:

stripe trigger invoice.payment_succeeded --with-subscription --override subscription:plan=price_123

内容的提问来源于stack exchange,提问作者João Pimentel Ferreira

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.12 17:22:33