Smile API Documentation
Mobile Legends Diamond Top-up API for seamless in-game purchases
Mobile LegendsBase URL
All API endpoints are relative to this base URL. Make sure to include the /api prefix in all requests.
Balance Endpoints
Get Smile account balance for all regions or a specific region.
Get Smile account balance from all configured regions (BR, PH).
GET /api/balance
{
"success": true,
"message": "Balance fetched successfully",
"result": {
"username": "James Milligan",
"balances": {
"br": 19.8,
"ph": 0
}
}
}
Get Smile account balance for a specific region.
| Parameter | Type | Required | Description |
|---|---|---|---|
region |
string | Required | Region code: br (Brazil) or ph (Philippines) |
GET /api/balance/br
{
"success": true,
"message": "Balance fetched successfully",
"result": {
"username": "James Milligan",
"region": "br",
"balance": 19.8,
"coupons": 0
}
}
Balance endpoints require valid Smile.one cookies to be configured in the system. If cookies are expired, you'll receive an error response.
Products Endpoint
Get all available Mobile Legends diamond packages.
| Parameter | Type | Required | Description |
|---|---|---|---|
region_slug |
string | Optional | Region code: br (Brazil) or ph (Philippines) |
GET /api/products?region_slug=ph
{
"success": true,
"message": "Product List",
"result": [
{
"id": 1,
"name": "86 Diamonds",
"smile_product_id": "mlbb86",
"slug": "mobilelegends",
"region_slug": "ph"
}
]
}
Check Role Endpoint
Verify user account before making a purchase. Always call this first to validate the game ID.
Verify Mobile Legends user ID and zone ID.
| Parameter | Type | Required | Description |
|---|---|---|---|
game_id |
string | Required | User's game ID (max 225 characters) |
zone_id |
string | Required | User's zone/server ID (max 225 characters) |
GET /api/check-role?game_id=123456789&zone_id=2345
{
"success": true,
"message": "Check Role",
"result": {
"username": "PlayerName",
"game_id": "123456789",
"zone_id": "2345"
}
}
Purchase Endpoint
Always call the check-role endpoint first to validate the user's game ID before making a purchase.
Process a Mobile Legends diamond purchase.
| Parameter | Type | Required | Description |
|---|---|---|---|
game_id |
string | Required | User's game ID |
zone_id |
string | Required | User's zone/server ID |
smile_product_id |
string | Required | Product ID from the products endpoint |
POST /api/purchase
Content-Type: application/json
{
"game_id": "123456789",
"zone_id": "2345",
"smile_product_id": "mlbb86"
}
{
"success": true,
"message": "Purchase Success",
"result": null
}
{
"success": false,
"message": "Product not found"
}
{
"success": false,
"message": "Something went wrong, Payment failed"
}
Response Format
All API responses follow this standard format:
{
"success": true | false,
"message": "Response message",
"result": { } | [ ] | null
}
| Field | Type | Description |
|---|---|---|
success |
boolean | true if request was successful, false otherwise |
message |
string | Human-readable message about the result |
result |
object/array/null | Response data (null for operations without return data) |
Error Handling
| Code | Description |
|---|---|
200 |
Success - Request completed successfully |
400 |
Bad Request - Invalid parameters or malformed request |
404 |
Not Found - Resource not found (e.g., invalid product ID) |
422 |
Validation Error - Missing or invalid required fields |
500 |
Server Error - Something went wrong on the server |
{
"success": false,
"message": "Validation failed",
"errors": {
"game_id": ["The game_id field is required."],
"zone_id": ["The zone_id field is required."]
}
}