#sachin-kannaujiya_error
1 messages ¡ Page 1 of 1 (latest)
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.
- sachin-kannaujiya_docs, 16 hours ago, 9 messages
đ 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.
hi there, can you share the request id [0]? it'd look like req_xxx
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
where to find request id ?
This shares more details on how you can find the request id : https://stripe.com/docs/api/request_ids
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Understand .But i have already created customer.
can you share the request id for which you are receiving that error message for?
req_qM44jHDXdfZ2rR
that's the request to create a Subscription, not the request which you are creating the Meter Event
When I creating meter event there is no req_id in reponse header
give me a while to see what I can find
ok
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
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
You'll want to follow this guide in https://docs.stripe.com/billing/subscriptions/usage-based/implementation-guide?dashboard-or-api=api
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
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"?
thanks , Let me correct
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
stripe_customer_is and customer id is same right ?
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
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.
that sounds like you called https://docs.stripe.com/api/usage_records/create instead of the meters API, then.
I want to know how much token user consumed.
does https://docs.stripe.com/billing/subscriptions/usage-based/implementation-guide#query-reported-usage help, in that case?
We need to create meter for each customer or can use a single meter for every customer