#zach_meters-v2
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/1300982319737340037
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
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.
- zach_meters-v2, 20 hours ago, 95 messages
- zach_api, 1 day ago, 60 messages
- zach_billing-credit-specificity, 4 days ago, 8 messages
zach_meters-v2
welcome back!
Can you share more details about the error? Sadly this is brand new and I can't even look up those objects myself internally
Haha
Error sending usage to stripe: Request req_v2Qxd7KOAjwblFXcZ: You must submit a customer reference in the payload value of stripe_customer_id as defined in the meter.
this is what i get, but i am sending stripe_customer_id
which is where i am lost
is this the same exact error as yesterday with no progress? Or did you figure out that value thing?
value thing was figured out
Can you share
The exact code you use to create the Meter
The exact code you use to create the MeterEvent
it had to be "unit" : "quantity"
sure
you have no way to see that payload though?
I see this, but no details
is there any logging on your end? it very well could be an issue on my end, but this is that generic error you and i were getting as well, so I am confused
there's no way for my team to view logs. I'm sure the people who built this can see logs but they haven't built the tool needed to help us yet. You're like the second dev I ever see trying to use this sadly
I can send you the code, i just have a feeling something else is going on, because it works locally
My gut is that it's like yesterday, you have a typo or move too fast
fair enough.
like you passed customer: 'cus_123' instead of stripe_customer_id: 'cus_123'
But it's a guess because those APIs are brand new so my usual intuition isn't well exercised yet. but if I see your code I can either spot it or reproduce
client = stripe.StripeClient(stripe.api_key) response = client.v2.billing.meter_events.create({
"identifier": record['idempotency_key'],
"event_name": record['event_name'],
"timestamp": timestamp,
"payload": { record['unit_of_measure']: record['quantity'], "stripe_customer_id": record['customer_id'] },
})
this is what I am doing
Cool, can you hardcode all the values to something random and share the exact code after that change, then run and share the exact request id for the error?
I can, but the problem is its working on my local machine, its only when i deploy to a server that it doesnt work.
So i am just trying to identify what is wrong with the payload, unfortunatley it all looks the same with a print statement
which is highly likely to be because some of those variables are empty/null honestly
yea, but in the print it shows it as good.
So I'd recommend carefully logging the payload/params before calling the API and it is highly likely to be the problem
if you have no logs, then ill go back to the drawing board on my end
yea, i did that, unfortunatley.
its definitley filled, but something else is going on.
No wories @hasty plinth thanks for the help
i would bother you on this more, but will try and do work on my end, i thought it might be easy for you to have pulled some log I dont have access to.
I asked an engineer internally to look up the log and you passed {"event_name":"token_*****","identifier":"949***","payload":{"tokens":"69","customer_id":"cus_QE***"},"timestamp":"2024-10-30T****"}",
But seems you are in same boat as me
so to me you clearly passed customer_id instead of stripe_customer_id
hmm, that is so strange
i sent you the code, but it must be some form of deployment issue then.
Thank you so much, this is actually super helpful..
I'm really sorry. This should take seconds to debug if we had good tooling, good error messages so this is definitely not on you
Yea, but this is helpful, it means its something going on on my end, because locally i send stripe_customer_id.
thanks for taking the time.
sure thing!