PHP Quick Start

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

Install

1{
2 "require": {
3 "sixmm/agent-sdk": "VERSION_PROVIDED_BY_6MM"
4 }
5}

Package access

6MM provides the approved Composer package name, source, and version during partner onboarding.

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

1<?php
2
3use Sixmm\Agent\AgentClient;
4use Sixmm\Agent\AgentConfig;
5
6$client = new AgentClient(new AgentConfig(
7 'https://api.6mm.com/agent',
8 'AGENT001',
9 getenv('AGENT_API_SECRET') ?: '',
10 'USDT'
11));

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

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

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