> For the complete documentation index, see [llms.txt](https://docs-sdk.crypto-chief.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-sdk.crypto-chief.com/processing/php.md).

# PHP SDK

The official PHP SDK for the Crypto Chief crypto processing API — accept payments, send payouts, sign transactions, and verify webhooks across 25+ chains.

The official PHP client for the [Crypto Chief](https://crypto-chief.com/processing/) crypto processing API. One Composer install gives you fully typed access to payments, payouts, on-chain transactions, wallets, and webhooks across 25+ chains.

[![Packagist](https://img.shields.io/packagist/v/crypto-chiefs/cryptochief-crypto-processing-php.svg)](https://packagist.org/packages/crypto-chiefs/cryptochief-crypto-processing-php)

## Requirements

* PHP **8.1+** with `bcmath`, `mbstring`, `openssl`, and `json` extensions
* A Crypto Chief **Merchant ID** and **API key** (Dashboard → Integration)

## Installation

```bash
composer require crypto-chiefs/cryptochief-crypto-processing-php
```

```php
use CryptoChief\Processing\Client;
use CryptoChief\Processing\Chain;
```

The package uses **readonly DTOs with constructor promotion** (PHP 8.1+) and **backed enums** for chains and error codes. Public properties are camelCase; the SDK converts to the API's snake\_case wire format for you.

## Quickstart

```php
<?php
require __DIR__ . '/vendor/autoload.php';

use CryptoChief\Processing\Chain;
use CryptoChief\Processing\Client;
use CryptoChief\Processing\Dto\EstimatePayoutRequest;

$client = new Client(
    merchantId: 'MERCHANT_ID',
    apiKey:     'API_KEY',
);

$est = $client->payouts()->estimate(new EstimatePayoutRequest(
    network:   Chain::EthSepolia->value,
    coin:      'ETH',
    amount:    '0.0001',
    toAddress: '0xRecipient...',
));

echo "amount to receive: {$est->amountToReceive}\n";
```

{% hint style="success" %}
If `estimate()` returns without throwing, your credentials and request signing are working end-to-end.
{% endhint %}

## What you can do

| Domain                       | Service                   | Key methods                                                                                                             |
| ---------------------------- | ------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| Single & batch payouts       | `$client->payouts()`      | `estimate`, `execute`, `batchExecute`, `info`, `history`, `waitFor`                                                     |
| Sign / execute arbitrary txs | `$client->transactions()` | `sign`, `execute`, `signEvmCall`, `jettonTransfer`                                                                      |
| Accept payments              | `$client->payIns()`       | `create`, `selectAsset`, `cancel`, `info`, `history`, `waitFor`                                                         |
| Wallets + RSA decrypt        | `$client->wallets()`      | `generate`, `list`, `info`, `payInHistory`, `freeze`, `rebindMaster`, `setCallbackUrl`, `setLabel`, `decryptPrivateKey` |
| Treasury sweeps              | `$client->sweeps()`       | `force`, `history`, `walletHistory`, `settings`, `updateSettings`                                                       |
| On-chain queries             | `$client->blockchain()`   | `blockchains`, `contractsList`, `contractsAvailable`, `walletBalance`, `transactionStatus`                              |
| Manual withdrawals           | `$client->withdrawals()`  | `info`, `history`                                                                                                       |
| Fiat ↔ crypto rates          | `$client->currencies()`   | `fiats`, `cryptos`, `fiatToCrypto`, `cryptoToFiat`                                                                      |
| API credits                  | `$client->credits()`      | `balance`, `topup`                                                                                                      |

## Explore the guides

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>🔑 Authentication</strong></td><td>Credentials, client setup, and request signing.</td><td><a href="/processing/php/authentication.md">Authentication</a></td></tr><tr><td><strong>💸 Send a payout</strong></td><td>Estimate, execute idempotently, and confirm.</td><td><a href="/processing/php/guides/payouts.md">Send a payout</a></td></tr><tr><td><strong>📥 Accept payments</strong></td><td>Create PayIn invoices and read deposits.</td><td><a href="/processing/php/guides/accept-payments.md">Accept crypto payments</a></td></tr><tr><td><strong>📡 Webhooks</strong></td><td>Verify signatures and handle typed events.</td><td><a href="/processing/php/guides/webhooks.md">Webhooks</a></td></tr><tr><td><strong>🧩 Contract calls</strong></td><td>EVM / TRON ABI calls with no hand-encoded calldata.</td><td><a href="/processing/php/guides/contract-calls.md">Contract calls (EVM / TRON)</a></td></tr><tr><td><strong>💎 TON transfers</strong></td><td>Jetton, NFT, and comment transfers in one call.</td><td><a href="/processing/php/guides/ton.md">TON: Jetton, NFT &amp; comments</a></td></tr></tbody></table>
