This guide provides everything a developer needs to integrate their MT5 system with the Predictpay Gateway and test it thoroughly before going live.
All API requests must be authenticated using a Bearer Token. You can generate your API Token from the Predictpay Admin Dashboard under the "Merchants" section.
Authorization: Bearer 1|your_api_token_here
Accept: application/json
Content-Type: application/json
Creates a new payment intent and returns the secure checkout URL for your user.
Endpoint: POST /api/v1/orders/create
{
"client_name": "John Doe",
"mt5_id": "99887766",
"amount_usd": 250.00,
"merchant_ref_id": "YOUR_UNIQUE_ORDER_123"
}
Note: merchant_ref_id must be unique per order to ensure idempotency. If you send the same merchant_ref_id twice, the API will return the existing order safely rather than creating a duplicate.
{
"success": true,
"order_id": "XP-000001",
"payment_url": "http://yourdomain.com/checkout/uuid-string",
"amount_inr": 21000.50,
"expires_at": "2026-04-21T14:30:00+05:30"
}
Allows you to poll or manually check an order's status if needed.
Endpoint: GET /api/v1/orders/{order_id}
{
"success": true,
"order_id": "XP-000001",
"status": "pending",
"amount_usd": 250.00,
"amount_inr": 21000.50,
"mt5_id": "99887766",
"merchant_ref_id": "YOUR_UNIQUE_ORDER_123",
"payment_url": "http://yourdomain.com/checkout/uuid-string",
"expires_at": "2026-04-21T14:30:00+05:30"
}
Instead of polling, Predictpay pushes real-time updates to your system when an admin approves or rejects the UTR.
When an admin clicks "Approve & Credit", Predictpay will make a POST request to your configured webhook_url.
{
"event": "order.completed",
"order_id": "XP-000001",
"merchant_ref_id": "YOUR_UNIQUE_ORDER_123",
"mt5_id": "99887766",
"client_name": "John Doe",
"amount_usd": 250.00,
"amount_inr": 21000.50,
"utr_number": "312345678901",
"status": "completed",
"timestamp": "2026-04-21T14:45:00+05:30"
}
To ensure the webhook is genuinely from Predictpay, we sign the payload using HMAC-SHA256 with your webhook_secret. You must compare the X-Predictpay-Signature header to a hash you generate on your server.
$payload = file_get_contents('php://input');
$signatureHeader = $_SERVER['HTTP_X_PREDICTPAY_SIGNATURE']; // format: sha256=<hash>
$expectedHash = 'sha256=' . hash_hmac('sha256', $payload, 'your_webhook_secret');
if (hash_equals($expectedHash, $signatureHeader)) {
// Valid! Credit the user's MT5 account
} else {
// Invalid signature, ignore
}
To safely test the system before going live, follow these exact steps:
/admin), go to Merchants, create a Test Merchant, and click "Generate API Key".https://webhook.site and enter it in the Merchant settings.POST /api/v1/orders/create with your token."payment_url" in an incognito window.Waiting Verification.webhook.site (or own server) and confirm you successfully received the signed JSON payload containing "status": "completed".