#ya-yang_api
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/1311059546520817715
đ 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.
- ya-yang_api, 13 minutes ago, 3 messages
Hi, can you share the specific request id where you saw this error? Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Also, can you share the request id from when it worked?
It works when I use the Stripe shell to send the billing events. It didn;t work when I use our stripe python SDK in our backend system
Can you share the request ids please?
I don't have the request ID
it failed in the SDK before the ID is generated
stripe.billing.MeterEvent.create(
... event_name="number_of_payroll_employees",
... payload={"value": "25", "stripe_customer_id": "cus_RHfpHo428gfbSC"},
... identifier="identifier_123",
... )
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'stripe' has no attribute 'billing'
module 'stripe' has no attribute 'billing' indicates you're using too old of a version of the sdk
Before stripe.billing was added
What version of the python sdk are you using
That's an exception thrown by the sdk
meaning that method doesn't exist
So it's an sdk version issue
The version you're using does not have that method
Do you know which version introduces the billing object?
Not off the top of my head no
You can try to track it down in the changes: https://github.com/stripe/stripe-python/tree/master
sdk is public
But if you just use the latest it'll have it
Note that that would also use the latest api version in requests though
yeah, we are still using the 2018-02-28 api version as the default
Yeah later sdk versions are pinned to latest api version
So if you want to override that and continue using 2018-02-28, then you'd need to explicitly set the api version in the sdk: https://docs.stripe.com/api/versioning
Just a heads up
got it, other than that, it would be safe to update the sdk?
There may be breaking changes
So you'd have to thoroughly test your integration
There's a long changelog that shows all breaking changes in the above linked sdk on github
You were on a very old version, so there's likely going to be several
On 5.5.0, we just had usage records
meter events are a more recent change