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.
pip install stripeVerified import paths — ran on the pinned version, not inferred.
Basic payment intent creation and webhook verification. Always verify webhook signatures — do not trust payload content without verification.
Update InvoiceLineItem.modify(invoice='in_...', line_item_id='il_...', params={})Pin SDK version in production. When upgrading major versions, review the API changelog for breaking changes between API versions at docs.stripe.com/changelog.
Update mock server expectations for v2 endpoint include params to use indexed format.
Use StripeClient(api_key='...') instances per request for multi-tenant applications.
Use secret keys (sk_live_... or sk_test_...) in the Python SDK.
Access request.body (Django) or request.data (Flask) before any parsing. Use @csrf_exempt in Django and ensure the body is read as bytes.
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.
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"`.