如何通过API修改Stripe账户的订阅邮件通知设置?
用Stripe API管理订阅邮件通知设置
要修改「发送即将续费通知邮件」「发送银行卡过期通知邮件」这类开关,直接调用Stripe的Account Update API即可,无需Webhooks。
对应字段映射
这些邮件通知的开关都在Account对象的settings.billing节点下:
- 「发送即将续费通知邮件」:
settings.billing.upcoming_invoice_notification.enabled - 「发送银行卡过期通知邮件」:
settings.billing.payment_method_expiring_notification.enabled
API请求示例
cURL 调用示例
curl https://api.stripe.com/v1/account \ -u sk_test_your_secret_key: \ -d "settings[billing][upcoming_invoice_notification][enabled]"=true \ -d "settings[billing][payment_method_expiring_notification][enabled]"=false
- 将字段值设为
true开启通知,false关闭通知 - 支持一次请求同时修改多个通知开关
验证修改结果
调用Retrieve Account API查看更新后的设置:
curl https://api.stripe.com/v1/account \ -u sk_test_your_secret_key:
在返回的JSON中找到settings.billing节点,确认对应字段的enabled值是否符合预期。
内容的提问来源于stack exchange,提问作者Maryna Serhiichuk
相关产品推荐
相关产品推荐

