Yextof Sportsbook Iframe Integration
Complete documentation for integrating Yextof Sportsbook via iframe
Getting Started
Introduction
This documentation explains how to integrate Yextof Sportsbook into your platform using iframe. The integration involves user authentication, transaction handling, and coupon management.
Authentication Flow
Users must be authenticated before accessing the sportsbook. The authentication token obtained from your login system will be used to verify users.
Integration Flow
User Login
User logs into your platform and receives an authentication token.
Iframe Initialization
Initialize the Yextof Sportsbook iframe with the user’s token:
<iframe src="https://[YEXTOF_URL]/embed?token=USER_TOKEN" width="100%" height="800" frameborder="0"></iframe>
User Verification
The iframe will verify the user by calling the verification endpoint with the token.
Coupon Creation
When a user creates a coupon, the iframe will call your transaction API to process the transaction.
Transaction Confirmation
After successful transaction processing, the coupon is created.
API Endpoints
User Verification
Verify user authentication token.
GET https://[YEXTOF_URL]/api/iframe/verify
Request Headers:
| Header | Value | Required |
|---|---|---|
| Authorization | Bearer USER_TOKEN | Yes |
Response:
{
"success": true,
"id": 8306,
"username": "test",
"balance": "3800.00"
}
Transaction Creation
Create a transaction for coupon processing.
POST https://[YOUR_URL]/api/transaction/create
Request Body:
{
"hash": "generated_hash",
"coupon_id": "12345",
"user_id": "8306",
"op_id": "8306",
"transaction_type": 2,
"transaction_date": "2023-11-15T10:30:00.000Z",
"transaction_amount": 100,
"transaction_last_amount": 3700.00,
"transaction_detail": "Coupon creation",
"api_transaction_id": null,
"currency": "USD",
"attempt": 0
}
Hash Generation:
The hash is generated using the following formula:
md5(`${user_id}${coupon_id}${amount}${secret_key}`)
Response:
{
"success": true,
"message": "Successfull."
}
Bet Report History
Retrieve coupon/bet history with various filters.
POST https://[YEXTOF_URL]/api/coupon/bet-report-history
Request Body:
{
"date1": "2023-01-01",
"date2": "2023-12-31",
"attempt": 0,
"is_live": 0,
"user_id": 8606,
"sport_id": 3,
"league_id": 123,
"event_id": 456,
"market_type_id": 1
}
Response:
{
"success": true,
"code": 200,
"data": [
{
"bet_id": 127,
"sport_ids": [3],
"player_id": 8606,
"currency": "USD",
"amount": 3000,
"total_odd": 2.1,
"win_amount": 6300,
"type": 1,
"status": 1,
"name": "John Caster",
"username": "john2",
"createdAt": "2025-06-03T18:14:20.000Z",
"detail": [
{
"event_date": "2025-08-03T18:15:00.000Z",
"sport": 3,
"sport_name": "Basketball",
"country": "Europe",
"league": "FIBA Europe Championship",
"event_name": "Home vs. Away",
"market_name": "Total 1st Half",
"odd_name": "Total (82.5) Over",
"odd_price": 2.1,
"status": "Win",
"event_info": "Event End",
"event_result": "95:90"
}
],
"ip": "1.1.1.1.1",
"is_live": 0,
"attempt": 0,
"event_count": 1
}
]
}
Implementation Details
Hash Generation Example
Below is an example of how to generate the security hash for transactions:
Node.js Example:
const crypto = require('crypto');
function generateSecurityHash(user_id, coupon_id, amount, secret_key) {
const hashData = `${user_id}${coupon_id}${amount}${secret_key}`;
const hash = crypto.createHash('md5');
hash.update(hashData);
return hash.digest('hex');
}
// Usage
const hash = generateSecurityHash(8306, 12345, 100, 'your_secret_key');
console.log(hash); // Output: generated_md5_hash
PHP Example:
function generateSecurityHash($user_id, $coupon_id, $amount, $secret_key) {
$hashData = $user_id . $coupon_id . $amount . $secret_key;
return md5($hashData);
}
// Usage
$hash = generateSecurityHash(8306, 12345, 100, 'your_secret_key');
echo $hash; // Output: generated_md5_hash
Transaction Types
Different transaction types used in the integration:
| Type | Value | Description |
|---|---|---|
| Coupon Win | 1 | Transaction for a winning coupon |
| Coupon Created | 2 | Transaction for coupon creation |
Important Notes
Implementation Guidelines
- Ensure your transaction API endpoint is secure and can handle the expected load
- Always validate the hash on your transaction endpoint to ensure request authenticity
- Implement proper error handling for failed transactions
- Keep your secret key secure and never expose it in client-side code
- Test the integration thoroughly in a sandbox environment before going live
Security Considerations
- Use HTTPS for all API communications
- Validate all input parameters to prevent injection attacks
- Implement rate limiting to prevent abuse
- Log all transactions for auditing purposes
- Regularly update and rotate your secret keys
Support
For issues related to iframe integration, contact Yextof at tg: @wega_manage.
Documentation version: 1.1