PHPackages                             basiqio/basiq-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. basiqio/basiq-sdk-php

AbandonedArchivedLibrary[API Development](/categories/api)

basiqio/basiq-sdk-php
=====================

PHP SDK for Basiq.io API

1.1.0(6y ago)07.2k↓33.3%2[1 issues](https://github.com/basiqio/basiq-sdk-php/issues)[2 PRs](https://github.com/basiqio/basiq-sdk-php/pulls)MITPHP

Since Jul 2Pushed 3y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (1)Versions (6)Used By (0)

Basiq.io PHP SDK
================

[](#basiqio-php-sdk)

PLEASE NOTE THIS SDK IS DEPRECATED.
===================================

[](#please-note-this-sdk-is-deprecated)

We are working hard behind the scenes to produce reliable and up to date SDK's for our customers.
-------------------------------------------------------------------------------------------------

[](#we-are-working-hard-behind-the-scenes-to-produce-reliable-and-up-to-date-sdks-for-our-customers)

In the meantime, if you are interested in generating your own, you can access our full Open API/Swagger spec [here](https://github.com/basiqio/basiq-open-api-spec).

This is the documentation for the PHP SDK for Basiq.io API

Introduction
------------

[](#introduction)

Basiq.io PHP SDK is a set of tools you can use to easily communicate with Basiq API. If you want to get familiar with the API docs, [click here](https://basiq.io/api/).

The SDK is organized to mirror the HTTP API's functionality and hierarchy. The top level object needed for SDKs functionality is the Session object which requires your API key to be instantiated. You can grab your API key on the [dashboard](http://dashboard.basiq.io).

Changelog
---------

[](#changelog)

1.1.0 Added support for secondaryLoginId

0.9.1beta - getTransactions now receives limit parameter. Fixed bug on refresh all connections

0.9.0beta - Initial release

Getting started
---------------

[](#getting-started)

Now that you have your API key, you can use the following command to install the SDK:

```
composer require basiqio/basiq-sdk-php
```

Next step is to import the used classes into your namespace. A list of classes you will probably use the most:

```
// Used to handle the token session
use Basiq\Session;

// Used to manipulate jobs and connections
use Basiq\Services\ConnectionService;

// Used to manipulate users
use Basiq\Services\UserService;
```

Common usage examples
---------------------

[](#common-usage-examples)

### Fetching a list of institutions

[](#fetching-a-list-of-institutions)

You can fetch a list of supported financial institutions. The function returns a list of Institution structs.

```
use Basiq\Session;

$session = new Session("YOUR_API_KEY");

$institutions = $session->getInstitutions();
```

You can specify the version of API when instantiating Session object. When the version is not specified, default version is 1.0.

```
use Basiq\Session;

$session = new Session("YOUR_API_KEY", "2.0");

$institutions = $session->getInstitutions();
```

### Creating a new connection

[](#creating-a-new-connection)

When a new connection request is made, the server will create a job that will link user's financial institution with your app.

```
use Basiq\Session;

$session = new Session("YOUR_API_KEY");

$user = $session->forUser($userId);

$job = $user->createConnection($institutionId, $userId, $password[, $securityCode, $secondaryLoginId]);

// Poll our server to wait for the credentials step to be evaluated
$connection = job->waitForCredentials(1000, 60);
```

### Fetching and iterating through transactions

[](#fetching-and-iterating-through-transactions)

In this example, the function returns a transactions list struct which is filtered by the connection-&gt;id property. You can iterate through transactions list by calling Next().

```
use Basiq\Session;
use Basiq\Utilities\FilterBuilder;

$session = new Session("YOUR_API_KEY");

$user = $session->forUser($userId);

$fb = new FilterBuilder();
$fb->eq("connection->id", "conn-id-213-id");
$transactions = $user->getTransactions($fb);

while ($transactions->next()) {
        var_dump("Next transactions len:", len(transactions.Data))
}
```

API
---

[](#api)

The API of the SDK is manipulated using Services and Entities. Different services return different entities, but the mapping is not one to one.

### Errors

[](#errors)

If an action encounters an error, you will receive an HTTPResponseException instance. The class contains all available data which you can use to act accordingly.

##### HTTPResponseException class fields

[](#httpresponseexception-class-fields)

```
public $response;
public $statusCode;
public $message;
```

Check the [docs](https://basiq.io/api/) for more information about relevant fields in the error object.

### Filtering

[](#filtering)

Some of the methods support adding filters to them. The filters are created using the FilterBuilder class. After instantiating the class, you can invoke methods in the form of comparison(field, value).

Example:

```
use Basiq\Utilities\FilterBuilder;

$fb = new FilterBuilder();
$fb->eq("connection->id", "conn-id-213-id")->gt("transaction.postDate", "2018-01-01")
$transactions = $user->getTransactions(fb);
```

This example filter for transactions will match all transactions for the connection with the id of "conn-id-213-id" and that are newer than "2018-01-01". All you have to do is pass the filter instance when you want to use it.

### SDK API List

[](#sdk-api-list)

Services #### Session

[](#session)

##### Creating a new Session object

[](#creating-a-new-session-object)

```
$session = new Session("YOUR_API_KEY");
```

#### UserService

[](#userservice)

The following are APIs available for the User service

##### Creating a new UserService

[](#creating-a-new-userservice)

```
$userService = new UserService($session);
```

##### Referencing a user

[](#referencing-a-user)

*Note: The following action will not send an HTTP request, and can be used to perform additional actions for the instantiated user.*

```
$user = $userService->forUser($userId);
```

##### Creating a new User

[](#creating-a-new-user)

```
$user = $userService->create(["email" => "", "mobile" => ""]);
```

##### Getting a User

[](#getting-a-user)

```
$user = $userService->get($userId);
```

##### Update a User

[](#update-a-user)

```
$user = $userService->update($userId, ["email" => "", "mobile" => ""]);
```

##### Delete a User

[](#delete-a-user)

```
null = $userService->delete($userId);
```

##### Refresh connections

[](#refresh-connections)

```
$jobs = $userService->refreshAllConnections($userId);
```

##### List all connections

[](#list-all-connections)

```
$conns = $userService->getAllConnections($userId[, $filter]);
```

##### Get account

[](#get-account)

```
$acc = $userService->getAccount($userId, $accountId);
```

##### Get accounts

[](#get-accounts)

```
$accs = $userService->getAccounts($userId[, $filter]);
```

##### Get transaction

[](#get-transaction)

```
$transaction = $userService->getTransaction($userId, $transactionId);
```

##### Get transactions

[](#get-transactions)

```
$transactions = $userService->getTransactions($userId[, $filter]);
```

#### ConnectionService

[](#connectionservice)

The following are APIs available for the Connection service

##### Creating a new ConnectionService

[](#creating-a-new-connectionservice)

```
$connService = new ConnectionService($session, $user);
```

##### Get connection

[](#get-connection)

```
$connection = $connService->get($connectionId);
```

##### Get connection entity with ID without performing an http request

[](#get-connection-entity-with-id-without-performing-an-http-request)

```
$connection = $connService->for($connectionId);
```

##### Create a new connection

[](#create-a-new-connection)

```
$job = $connService->create(["institutionId" => "", "loginId" => "", "password" => "", "securityCode" => "", "secondaryLoginId" => ""]);
```

##### Update connection

[](#update-connection)

```
$job = $connService->update($connectionId, $password);
```

##### Delete connection

[](#delete-connection)

```
null = $connService->delete($connectionId);
```

##### Get a job

[](#get-a-job)

```
$job = $connService->getJob($jobId);
```

Entities ##### Updating a user instance

[](#updating-a-user-instance)

```
$user = $user->update(["email" => "", "mobile" => ""]);
```

##### Deleting a user

[](#deleting-a-user)

```
null = $user->delete();
```

##### Get all of the user's accounts

[](#get-all-of-the-users-accounts)

```
$accounts = $user->getAccounts();
```

##### Get a user's single account

[](#get-a-users-single-account)

```
$account = $user->getAccount($accountId);
```

##### Get all of the user's transactions

[](#get-all-of-the-users-transactions)

```
$transactions = $user->getTransactions($filterBuilder = null, $limit = null < 500);
```

##### Get a user's single transaction

[](#get-a-users-single-transaction)

```
$transaction = $user->getTransaction($transactionId);
```

##### Create a new connection

[](#create-a-new-connection-1)

```
$job = $user->createConnection(["institutionId" => "", "loginId" => "", "password" => "", "securityCode" => "", "secondaryLoginId" => ""]);
```

##### Refresh all connections

[](#refresh-all-connections)

```
$jobs = $user->refreshAllConnections();
```

#### Connection

[](#connection)

##### Refresh a connection

[](#refresh-a-connection)

```
$job = $connection->refresh();
```

##### Update a connection

[](#update-a-connection)

```
$job = $connection->update($password);
```

##### Delete a connection

[](#delete-a-connection)

```
null = $connection->delete();
```

#### Job

[](#job)

##### Get the connection id (if available)

[](#get-the-connection-id-if-available)

```
$connectionId = $job->getConnectionId();
```

##### Get the connection

[](#get-the-connection)

```
$connection = $job->getConnection();
```

##### Get the connection after waiting for credentials step resolution

[](#get-the-connection-after-waiting-for-credentials-step-resolution)

(interval is in milliseconds, timeout is in seconds; in case of timeout an exception will be thrown)

```
$connection = $job->waitForCredentials($interval, $timeout);
```

##### Get the connection after waiting for transactions step resolution

[](#get-the-connection-after-waiting-for-transactions-step-resolution)

(interval is in milliseconds, timeout is in seconds; in case of timeout an exception will be thrown)

```
$connection = $job->waitForTransactions($interval, $timeout);
```

#### Transaction list

[](#transaction-list)

##### Getting the next set of transactions \[mut\]

[](#getting-the-next-set-of-transactions-mut)

```
$next = $transactions->next();
```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity66

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

Total

3

Last Release

2299d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/24b9d7111e3caa43f406c0cf6cbaa164dedfad9fde577db8d49e1ddf2d100c92?d=identicon)[basiq](/maintainers/basiq)

---

Top Contributors

[![aterentic-basiq](https://avatars.githubusercontent.com/u/19322910?v=4)](https://github.com/aterentic-basiq "aterentic-basiq (3 commits)")[![serafimneb](https://avatars.githubusercontent.com/u/22741377?v=4)](https://github.com/serafimneb "serafimneb (2 commits)")[![ckailash](https://avatars.githubusercontent.com/u/408917?v=4)](https://github.com/ckailash "ckailash (1 commits)")[![saundersdigital](https://avatars.githubusercontent.com/u/47044474?v=4)](https://github.com/saundersdigital "saundersdigital (1 commits)")[![slapcevic](https://avatars.githubusercontent.com/u/29034814?v=4)](https://github.com/slapcevic "slapcevic (1 commits)")[![dalehurley](https://avatars.githubusercontent.com/u/286185?v=4)](https://github.com/dalehurley "dalehurley (1 commits)")[![bridget-basiq](https://avatars.githubusercontent.com/u/86027648?v=4)](https://github.com/bridget-basiq "bridget-basiq (1 commits)")

---

Tags

apisdkfinancebasiq

### Embed Badge

![Health badge](/badges/basiqio-basiq-sdk-php/health.svg)

```
[![Health](https://phpackages.com/badges/basiqio-basiq-sdk-php/health.svg)](https://phpackages.com/packages/basiqio-basiq-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

23914.2M16](/packages/hubspot-api-client)[mailchimp/transactional

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

Resend PHP library.

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

Checkout.com SDK for PHP

553.3M7](/packages/checkout-checkout-sdk-php)[crowdin/crowdin-api-client

PHP client library for Crowdin API v2

611.5M5](/packages/crowdin-crowdin-api-client)

PHPackages © 2026

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