#zack_wehner-usage-records-metadata
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1217498481355264071
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Fundamentally, I want to do more then say X number of usage on this date, i want to say X number of usage on this data for this specific scenario X, later in the day you may be charged against the same product for scenario Z
Hi ๐
I'm not sure I follow. I can understand wanting to relate the usage back to specific actions in your application/service but are you saying you want to charge the customer differently based on the "scenario"?
the charge is the same X$ per page
but perhaps they worked on customer A's case today
and tomorrow they worked on customer B's case
but the product is still X and X$'s
so now i report usage for customer A against that product and usage for Customer B against that product
I want the usage record to differentiate between Customer A and Customer B
in other words, similar to how i can add metadata tags to products and subscriptions
i want to add additional data to the Usage record
Unfortunately the Usage Record object does not allow you to add metadata https://docs.stripe.com/api/usage_records/create
yea that is where i am stuck
You could update the SUbscription Item metadata each time you added a new usage record and record the usage for each Subscription Item https://docs.stripe.com/api/subscription_items/update#update_subscription_item-metadata
seems less than ideal right
it means i have to track usage using metadata tags
on the susbscription item, which is kinda the whole point of reporting usage in the first place
I understand that. It's a rough edge. I cannot speak to the original design but I think it was intended that each "scenario" would represent a different Price so you wouldn't need to "tag" each usage record.
But I can ask metadata be added to the Usage Record object as a feature request. I cannot guarantee if it will be worked on but at least I can make your interests known
Please do this would help tremendously.
Not having this meta data might actually make us shift from the planned stripe implementation
to SAP ariba potentially
One more question I guess while I have you, related, would there be a way at time of invoicing to basically update metadata against the invoice line items to give this additional context
lets say i had 100 pages of usage
which was actually 10 different scenarios
the invoice line would be for 100 pages
but below that i would want to have some detail on 10 to each scenario, could this be achieved?
Okay yes you could do this. Automatically generated invoices remain in draft status for 1 hour to permit just such modifications.
so in theory i can record this granular usage info on my internal system. then at tiem of invoice write some semi complex logic to break that invoice into more line items,or provide meta data?
You would track the scenarios for each billing period internally, then listen for the invoice.created webhook event. You could use the Customer ID and Subscription ID in the Invoice object returned to look up the usage scenarios and then update the metadata for each InvoiceItem. https://docs.stripe.com/api/invoiceitems/update#update_invoiceitem-metadata
i see, seems like a potential workaround, but very much less than ideal
is there anyway for me to track the feature request ticket?
You can write in to Support and they should be able to keep you informed of any progress on this feature.
OK, but just to confirm you will raise a feature request on your end as well? Just want to make sure this isn't lost ๐
I found a ticket where it has already been raised and I added a description of your scenario to provide further information that the feature is needed by our users.