PHPackages                             plisio/plisio-api-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. [Payment Processing](/categories/payments)
4. /
5. plisio/plisio-api-php

ActiveLibrary[Payment Processing](/categories/payments)

plisio/plisio-api-php
=====================

1.0.2(5y ago)156.8k↑113.3%5[2 issues](https://github.com/Plisio/plisio-api-php/issues)MITPHP

Since Jan 8Pushed 4y ago2 watchersCompare

[ Source](https://github.com/Plisio/plisio-api-php)[ Packagist](https://packagist.org/packages/plisio/plisio-api-php)[ Docs](https://plisio.net)[ RSS](/packages/plisio-plisio-api-php/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)DependenciesVersions (4)Used By (0)

\#This PHP SDK project for Plisio Api Support

This is fully object-oriented php's composer package, developed to work with Plisio's cryptocurrency payment-gateway.

```
interface InteractionInterface
{
    /**
     * @throws Throwable on errors (If silent mode turn off)
     * @return null on errors (If silent mode turn on)
     * @return BalanceApiResponse on success
     */
    public function getBalance(string $currency): ?BalanceApiResponse;

    /**
     * @throws Throwable on errors (If silent mode turn off)
     * @return null on errors (If silent mode turn on)
     * @return OperationApiResponse on success
     */
    public function getOperationById(string $id): ?OperationApiResponse;

    /**
     * @throws Throwable on errors (If silent mode turn off)
     * @return null on errors (If silent mode turn on)
     * @return CommissionApiResponse on success
     */
    public function getCommission(CommissionQuery $query): ?CommissionApiResponse;

    /**
     * @throws Throwable on errors (If silent mode turn off)
     * @return null on errors (If silent mode turn on)
     * @return CryptocurrencyApiResponse on success
     */
    public function getCurrencyInfoByFiat(string $fiat): ?CryptocurrencyApiResponse;

    /**
     * @throws Throwable on errors (If silent mode turn off)
     * @return null on errors (If silent mode turn on)
     * @return FeePlanApiResponse on success
     */
    public function getFeePlanByPsyscid(string $psyscid): ?FeePlanApiResponse;

    /**
     * @throws Throwable on errors (If silent mode turn off)
     * @return null on errors (If silent mode turn on)
     * @return WithdrawApiResponse on success
     */
    public function withdraw(WithdrawQuery $withdrawQuery): ?WithdrawApiResponse;

    /**
     * @throws Throwable on errors (If silent mode turn off)
     * @return null on errors (If silent mode turn on)
     * @return InvoiceWhiteLabelResponse on success
     */
    public function createInvoice(InvoiceQuery $invoiceQuery): ?InvoiceWhiteLabelResponse;

    /**
     * @throws Throwable on errors (If silent mode turn off)
     * @return FeeApiResponse on success
     * @return null on errors (If silent mode turn on)
     */
    public function getFee(FeeQuery $feeQuery): ?FeeApiResponse;
}
```

***InteractionInterface*** methods description:

1. ***getBalance(string $currency)***

    Let's see yourself cryptocurrency **balance** in *Bitcoin (BTC)*, for example. Also supports 9 [cryptocurrencies](https://plisio.net/documentation/appendices/supported-cryptocurrencies).

    `$balance = $this->interaction->getBalance(Currencies::BTC);`
2. ***getOperationById(string $id)***

    Returns information about concrete transaction by transaction identifier, example:

    `$operation = $this->interaction->getOperationById('61e9384388ecfd3ea775dfb2');`
3. ***getCommission(CommissionQuery $query)***

    Estimates cryptocurrency fee and Plisio commission, accepts CommissionQuery class, example:

    `$commission = $this->interaction->getCommission(new CommissionQuery(Currencies::BTC));`

    Also commission query class has nullable parameters:

    ```
     private ?string $addresses = null;
     private ?string $amounts = null;
     private ?string $type = null;
     private ?string $feePlan = null;
    ```

    - `$addresses` - Wallet address or comma separated addresses when estimating fee for mass withdrawal
    - `$amounts` - Amount or comma separated amount that will be sent in case of mass withdraw
    - `$type` - Operation type, such as: 'cash\_out' or 'mass\_cash\_out'
    - `$feePlan` - The name of [fee plan](https://plisio.net/documentation/endpoints/fee-plans)
4. ***getCurrencyInfoByFiat(string $fiat)***

    Provides current rate of exchange supported cryptocurrencies to [the definite fiat currency](https://plisio.net/documentation/appendices/supported-fiat-currencies), needs to send the request to API by the method with selected fiat currency.

    Let's get the rate of *Australian Dollar (AUD)*, for instance. By the way, if there is not selected any of fiat currency, is rate of *United States Dollar (USD)*, by default. **The response** is a list of models that consist rates of exchanges:

    `$info = $this->interaction->getCurrencyInfoByFiat(FiatCurrencies::AUD);`
5. ***getFeePlanByPsyscid(string $psyscid)***

    Returns the model with [fee plans](https://plisio.net/documentation/endpoints/fee-plans)by selected `cryptocurrency`. Also, this model has additional fields pointed what your fee plan is.

    Example:

    `$feePlan = $this->interaction->getFeePlanByPsyscid(Currencies::BTC);`
6. ***withdraw(WithdrawQuery $withdrawQuery)***If you want to withdraw, you should call `withdraw` method that accepts WithdrawQueryClass:

    ```
     private string $psyscid;
     private string $to;
     private string $amount;
     private int $feeRate;
     private string $feePlan;

     private ?string $type = null;
    ```

    - `$psyscid` — a name of cryptocurrency;
    - `$to` — hash or multiple comma separated hashes pooled for the *mass\_cash\_out*;
    - `$amount` — any comma separated float values for the *mass\_cash\_out*in the order that hashes are in `to` parameter;
    - `$feePlan` — a name of the one of [fee plans](https://plisio.net/documentation/endpoints/fee-plans);
    - `$feeRate` — custom feeRate. conf\_target (blocks) for BTC like cryptocurrencies or gasPrice in GWAI for ETH based cryptocurrencies;
    - `$type` — operation type (it's an optional parameter).

    Example:

    ```
    $withdraw = $this->interaction->withdraw(
            new WithdrawQuery(
                Currencies::BTC,
                '2N3cD7vQxBqmHFVFrgK2o7HonHnVoFxxDVB',
                '0.00031',
                FeePlans::NORMAL,
                1
            )
        );
    ```
7. ***createInvoice(InvoiceQuery $invoiceQuery)***

    Let us coming go to the creation of invoices, first you need to build InvoiceQuery class:

    ```
    private string $currency;
    private string $orderName;
    private string $orderNumber;

    private ?string $amount = null;
    private ?string $sourceCurrency = null;
    private ?string $sourceAmount = null;
    private ?string $allowedPsyscids = null;
    private ?string $description = null;
    private ?string $callBackUrl = null;
    private ?string $email = null;
    private ?string $language = null;
    private ?string $plugin = null;
    private ?string $version = null;
    private ?bool $redirectToInvoice = null;
    private ?string $expireMin = null;
    ```

    The query needs to receive the next **required** parameters:

    - `$currency` — the name of cryptocurrency;
    - `$orderName` — merchant internal order name;
    - `$orderNumber` — merchant internal order number.

    Beside these params, there are **additional** such as:

    - `$amount` — any cryptocurrency float value. If you want to convert a fiat currency, you should skip current field and use the next two fields instead it;
    - `$sourceCurrency` — the name of the fiat currency;
    - `$sourceAmount` — any float value;
    - `$allowedPsyscids` — comma-separated list of cryptocurrencies that allowed for payment. Also, you will be able to select one of them. Example: *'BTC,ETH,TZEC'*;
    - `$description` — merchant invoice description;
    - `$callbackUrl` — merchant full URL to get invoice updates. The *POST* request will be sent to this URL. If this parameter isn’t set, a callback will be sent to URL that can be set under profile in API settings, that has got 'Status URL' field;
    - `$email` — an autofill invoice email. You will be asked to insert their email where a notification will be sent;
    - `$language` — en\_US (now supports English only);
    - `$plugin` — Plisio’s internal field to determine integration plugin;
    - `$version` — Plisio’s internal field to determine integration plugin version.

    Example:

    ```
    $invoice = $this->interaction->createInvoice(
            (new InvoiceQuery(Currencies::BTC, 'some order', '234sdfsd'))
                ->setAmount('0.01')
        );
    ```
8. ***getFee(FeeQuery $feeQuery)***

    To estimate fee you should create FeeQuery class with parameters:

    ```
    private string $psyscid;
    private string $addresses;
    private string $amounts;

    private ?string $feePlan = null;
    ```

    - `$psyscid` — a name of cryptocurrency;
    - `$addresses` — wallet address or comma separated addresses when estimating fee for mass withdrawal;
    - `$amounts` — amount or comma separated amount that will be sent in case of mass withdraw;
    - `$feePlan` — a name of the one of [fee plans](https://plisio.net/documentation/endpoints/fee-plans)(it is not required).

    Example:

    ```
    $fee = $this->interaction->getFee(
            new FeeQuery(
                Currencies::BTC,
                'tb1qfqtvgh97umdum8zwyah4ztzkwz8j7qyyalgwa4',
                '0.0003'
            )
        );
    ```

Entrypoint oh php's sdk is represented with singleton-class ***PlisioPhpSdk***, example:

```
$container = \PlisioPhpSdk\PlisioPhpSdk::get();
/** @var \PlisioPhpSdk\Http\InteractionInterface $interaction */
$interaction = $container->get(\PlisioPhpSdk\Http\InteractionInterface::class);
```

Also, this sdk's provides suitable configuration possibility, you can create ***conf.yaml*** file like below:

```
plisio-php-sdk:
  common:
    dev:
      api-key:
      base-uri:
      user:
      password:
    prod:
      api-key:
      base-uri:
  current-env: dev
  silent: false
```

To configure sdk's you need to create conf.yaml file in your's project-root directory and launch console command from vendor's directory:

***php cli/console.php plisio-php-sdk:load-conf "path to conf.yaml file"***

Sdk's has two working modes from the box (***This functionality only concerns interaction with the api***):

- ***Silent mode*** (Does not throw exception, return null in some cases), all exception writing out in .log file
- ***Non-silent mode*** (Throws exceptions), also all exceptions are logged

The sdk is logged in the plisio-php-sdk.log log file, for convenience, you can create a symbolic link from your root directory to this file. In the quality of the demonstration, all the functionality of the sdk (working with the test resource) is duplicated by console commands:

***plisio-php-sdk:load-conf***

***plisio-php-sdk:test-balance***

***plisio-php-sdk:test-commission***

***plisio-php-sdk:test-create-invoice***

***plisio-php-sdk:test-currency-info***

***plisio-php-sdk:test-fee***

***plisio-php-sdk:test-fee-plan***

***plisio-php-sdk:test-operation***

***plisio-php-sdk:test-withdraw***

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 85.7% of commits — single point of failure

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

Total

3

Last Release

2145d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5dccd72d597c4eff884676f9ad46783809d9354c8c1ddc0b5902320f3a0b2096?d=identicon)[Plisio](/maintainers/Plisio)

---

Top Contributors

[![Plisio](https://avatars.githubusercontent.com/u/49682568?v=4)](https://github.com/Plisio "Plisio (6 commits)")[![davidschrooten](https://avatars.githubusercontent.com/u/44698574?v=4)](https://github.com/davidschrooten "davidschrooten (1 commits)")

---

Tags

paymentgatewaybitcoinmerchantlitecoindogecoinethereumbitcoin-cashzcashplisio

### Embed Badge

![Health badge](/badges/plisio-plisio-api-php/health.svg)

```
[![Health](https://phpackages.com/badges/plisio-plisio-api-php/health.svg)](https://phpackages.com/packages/plisio-plisio-api-php)
```

###  Alternatives

[ccxt/ccxt

A cryptocurrency trading API with more than 100 exchanges in JavaScript / TypeScript / Python / C# / PHP / Go

43.2k341.0k1](/packages/ccxt-ccxt)[coingate/coingate-php

CoinGate library for PHP

58517.9k1](/packages/coingate-coingate-php)[omnipay/bitpay

BitPay driver for the Omnipay payment processing library

1383.5k1](/packages/omnipay-bitpay)[coingate/omnipay-coingate

CoinGate driver for the Omnipay payment processing library

1037.2k1](/packages/coingate-omnipay-coingate)

PHPackages © 2026

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