Getting started
Three things and you are live:
gsmxtool_. Keep it on your server.payment_url you get back.Using DHRU, WHMCS or Joudisoft? You do not need the API — download the ready module from Modules in your dashboard.
Non-custodial · we never hold your funds
Sign in to your merchant dashboard.
New to GSM X Tool Pay?
We will email you a 6-digit code.
Remembered it?
Two short steps, then connect your first wallet.
Already have an account?
A small JSON API over HTTPS. Create a payment, send your customer to the checkout link, and we call your webhook the moment it clears.
https://pay.gsmxtool.com/api/v1
Three things and you are live:
gsmxtool_. Keep it on your server.payment_url you get back.Using DHRU, WHMCS or Joudisoft? You do not need the API — download the ready module from Modules in your dashboard.
Send your key in the X-API-Key header on every request. Authorization: Bearer <key> works too.
X-API-Key: gsmxtool_your_api_key Content-Type: application/json
/api/v1/paymentCreates a payment and returns the checkout link to send your customer to.
| Field | Type | Description |
|---|---|---|
amount required | decimal | Amount to charge, e.g. 25.00. |
webhook_url required | url | Where we POST the result when the payment changes status. |
currency | string | Currency code. Defaults to USDT. |
gateway | string | trc20usdt, bep20usdt, binancec2c, banglaqr, bkashpersonal, bkashlive or auto (default) to let the customer choose. |
return_url | url | Where the customer goes after paying. |
description | string | Shown on the checkout, e.g. Order #1042. |
customer_name | string | Pre-fills the checkout. |
customer_email | string | Pre-fills the checkout. |
curl -X POST https://pay.gsmxtool.com/api/v1/payment \ -H "X-API-Key: gsmxtool_your_api_key" \ -H "Content-Type: application/json" \ -d '{ "amount": "25.00", "gateway": "trc20usdt", "webhook_url": "https://yourapp.com/webhooks/gsmxtool", "return_url": "https://yourapp.com/thanks", "description": "Order #1042" }'
$ch = curl_init('https://pay.gsmxtool.com/api/v1/payment'); curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => ['X-API-Key: gsmxtool_your_api_key', 'Content-Type: application/json'], CURLOPT_POSTFIELDS => json_encode([ 'amount' => '25.00', 'webhook_url' => 'https://yourapp.com/webhooks/gsmxtool', 'return_url' => 'https://yourapp.com/thanks', 'description' => 'Order #1042', ]), ]); $res = json_decode(curl_exec($ch), true); if ($res['success']) header('Location: ' . $res['payment_url']);
const res = await fetch('https://pay.gsmxtool.com/api/v1/payment', { method: 'POST', headers: { 'X-API-Key': process.env.GSMX_KEY, 'Content-Type': 'application/json' }, body: JSON.stringify({ amount: '25.00', webhook_url: 'https://yourapp.com/webhooks/gsmxtool' }), }); const { payment_url } = await res.json();
Response
{
"success": true,
"ref": "GX5C9BB433AC",
"payment_url": "https://pay.gsmxtool.com/pay/GX5C9BB433AC",
"amount": "25.00000000",
"currency": "USDT",
"status": "initiated",
"created_at": "2026-10-21 09:52:11"
}/api/v1/payment/{ref}Returns the current state of one payment. Call this from your server before delivering anything — never trust a redirect alone.
curl https://pay.gsmxtool.com/api/v1/payment/GX5C9BB433AC -H "X-API-Key: gsmxtool_your_api_key"
Response
{
"success": true,
"ref": "GX5C9BB433AC",
"amount": "25.00000000",
"currency": "USDT",
"gateway": "trc20usdt",
"gateway_trx_id": "9f2c…e81a",
"status": "completed",
"webhook_status": "success",
"payment_url": "https://pay.gsmxtool.com/pay/GX5C9BB433AC",
"created_at": "2026-10-21 09:52:11",
"updated_at": "2026-10-21 09:52:39"
}/api/v1/paymentsYour payments, newest first.
| Query | Type | Description |
|---|---|---|
status | string | Filter: initiated, pending, completed, failed, canceled. |
page | int | Page number, from 1. |
per_page | int | Rows per page, 1–100. Default 20. |
curl "https://pay.gsmxtool.com/api/v1/payments?status=completed&per_page=50" -H "X-API-Key: gsmxtool_your_api_key"
The response has data (the rows) and pagination (total, page, per_page, last_page).
/api/v1/payment/{ref}/cancelCancels a payment that has not completed yet. A completed, failed or already canceled payment cannot be canceled.
curl -X POST https://pay.gsmxtool.com/api/v1/payment/GX5C9BB433AC/cancel -H "X-API-Key: gsmxtool_your_api_key" { "success": true, "ref": "GX5C9BB433AC", "status": "canceled" }
When a payment changes status we send a POST with a JSON body to the webhook_url you gave. Answer with any 2xx code.
{
"ref": "GX5C9BB433AC",
"status": "completed",
"amount": "25.00000000",
"currency": "USDT",
"gateway": "trc20usdt",
"gateway_trx": "9f2c…e81a",
"created_at": "2026-10-21 09:52:11"
}ref and check that status is completed and the amount is what you expected.// webhook.php — the safe pattern $in = json_decode(file_get_contents('php://input'), true); $ch = curl_init('https://pay.gsmxtool.com/api/v1/payment/' . urlencode($in['ref'])); curl_setopt_array($ch, [CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => ['X-API-Key: ' . getenv('GSMX_KEY')]]); $trx = json_decode(curl_exec($ch), true); if (($trx['status'] ?? '') === 'completed') { // mark your order paid — once } http_response_code(200);
Put the key in .env and use the Http facade.
# .env
GSMX_KEY=gsmxtool_your_api_key
GSMX_URL=https://pay.gsmxtool.comuse Illuminate\Support\Facades\Http; public function checkout(Order $order) { $res = Http::withHeaders(['X-API-Key' => env('GSMX_KEY')]) ->post(env('GSMX_URL') . '/api/v1/payment', [ 'amount' => $order->total, 'webhook_url' => route('payments.webhook'), 'return_url' => route('orders.show', $order), 'description' => "Order #{$order->id}", ]); return $res->json('success') ? redirect($res->json('payment_url')) : back()->withErrors($res->json('message')); }
Every error has "success": false and a human-readable message, with a matching HTTP code — most often 400 (bad input), 401 (missing or wrong key), 404 (unknown ref) and 422 (gateway not available on your plan).
| Status | Meaning |
|---|---|
| initiated | Created; the customer has not paid yet. |
| pending | Payment submitted and waiting for confirmation or your review. |
| completed | Confirmed. Safe to deliver after a status check. |
| failed | Verification failed. Do not deliver. |
| canceled | Canceled by you through the API or dashboard. |