> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dimepayments.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Python SDK

> Official Python client for the Dime Payments API

## Installation

Requires Python 3.10+

```bash theme={null}
pip install dime-python-sdk
```

## Quickstart

```python theme={null}
from dime_payments import Client

dime = Client('your-api-token')

txn = dime.transactions.charge_card('YOUR_SID', {
    'amount': '49.99',
    'token': 'tok_abc123',
})

print(txn.transaction_status)  # "Success"
```

## Configuration

```python theme={null}
from dime_payments import Client, Config

# Simple setup
dime = Client('your-api-token')

# Full control
dime = Client(Config(
    token='your-api-token',
    base_url='https://app.dimepayments.com',
    timeout=30.0,
    max_retries=2,
))
```

## Available Resources

| Property                  | Endpoints                                                           |
| ------------------------- | ------------------------------------------------------------------- |
| `dime.transactions`       | charge\_card, charge\_ach, tokenize\_card, refund, void, show, list |
| `dime.customers`          | list, show, create, update, delete                                  |
| `dime.payment_methods`    | list, show, create, update, delete                                  |
| `dime.merchants`          | list, show, create, update, get\_form\_link                         |
| `dime.addresses`          | list, show, create, update, delete                                  |
| `dime.deposits`           | list, list\_with\_transactions, show                                |
| `dime.recurring_payments` | list, show, create, edit, pause, cancel, activate, delete           |

## Pagination

```python theme={null}
# Stream all transactions across every page
for txn in dime.transactions.list('YOUR_SID', {
    'start_date': '2026-01-01 00:00:00',
    'end_date':   '2026-01-31 23:59:59',
}).auto_paging():
    print(txn.amount)
```

## Error Handling

```python theme={null}
from dime_payments import DimeException, ValidationException

try:
    dime.transactions.charge_card('YOUR_SID', {'amount': '0'})
except ValidationException as e:
    print(e.get_errors())  # {'data.amount': ['must be greater than 0']}
except DimeException as e:
    print(e.get_status_code())
```

## Links

* [GitHub](https://github.com/dime-technology/dime-python-sdk)
* [PyPI](https://pypi.org/project/dime-python-sdk/)
* [API Reference](/api-reference)
