#adityalystlocdeveloper_33428

1 messages · Page 1 of 1 (latest)

umbral boneBOT
#

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.

tepid bloom
#

👋 How can I help?

slim crystal
#

hello i have metered plan if user used our plan till the month invoice draft invoice is created i want to add usages record for that entire last month . But currently it was creating record but for next invoice i want it for last month

#

which event i can use to add that metred usage for a month and charge at the end of month

#

i want to add overall month usages at once

tepid bloom
slim crystal
#

yes i want to do that only when invoice is in draft i wanto add total usage of that particular month but it was adding in next month

#

case "invoice.created":
const invoiceid = eventdata.id;
const invoicesubscriptionitemid = eventdata.lines.data[0].subscription_item;
const amounttobepaid = eventdata.amount_due;
if (amounttobepaid > 0) {
await stripe.subscriptionItems.createUsageRecord(invoicesubscriptionitemid, {
quantity: 25500,
action: "set",
});
}

#

we have to give time paramter?

#

to add in last month?

tepid bloom
slim crystal
#

req_xR0AVZ0PmRyQ0n

#

just to be clear i want metered usages when invoice is in draft for last month

umbral boneBOT
slim crystal
#

hello

spare vapor
#

sorry, that's not possible at the moment. Usage reported after a billing period ends, even if its during the 5 minutes buffer time, will always fall into a new period. Basically, once a period has closed, our system will not allow usages to be reported in the closed period

slim crystal
#

any solution for this