#jobjen02

1 messages · Page 1 of 1 (latest)

mint swallowBOT
willow pine
#

Hi, I contacted sales already, but they don't understand it at all. I thing there might be a bug

gloomy egret
#

Can you provide more information? Like example request IDs of what you've tried?

willow pine
#

That button "Create usage record" has a dropdown where I can select 2 items, when I select the "set" option, i expect that the usage will be set to the filled in number, but it just adds one. The other option from the select does the exact same thing

gloomy egret
#

I've asked a colleague to take a look as things are running busy on discord at the moment, they will take a look and repond as soon as they can

#

thanks for your patience

willow pine
#

alright, thank you

cursive spire
#

Hello, do you have the ID of this subscription (sub_1234)?

willow pine
#

I send it private to you, since this is a public chat

cursive spire
#

Thanks I'll look. For future reference, IDs are safe to share in public chats, the only way someone can do something with one is if they have your login or secret key (at which point the login or secret key is the problem)

willow pine
#

alright, thank you

cursive spire
#

Have you tried to do action=set on any of your requests today?

#

The most recent request that I can see with action=set is from two days ago

willow pine
#

no, not today

cursive spire
#

Yeah and in my testing set vs increment doesn't seem to matter when aggregate_usage=sum on the Price, they both increment the value

#

I tried providing negative values but those are considered invalid

willow pine
#

yeah, so thats the problem

cursive spire
#

Still looking for a way to issue a correction

willow pine
#

I just can't decrese the value

#

Becouse now, the customer gets charged way too much

cursive spire
#

Yeah, the one workaround that would definitely work would be setting aggregate_usage to one of the other values and then directly setting their usage

#

But I feel like we have to have some way to correct this with sum

willow pine
#

yes

cursive spire
#

So with sum you say that a user used 1 unit then 1 unit then 1 unit so they used 3 units

#

With the other ones you would set 1 unit then 2 units then 3 units and we would use the last one provided

willow pine
#

yeah, but I need the sum method

cursive spire
#

Yep, I am still looking in to it. May need to pull in another colleague as the server is getting pretty busy

willow pine
#

alright, thanks for your help!

cursive spire
#

So we do have a way to do this that I accidentally overlooked. You can provide a timestamp when reporting usage and that can override a previously set usage record at that time

#

So you can set the usage record to the time you want to get rid of usage for and provide a quantity of 0

willow pine
#

That does't work

#

That just sets a 0, but doesn't change anything

cursive spire
#

It changed it in my tests so this should be possible. Did you provide the exact same timestamp as another usage record that already exists?

willow pine
#

exact timestamp?

#

I did the hours and minutes

#

from the UI

cursive spire
#

Ah, the API takes a timestamp that has second granularity

willow pine
#

yeah, i tought so

cursive spire
#

Will double check but I am not sure if the dashboard can do this, you may have to switch to using the API

#

Yeah as far as I can see, the dashboard doesn't have a way to rewrite this the way the API can. I will put in a feature request but for now I think the API would be the way to go

willow pine
#

how can I do it then?

#

could you send me the test code you created?

cursive spire
#

I have been using our node library so:

  'si_LtVAyMVX2N5Nxk',
  {quantity: 0, timestamp: 1571252444}
);```
willow pine
#

how did you get the excact timestamp?

#

Do I need to fetch the updates first, and then take some timestamps?

cursive spire
#

I was reusing a timestamp that I had previously set. I thought you could just list usage records but I now see that we don't have an endpoint for that. Checking to see how you can get these timestamps...

willow pine
#

alright, thanks!

#

I see the timestamps from the network tab🙂

#

yeah it works lol

cursive spire
#

Glad that works! Still checking with a colleague if you can see them through the API or elsewhere

willow pine
#

Yeah, now it takes a lot of time

#

I just copy and paste some timestamps now to overwrite it. A nice feature would be to set a new starting point or something

cursive spire
#

Yeah, will put in feedback for this. So it looks like we don't have an API endpoint for this. The main ways to do it would be to convert the usage timestamps from the dashboard in to unix timestamps or to filter your request logs (https://dashboard.stripe.com/test/logs) to look for other times that usage was reported for that subscription item

willow pine
#

Yeah, i'm just overwriting stuff now

cursive spire
#

I think we don't expect the dashboard to be used much if at all for this flow. It seems the assumption is that the API is setting this usage and that you would have a record of the timestamps that usage was reported for

willow pine
#

Yeah true, but assumptions are never right within coding hahah

#

There was a bug in the API, so for that reason the usage is incorrect

cursive spire
#

In your API code or are you saying that the call bugged out on the Stripe side?

willow pine
#

In our API

#

it reported usage incorrect

#

I finished updating, the usage is correct now

#

Thanks for the help!

cursive spire
#

Awesome! Glad you could fix this