#ya-yang_api

1 messages ¡ Page 1 of 1 (latest)

spring citrusBOT
#

👋 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.

runic nimbus
#

Also, can you share the request id from when it worked?

terse pebble
#

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

runic nimbus
#

Can you share the request ids please?

spring citrusBOT
terse pebble
#

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'

hushed dragon
#

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

terse pebble
#

I'm using 5.5.0

#

But I was able to use it a few weeks ago

hushed dragon
#

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

terse pebble
#

Do you know which version introduces the billing object?

hushed dragon
#

Not off the top of my head no

#

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

terse pebble
#

yeah, we are still using the 2018-02-28 api version as the default

hushed dragon
#

Yeah later sdk versions are pinned to latest api version

#

Just a heads up

terse pebble
#

got it, other than that, it would be safe to update the sdk?

hushed dragon
#

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