正如标题所示,我需要获取发票的结算周期。 period_start
和period_end
不合适,因为订阅的结算周期的第一张发票具有相同的时间戳。此外,这些时间戳是发票项目添加到发票的期间,而不是显示发票所包含的期间。
我需要查看发票适用的日期。例如,第一张发票的结算周期将是从订阅开始到生成下一张发票之前的毫秒。那种事。
答案 0 :(得分:1)
You want the period
of the subscription(s) line item(s) on the invoice. You'd retrieve the invoice via the API and then you would loop over the invoice items. You would find one with the type
property set to subscription
which indicates this line item corresponds to the subscription you just charged for.
You can then look at the period
hash with period[start]
and period[end]
to know which period you just invoiced for.