PHPackages                             seegno/bitreserve-sdk-php - 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. seegno/bitreserve-sdk-php

ActiveLibrary[API Development](/categories/api)

seegno/bitreserve-sdk-php
=========================

Uphold SDK PHP for the Uphold API

5.0.1(9y ago)303824[4 issues](https://github.com/seegno/uphold-sdk-php/issues)MITPHPPHP &gt;=5.5

Since Jan 22Pushed 8y ago14 watchersCompare

[ Source](https://github.com/seegno/uphold-sdk-php)[ Packagist](https://packagist.org/packages/seegno/bitreserve-sdk-php)[ Docs](https://github.com/seegno/uphold-sdk-php)[ RSS](/packages/seegno-bitreserve-sdk-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (18)Used By (0)

Uphold SDK for PHP
==================

[](#uphold-sdk-for-php)

[![Latest Version](https://camo.githubusercontent.com/344ff912af5112e6933a8913a0da36244da59e3286342333e3faaa14a2b69256/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736565676e6f2f7570686f6c642d73646b2d7068702e737667)](https://packagist.org/packages/seegno/uphold-sdk-php)[![Build Status](https://camo.githubusercontent.com/3570a9c6fc573df583f5a64f302ae2db721e9060a9bad3ff264019677912fbce/68747470733a2f2f7472617669732d63692e6f72672f736565676e6f2f7570686f6c642d73646b2d7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/seegno/uphold-sdk-php)[![Code Climate](https://camo.githubusercontent.com/73675f576d53094dc252b9c5c2a10f865631a616dcf8ebe764ff6476cf4d6401/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f736565676e6f2f7570686f6c642d73646b2d7068702f6261646765732f6770612e737667)](https://codeclimate.com/github/seegno/uphold-sdk-php)[![Test Coverage](https://camo.githubusercontent.com/6df5b9d1affe35d40d6a9c5f56f16f193bccbb40bc9b2557bf7a425c22a7293c/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f736565676e6f2f7570686f6c642d73646b2d7068702f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/seegno/uphold-sdk-php)[![License](https://camo.githubusercontent.com/b16542d4ac4ec518ae6607fce2afc77bb2131c9732d13f17a6990626c3f260c0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f736565676e6f2f7570686f6c642d73646b2d7068702e737667)](https://packagist.org/packages/seegno/uphold-sdk-php)

Uphold is a next generation money service business that shields you from bitcoin volatility by enabling you to hold bitcoin as the money you use every day.

The Uphold SDK for PHP provides an easy way for developers to integrate PHP applications with the [Uphold API](https://uphold.com/en/developer/api/documentation).

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

[](#requirements)

- PHP &gt;= 5.5 with the [cURL](http://php.net/manual/en/book.curl.php) extension.
- [Guzzle](https://github.com/guzzle/guzzle) library.

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

[](#installation)

### Standalone

[](#standalone)

Grab the latest version of the library:

```
$ git clone https://github.com/seegno/uphold-sdk-php.git

```

Install composer:

```
$ curl -s https://getcomposer.org/installer | php

```

Install the library dependencies:

```
$ php composer.phar install

```

Require the autoloader file generated by composer:

```
require 'vendor/autoload.php';
```

### Integrating with another project using composer

[](#integrating-with-another-project-using-composer)

Require the library package as a dependency:

```
{
    "require": {
        "seegno/uphold-sdk-php": "~5.0"
    }
}
```

Basic usage
-----------

[](#basic-usage)

In order to learn more about the Uphold API, please check out the [API documentation](https://uphold.com/en/developer/api/documentation).

First, create a Personal Access Token (PAT) using the command described below.

### Create a Personal Access Token

[](#create-a-personal-access-token)

```
$ php lib/Uphold/console.php tokens:create

```

Then, create a new instance of the `Client` class with token. Take a look at the following examples and explore more on the [examples](https://github.com/seegno/uphold-sdk-php/tree/master/examples) directory.

### Authorize user

[](#authorize-user)

```
require_once 'vendor/autoload.php';

use Uphold\UpholdClient as Client;

// Initialize the client.
$client = new Client(array(
  'client_id' => 'APPLICATION_CLIENT_ID',
  'client_secret' => 'APPLICATION_CLIENT_SECRET',
));

// Authorize user using the code parameter from the application redirect url.
$user = $client->authorizeUser('CODE');

// Get the Bearer token.
$bearer = $user->getClient()->getOption('bearer');
```

### Get authenticated user

[](#get-authenticated-user)

```
require_once 'vendor/autoload.php';

use Uphold\UpholdClient as Client;

// Initialize the client.
$client = new Client();

// Get user.
$user = $client->getUser('AUTHORIZATION_TOKEN');
```

### Get user balances

[](#get-user-balances)

```
require_once 'vendor/autoload.php';

use Uphold\UpholdClient as Client;

// Initialize the client.
$client = new Client();

// Get user.
$user = $client->getUser('AUTHORIZATION_TOKEN');

// Get user balances for all currencies.
$balances = $user->getBalances();
```

You could get user total balance:

```
// Get user total balance.
$balance = $user->getTotalBalance();
```

The above produces the output shown below:

```
Array
(
    [amount] => 3.14
    [currency] => BTC
)
```

### Get user cards

[](#get-user-cards)

```
require_once 'vendor/autoload.php';

use Uphold\UpholdClient as Client;

// Initialize the client.
$client = new Client();

// Get user.
$user = $client->getUser('AUTHORIZATION_TOKEN');

// Get current user cards.
$cards = $user->getCards();
```

### Create new card

[](#create-new-card)

```
require_once 'vendor/autoload.php';

use Uphold\UpholdClient as Client;

// Initialize the client.
$client = new Client();

// Get the current user.
$user = $client->getUser('AUTHORIZATION_TOKEN');

// Create a new 'BTC' card.
$card = $user->createCard('My new card', 'BTC');
```

The above produces the output shown below:

```
Uphold\Model\Card Object
(
    [id:protected] => ade869d8-7913-4f67-bb4d-72719f0a2be0
    [address:protected] => Array
        (
            [bitcoin] => 1GpBtJXXa1NdG94cYPGZTc3DfRY2P7EwzH
        )

    [addresses:protected] => Array
        (
            [0] => Array
                (
                    [id] => 1GpBtJXXa1NdG94cYPGZTc3DfRY2P7EwzH
                    [network] => bitcoin
                )

        )

    [available:protected] => 0.00
    [balance:protected] => 0.00
    [currency:protected] => BTC
    [label:protected] => My new card
    [lastTransactionAt:protected] =>
    [transactions:protected] =>
    [settings] => Array
        (
            [position] => 10
        )
)
```

### Get rates

[](#get-rates)

```
require_once 'vendor/autoload.php';

use Uphold\UpholdClient as Client;

// Initialize the client.
$client = new Client();

// Get rates (public endpoint).
$rates = $client->getRates();
```

Or you could get rates for a specific currency:

```
// Get rates for BTC.
$rates = $client->getRatesByCurrency('BTC');
```

The above produces the output shown below:

```
Array
(
    [0] => Uphold\Model\Rate Object
        (
            [ask:protected] => 1
            [bid:protected] => 1
            [currency:protected] => BTC
            [pair:protected] => BTCBTC
        )

    [1] => Uphold\Model\Rate Object
        (
            [ask:protected] => 234.89
            [bid:protected] => 234.8
            [currency:protected] => USD
            [pair:protected] => BTCUSD
        )
)
```

### Create and commit a new transaction

[](#create-and-commit-a-new-transaction)

```
require_once 'vendor/autoload.php';

use Uphold\UpholdClient as Client;

// Initialize the client.
$client = new Client();

// Get user.
$user = $client->getUser('AUTHORIZATION_TOKEN');

// Get a specific card by id.
$card = $user->getCardById('ade869d8-7913-4f67-bb4d-72719f0a2be0');

// Create a new transaction.
$transaction = $card->createTransaction('foo@bar.com', '2.0', 'BTC');

// Commit the transaction.
$transaction->commit();
```

The above produces the output shown below:

```
Uphold\Model\Transaction Object
(
    [id:protected] => a97bb994-6e24-4a89-b653-e0a6d0bcf634
    [createdAt:protected] => 2015-01-30T11:46:11.439Z
    [denomination:protected] => Array
        (
            [pair] => BTCBTC
            [rate] => 1
            [amount] => 2.0
            [currency] => BTC
        )
    [destination:protected] =>
    [message:protected] =>
    [origin:protected] =>
    [params:protected] =>
    [refundedById:protected] =>
    [status:protected] => completed
    [type] => transfer
)
```

### Get all public transactions

[](#get-all-public-transactions)

```
require_once 'vendor/autoload.php';

use \Uphold\UpholdClient as Client;

// Initialize the client.
$client = new Client();

// Get all public transactions (public endpoint).
$pager = $client->getReserve()->getTransactions();

// Get next page of transactions.
$transactions = $pager->getNext();
```

Or you could get a specific public transaction:

```
// Get one public transaction.
$transaction = $client->getReserve()->getTransactionById('a97bb994-6e24-4a89-b653-e0a6d0bcf634');
```

### Get reserve status

[](#get-reserve-status)

```
require_once 'vendor/autoload.php';

use \Uphold\UpholdClient as Client;

// Initialize the client.
$client = new Client();

// Get the reserve summary of all the obligations and assets within it (public endpoint).
$statistics = $client->getReserve()->getStatistics();
```

### Pagination

[](#pagination)

Some endpoints will return a paginator. Here is some examples on how you can handle it.

```
// Get public transactions.
$pager = $client->getReserve()->getTransactions();

// Check whether the paginator has a valid next page.
while($pager->hasNext()) {
    // Get next page with results.
    $transactions = $pager->getNext();

    // Do something...
}
```

Tests
-----

[](#tests)

Run the tests from the root directory:

```
$ ./vendor/bin/phpunit

```

You can find PHPUnit documentation [here](https://phpunit.de/documentation.html).

Contributing &amp; Development
------------------------------

[](#contributing--development)

#### Contributing

[](#contributing)

Found a bug or want to suggest something? Take a look first on the current and closed [issues](https://github.com/seegno/uphold-sdk-php/issues). If it is something new, please [submit an issue](https://github.com/seegno/uphold-sdk-php/issues/new).

#### Develop

[](#develop)

It will be awesome if you can help us evolve `uphold-sdk-php`. Want to help?

1. [Fork it](https://github.com/seegno/uphold-sdk-php).
2. `php composer.phar install`.
3. Hack away.
4. Run the tests: `phpunit`.
5. Create a [Pull Request](https://github.com/seegno/uphold-sdk-php/compare).

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community25

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~46 days

Recently: every ~61 days

Total

17

Last Release

3384d ago

Major Versions

1.1.0 → 2.0.02015-02-21

2.0.2 → 3.0.02015-08-14

3.0.0 → 4.0.02015-10-20

4.3.1 → 5.0.02016-12-22

PHP version history (2 changes)1.0.0PHP &gt;=5.4.4

3.0.0PHP &gt;=5.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/3f3a4904f6390715d09f4061fe60eec4ac8dac44856adbc50a6ea035a9988ca1?d=identicon)[nunorafaelrocha](/maintainers/nunorafaelrocha)

![](https://www.gravatar.com/avatar/9487154d134c4ac228e121b4ed66a1f2cbd97f7d96b52b065dd0ae3efec35e32?d=identicon)[fixe](/maintainers/fixe)

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

---

Top Contributors

[![nunorafaelrocha](https://avatars.githubusercontent.com/u/1175149?v=4)](https://github.com/nunorafaelrocha "nunorafaelrocha (57 commits)")[![fixe](https://avatars.githubusercontent.com/u/484559?v=4)](https://github.com/fixe "fixe (53 commits)")[![joaonice](https://avatars.githubusercontent.com/u/1272480?v=4)](https://github.com/joaonice "joaonice (35 commits)")[![nunofgs](https://avatars.githubusercontent.com/u/92085?v=4)](https://github.com/nunofgs "nunofgs (13 commits)")[![ruimarinho](https://avatars.githubusercontent.com/u/288709?v=4)](https://github.com/ruimarinho "ruimarinho (6 commits)")[![arevalomalina](https://avatars.githubusercontent.com/u/7799024?v=4)](https://github.com/arevalomalina "arevalomalina (2 commits)")[![byrnereese](https://avatars.githubusercontent.com/u/28429?v=4)](https://github.com/byrnereese "byrnereese (2 commits)")[![kratos-42](https://avatars.githubusercontent.com/u/12373116?v=4)](https://github.com/kratos-42 "kratos-42 (1 commits)")

---

Tags

phpsdkupholdphpsdkuphold

### Embed Badge

![Health badge](/badges/seegno-bitreserve-sdk-php/health.svg)

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

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[hubspot/api-client

Hubspot API client

23414.2M16](/packages/hubspot-api-client)[php-opencloud/openstack

PHP SDK for OpenStack APIs. Supports BlockStorage, Compute, Identity, Images, Networking and Metric Gnocchi

2292.2M23](/packages/php-opencloud-openstack)[mailchimp/transactional

458.9M16](/packages/mailchimp-transactional)[resend/resend-php

Resend PHP library.

564.7M21](/packages/resend-resend-php)[checkout/checkout-sdk-php

Checkout.com SDK for PHP

553.3M7](/packages/checkout-checkout-sdk-php)

PHPackages © 2026

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