#anubhavshakya
1 messages · Page 1 of 1 (latest)
You'd manually amend the invoice/items after creation but before it's finalised
Yes you can't edit those items directly. You'd likely need to add a new negative item to offset the usage cost: https://stripe.com/docs/api/invoiceitems/create#create_invoiceitem-amount
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
is there any other solution ? can I reset the reported usage so that invoice can be zero
You'd just create a new Usage Record and use action: 'set' to override all the old records:
https://stripe.com/docs/api/usage_records/create
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I have tried this, this is not working. I mean when I use set then it behave same like increament
Hmm, it's likely that the timestamp you're passing is outside of the billing period for the invoice
I have reported lot of usage using increment so how to set total_usage to zero. and I do not have timestamp, I will use this with the api. should I fetch the all usage ? if yes then where I can find timestamp so that I can mark zero
You need to pass a timestamp when creating the Usage Record that is within the billing period of the invoice you want to change
I have tried the timestamp between the start and end of billing cycle but it is not working...
Can you share the ID (req_xxx) of the API request? https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
And the Invoice ID (in_xxx)
This is subscription item id "si_PAr0X3skkjvjYH" for which I am reporting the usage
👋 stepping in
I'm not seeing a $220 invoice (from your screenshot) on that sub?
both are different sorry, but I have reported the usage for this subscription
So the simplest thing to do here is to create a fresh test Subscription and create one usage record and then test setting that one usage record to 0
Do this in sequential API requests so you can easily look at the behavior