3

I am very new the stripe & stripe API, right now am integrating the stripe into the django python server. I am able to create the customers & accounts. While updating the account with the bank token, I got an error "This application is not authorized to edit this account". I am able to see the connected accounts on the connected accounts page in stripe dashboard. Here is my code where I got the issue when account.save()

try:
    account = stripe.Account.retrieve(user_account_id)
    account.external_accounts = bank_account_token
    account.save()
except Exception as e:
    retrun e.message
return account
Kushal Kumar
  • 173
  • 1
  • 14
  • You should write to Stripe's support at https://support.stripe.com/email and include the ID of the account. They will be able to look at your logs and help you figure out the issue. – Ywain Dec 06 '17 at 17:54
  • Thank you very much for your reply, will do that now. – Kushal Kumar Dec 07 '17 at 06:15
  • Yea, I did it & got the answer from Stripe. Thank you :) `account = stripe.Account.retrieve(user_account_id) account.external_accounts.create(external_account=bank_accou‌​nt_token) account.save()` – Kushal Kumar Jan 22 '18 at 06:33

1 Answers1

2

In my stripe experience, I had the same error like you. I looked the stripe documentation carefully and I found that I used the wrong user type. As you know, the stripe has 3 user types. standard, express, custom. What I've done wrong is I used the standard account type. It was wrong. Only custom account can have external_account.

So I changed the account type as 'custom' instead of 'standard'.

Here is my rails code below:

account = Stripe::Account.retrieve(current_user.stripe_account)
account.external_accounts.create(:external_account => params[:stripeToken])
account.save
Zhong Ri
  • 2,556
  • 1
  • 19
  • 23
  • Thank you very much, actually it fixed by updating the code in python `account = stripe.Account.retrieve(user_account_id) account.external_accounts.create(external_account=bank_account_token) account.save() ` – Kushal Kumar Jan 22 '18 at 06:29