lsparagino / bridgesdk
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/lsparagino/bridgesdk
Requires
- php: >=8.2
- brick/date-time: >=0.7.0
- brick/math: >=0.12.1
- galbar/jsonpath: >=3.0
- guzzlehttp/guzzle: ^7.0
- phpdocumentor/type-resolver: >=1.8
- speakeasy/serializer: ^4.0.3
Requires (Dev)
- laravel/pint: >=1.21.2
- phpstan/phpstan: >=2.1.0
- phpunit/phpunit: >=10
- roave/security-advisories: dev-latest
This package is not auto-updated.
Last update: 2026-01-31 21:21:21 UTC
README
Developer-friendly & type-safe Php SDK specifically catered to leverage Bridge API.
Summary
Bridge API: APIs to move into, out of, and between any form of a dollar
Table of Contents
SDK Installation
Tip
To finish publishing your SDK you must run your first generation action.
The SDK relies on Composer to manage its dependencies.
To install the SDK first add the below to your composer.json file:
{
"repositories": [
{
"type": "github",
"url": "<UNSET>.git"
}
],
"require": {
"rethink/bridgesdk": "*"
}
}
Then run the following command:
composer update
SDK Example Usage
Example
declare(strict_types=1); require 'vendor/autoload.php'; use ReThink\BridgeSDK; $sdk = BridgeSDK\BridgeSDK::builder() ->setSecurity( '<YOUR_API_KEY_HERE>' ) ->build(); $response = $sdk->bridgeWallets->list( ); if ($response->bridgeWalletsList !== null) { // handle response }
Authentication
Per-Client Security Schemes
This SDK supports the following security scheme globally:
| Name | Type | Scheme |
|---|---|---|
apiKey |
apiKey | API key |
To authenticate with the API the apiKey parameter must be set when initializing the SDK. For example:
declare(strict_types=1); require 'vendor/autoload.php'; use ReThink\BridgeSDK; $sdk = BridgeSDK\BridgeSDK::builder() ->setSecurity( '<YOUR_API_KEY_HERE>' ) ->build(); $response = $sdk->bridgeWallets->list( ); if ($response->bridgeWalletsList !== null) { // handle response }
Available Resources and Operations
Available methods
AssociatedPersons
- get - Get a single associated person (Beta)
- delete - Delete a single associated person
- update - Update a single associated person
BatchSettlements
- create - Create a Batch Settlement Schedule
BridgeWallets
- list - Get all Bridge Wallets
- getTotalBalances - Get total balances of all Bridge Wallets
- getHistory - Get transaction history for a Bridge Wallet
- listByCustomer - Get all Bridge Wallets for a customer
- create - Create a Bridge Wallet
- get - Get a Bridge Wallet
Cards
- createPinUpdateUrl - Create Card PIN Update URL
- generateEphemeralKey - Generate an Ephemeral Key to Reveal Card Details
- getSummary - Get a summary of your card program
- getDesigns - Get a listing of your card program's card designs
- get - Retrieve a card account
- list - Get all card accounts
- provisionAccount - Provision a card account
- freeze - Place a freeze on the card account
- unfreeze - Unfreeze the card account
- createMobileWalletProvisioningRequest - Create a mobile wallet push provisioning request
- listAuthorizations - Retrieve pending card authorizations
- getTransactions - Retrieve card transactions
- getTransaction - Retrieve a card transaction
- getAuthControls - Retrieve authorization controls
- provisionDepositAddress - Provision an additional top-up deposit address for the card account
- createWithdrawal - Create a funds withdrawal request
- listWithdrawals - Retrieve the withdrawal history of funds
- getWithdrawal - Retrieve a card withdrawal
- generateStatement - Generate a card account statement
CryptoReturnPolicies
- getAll - Get all crypto return policies
- create - Create a new crypto return policy
- delete - Delete a single crypto return policy object
- update - Update an existing crypto return policy
Customers
- list - Get all customers
- create - Create a customer
- get - Get a single customer object
- update - Update a single customer object
- delete - Delete a single customer object
- getAssociatedPersons - Get associated persons for a business customer (Beta)
- addAssociatedPerson - Create a new associated person for a business customer (Beta)
- getAssociatedPerson - Get a single associated person (Beta)
- updateAssociatedPerson - Update a single associated person
- deleteAssociatedPerson - Delete a single associated person
- getTosAcceptanceLink - Retrieve a hosted URL for ToS acceptance for an existing customer
- getKycLink - Retrieve a hosted KYC Link for an existing customer
- getTransfers - Get all transfers
- getStaticTemplates - Get all static templates for a customer
- createTosLink - Request a hosted URL for ToS acceptance for new customer creation
Developers
- getFees - Get the configured fees
- updateFees - Update the configured fees
- getFeeExternalAccount - Get the configured fee External Account
- configureFeeExternalAccount - Configure a fee External Account
ExchangeRates
- get - Get current exchange rate between two currencies.
ExternalAccounts
- listForCustomer - Get all External Accounts
- get - Retrieve an External Account object
- list - Get all External Accounts
- create - Create a new External Account
- update - Update an External Account
- delete - Delete a single External Account object
- reactivate - Reactivate an External Account
FiatPayoutConfigurations
- get - Get the fiat payout configuration for a customer
- update - Update the fiat payout configuration for a customer
FundsRequests
- list - Get all funds requests
KycLinks
- generate - Generate the Links needs to complete KYC for an individual or business
- list - Get all KYC links.
- getById - Check the status of a KYC link
LiquidationAddresses
- create - Create a Liquidation Address
- list - Get all Liquidation Addresses
- getById - Get a Liquidation Address
- update - Update a Liquidation Address
- getDrains - Get drain history of a Liquidation Address
getBalance- Get the balance of a Liquidation Address (deprecated) ⚠️ Deprecated- allDrains - Liquidation Address Activity Across All Customers
- listForCustomer - Get all Liquidation Addresses for a customer
Lists
- getOccupationCodes - Get occupation codes
- listCountries - Get countries
Plaid
- createLinkRequest - Generate a Plaid Link token for a customer
- exchangePublicToken - Exchange Plaid public token for an access token
PrefundedAccounts
- list - Get a list of all Prefunded Account
- get - Get details for a specific Prefunded Account
- getHistory - Get funding history of a Prefunded Account
Rewards
- getRates - Get the current reward rates
- summary - Get a summary of all rewards for a given stablecoin
- currencyRates - Get the currency reward rates for a given stablecoin
- getSummary - Get a summary of a customer's rewards
- getCustomerHistory - Get a history of a customer's rewards
StaticMemos
- list - List Static Memos
- create - Create a Static Memo
- listByCustomer - List Static Memos for Customer
- get - Get a Static Memo
- update - Update a Static Memo
- getHistoryForCustomer - Static Memo Activity
- getHistory - Static Memo Activity Across All Customers
Transfers
- get - Get all transfers
- create - Create a transfer
- getById - Get a transfer
- update - Update a transfer
- delete - Delete a transfer
- listStaticTemplates - Get all static templates
VirtualAccounts
- create - Create a Virtual Account
- listByCustomer - List Virtual Accounts by Customer
- get - Get a Virtual Account
- update - Update a Virtual Account
- deactivate - Deactivate a Virtual Account
- reactivate - Reactivate a Virtual Account
- customerHistory - Virtual Account Activity
- list - List Virtual Accounts
- getHistory - Virtual Account Activity Across All Customers
Webhooks
Error Handling
Handling errors in this SDK should largely match your expectations. All operations return a response object or throw an exception.
By default an API error will raise a Errors\APIException exception, which has the following properties:
| Property | Type | Description |
|---|---|---|
$message |
string | The error message |
$statusCode |
int | The HTTP status code |
$rawResponse |
?\Psr\Http\Message\ResponseInterface | The raw HTTP response |
$body |
string | The response content |
When custom error responses are specified for an operation, the SDK may also throw their associated exception. You can refer to respective Errors tables in SDK docs for more details on possible exception types for each operation. For example, the list method throws the following exceptions:
| Error Type | Status Code | Content Type |
|---|---|---|
| Errors\Error | 400, 401, 404 | application/json |
| Errors\Error | 500 | application/json |
| Errors\APIException | 4XX, 5XX | */* |
Example
declare(strict_types=1); require 'vendor/autoload.php'; use ReThink\BridgeSDK; use ReThink\BridgeSDK\Models\Errors; $sdk = BridgeSDK\BridgeSDK::builder() ->setSecurity( '<YOUR_API_KEY_HERE>' ) ->build(); try { $response = $sdk->bridgeWallets->list( ); if ($response->bridgeWalletsList !== null) { // handle response } } catch (Errors\ErrorThrowable $e) { // handle $e->$container data throw $e; } catch (Errors\ErrorThrowable $e) { // handle $e->$container data throw $e; } catch (Errors\APIException $e) { // handle default exception throw $e; }
Server Selection
Override Server URL Per-Client
The default server can be overridden globally using the setServerUrl(string $serverUrl) builder method when initializing the SDK client instance. For example:
declare(strict_types=1); require 'vendor/autoload.php'; use ReThink\BridgeSDK; $sdk = BridgeSDK\BridgeSDK::builder() ->setServerURL('https://api.bridge.xyz/v0') ->setSecurity( '<YOUR_API_KEY_HERE>' ) ->build(); $response = $sdk->bridgeWallets->list( ); if ($response->bridgeWalletsList !== null) { // handle response }
Development
Maturity
This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally looking for the latest version.
Contributions
While we value open-source contributions to this SDK, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation. We look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release.