PHPackages                             coingate/coingate-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. coingate/coingate-php

ActiveLibrary[Payment Processing](/categories/payments)

coingate/coingate-php
=====================

CoinGate library for PHP

v4.1.0(3y ago)56459.2k—9.6%37[4 issues](https://github.com/coingate/coingate-php/issues)[2 PRs](https://github.com/coingate/coingate-php/pulls)1MITPHPPHP &gt;=7.3.0CI passing

Since Mar 24Pushed 3mo ago10 watchersCompare

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

READMEChangelog (10)Dependencies (3)Versions (18)Used By (1)

CoinGate PHP library for API v2
===============================

[](#coingate-php-library-for-api-v2)

The CoinGate PHP library provides convenient access to the CoinGate API from applications written in the PHP language.

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

[](#requirements)

PHP 7.3.0 and later.

Composer
--------

[](#composer)

You can install library via [Composer](http://getcomposer.org/). Run the following command:

```
composer require coingate/coingate-php
```

Manual Installation
-------------------

[](#manual-installation)

If you do not wish to use Composer, you can download the [latest release](https://github.com/coingate/coingate-php/releases). Then, to use the library, include the `init.php` file.

```
require_once('/path/to/coingate-php/init.php');
```

Dependencies
------------

[](#dependencies)

The library require the following extensions in order to work properly:

- [`curl`](https://secure.php.net/manual/en/book.curl.php), although you can use your own non-cURL client if you prefer
- [`json`](https://secure.php.net/manual/en/book.json.php)

If you use Composer, these dependencies should be handled automatically. If you install manually, you'll want to make sure that these extensions are available.

Getting Started
---------------

[](#getting-started)

You can sign up for a CoinGate account at  for production and  for testing (sandbox).

Please note, that for Sandbox you must generate separate API credentials on . API credentials generated on  will not work for Sandbox mode.

Usage of CoinGate PHP library looks like:

```
$client = new \CoinGate\Client('YOUR_API_TOKEN');
```

In order, to use sandbox mode, you need to set second parameter to `true`.

```
$client = new \CoinGate\Client('YOUR_API_TOKEN', true);
```

If you plan to use Public API endpoints only, authentication is not required.

```
$client = new CoinGate\Client();

// if needed you can set configuration parameters later
$client->setApiKey('YOUR_API_TOKEN');
$client->setEnvironment('sandbox');
```

Full documentation of the CoinGate API can be found [here](https://developer.coingate.com/reference/api-overview)

### Example

[](#example)

An example of an app using this library can be found [here](https://github.com/coingate/laravel-demo)

Payment Gateway API
-------------------

[](#payment-gateway-api)

### Create Order

[](#create-order)

Create order at CoinGate and redirect shopper to invoice (payment\_url).

```
$params = [
    'order_id'          => 'YOUR-CUSTOM-ORDER-ID-115',
    'price_amount'      => 1050.99,
    'price_currency'    => 'USD',
    'receive_currency'  => 'EUR',
    'callback_url'      => 'https://example.com/payments?token=6tCENGUYI62ojkuzDPX7Jg',
    'cancel_url'        => 'https://example.com/cart',
    'success_url'       => 'https://example.com/account/orders',
    'title'             => 'Order #112',
    'description'       => 'Apple Iphone 13'
];

try {
    $order = $client->order->create($params);
} catch (\CoinGate\Exception\ApiErrorException $e) {
    // something went wrong...
    // var_dump($e->getErrorDetails());
}

echo $order->id;
```

### Checkout

[](#checkout)

Placing created order with pre-selected payment currency (BTC, LTC, ETH, etc). Display payment\_address and pay\_amount for shopper or redirect to payment\_url. Can be used to white-label invoices.

```
$checkout = $client->order->checkout(7294, [
    'pay_currency' => 'BTC'
]);
```

### Get Order

[](#get-order)

After creating an order, you will get an ORDER ID. This ID will be used for GET ORDER requests.

```
$order = $client->order->get(7294);
```

### List Orders

[](#list-orders)

Retrieving information of all placed orders.

```
$orders = $client->order->list([
    'created_at' => [
        'from' => '2022-01-25'
    ]
]);
```

Public API
----------

[](#public-api)

### Get Exchange Rate

[](#get-exchange-rate)

Current exchange rate for any two currencies, fiat or crypto. This endpoint is public, authentication is not required.

```
$client->getExchangeRate('BTC', 'EUR');
```

### List Exchange Rates

[](#list-exchange-rates)

Current CoinGate exchange rates for Merchants and Traders. This endpoint is public, authentication is not required.

```
$client->listExchangeRates();
```

### Ping

[](#ping)

A health check endpoint for CoinGate API. This endpoint is public, authentication is not required.

```
$client->ping();
```

### IP Addresses

[](#ip-addresses)

Get IP addresses of CoinGate servers

```
$client->getIPAddresses();
```

### Currencies

[](#currencies)

```
$client->getCurrencies();

// Crypto + Native + Merchant Pay
$client->getCheckoutCurrencies();

// get Merchant Pay currencies only
$client->getMerchantPayCurrencies();

// get Merchant Receive currencies only
$client->getMerchantPayoutCurrencies();
```

### Platforms

[](#platforms)

```
$client->getPlatforms();
```

Custom Request Timeout
----------------------

[](#custom-request-timeout)

To modify request timeouts (connect or total, in seconds) you'll need to tell the API client to use a CurlClient other than its default. You'll set the timeouts in that CurlClient.

```
// set up your tweaked Curl client
$curl = new \CoinGate\HttpClient\CurlClient();
$curl->setTimeout(10);
$curl->setConnectTimeout(5);

// tell CoinGate Library to use the tweaked Curl client
\CoinGate\Client::setHttpClient($curl);

// use the CoinGate API client as you normally would
```

Test API Connection
-------------------

[](#test-api-connection)

```
$result = \CoinGate\Client::testConnection('YOUR_API_TOKEN');
```

In order, to test API connection on sandbox mode, you need to set second parameter to `true`.

```
$result = \CoinGate\Client::testConnection('YOUR_API_TOKEN', true);
```

Attention plugin developers
---------------------------

[](#attention-plugin-developers)

Are you writing a plugin that integrates CoinGate and embeds our library? Then please use the setAppInfo function to identify your plugin. For example:

```
\CoinGate\Client::setAppInfo("MyAwesomePlugin", "1.0.0");
```

The method should be called once, before any request is sent to the API. The second parameter is optional.

###  Health Score

53

—

FairBetter than 97% of packages

Maintenance52

Moderate activity, may be stable

Popularity52

Moderate usage in the ecosystem

Community28

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

Recently: every ~295 days

Total

13

Last Release

1459d ago

Major Versions

v1.0.1 → 2.0.02016-05-23

v2.x-dev → 3.0.02018-04-24

3.0.5 → v4.x-dev2022-03-30

### Community

Maintainers

![](https://www.gravatar.com/avatar/0a856044f80466c2918ae8f2c9fa2c70d42dce5883115bc5829695be68302531?d=identicon)[TomasAchmedovas](/maintainers/TomasAchmedovas)

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

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

---

Top Contributors

[![minvs1](https://avatars.githubusercontent.com/u/2649067?v=4)](https://github.com/minvs1 "minvs1 (29 commits)")[![ibaciulis](https://avatars.githubusercontent.com/u/1185725?v=4)](https://github.com/ibaciulis "ibaciulis (20 commits)")[![vgumonis](https://avatars.githubusercontent.com/u/43743406?v=4)](https://github.com/vgumonis "vgumonis (17 commits)")[![pukys](https://avatars.githubusercontent.com/u/10064051?v=4)](https://github.com/pukys "pukys (5 commits)")[![linaspasv](https://avatars.githubusercontent.com/u/1407067?v=4)](https://github.com/linaspasv "linaspasv (2 commits)")[![FallDi](https://avatars.githubusercontent.com/u/4299295?v=4)](https://github.com/FallDi "FallDi (1 commits)")[![rytisbitcoin](https://avatars.githubusercontent.com/u/18306174?v=4)](https://github.com/rytisbitcoin "rytisbitcoin (1 commits)")[![rytisder](https://avatars.githubusercontent.com/u/17141616?v=4)](https://github.com/rytisder "rytisder (1 commits)")

---

Tags

coingate-librarycoingate-phpcomposerphp-librarypaymentgatewaybitcoinmerchantlitecoinaltcoincoingate

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[coingate/omnipay-coingate

CoinGate driver for the Omnipay payment processing library

1037.0k1](/packages/coingate-omnipay-coingate)[plisio/plisio-api-php

155.8k](/packages/plisio-plisio-api-php)[omnipay/bitpay

BitPay driver for the Omnipay payment processing library

1383.2k1](/packages/omnipay-bitpay)[sudiptpa/omnipay-nabtransact

National Australia Bank (NAB) Transact driver for the Omnipay payment processing library.

1017.2k](/packages/sudiptpa-omnipay-nabtransact)[lucassmacedo/omnipay-mercadopago

MercadoPago gateway for OmniPay

154.6k](/packages/lucassmacedo-omnipay-mercadopago)

PHPackages © 2026

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