#masud-webhook-creation

1 messages · Page 1 of 1 (latest)

haughty thornBOT
spare perch
#

Connect endponts will give you events for all connected accounts rather than having to set one up on each connected account

coral fractal
#

ah okay so i'm using the wrong api

#

is the correct api in that doc list

spare perch
coral fractal
#

Sorry maybe i should've clarified. This isn't MY account. It's a user that authenticated via oauth. I'm using the access_token i've gotten post oauth success.

So the stripe account is not a connect account on our platform.

spare perch
#

Is this for a Stripe App?

#

Or something else?

#

Can look in to if this is possible. I think connect platforms can't do this but will have to look in to other scenarios

coral fractal
#

Something else

We use oauth to get their info and then make api calls using the access_token.

#

For example the access_token works fine for all other things like creating new Products, Subscriptions, PaymentIntents, etc. But it's not working for webhooks.

coral fractal
spare perch
#

I may not be familiar with this flow. Is there a specific doc of ours that you were referring to for connecting to these accounts like this?

#

Example request IDs for making the prices may help clarify for me as well

#

That the error ends with create a Connect webhook on your account instead tells me that the request was considered to be Connect

coral fractal
#

It shouldn’t be considered a connect. I’m trying to add it directly to an account that I don’t have access to outside their access token.

#

Like I said, the account isn’t a “connect account” on our stripe platform.

#

It SEEMS like stripe doesn’t support adding webhooks to an account using their access token. Which seems odd.

spare perch
#

Not sure what to say, I'd need example requests or the doc on the process that you are using so I could look in to this

coral fractal
#

an example request is on the first message

#
@organization = Organization.find_by(token: params[:organization_id])
            require 'stripe'
            Stripe.api_key = @organization.stripe_account.access_token

            Stripe::WebhookEndpoint.create({
            url: Rails.env.development? ? 'https://queue.ngrok.io/api/stripe_payment_intent' : 'https://app.usequeue.com/api/stripe_payment_intent',
            connect: true,
            enabled_events: [
                    'payment_intent.succeeded'
                ],
            })

I can DM the stripe access token if you need it

spare perch
#

Sorry, to clarify what I am trying to figure out is how exactly you are connecting to these accounts. The only way to get an access token that I know of is a connect flow so I need to see what exactly is happening when you make these calls if you aren't using the flow I linked to earlier

haughty thornBOT
graceful furnace
#

masud-webhook-creation

#

@coral fractal mostly as a platform you create the endpoint on your own Stripe account. You can never create it on the connected account

graceful furnace
#

look at my answer above, it explains your issue

coral fractal
graceful furnace
#

You did say you went through OAuth which is exactly Connect. That's the whole feature

coral fractal
#

okay so didn't know doing this counted as a "connect account" since these accounts won't appear on our platform under Connect tab.

graceful furnace
#

they would 100% appear there

#

Do you have an example account id acct_123 that I can look at?

coral fractal
#

Account i am trying to create a webhook to: acct_1MSnC2G02uXfwr5H

#

okay yeah, you're right. it does show up under the Connected tabs on my stripe account

#

So we can't add webhooks for connected accounts, bummer okay

#

Webhooks helps us know when a subscription payment has gone through each month (or w/e interval), so a we can keep record of that on our database.
(goal of our company is to make it easier to create subscriptions on their stripe account in special use case ways. that's why we wanted it)

graceful furnace