skillfed

dodopayments

The official Python library for the Dodo Payments API

dodopayments v1.112.0 84.1K downloads/30d#14,026 on PyPI12
Permissive license Apache-2.0 Active released

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 on this page — 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

dodopayments on PyPI

pip

pip install dodopayments

uv

uv add dodopayments

poetry

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 the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 6 — anyio, distro, httpx, pydantic, sniffio, typing-extensions
Maintenance actively maintained — 1 days since the last release
Last repo commit
First released
Downloads 84,110/month — #14,026 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: dodopayments-1.112.0-py3-none-any.whl

Intended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: OS IndependentOperating System :: POSIXOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python ModulesTyping :: Typed

Tags

payment api client pythondodo payments sdkasync payment processingrest api client librarytyped http clientpayment gateway integrationhttpx-based api wrapper
payment-processingasync-supporttype-safe

More Python Modules packages