#sachin-kannaujiya_error

1 messages ¡ Page 1 of 1 (latest)

foggy lakeBOT
thorny doveBOT
#

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.

foggy lakeBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1256139517203709993

📝 Have more to share? Add details, code, screenshots, videos, etc. below.

worthy jay
frosty lance
#

where to find request id ?

worthy jay
frosty lance
#

Understand .But i have already created customer.

worthy jay
#

can you share the request id for which you are receiving that error message for?

frosty lance
#

req_qM44jHDXdfZ2rR

worthy jay
#

that's the request to create a Subscription, not the request which you are creating the Meter Event

frosty lance
#

When I creating meter event there is no req_id in reponse header

worthy jay
#

give me a while to see what I can find

frosty lance
#

ok

worthy jay
#

so this is your request to create the Billing Meter : https://dashboard.stripe.com/test/logs/req_lCzI6UsSoXFRPb - you shouldn't be specifying event_payload_key: "cus_QMenG3HRRuk62R". To keep things simple, I suggest you only pass in default_aggregation.formula, display_name and event_name when creating the Billing Meter

frosty lance
#
  async createMeterEvent(loginUser: ActiveUser) {
    const customer = await this.getCustmerByEmail(loginUser.email);
    console.log(customer);
    return this.stripe.billing.meterEvents.create({
      event_name: 'dexie_usage',
      payload: {
        value: '25',
        stripe_customer_id: customer.id,
      },
      // identifier: 'identifier_123',
    });
  }

this is code I am using to create meter event

worthy jay
#

I know, but in the first place, the request which you're making to create the Meter is already incorrect

#

for example, why did you pass in event_payload_key: "cus_QMenG3HRRuk62R"?

frosty lance
#

thanks , Let me correct

worthy jay
#

The sample in our docs show event_payload_key: 'stripe_customer_id',

#

You can compare the request you made to what our sample is doing

frosty lance
#

stripe_customer_is and customer id is same right ?

worthy jay
#

I'm not sure what you mean by it's the same? Can you give me an example of what you mean?

#

anything which is a placeholder, will have double curly brackets

#

e.g. {{METER_ID}} -> this is a placeholder for the actual meter ID

thorny doveBOT
frosty lance
#

that issue has been resolve but another one is :Cannot create a usage record for si_Q0NKc50wISDf9lA because it is not on the legacy metered billing system. Call /v1/billing/meter_events instead.

hidden swift
frosty lance
#

I want to know how much token user consumed.

frosty lance
#

We need to create meter for each customer or can use a single meter for every customer

hidden swift
#

one for each

#

that's a very broad question, please try and make it more specific.