Application fee testing error

784 views
Skip to first unread message

bensam...@gmail.com

unread,
Jan 6, 2018, 10:32:28 PM1/6/18
to Stripe API Discussion
Hi there,

I'm attempting to setup an open marketplace using Stripe but whenever I attempt to make a transaction from a 'buyer' to a 'seller' I receive this error:

Error: Can only apply an application_fee when the request is made on behalf of another account (using an OAuth key, the Stripe-Account header, or the destination parameter).

I'm using OAuth to generate a Stripe User ID for the seller, and referencing that whenever a buyer purchases an item.


I've also attempted to setup Stripe OAuth and attempted to purchase the item in incognito mode to no effect.

Thank you

Remi J.

unread,
Jan 6, 2018, 10:36:32 PM1/6/18
to api-d...@lists.stripe.com
Hey,

This error usually happens when you try to make a request through Stripe Connect but where the connected account is your own platform account. This usually means that, when you went through the OAuth flow, you were already logged into your platform's dashboard so you connected this account to itself. It works technically but prevents you from taking an application fee and returns that specific error.

What you want to do here is connect a completely different account to your platform. The easiest solution is to go to the dashboard and disconnect your session. Once it's done, go through the OAuth flow again which will create a separate test account behind the scenes. You can click the "Skip this account form" at the top to avoid activating the account. Once you do, you should see a completely different account id (acct_XXXX) in the `stripe_user_id` response during the last step of the OAuth flow.

If you're still experiencing issues after this though, I'd recommend reaching out to our support team directly here: https://support.stripe.com/email

Best,
Remi

--
You received this message because you are subscribed to the Google Groups "Stripe API Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to api-discuss+unsubscribe@lists.stripe.com.
To post to this group, send email to api-d...@lists.stripe.com.
Visit this group at https://groups.google.com/a/lists.stripe.com/group/api-discuss/.

bensam...@gmail.com

unread,
Jan 7, 2018, 9:47:45 AM1/7/18
to Stripe API Discussion
Hi again,

Thanks for the quick response!

Turns out the issue was totally unrelated.

The account ID I was passing as the stripe_account parameter was invalid, everything works fine now.
To unsubscribe from this group and stop receiving emails from it, send an email to api-discuss...@lists.stripe.com.

Remi J.

unread,
Jan 7, 2018, 9:50:40 AM1/7/18
to api-d...@lists.stripe.com
Hey,

When you pass an invalid account id, the error is different. It usually says that you don't have access to that account since it either does not exist or is not connected to your platform. You can confirm this with the following curl request:

   -u sk_test_BQokikJOvBiI2HlWgH4olfQ2: \
   -d amount=1000 \
   -d currency=usd \
   -d source=tok_visa \
   -H "Stripe-Account: 1234"

This currently returns:

{
  "error": {
    "type": "invalid_request_error",
    "message": "The provided key 'sk_test_********************lfQ2' does not have access to account '1234' (or that account does not exist). Application access may have been revoked."
  }
}

It's likely that the account id you passed was your platform's at that point and when you fixed this the error went away.

Let me know if you need anything else!
All the best,
Remi

To unsubscribe from this group and stop receiving emails from it, send an email to api-discuss+unsubscribe@lists.stripe.com.
Reply all
Reply to author
Forward
0 new messages