PHP Quick Start

Install and initialize the PHP SDK from a backend service.
View as Markdown

Install

{
"require": {
"sixmm/agent-sdk": "VERSION_PROVIDED_BY_6MM"
}
}

Package access

6MM provides the approved Composer package name, repository, and version during partner onboarding. The package should not be assumed to exist on public Packagist.

Before you start

  • Confirm the Agent API base URL with 6MM.
  • Load apiSecret from environment variables or secret management.
  • Keep SDK usage inside backend services only.
  • Prepare idempotent handling for transfer and webhook flows.

Initialize client

<?php
use Sixmm\Agent\AgentClient;
use Sixmm\Agent\AgentConfig;
$client = new AgentClient(new AgentConfig(
'https://agent-api.6mm.com',
'AGENT001',
getenv('AGENT_API_SECRET') ?: '',
'USDT'
));

Backend only

The PHP SDK signs Agent API requests and must not be exposed through public source code or frontend runtime environments.

Example: transfer funds in

$response = $client->transfer([
'agentOrderNo' => 'AGT-ORDER-1001',
'agentUserId' => 'agent-user-001',
'direction' => 'IN',
'currency' => 'USDT',
'amount' => '10.00',
]);

Use decimal strings for amounts and preserve the original agentOrderNo when retrying or querying transfer status.

Next steps

NeedNext page
Understand Agent SDK capabilitiesAgent SDK Overview
Review signing behaviorSecrets & Signing
Verify callback deliveryWebhooks & Idempotency
Diagnose an integration problemSDK Troubleshooting