Stripe

14.2.0 · active · verified Sun Mar 01

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.

Warnings

Install

Imports

Quickstart

Basic payment intent creation and webhook verification. Always verify webhook signatures — do not trust payload content without verification.

import stripe

stripe.api_key = 'sk_test_...'

# Create a payment intent
pi = stripe.PaymentIntent.create(
    amount=2000,
    currency='usd',
    payment_method_types=['card']
)
print(pi.client_secret)

# Verify webhook
import stripe.webhook
event = stripe.Webhook.construct_event(
    payload=request.body,
    sig_header=request.headers['Stripe-Signature'],
    secret='whsec_...'
)

view raw JSON →