{"id":74,"library":"stripe","title":"Stripe","description":"Official Python SDK for the Stripe Payments API. Actively maintained by Stripe. Versioned on a date-based API release cycle (e.g. 2026-02-25.clover). SDK major versions track breaking Python API changes separately from API version pinning. Current API version: 2026-02-25.clover.","status":"active","version":"14.2.0","language":"python","source_language":"en","source_url":"https://github.com/stripe/stripe-python","tags":["payments","stripe","billing","subscriptions","python","api"],"install":[{"cmd":"pip install stripe","lang":"bash","label":"Python"}],"dependencies":[{"reason":"Default HTTP client. Can be swapped for aiohttp via StripeClient.","package":"requests","optional":false}],"imports":[{"wrong":"","symbol":"stripe","correct":"import stripe"}],"quickstart":{"code":"import stripe\n\nstripe.api_key = 'sk_test_...'\n\n# Create a payment intent\npi = stripe.PaymentIntent.create(\n    amount=2000,\n    currency='usd',\n    payment_method_types=['card']\n)\nprint(pi.client_secret)\n\n# Verify webhook\nimport stripe.webhook\nevent = stripe.Webhook.construct_event(\n    payload=request.body,\n    sig_header=request.headers['Stripe-Signature'],\n    secret='whsec_...'\n)","lang":"python","description":"Basic payment intent creation and webhook verification. Always verify webhook signatures — do not trust payload content without verification."},"warnings":[{"fix":"Update InvoiceLineItem.modify(invoice='in_...', line_item_id='il_...', params={})","message":"SDK v14.0 (November 2025) pinned API version to 2025-09-30.clover and included breaking changes: InvoiceLineItem.modify() now requires invoice and line_item_id as explicit method parameters. Code passing them via params dict breaks.","severity":"breaking","affected_versions":"< 14.0.0"},{"fix":"Pin SDK version in production. When upgrading major versions, review the API changelog for breaking changes between API versions at docs.stripe.com/changelog.","message":"Stripe API uses date-based versioning (e.g. 2026-02-25.clover). Each SDK major version pins a new API version. Upgrading SDK major version automatically changes which API version your requests use, which can break existing integrations.","severity":"breaking","affected_versions":"all"},{"fix":"Update mock server expectations for v2 endpoint include params to use indexed format.","message":"V2 API endpoints (e.g. /v2/billing) use indexed query format for include[] params: ?include[0]=foo&include[1]=bar. Code mocking the old repeated format (?include=foo&include=bar) breaks in unit tests.","severity":"breaking","affected_versions":">= 13.1.0"},{"fix":"Use StripeClient(api_key='...') instances per request for multi-tenant applications.","message":"stripe.api_key is a global. In multi-threaded or async apps, setting it globally can cause key leakage between requests. Using different keys per request requires StripeClient, not the global API.","severity":"gotcha","affected_versions":"all"},{"fix":"Use secret keys (sk_live_... or sk_test_...) in the Python SDK.","message":"Publishable keys (pk_live_..., pk_test_...) are for Stripe.js front-end only. Using them server-side in the Python SDK returns 401 Unauthorized.","severity":"gotcha","affected_versions":"all"},{"fix":"Access request.body (Django) or request.data (Flask) before any parsing. Use @csrf_exempt in Django and ensure the body is read as bytes.","message":"Webhook signature verification requires the raw request body, not parsed JSON. Frameworks that pre-parse the body (e.g. Django REST Framework with JSONParser) will cause signature verification to fail.","severity":"gotcha","affected_versions":"all"},{"fix":"Ensure the 'stripe' library is installed using `pip install stripe`. If the module existed in an older version, consider pinning an older SDK version or updating the import statement.","message":"The 'stripe' library or its 'webhook' submodule could not be found. This typically indicates that the 'stripe' package is not installed in the environment or the submodule has been removed/renamed in the installed version.","severity":"breaking","affected_versions":"all"},{"fix":"Ensure the `stripe` library is correctly installed in the Python environment using `pip install stripe`. If using a virtual environment, ensure it is activated. Verify the installation by running `python -c \"import stripe.webhook\"`.","message":"The `stripe` library or its submodules (e.g., `stripe.webhook`) cannot be imported if the package is not installed or not available in the Python environment's `sys.path`. This results in a `ModuleNotFoundError`.","severity":"breaking","affected_versions":"all"}],"env_vars":{"optional":[{"name":"STRIPE_WEBHOOK_SECRET","note":"Used for webhook signature verification (whsec_...). Different per endpoint."}],"required":[{"name":"STRIPE_API_KEY","note":"Secret key (sk_live_... or sk_test_...). Never use publishable key (pk_...) server-side."}]},"search_vec":"'2026-02-25.clover':24,41 'activ':10 'api':9,20,31,35,39,47 'base':19 'bill':44 'break':29 'chang':32 'current':38 'cycl':22 'date':18 'date-bas':17 'e.g':23 'maintain':11 'major':26 'offici':2 'payment':8,42 'pin':37 'python':3,30,46 'releas':21 'sdk':4,25 'separ':33 'stripe':1,7,13,43 'subscript':45 'track':28 'version':14,27,36,40","created_at":"2026-03-16T04:39:09.011572+00:00","updated_at":"2026-04-16T22:29:23.186995+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":100,"quickstart_score":80,"quickstart_tag":"verified","pypi_latest":"15.5.1","cli_name":"","cli_version":null,"type":"sdk","homepage":"https://stripe.com","github":"https://github.com/stripe/stripe-python","docs":"https://stripe.com/docs/api/?lang=python","changelog":"https://github.com/stripe/stripe-python/blob/master/CHANGELOG.md","pypi":"https://pypi.org/project/stripe/","npm":"https://www.npmjs.com/package/stripe","openapi_spec":null,"status_page":null,"smithery":null,"categories":["payments","http-networking"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-08-26","next_check":"2026-07-29","install_tag":"verified"}}