--- id: dodopayments version: "1.112.0" license: Apache-2.0 license_treatment: permissive maintenance: active --- # dodopayments — The official Python library for the Dodo Payments API License: permissive · Maintenance: active · Downloads: 84.1K/mo ## What it is and what it does Dodopayments is the official Python client for the Dodo Payments REST API. It wraps HTTP calls to Dodo's payment endpoints with type-safe request and response objects, automatic pagination, and both sync and async execution modes. The library is built on httpx and pydantic, providing full type hints for IDE autocomplete and optional runtime type checking. You use it to integrate Dodo Payments into Python applications—creating checkout sessions, listing payments, and managing transactions through a typed, ergonomic interface. It handles authentication via bearer token, environment switching (test vs. live mode), error classification (connection errors, rate limits, API errors), and optional aiohttp backend for async workloads. Use it for: - Build a checkout flow in a web app by creating sessions and retrieving session IDs for payment forms. - Iterate through all payments in your account with automatic pagination, without manual page-fetching logic. - Handle payment errors gracefully by catching specific exception types (RateLimitError, AuthenticationError, etc.). - Use async/await in a high-concurrency service to make non-blocking payment API calls. - Leverage type hints and Pydantic models to catch integration bugs early in development. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides a Python client library for the Dodo Payments REST API, with both synchronous and asynchronous interfaces, type-checked request and response handling, and automatic pagination. Yes. The library is actively maintained (release 1 day old), has no known vulnerabilities, low install friction, permissive licensing, and provides a well-typed, ergonomic interface to Dodo Payments. Install it if you need to integrate Dodo Payments into a Python application. No significant blockers. ## Install pip install dodopayments uv add dodopayments poetry add dodopayments ## Installing dodopayments Before you install: Low friction install with six common dependencies (anyio, distro, httpx, pydantic, sniffio, typing-extensions). Repository is actively maintained with a release 1 day old and no archived status. License in practice: Apache-2.0 is permissive; you can use, modify, and distribute this library with minimal restrictions, provided you include a copy of the license and state significant changes. Quickstart: pip install dodopayments import os from dodopayments import DodoPayments client = DodoPayments( bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), environment="test_mode", ) response = client.checkout_sessions.create( product_cart=[{"product_id": "pdt_example", "quantity": 1}] ) print(response.session_id) Requires Python 3.9 or later and a valid Dodo Payments API key set via environment variable. Verify before relying: - Whether the library's error handling (APIConnectionError, APIStatusError subclasses) covers all real-world failure modes you expect. - Performance characteristics of auto-pagination iterators under high-volume list operations. - Whether aiohttp backend (optional extra) is production-ready for your concurrency requirements. ## Package facts - License: Apache-2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 84.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags payment api client python, dodo payments sdk, async payment processing, rest api client library, typed http client, payment gateway integration, httpx-based api wrapper, payment-processing, async-support, type-safe [View on SkillFed](https://skillfed.io/packages/dodopayments) · [View on PyPI](https://pypi.org/project/dodopayments/)