> ## 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.

# PHP SDK

> Official PHP client for the Dime Payments API

## Installation

Requires PHP 8.3+

```bash theme={null}
composer require dime-technology/dime-php-sdk
```

## Quickstart

```php theme={null}
$dime = new \DimePayments\Sdk\Client('your-api-token');

$txn = $dime->transactions->chargeCard('YOUR_SID', [
    'amount' => 49.99,
    'token'  => 'tok_abc123',
]);

echo $txn->transactionStatus; // "Success"
```

## Configuration

```php theme={null}
use DimePayments\Sdk\Client;
use DimePayments\Sdk\Config;

// Simple setup
$dime = new Client('your-api-token');

// Full control
$dime = new Client(new Config(
    token:      'your-api-token',
    baseUrl:    'https://app.dimepayments.com',
    timeout:    30.0,
    maxRetries: 2,
));
```

## Available Resources

| Property                   | Endpoints                                                 |
| -------------------------- | --------------------------------------------------------- |
| `$dime->transactions`      | charge card/ACH, tokenize, refund, void, show, list       |
| `$dime->customers`         | list, show, create, update, delete                        |
| `$dime->paymentMethods`    | list, show, create, update, delete                        |
| `$dime->merchants`         | list, show, create, update, get onboarding form link      |
| `$dime->addresses`         | list, show, create, update, delete                        |
| `$dime->deposits`          | list, list-with-transactions, show                        |
| `$dime->recurringPayments` | list, show, create, edit, pause, cancel, activate, delete |

## Error Handling

```php theme={null}
use DimePayments\Sdk\Exceptions\DimeException;
use DimePayments\Sdk\Exceptions\ValidationException;

try {
    $dime->transactions->chargeCard('YOUR_SID', ['amount' => 0]);
} catch (ValidationException $e) {
    $e->getErrors();   // ['data.amount' => ['must be greater than 0']]
} catch (DimeException $e) {
    $e->getStatusCode();
}
```

## Links

* [GitHub](https://github.com/dime-technology/dime-php-sdk)
* [Packagist](https://packagist.org/packages/dime-technology/dime-php-sdk)
* [API Reference](/api-reference)
