#zsmorgan21
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- zsmorgan21, 7 minutes ago, 9 messages
- zsmorgan21, 3 hours ago, 3 messages
instead both period_start and period_end are november
Can you please further explain what period_start and period_end represent on an invoice obj?
Happy to take a look. Can you send me the text of that invoice's ID? (in_1234)
Not having much luck typing it out or copying from the screenshot unfortunately
ya one sec
sorry
Here is an example: in_1O4RxGHmbQZtVN0XqhtbNuhH
So for this guy, in the stripe dashboard it shows:
OCT 23, 2023 - OCT 23, 2024
But we get back the same date for period_start and period_end
Interesting. I am seeing accurrate timestamps on the latest event that was sent on the invoice
end: 1729704618,
start: 1698082218
},```
https://dashboard.stripe.com/test/events/evt_1O4SUZHmbQZtVN0XHlTyA0hc
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
So when directly retrieve that invoice via the API are you seeing one of those timestamps as both the start and end?
Ya, I have another example
Sounds good happy to see if that helps clarify what is happening
Can you send me the snippet of code where you are retrieving that invoice? I can't imagine it is much more than just calling retrieve on that ID but it may still help to see
But we get back
const stripeResponse = await this.stripe.invoices.list({
customer: customerId,
limit: 6,
starting_after: startingAfter,
expand: ['data.subscription.plan.product'],
});
FWIW, its seems that the first invoice of the subscription is the only one with this problem?
Ah so it is the list endpoint. Will see if I can repro on my side
Can you quickly also try directly retrieving a single invoice and seeing if that gets the same behavior?
Yeah, at least it is consistent. Though that is strange that this is not reflecting the data that I am seeing on those same invoices on my side
I wonder if this has to do with the test clock on these subscriptions/invoices
I am seeing the same behavior with and without a test clock. Not sure why this is happening here but am digging further
OK sounds good. Not sure if you saw this, but I only see it happening for the first invoice of the subscription
So for that clock user if you look at other invoices, the period_start and periond_end make sense
Yep yep, saw that you mentioned it is the first invoice. I was partially expecting the timestamps to be correct on the first invoice when a test clock is not used, sometimes clocks can throw things off
Also interestingly, the invoice item for the subscription actually shows the correct timestamps and it is from the same API response
Ya I did notice that. I didn't know if we should be using the subscription period.end and period.start
I am checking with my colleagues about this. I think this may be a bug.
Ah, I was mistaken about what these fields represent. The period_start and period_end properties are for the previous billing period, the period hash on the invoice is for the next billing period.
So if you have a monthly subscription on the 1st of the month, the invoice on the 1st of November will be for the 1st of October until the 1st of November while the line item for the subscription will be for 1st of November to the 1st of December.
Because the first invoice doesn't have a previous period, we just duplicate the start date
ahhh ok GOT IT
Yep, a big aha moment for me as well
haha!
So subscriptions only support billing based on previous month, not upcoming?
I guess Im confused about that first invoice. What would that payment be for then? I'd imagine the upcoming billing period, right?
It seems like, from you screenshot, these are the dates we'd actually want.
Cuz they get billed at the beginning of the period, not the end, right?
Apologies, I was wrong in saying "previous billing period". More accurrately, period_start and period_end represent the time in which billables on the invoice where accrued
And the invoice item is the dates that the customer is currently paying for
For non-metered subscriptions we only support billing for the upcoming month.
So yes, the dates on the invoice item would be the one that you want
gotchya
And for invoice subscriptions, is there any chance there'd be multiple line items?
Yes, there can be:
- Recurring items from the subscription that the invoice is for
- One-time invoice items from being added manually or for a proration