PHPackages                             lai3221/aspire-laravel-sdk - 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. lai3221/aspire-laravel-sdk

ActiveLibrary[API Development](/categories/api)

lai3221/aspire-laravel-sdk
==========================

Laravel 11 SDK for the Aspire API, covering sandbox and production environments.

v1.0.0(1mo ago)02↓85.7%MITPHPPHP ^8.2CI failing

Since Jun 5Pushed 1mo agoCompare

[ Source](https://github.com/lai3221/aspire-laravel-sdk)[ Packagist](https://packagist.org/packages/lai3221/aspire-laravel-sdk)[ RSS](/packages/lai3221-aspire-laravel-sdk/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (7)Versions (2)Used By (0)

Aspire Laravel SDK
==================

[](#aspire-laravel-sdk)

A Laravel 11 friendly SDK for Aspire's REST APIs. It supports sandbox and production environments, API-key and bearer-token authentication, typed resources, webhook verification, and an editable endpoint map for partner-specific Swagger/OpenAPI paths.

> Important: Aspire may provide partner-specific API routes in Swagger during onboarding. This package keeps all endpoint paths in `config/aspire.php`, so you can adjust paths without changing application code.

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

[](#installation)

```
composer require aspireapp/aspire-laravel-sdk
php artisan vendor:publish --tag=aspire-config
```

Environment
-----------

[](#environment)

```
ASPIRE_ENVIRONMENT=sandbox
ASPIRE_SANDBOX_BASE_URL=https://sandbox-api.aspireapp.com
ASPIRE_PRODUCTION_BASE_URL=https://api.aspireapp.com
ASPIRE_API_VERSION=v1
ASPIRE_CLIENT_ID=your-client-id
ASPIRE_CLIENT_SECRET=your-client-secret
ASPIRE_API_KEY=your-api-key
ASPIRE_ACCESS_TOKEN=your-oauth-access-token
ASPIRE_PROXY_URL=socks5h://username:password@127.0.0.1:1080
ASPIRE_WEBHOOK_SECRET=your-webhook-secret
```

Switch to production by setting:

```
ASPIRE_ENVIRONMENT=production
```

If Aspire gives you a region-specific or account-specific host, set:

```
ASPIRE_BASE_URL=https://your-onboarded-host.example
```

Quick start
-----------

[](#quick-start)

```
use Aspire\Sdk\Facades\Aspire;

$accounts = Aspire::accounts()->list();
$balances = Aspire::accounts()->balances('account_id');

$payout = Aspire::payouts()->create([
    'source_account_id' => 'account_id',
    'recipient_id' => 'recipient_id',
    'amount' => 10000,
    'currency' => 'SGD',
    'reference' => 'INV-1001',
]);
```

OAuth
-----

[](#oauth)

```
$url = Aspire::oauth()->authorizationUrl(
    redirectUri: route('aspire.callback'),
    scopes: ['accounts.read', 'transactions.read', 'payouts.write']
);

$token = Aspire::oauth()->token($request->get('code'), route('aspire.callback'));
$refreshed = Aspire::oauth()->refresh($token['refresh_token']);
```

Resources
---------

[](#resources)

### Accounts

[](#accounts)

```
Aspire::accounts()->list(['currency' => 'SGD']);
Aspire::accounts()->retrieve('account_id');
Aspire::accounts()->balances('account_id');
Aspire::accounts()->details('account_id');
```

### Transactions and bank feeds

[](#transactions-and-bank-feeds)

```
Aspire::transactions()->list(['from' => '2026-01-01', 'to' => '2026-01-31']);
Aspire::transactions()->retrieve('transaction_id');
Aspire::bankFeeds()->accounts();
Aspire::bankFeeds()->transactions(['account_id' => 'account_id']);
Aspire::bankFeeds()->sync(['account_id' => 'account_id']);
```

### Recipients and payouts

[](#recipients-and-payouts)

```
Aspire::recipients()->create([...]);
Aspire::recipients()->validate([...]);
Aspire::payouts()->quote([...]);
Aspire::payouts()->create([...]);
Aspire::payouts()->bulkCreate(['items' => [[...], [...]]]);
Aspire::payouts()->cancel('payout_id');
Aspire::payouts()->paymentLink([...]);
```

### FX

[](#fx)

```
Aspire::fx()->quote([
    'source_currency' => 'SGD',
    'target_currency' => 'USD',
    'source_amount' => 10000,
]);

Aspire::fx()->convert(['quote_id' => 'quote_id']);
```

### Cards and users

[](#cards-and-users)

```
Aspire::users()->create([...]);
Aspire::cards()->create([...]);
Aspire::cards()->freeze('card_id');
Aspire::cards()->unfreeze('card_id');
Aspire::cards()->updateLimits('card_id', [...]);
Aspire::cards()->transactions('card_id');
```

### Account opening

[](#account-opening)

```
Aspire::accountOpening()->createApplication([...]);
Aspire::accountOpening()->updateApplication('application_id', [...]);
Aspire::accountOpening()->uploadDocument('application_id', [...]);
Aspire::accountOpening()->submitApplication('application_id');
```

### Webhooks

[](#webhooks)

```
$payload = $request->getContent();
$signature = $request->header(config('aspire.webhook.signature_header'));
$timestamp = $request->header(config('aspire.webhook.timestamp_header'));

abort_unless(Aspire::webhooks()->verify($payload, $signature, $timestamp), 403);

$event = json_decode($payload, true);
```

Generic requests
----------------

[](#generic-requests)

Use this when Aspire adds an endpoint before this SDK adds a typed method:

```
$response = Aspire::request('POST', '/custom/path', payload: ['key' => 'value']);
```

Endpoint coverage
-----------------

[](#endpoint-coverage)

The endpoint map in `config/aspire.php` covers:

- OAuth authorization, token refresh, token revocation
- Accounts, balances, account details
- Transactions and transaction attachments
- Bank Feed accounts, transactions, sync
- Recipients creation, validation, CRUD
- Payouts, bulk payouts, payout quote, cancellation, payment links
- FX quotes and conversions
- Card issuance, card update, freeze, unfreeze, cancellation, limits, card transactions
- Users/employees access lifecycle
- Account-opening applications and document uploads
- Webhook endpoint management and local signature verification

Publishing to GitHub and Packagist
----------------------------------

[](#publishing-to-github-and-packagist)

1. Create a public GitHub repository, for example `aspire-laravel-sdk`.
2. Commit this package.
3. Add a semantic version tag:

```
git tag v0.1.0
git push origin main --tags
```

4. Submit the repository URL on Packagist.
5. Enable Packagist GitHub hook or GitHub Actions auto-update.

Suggested first release: `v0.1.0`, then promote to `v1.0.0` after confirming Aspire's partner Swagger paths and response schemas in sandbox.

Testing
-------

[](#testing)

```
composer install
composer test
```

Code style
----------

[](#code-style)

```
composer format
```

License
-------

[](#license)

MIT

Multi-account runtime credentials and per-account proxy
-------------------------------------------------------

[](#multi-account-runtime-credentials-and-per-account-proxy)

API reference:

For applications that manage several Aspire registered accounts in one Laravel project, do not rely on a single `.env` credential set. Store each account's `client_id`, `client_secret`, token and proxy settings in your database, then build a runtime client from the account selected by the frontend.

```
use App\Models\AspireAccount;
use Aspire\Sdk\Facades\Aspire;

$account = AspireAccount::query()
    ->whereKey($request->integer('aspire_account_id'))
    ->where('company_id', $request->user()->company_id)
    ->where('is_active', true)
    ->firstOrFail();

$balance = Aspire::forAccount($account)
    ->accounts()
    ->balances($request->string('account_id')->toString());
```

The SDK reads these model or array attributes when using `Aspire::forAccount()` or `Aspire::forCredentials()`:

- `environment`: `sandbox` or `production`
- `base_url`: optional Aspire account-specific or region-specific base URL
- `client_id`: Aspire Client ID for the selected registered account
- `client_secret`: Aspire Client Secret for the selected registered account
- `api_key`: optional API key, when your Aspire integration uses API-key authentication
- `access_token`: optional OAuth access token
- `proxy_url` or `proxy`: preferred per-account full proxy URL, for example `socks5h://username:password@127.0.0.1:1080`
- `proxy_scheme`, `proxy_host`, `proxy_port`, `proxy_username`, `proxy_password`: backward-compatible split proxy settings

```
$client = Aspire::forCredentials([
    'environment' => 'production',
    'client_id' => $account->client_id,
    'client_secret' => $account->client_secret,
    'access_token' => $account->access_token,
    'proxy_url' => 'socks5h://proxy-user:proxy-pass@127.0.0.1:1080',
]);

$payout = $client->payouts()->create($payload);
```

See `MULTI_ACCOUNT_USAGE.md` for migration, Eloquent model, SOCKS5 proxy string support, token refresh and controller examples.

Transfer helper example:

```
$transfer = Aspire::forAccount($account)->transfers()->create($payload);
```

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance90

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

49d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/25782046?v=4)[lai3221](/maintainers/lai3221)[@lai3221](https://github.com/lai3221)

---

Top Contributors

[![lai3221](https://avatars.githubusercontent.com/u/25782046?v=4)](https://github.com/lai3221 "lai3221 (1 commits)")

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/lai3221-aspire-laravel-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/lai3221-aspire-laravel-sdk/health.svg)](https://phpackages.com/packages/lai3221-aspire-laravel-sdk)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.3M347](/packages/psalm-plugin-laravel)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

813336.8k3](/packages/defstudio-telegraph)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

77922.3M186](/packages/laravel-mcp)[illuminate/auth

The Illuminate Auth package.

10528.2M1.3k](/packages/illuminate-auth)[api-platform/laravel

API Platform support for Laravel

58174.6k17](/packages/api-platform-laravel)[illuminate/routing

The Illuminate Routing package.

1419.2M3.2k](/packages/illuminate-routing)

PHPackages © 2026

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