Stripe Connect Application Deauthorized

1,083 views
Skip to first unread message

Mantas Konstantinavicius

unread,
Jun 22, 2014, 3:20:18 PM6/22/14
to api-d...@lists.stripe.com
Quick question!

Does Stripe send through the (previously) connected user's stripe_user_id with the account.application.deauthorized webhook? If not, how do I identify which user has just disconnected from my app (local cleanup, etc)?

Thanks!

Ryan McGeary

unread,
Jun 22, 2014, 6:45:31 PM6/22/14
to api-d...@lists.stripe.com
Yes. A user_id param is passed for Stripe Connect application webhooks. 
--
You received this message because you are subscribed to the Google Groups "Stripe API Discussion" group.
To post to this group, send email to api-d...@lists.stripe.com.
Visit this group at http://groups.google.com/a/lists.stripe.com/group/api-discuss/.

To unsubscribe from this group and stop receiving emails from it, send an email to api-discuss...@lists.stripe.com.

Mantas Konstantinavicius

unread,
Jun 26, 2014, 8:57:28 AM6/26/14
to api-d...@lists.stripe.com
Hey,

Thanks for the answer, though I think that we're talking about different things here. :)

I know that Stripe send through the user_id param with their webhook events.

The problem is that I don't see a user_id param on "account.application.deauthorized" which is sent to the app when a user manually disconnects through their Stripe admin dashboard.

According to Stripe docs we're supposed to do "any required cleanup on your servers" when this event is received... how do I know which user just disconnected (so I can find their stripe-connect settings in my db and delete them)?

I must be doing something wrong.

Thanks
To unsubscribe from this group and stop receiving emails from it, send an email to api-discuss+unsubscribe@lists.stripe.com.

Ryan McGeary

unread,
Jun 26, 2014, 10:54:55 AM6/26/14
to api-d...@lists.stripe.com
Mantas,

Hmm. I'm not sure what to tell you. I've implemented and tested this against my application (relying on user_id) and have even contributed to the stripe_events ruby gem to help specifically handle the idiosyncrasies surrounding this webhook.

Here is the full JSON payload that I see with an "account.application.deauthorized" webhook (it includes the user_id param).

{
  "id": "evt_xyz12312312312",
  "created": 1403793876,
  "livemode": false,
  "type": "account.application.deauthorized",
  "data": {
    "object": {
      "id": "ca_xyz123xyz123xyz123xyz123xyz123xy",
      "name": "Some Application",
      "object": "application"
    }
  },
  "object": "event",
  "pending_webhooks": 1,
  "request": null,
  "user_id": "acct_xyz123xyz123xyz123xy"
}

-Ryan


To unsubscribe from this group and stop receiving emails from it, send an email to api-discuss...@lists.stripe.com.

Mantas Konstantinavicius

unread,
Jun 26, 2014, 11:03:26 AM6/26/14
to api-d...@lists.stripe.com
Yea, that's what i was expecting to get heh! But instead:

{
 
"id": "evt_104ICY4cR86pXK65HZrRCfuL",
 
"created": 1403786346,

 
"livemode": false,
 
"type": "account.application.deauthorized",
 
"data": {
   
"object": {

     
"id": "ca_4BQH2bSKjSy8J4jVsG1uYFTfZ5tvFO4y",
     
"name": "Harpoon Test Mantas",

     
"object": "application"
   
}
 
},
 
"object": "event",

 
"pending_webhooks": 2,
 
"request": null
}

No idea why - let me experiment with my Stripe setup to see if I can fix this.

Thanks so much for you help!

Jim Danz

unread,
Jun 26, 2014, 12:25:06 PM6/26/14
to api-d...@lists.stripe.com
Hey Mantas,

Are you testing by connecting your "own" account to your application?  (As in, the same account that owns the application?).  If so, this can cause some confusion in testing.

Essentially there are 2 different Webhook endpoints:
1) your merchant Webhook endpoint, set in the Webhooks pane in the dashboard. This gets events for your merchant itself, and never gets user ids in payloads (because it's all from the same user)
2) your connect application Webhook endpoint, set on the Application settings page. This gets events on behalf of your connected users, and does get user_id in the payload so that you can differentiate.

So it sounds like what may be happening here is that you're actually looking at Webhooks being sent to your merchant Webhook endpoint, hence the lack of user_id in the payload.

Sorry that we don't make this all clearer!

Jim

--

Mantas Konstantinavicius

unread,
Jun 26, 2014, 12:41:53 PM6/26/14
to api-d...@lists.stripe.com
Hey,

Yep, took me a couple hours but I figured this out. :)

Thanks!


--
You received this message because you are subscribed to a topic in the Google Groups "Stripe API Discussion" group.
Reply all
Reply to author
Forward
0 new messages