PHP SDK for https://amlkyc.tech API. Provides convenient access to:
- Fast Checks (быстрые проверки)
- Investigations (расследования)
- User Balance (баланс)
The SDK is built on top of Guzzle and follows PSR conventions. Ready for publication on Packagist.
Install via Composer (after publishing to Packagist):
composer require amlkyc/sdk
For local development, clone the repo and run:
composer install
Use your API key (Bearer token) when creating the client:
use AmlKyc\Client;
$client = new Client('YOUR_API_KEY');
The base URI defaults to https://amlkyc.tech
. You can override it with the second constructor argument.
$fast = $client->fastChecks();
// Create a new fast check
$created = $fast->create('TLWKepDBC8RZjAhtWyNqASyzgyVyHUuS7o', 'USDT', 'trx');
// Run the fast check
$run = $fast->run($created['id']);
// Get details
$detail = $fast->getById($created['id']);
// List fast checks
$list = $fast->list();
$inv = $client->investigations();
// Create investigation (target is address id or transaction hash)
$created = $inv->create('1', 'USDT');
// Run investigation
$inv->run($created['id']);
// Get graph (optionally for a specific item)
$graph = $inv->graph($created['id'], 123);
// Request deep analysis for an address within the investigation
$deep = $inv->deep($created['id'], 'TLWKepDBC8RZjAhtWyNqASyzgyVyHUuS7o');
$balanceApi = $client->balance();
$balance = $balanceApi->get();
$fiat = $balanceApi->allowedFiat();
$invoice = $balanceApi->createInvoice(300, 'rub');
All network and API errors are thrown as AmlKyc\\Exception\\ApiException
with methods:
getStatusCode()
— HTTP status code when availablegetBody()
— decoded JSON response body when available
Unit tests (mocked, no network):
vendor/bin/phpunit
Integration tests (real network):
Set your API key as env var and enable integration tests:
export AMLKYC_API_KEY="7500|V7Yz2LcScGI2HtfbGNc08e2huNI6XOv6ppR7tc7L"
export AMLKYC_TEST_ADDRESS="TLWKepDBC8RZjAhtWyNqASyzgyVyHUuS7o"
export AMLKYC_RUN_INTEGRATION=true
vendor/bin/phpunit --testsuite "AmlKyc SDK Test Suite"
Note: running integration tests may consume your balance.
MIT License. See LICENSE file.