question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How do I use django stripe with connected accounts?

See original GitHub issue

What are you trying to accomplish?

I’m trying to have the Products and Prices from a connected account in my database.

Other

When editing/creating a product on the connected account’s dashboard I get the connect webhook event, but it finishes with a 500 error, the error in my server being

stripe.error.InvalidRequestError: Request req_0msOTP9AEL3iRw: No such product: 'prod_JFNkegEUIqzAvK'

This is all locally, and in test mode. I’m using the latest release of this library: 2.4.3. Using the djstripe_sync_models command does not sync the product in the connected account.

What do I have to do to have the connected account’s products on the database? I have not input any API keys for connected accounts into my db. All requests and webhooks related to my platform work as expected.

Do I have to add the connected account’s api key, and does django stripe basically use the legacy method here: https://stripe.com/docs/connect/authentication?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
shukryzablahcommented, Jun 12, 2021

@arnav13081994 Thank you. I’ll try out the latest release 2.5.0 soon.

1reaction
arnav13081994commented, May 22, 2021

@shukryzablah Stripe now recommends that one use the stripe_account header to make any API calls “on behalf of” their connected account. Hence you need not worry about using the API keys of your connected accounts unless your use-case demands it. You simply need to send the Account ID of the connected account along with your request and Stripe will automatically associate that request with the Stripe Account that ID belongs to. This is what Stripe recommends.

dj-stripe doesn’t have full support for Connect Webhooks so far. I have raised a PR that should solve your issue. You can check it out here.

As far as having the products of your connected accounts on your db is concerned, my understanding is that as soon as your Connect Webhooks start working, they should start to sync and automatically start appearing on your DB.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Connected Accounts – Python - api
Clients can make requests as connected accounts using the special header Stripe-Account which should contain a Stripe account ID (usually starting with the ......
Read more >
django and stripe connect for mulitparty payment system
Well you didn't tell us your use case so I'm not sure what you're even trying to do. If you are creating a...
Read more >
Django - How can I manage custom payments between ...
What I think that is the better is to use (Stripe Connect) Express/Custom Accounts to create an account for each user that posts...
Read more >
Django and Stripe Payments Tutorial
Stripe is one of the most popular solutions for handling online payments. It has a fairly simple API and official SDK's. We will...
Read more >
Dj-Stripe: Home
Dj-stripe is an extensible wrapper around the Stripe API that continuously syncs most of the Stripe Data to your local database as pre-implemented...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found