⚡ Solution Summary

  • The error was caused by a typo in the parameter name 'stripe_acccount'.
  • Ensure the correct spelling 'stripe_account' is used.
  • Verify that the connected account ID is valid.
  • Check API keys for proper access to the connected account.
### Describe the bug The [docs](https://docs.stripe.com/connect/subscriptions?lang=python) state that subscriptions can be create for connected accounts using the `stripe_account` parameter: However, using the code from the docs returns an `InvalidRequestError: ... Received unknown parameter: stripe_acccount`. Is it possible to create a subscription for a connected account via the python API? ### To Reproduce 1. Create a connected account 2. Create a customer for the connected account 3. Create a product and price for the connected account 4. Create a subscription for the connected account as per [docs](https://docs.stripe.com/connect/subscriptions?lang=python) ``` stripe.Subscription.create( customer='{{CUSTOMER_ID}}', items=[{"price": '{{PRICE_ID}}'}], expand=["latest_invoice.payment_intent"], stripe_account='{{CONNECTED_ACCOUNT_ID}}', ) ``` ### Expected behavior Subscription is created for customer on the connecgted account Actual behaviour: ``` InvalidRequestError: ... Received unknown parameter: stripe_acccount ``` ### Code snippets _No response_ ### OS macOS ### Language version Python 3.11 ### Library version stripe-python v9.7.0 ### API version 2024-04-10 ### Additional context _No response_

Discussion & Fixes

remi-stripe 2024-05-19
@rebkwok I tried that exact code you have with the hardcoded values on v9.7.0 and the error I get is ``` stripe._error.PermissionError: The provided key 'sk_test_********************A6xl' does not have access to account '{{CONNECTED_ACCOUNT_ID}}' (or that account does not exist). Application access may have been revoked. ``` That error is expected since it's not a real account id but it confirms the code runs just fine and `stripe_account` is turned into the `Stripe-Account` header internally as expected. Can you provide a simple end-to-end reproduction of the exact bug you are experiencing? Is it possible something else in your code is causing this error? Can you also share an exact request id `req_123` which would be in the error returned so that I can look deeper?
rebkwok 2024-05-19
@remi-stripe I have run through all my steps again in a shell and have not run into the same issue. It was due to a dumb typo in my code; sorry for the false alarm. But thanks so much for the quick response, it is really appreciated :). I will close the issue.

Get updates

We publish verified fixes weekly. No spam.

Subscribe