PHPackages                             cashila/php-api-wrapper - 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. cashila/php-api-wrapper

ActiveLibrary[API Development](/categories/api)

cashila/php-api-wrapper
=======================

PHP API for Cashila.com

2181PHP

Since Aug 7Pushed 10y ago3 watchersCompare

[ Source](https://github.com/cashila/PHP-API-wrapper)[ Packagist](https://packagist.org/packages/cashila/php-api-wrapper)[ RSS](/packages/cashila-php-api-wrapper/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Cashila API client
==================

[](#cashila-api-client)

This package is a wrapper for [Cashila API](https://www.cashila.com/docs/api).

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

[](#installation)

Install the latest version with

```
composer require cashila/php-api-wrapper dev-master
```

Usage
-----

[](#usage)

You will need api key to use this. You can create one on [API page](https://www.cashila.com/api-keys).

```
use Cashila\Api\Client;

$token = '[ api token ]';
$secret = '[ api secret ]';
// use sandbox server instead of production
$useSandbox = false;

$client = new Client($token, $secret, $useSandbox);

// fetches recent billpays
$res = $client->privateGet('billpays');
print_r($res);
```

Examples
--------

[](#examples)

Create billpay:

```
$res = $client->createBillPay([
  'amount' => 12,
  'currency' => 'EUR',
  'name' => 'Bruce Wayne',
  'address' => '1007 Mountain Drive',
  'postal_code' => '123',
  'city' => 'Gotham',
  'country_code' => 'US',
  'iban' => 'SI56020193466787867',
  'bic' => 'LJBASI2X',
]);
print_r($res);
```

Create billpay for saved recipient:

```
$res = $client->createBillPayFor('[ recipient id ]', [
  'amount' => 42,
  'currency' => 'EUR'
]);
print_r($res);
```

Create recipient:

```
$res = $client->createRecipient(array (
  'name' => 'Bruce Wayne',
  'address' => '1007 Mountain Drive',
  'postal_code' => '123',
  'city' => 'Gotham',
  'country_code' => 'US',
  'iban' => 'SI56020193466787867',
  'bic' => 'LJBASI2X',
));
print_r($res);
```

Upload verification

```
$res = $client->updateVerification([
  "first_name" => "Peter",
  "last_name" =>"Griffin",
  "address" =>"Spooner street",
  "postal_code" =>"1234",
  "city" =>"Quahog",
  "country_code" =>"US"
], [
  'gov-id-front' => '[ path to picture of government id, front side ]',
  'residence' => '[ path to picture of proof of residence ]',
]);
print_r($res);
```

BitID pairing
-------------

[](#bitid-pairing)

```
use Cashila\Api\Client as Cashila;

// You will need to sign message with
// your wallet. Here we are using BitCoinRpc
// https://github.com/aceat64/EasyBitcoin-PHP
require 'BitcoinRpc.php';

// configure bitcoin rpc client
$btc_rpc_host = '127.0.0.1';
$btc_rpc_port = 8332;
$btc_rpc_username = '[ your bitcoin rpc username ]';
$btc_rpc_password = '[ your bitcoin rpc password ]';

// address from your wallet you want to pair with Cashila
$btc_address = '[ address you want to pair ]';

/*
 * Pairing wallet with cashila
 *
 * This needs to be done only once per wallet/user.
 * If address is already paired, you can skip to
 * retrieving token
 */
// bitid url to sign
// https://www.cashila.com/bitid-qrcode
$bitid_uri = '[ bitid url ]';

// bitcoin rpc client
$btc_rpc = new BitcoinRpc(
  $btc_rpc_username,
  $btc_rpc_password,
  $btc_rpc_host,
  $btc_rpc_port
);

// do pairing, this needs to be done only once
Cashila::bitIdPair($bitid_uri, function($uri) use($btc_rpc, $btc_address) {
  // sign uri
  $signature = $btc_rpc->signmessage($btc_address, $uri);
  return [
    'address'=>$btc_address,
    'signature'=>$signature
  ];
});

/*
 * Retrieving access token
 */
$client = Cashila::bitIdAuth(function($uri) use($btc_rpc, $btc_address) {
  // sign uri
  $signature = $btc_rpc->signmessage($btc_address, $uri);

  return [
    'address'=>$btc_address,
    'signature'=>$signature
  ];
});

// client has stored token and secret,
// from now on you can make requests
$res = $client->privateGet('recipients');
print_r($res);

// you can (and should) store token and
// secret for later use
$token = $client->getToken();
$secret = $client->getSecret();

// and use it at later time
$newClient = new Cashila($token, $secret);
$res = $newClient->privateGet('recipients');
print_r($res);
```

Configuring defaults
--------------------

[](#configuring-defaults)

You can set default environment (production or sandbox):

```
Cashila\Api\Client::setDefaultSandbox(true);
```

Call API methods directly
-------------------------

[](#call-api-methods-directly)

You can call API methods directly, by calling magic method, which takes name in the following form:

```
(private|public)(get|post|put|delete)

```

I takes 3 arguments:

- resource path (without version), e.g. account/limits
- payload, can be array, string, or SplFileInfo (for file uploads)
- nonce

For example:

```
$client->privateGet('accounts/limits');
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

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

---

Top Contributors

[![alesl](https://avatars.githubusercontent.com/u/955281?v=4)](https://github.com/alesl "alesl (8 commits)")

### Embed Badge

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

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

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