Integrate Strongmb into your app in minutes. Official SDKs for PHP, Node.js, and Python — authentication and error handling included.
All three SDKs share the same resource/method structure. Pick your language and start in under 5 minutes.
<?php require 'vendor/autoload.php'; use Strongmb\Strongmb; use Strongmb\Exceptions\ApiException; use Strongmb\Exceptions\AuthException; $strongmb = new Strongmb('YOUR_API_KEY'); try { $response = $strongmb->data->purchase( phone: '08012345678', productCode: 'smb_mtn_sme_1gb_30days', reference: 'MYAPP' . strtoupper(uniqid()), ); if ($response->successful()) { $data = $response->data(); echo "✓ 1GB sent to {$data['recipient']}\n"; echo " Balance: ₦{$data['balance_after']}\n"; } elseif ($response->processing()) { echo '⏳ Processing… reference: ' . $response->data()['reference']; } elseif ($response->failed()) { echo '✗ Failed. Trace ID: ' . $response->traceId(); } } catch (AuthException $e) { echo 'Invalid API key.'; } catch (ApiException $e) { echo "Error [{$e->getApiCode()}]: {$e->getMessage()}"; }
const { Strongmb, ApiError, AuthError } = require('@strongmb/node');
const strongmb = new Strongmb('YOUR_API_KEY');
(async () => {
try {
const response = await strongmb.data.purchase({
phone: '08012345678',
productCode: 'smb_mtn_sme_1gb_30days',
reference: 'MYAPP' + Date.now(),
});
if (response.successful()) {
const data = response.data();
console.log(`✓ 1GB sent to ${data.recipient}`);
console.log(` Balance: ₦${data.balance_after}`);
} else if (response.processing()) {
console.log('⏳ Processing…', response.data().reference);
} else if (response.failed()) {
console.log('✗ Failed. Trace ID:', response.traceId());
}
} catch (e) {
if (e instanceof AuthError) console.log('Invalid API key.');
else if (e instanceof ApiError) console.log(`Error [${e.getApiCode()}]: ${e.message}`);
else console.log('Network error:', e.message);
}
})();from strongmb import Strongmb, ApiError, AuthError, StrongmbError client = Strongmb("YOUR_API_KEY") try: response = client.data.purchase( phone="08012345678", product_code="smb_mtn_sme_1gb_30days", reference="MYAPP123456", ) if response.successful(): data = response.data() print(f"✓ 1GB sent to {data['recipient']}") print(f" Balance: ₦{data['balance_after']:,}") elif response.processing(): print("⏳ Processing… reference:", response.data()["reference"]) elif response.failed(): print("✗ Failed. Trace ID:", response.trace_id()) except AuthError: print("Invalid API key.") except ApiError as e: print(f"Error [{e.get_api_code()}]: {e}") except StrongmbError as e: print(f"Network error: {e}")
successful(), processing(), and failed() helpers so your transaction-state logic is identical across languages.
StrongmbError // Network / JSON parse failure └── ApiError // HTTP 4xx / 5xx from the API └── AuthError // HTTP 401 — invalid or missing API key
trace_id for faster triage.