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

Stripe API获取Price时如何展开currency_options中的tiers?

解决Stripe API获取Price时展开所有currency_options内tiers的问题
  • 问题根源:currency_options是键值对对象(键为货币代码),而非数组,原命令里的currency_options.data.tiers是错误写法,Stripe无法识别该路径。
  • 最优方案:使用**通配符***匹配currency_options下的所有货币键,一次请求即可展开所有对应tiers,同时保留根层级tiers的展开。

修改后的CLI命令:

stripe prices retrieve X \
-d "expand[0]"=tiers \
-d "expand[1]"=currency_options.*.tiers
  • 效果说明:该命令会同时返回:
    1. 根层级的tiers字段
    2. currency_options下所有货币对应的tiers字段,无需预先知晓货币代码,一次请求完成数据获取

内容的提问来源于stack exchange,提问作者Victor T.

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.23 02:17:03