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

使用Chargebee创建订阅时触发Failed to create subscription TypeError错误求助

Chargebee创建订阅时触发Failed to create subscription错误求助

各位好,我在调用Chargebee API创建订阅的时候卡壳了,一直弹出这个错误:

Error: Failed to create subscription

以下是我写的代码片段,已经打印了传入的参数,看起来customerId和options都是符合预期的,但就是创建订阅这一步走不通,有没有有经验的朋友能帮我排查下问题?

async createSubscriptionForTeamMember(customerId, options) {
    try {
        // Proceed with subscription creation using Chargebee API
        console.log(customerId); // 16CMrdUBRD3oj1Wy5
        console.log(options); // {subscription_items: [ { item_price_id: 'monthly', quantity: 1 } ]}
        const subscriptionResult = await chargebee.subscription.create_with_items(customerId, options).request();
        const subscription = subscriptionResult.subscription;

        console.log('subscription', subscription.status);

        // Retrieve customer information including payment method
        const customerResult = await chargebee.customer.retrieve(customerId).request();
        const customer = customerResult.customer;

        console.log('customer.payment_method', customer.id);

        // Parse subscription details
        const nextBillingTimestam...
}

我已经确认了对应客户是存在的,而且item_price_id在Chargebee后台也正确配置了,但就是找不到订阅创建失败的原因,麻烦大家帮忙看看!

备注:内容来源于stack exchange,提问作者Omar Chakroun

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.04.17 10:38:06