API Documentation
Integrate GsmFastPay's powerful crypto payment gateway into your application seamlessly.
Base URL:
https://gsmfastpay.org
Authentication
Authenticate your requests by including your API Key in the request headers.
X-API-KEY: your_api_key_here
Accept: application/json
POST Create Payment
Endpoint: /api/v1/payment
Parameters
| Field | Type | Description |
|---|---|---|
| amount | Decimal | The amount to charge (e.g. 10.50) |
| currency | String | Currency code (default: USDT) |
| webhook_url | URL | Your URL to receive payment updates |
| return_url | URL | Where to redirect user after payment |
Example PHP (cURL)
$payload = [
'amount' => 50.00,
'currency' => 'USDT',
'webhook_url' => 'https://your-site.com/callback',
'return_url' => 'https://your-site.com/success',
'description' => 'Order #1001'
];
$ch = curl_init('https://gsmfastpay.com/api/v1/payment');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'X-API-KEY: your_api_key',
'Content-Type: application/json'
]);
$response = json_decode(curl_exec($ch), true);
if ($response['success']) {
header('Location: ' . $response['payment_url']);
}
Laravel Integration
For Laravel, we recommend using the Http facade for a cleaner implementation.
Step 1: Set up .env
GSM_API_KEY=your_key_here
GSM_BASE_URL=https://gsmfastpay.com
Step 2: Create Payment Controller
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Http;
class PaymentController extends Controller
{
public function checkout(Request $order)
{
$response = Http::withHeaders([
'X-API-KEY' => env('GSM_API_KEY'),
])->post(env('GSM_BASE_URL') . '/api/v1/payment', [
'amount' => $order->total,
'currency' => 'USDT',
'webhook_url' => route('payment.webhook'),
'return_url' => route('payment.success'),
'description' => "Payment for Order #{$order->id}",
]);
if ($response->successful()) {
return redirect($response->json()['payment_url']);
}
return back()->withErrors('Payment failed to initialize.');
}
}
Handling Webhooks
GsmFastPay will send a POST request to your webhook_url when a payment is completed.
{
"ref": "GX12345678",
"status": "completed",
"amount": "50.00",
"currency": "USDT",
"gateway_trx": "TXID987654321"
}
Security Note: Always call the
Verify Payment endpoint manually from your server to confirm the status before providing services.