PHP SDK on GitHub
Browse the source code, examples, releases, and issue tracker.
Installation
Initialize the client
Available methods
Errors
See Handle a callback for verification code.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Install and use the official Billions PHP SDK.
composer require billions-works/sdk-php
<?php
require 'vendor/autoload.php';
use Billions\BillionsApi;
$api = new BillionsApi($_ENV['BILLIONS_API_KEY']);
$api = new BillionsApi(
apiKey: $_ENV['BILLIONS_API_KEY'],
baseUrl: 'https://api.billions.works',
version: 'v1',
httpClient: $customGuzzleClient,
);
$api->getVersion();
$api->getCurrencies();
$api->getMerchantInfo();
$api->estimateFees($payload);
$api->createInvoice($payload);
$api->getInvoice($invoiceId);
$api->getInvoicesByOrderNo($orderNo);
$api->verifyInvoicePaid($invoiceId, $callbackData);
$api->verifyInvoicePaid($callbackDataWithId);
| Exception | Meaning |
|---|---|
BillionsApiException | The API request failed; exposes statusCode and responseBody |
InvoiceNotPaidException | The retrieved invoice is not completed |
CallbackVerificationException | Callback data differs from the API invoice |