How do I use django stripe with connected accounts?
See original GitHub issueWhat 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:
- Created 2 years ago
- Reactions:1
- Comments:8 (4 by maintainers)
Top GitHub Comments
@arnav13081994 Thank you. I’ll try out the latest release 2.5.0 soon.
@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 theAccount ID
of theconnected 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 forConnect 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.