PHPackages                             bitgen/sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. bitgen/sdk

ActiveLibrary[API Development](/categories/api)

bitgen/sdk
==========

Official PHP SDK for the BITGEN API v3.1.x

v0.1.7(3mo ago)04proprietaryPHPPHP ^8.2

Since Mar 10Pushed 3mo agoCompare

[ Source](https://github.com/bitgenplatform/sdk-php)[ Packagist](https://packagist.org/packages/bitgen/sdk)[ Docs](https://github.com/bitgenplatform/sdk-php)[ RSS](/packages/bitgen-sdk/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependencies (2)Versions (8)Used By (0)

bitgen/sdk
==========

[](#bitgensdk)

Official PHP SDK for the BITGEN API v3.1.x.

Requirements
------------

[](#requirements)

- PHP 8.2+
- Guzzle 7.x (`guzzlehttp/guzzle`)

Installation
------------

[](#installation)

```
composer require bitgen/sdk
```

Quick start
-----------

[](#quick-start)

```
use Bitgen\Sdk\BitgenClient;

$client = new BitgenClient([
    'scope'  => 'YOUR_SCOPE_UUID',
    'apiKey' => 'YOUR_API_KEY',
    'env'    => 'sandbox', // 'sandbox' | 'production'
]);
```

Usage
-----

[](#usage)

### Assets

[](#assets)

```
$asset  = $client->asset->get('BTC');
echo $asset->name;  // Bitcoin
echo $asset->price; // 57731.19

$assets = $client->asset->list(); // Asset[]
```

### Bank

[](#bank)

```
$account = $client->bank->get($userUuid);
echo $account->amount; // 470.13

$result = $client->bank->withdraw($userUuid, 50);
echo $result->amount->finalWithdrawnAmount; // 47

$ops = $client->bank->operations($userUuid, [
    'direction' => 'WITHDRAWAL',
    'from'      => 1770748202,
    'to'        => 1772399995,
]);
```

### Orders

[](#orders)

```
// Buy — amount in EUR
$order = $client->order->create([
    'user'   => $userUuid,
    'asset'  => 'ETH',
    'amount' => 25,
    'mode'   => 'BUY',
]);
echo $order->tunnel; // "a8a6787e-..."
echo $order->state;  // "REGISTERED"

// Sell — amount in asset units
$order = $client->order->create([
    'user'   => $userUuid,
    'asset'  => 'BTC',
    'amount' => 0.0003601,
    'mode'   => 'SELL',
]);

// Poll status
$order = $client->order->get($tunnel);
echo $order->state;                    // "PAID"
echo $order->data->deliveredAmount;    // 0.01419787

$history = $client->order->history($userUuid); // Order[]
```

### Transactions (withdrawals)

[](#transactions-withdrawals)

```
use Bitgen\Sdk\Exception\BitgenException;

try {
    $tx = $client->transaction->create([
        'user'          => $userUuid,
        'asset'         => 'BTC',
        'amount'        => 0.0003,
        'targetAddress' => 'tb1qrpd5g02e04lven83f46aeqy52wfqn8kk9h5kts',
        // 'targetTag'  => '...',  // optional — required for some assets (e.g. XRP)
    ]);
    echo $tx->txId;  // "761860cb-..."
    echo $tx->state; // "INITIALIZED"

} catch (BitgenException $e) {
    echo $e->code;       // 406
    echo $e->apiMessage; // "insufficient_funds"
}

$tx      = $client->transaction->get($txId);
$history = $client->transaction->history($userUuid, ['asset' => 'BTC']);
```

### Users

[](#users)

```
$created = $client->user->create([
    'email'     => 'jane.doe@example.com',
    'iban'      => 'FR76...',
    'firstname' => 'Jane',
    'lastname'  => 'Doe',
]);
echo $created->uuid;

$list   = $client->user->list(['offset' => 0, 'limit' => 100]);
echo $list->meta->total;

$detail = $client->user->get($userUuid);
echo $detail->user->account->email;
echo $detail->bank->amount;

$client->user->update($userUuid, ['email' => 'new@example.com']);
$client->user->disable($userUuid);
```

### Wallets

[](#wallets)

```
$wallets = $client->wallet->list($userUuid); // Wallet[]
$wallet  = $client->wallet->get($userUuid, 'BTC');
echo $wallet->balance;         // 0.0015849
echo $wallet->asset->baseUnit; // 100000000
```

### Stats

[](#stats)

```
$health = $client->stats->health();
echo $health->version; // "3.1"

$stats = $client->stats->quotas();
echo $stats->users->remain; // 989
```

Error handling
--------------

[](#error-handling)

ExceptionWhenProperties`BitgenException`Any standard API error (JSON body with `error` key)`status`, `code`, `service`, `module`, `apiMessage````
use Bitgen\Sdk\Exception\BitgenException;

try {
    $order = $client->order->create([...]);
} catch (BitgenException $e) {
    // $e->service    → "order"
    // $e->module     → "create"
    // $e->code       → 416
    // $e->apiMessage → "requested_amount_error"
    // $e->status     → HTTP status code
}
```

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance82

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2 days

Total

7

Last Release

94d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/dca7eb957fec3e5607cdf2a42dc893d08fee2e6b378948d3214c2e1ffad86f47?d=identicon)[hlavigne](/maintainers/hlavigne)

### Embed Badge

![Health badge](/badges/bitgen-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/bitgen-sdk/health.svg)](https://phpackages.com/packages/bitgen-sdk)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.2M46](/packages/tencentcloud-tencentcloud-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k496.1k33](/packages/neuron-core-neuron-ai)[avalara/avataxclient

Client library for Avalara's AvaTax suite of business tax calculation and processing services. Uses the REST v2 API.

528.3M7](/packages/avalara-avataxclient)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

252.5k](/packages/eslazarev-wildberries-sdk)[files.com/files-php-sdk

Files.com PHP SDK

2478.1k](/packages/filescom-files-php-sdk)[aimeos/prisma

A powerful PHP package for integrating media related Large Language Models (LLMs) into your applications

1772.4k4](/packages/aimeos-prisma)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
