#bmizerany-sub
1 messages · Page 1 of 1 (latest)
Hi there, I was wondering if you have a request id (req_xyz) I could look at please?
which of the requests above would be most helpful?
Here is the transition from one phase to the next: req_DaaySSeHZrLoN6
adding the usage record: req_2KX2JSGPqrqBSM
after the change
I just ran a script and captured the request IDs to demo the process: req_JqNwIzkmifCt7c req_lqlTKlUVTaFbqr req_yQyHnXUVTkv8xG req_EQ6uhtuWDtIUKq req_NOGQTIu9mahcEn req_HZ26fOiSufZPrG req_rvfoQeRVgseEsL req_2IynbZTFchTBcT req_czpaQjhGn98GE4 req_ddS0xTmeSuucSn req_FHzlnFrn1TkmfI req_vefYM5ufeSx4YC req_tdIXjmzjXxCkT4 req_Pvsc2aFe4ssCdo req_JsUnq5E5erbsrm req_rJwPAseOQULxa0 req_BH65qchpTfGNxm req_JSE75RTO5y28KM req_fy5H31K1QkyHyV req_05KJWz1KNS5l3u req_6CYABvLdKcA7qu req_jEp49k4QroBvUy req_iokjwMg7kYsdey req_Oi7KRzaCe1s6nq req_BqTFPBGOPCZxW8 req_ezLugYwdcKztlI req_nKQABA9GZKOmx8 req_7603b2dfD6gRts req_EK1xe8wQ8qg267 req_jnrLqH1KxrgQlH
Following the flow of the subscription, this is the flow:
- The subscription was created at 03/03/2022, 17:15:15, along with the subscription schedule with
price_1KZPjJCdYGloJaDMnxWeYlOd - The subscription schedule was updated at 03/03/2022, 17:15:41 the price was updated to
price_1KZPjJCdYGloJaDMroAPQx2E - The subscription schedule was updated at 03/03/2022, 18:43:32 and the price was updated to
price_1KZPjJCdYGloJaDMnxWeYlOd
- The subscription item id is si_LFva8t2D7Fzstw
- The subscription item id is si_LFvbYwGhOAvxFL
- The subscription item id is si_LFx1zoVKRoUa72
Looking at the request req_2KX2JSGPqrqBSM, the usage record was created for si_LFx1zoVKRoUa72, thus, only the price at 3. was displayed
Thank you for your help. To be sure I'm understanding correctly: The last usage_record was created for a price that was in an old phase?
I'm currently looking at sub_1KZRgtCdYGloJaDMJtc06n7I (from a new test) and it shows there is usage of a price with quantity 1000, but just before creating that usage record, I created usage records for and item (or so I think) in a previous phase, and I do not see that usage in the invoice.
Here are the logs for the output requests: POST /v1/subscription_items/si_LFyM06HujPBOfR/usage_records POST /v1/subscription_items/si_LFyMrZk86qqSgI/usage_records POST /v1/subscription_items/si_LFyM9Q9K5qmegH/usage_records
Is there a way to view usage across a schedule?
in the dashboard or API?
Now I'm seeing Invalid subscription_item id: si_LFyM06HujPBOfR in the Dashboard when I click to view usage history from invoice in_1KZSPNCdYGloJaDMd6Pd4NBY
Am I not understanding subscription schedules correctly? Is it that once they go into effect, then delete all the previous subscription items?
👋 stepping in and give me some time to grasp the context
hi! thank you!
Hmm agree that it's weird on the Dashboard when it displayed "invalid subscription item_id"
So the Invoice was created against the Subscription Item si_LFyM06HujPBOfR at 2022-03-04 04:06:25 UTC But that Subscription Item is replaced by req_dH3hPjNC8oxI7w at 2022-03-04 04:06:27 UTC
But that Subscription Item is replaced by req_dH3hPjNC8oxI7w at 2022-03-04 04:06:27 UTC
What does "replaced" mean?
Is that to say that in the dashboard it is only reporting the current usage for the current phase?
When you sent that request (req_dH3hPjNC8oxI7w), You have ended the current phase immediately by specifying its end_date to "now". I believe that's when the Subscription Item is replaced
But the Invoice was created for the replaced Item, which is why when you view that Invoice specifically, it can't find the Subscription Item it is bounded to anymore. I agree that we should improve the UI, but it's expected
- si_LFyM06HujPBOfR is created -> Invoice in_1KZSPNCdYGloJaDMd6Pd4NBY is created accordingly
- Another si is created and replace above si, creating new Invoice
- When look up in_1KZSPNCdYGloJaDMd6Pd4NBY in Dashboard, can't find the related si anymore
yeah I can't find it either
does that mean the usage records are lost and will never be billed for?
I believe I was following the docs correctly
Okie, can you give me the request id for POST /v1/subscription_items/si_LFyM06HujPBOfR/usage_records ?
It looks like you created the Subscription at 2022-03-04 04:06:25 UTC then 2 seconds after 2022-03-04 04:06:27 UTC try to modify its Schedule with ending the started phase immediately and start a new one, which results in a replacement
I wonder when did you report usage for si_LFyM06HujPBOfR? Is it within that 2 seconds? Or after?
looking
I don't have those logs on hand and can't find them in the dash :/
It looks like you created the Subscription at 2022-03-04 04:06:25 UTC then 2 seconds after 2022-03-04 04:06:27 UTC try to modify its Schedule with ending the started phase immediately and start a new one, which results in a replacement
Ah!
So it does replace them
Is that because it happened within some time frame? (e.g. 1 hour)?
That is to say, if I had waited 1 hour, then appended the new phase, I would have two records or usage, one for each item/price/phase?
I think so. 2 seconds is tricky. If you had waited 1 hour, and reported some usage within than 1 hour then it should be recorded correctly
Can report usage far enough into the future that it lands in the next phase and counts and a 3 pointer?
Also, does this mean unless I work around this, my users can upgrade/downgrade a few times and hour and never be billed for usage? :/
Not really follow the previous question, but 2 secs is an edge case and normally it should be find for > 1min or so
oh nice okay. will try with 1min