nishimura.clubnishimura.club

Node.js Stripe Subscription 更新

作成日
2021-10-06
更新日
2021-10-06
const subscription = await stripe.subscriptions.retrieve( "sub_xxxx", // Userモデルに保存したsubscriptionId ); const params = { items: [ { id: subscription.items.data[0].id, plan: "price_xxxx", // 新しいプラン }, ], }; const updatedSubscription = await stripe.subscriptions.update( "sub_xxxx", // Userモデルに保存したsubscriptionId params, );

Stripe API Reference - Update a subscription - cURL

Related

Tags

Stripe
NodeJS

Share