UNIX Gaming Reseller API
Sell Mobile Legends diamonds on your own website. Your site sends the order to UNIX Gaming, we deliver the diamonds to the player automatically, and you see the result in seconds.
Getting started
- Get an account and API key from UNIX Gaming: apply to become a reseller. Your key starts with
uxr_. - Add balance in Smile Coins. Pay UNIX Gaming and we add Smile Coins to your reseller balance. Every price and balance in this API is in Smile Coins, and each order is paid from this balance.
- Connect your website with the requests below. Base URL:
https://unixtopup.com
Flow for each customer order: your customer pays you on your site → your server calls POST /api/v1/orders → we charge your balance and send the diamonds → you check GET /api/v1/orders/{order_id} (or receive a notification) until the status is success.
API key
Send your key with every request:
Authorization: Bearer uxr_your_key_here
- Keep the key on your server only. Never put it in your website's JavaScript, an app, or a public repository: anyone with the key can spend your balance.
- If a key leaks, ask UNIX Gaming to revoke it and issue a new one. We can also lock your key to your server's IP addresses.
- Limits: 120 requests per minute, 30 orders per minute, 30 player checks per minute.
Every response has the same shape:
{ "success": true, "message": "OK", "data": { ... } }
{ "success": false, "message": "Not enough balance: ...", "error": { "code": "insufficient_balance" } }
GET/api/v1/products
All packages you can sell and their price in Smile Coins, the same for every reseller. Use product_id when you order. Prices can change, so read them again regularly (for example every hour).
{ "success": true, "message": "OK", "data": { "products": [
{ "product_id": "mobilelegends-2", "game": "MLBB Diamonds (Nepal Region)", "name": "86 Diamonds",
"category": "Diamonds", "price": 71.3, "currency": "SMILE_COIN", "available": true, "requires": ["player_id", "server_id"] }
] } }
One product: GET /api/v1/products/{product_id}
GET/api/v1/players/check?player_id=…&server_id=…
Optional. Shows the player's in-game name so your customer can confirm the account before paying. Free.
{ "success": true, "message": "Player found", "data": { "player_id": "123456789", "server_id": "1234", "player_name": "Luffy" } }
POST/api/v1/orders
| Field | Required | What it is |
|---|---|---|
product_id | yes | From /api/v1/products |
player_id | yes | MLBB User ID, 5–12 digits |
server_id | yes | MLBB Server (Zone) ID, 2–6 digits |
client_reference | yes | Your own order ID, unique per order (1–64 characters: letters, digits, . _ : -) |
POST /api/v1/orders
Content-Type: application/json
{ "product_id": "mobilelegends-2", "player_id": "123456789", "server_id": "1234", "client_reference": "SHOP-10045" }
Reply 201:
{ "success": true, "message": "Order created. The top-up is being sent.", "data": {
"order_id": "UG-7KQ2MZ4P", "client_reference": "SHOP-10045", "status": "processing",
"product_id": "mobilelegends-2", "product_name": "86 Diamonds", "game": "MLBB Diamonds (Nepal Region)",
"player_id": "123456789", "server_id": "1234", "player_name": "Luffy",
"price": 71.3, "currency": "SMILE_COIN", "created_at": "2026-11-23T10:15:02Z", "completed_at": null, "refunded_at": null } }
- The price is always the price from
/api/v1/products, charged in Smile Coins. Any price you send is ignored. - Safe to retry: if your request times out, send the same
client_referenceagain. You get the same order back ("duplicate": true). It is never charged or delivered twice. - Before charging, we check that the player exists and that you have enough balance. If anything is wrong you get an error and nothing is charged.
GET/api/v1/orders/{order_id}
Also: GET /api/v1/orders?client_reference=SHOP-10045, and the list GET /api/v1/orders?limit=50&status=success&before=UG-… (newest first; pass next_before from the reply to get the next page).
| status | Meaning | What to do |
|---|---|---|
processing | Being sent to the game. Usually takes a few seconds. | Check again in 5–10 seconds. |
success | Diamonds delivered. | Mark your customer's order complete. |
refunded | Delivery failed and nothing was sent. The coins are back in your balance. | Refund or retry your customer with a new client_reference. |
pending_verification | The game provider didn't confirm in time. Your money is held while UNIX Gaming checks it by hand. | Wait. It becomes success or refunded. Don't create a new order for the same customer, or they could get diamonds twice. |
failed | Failed; a refund is on its way (becomes refunded within seconds). | Wait for refunded. |
cancelled | Cancelled by UNIX Gaming. | Contact us. |
GET/api/v1/balance
{ "success": true, "message": "OK", "data": { "balance": 1528.7, "currency": "SMILE_COIN", "account_status": "active", "ordering_open": true } }
ordering_open: false means UNIX Gaming has paused orders for a while; new orders are refused with ordering_paused and nothing is charged.
Notifications (optional)
Give UNIX Gaming an https URL on your server. When an order changes to success, refunded, failed, pending_verification or cancelled, we send a POST:
X-Unix-Event-Id: evt_5f1c...
X-Unix-Signature: t=1763892902,v1=9a3c...
{ "event_id": "evt_5f1c...", "type": "order.success", "created_at": "2026-11-23T10:15:06Z", "data": { ...same as the order status reply... } }
- Check the signature with the notification secret we give you (
whsec_…): compute HMAC-SHA256 oft + "." + raw bodywith the secret and compare it withv1. Reject timestamps older than 5 minutes. - Answer with any
2xxstatus. Otherwise we try again after 30 s, 2 min, 10 min, 30 min, 2 h and 6 h. - The same event can arrive twice: use
event_idto ignore repeats. Notifications are a convenience; the order status request is always the truth.
Errors
| HTTP | error.code | Meaning |
|---|---|---|
| 401 | missing_api_key, invalid_api_key | No key, a wrong key, or a revoked key |
| 403 | account_suspended, ip_not_allowed | Account blocked, or the request came from an IP that isn't allowed |
| 402 | insufficient_balance | Not enough Smile Coins (error.balance, error.required). Nothing charged. |
| 404 | product_not_found, order_not_found | Unknown product or order |
| 422 | invalid_player | The player ID or server doesn't exist. Nothing charged. |
| 422 | invalid_player_format, invalid_client_reference, product_unavailable | Fix the request. Nothing charged. |
| 429 | rate_limited | Too many requests. Wait a minute. |
| 503 | ordering_paused, service_unavailable | Temporarily unavailable. Nothing charged. Try again later. |
Code examples
cURL
curl -X POST https://unixtopup.com/api/v1/orders \
-H "Authorization: Bearer $UNIX_API_KEY" -H "Content-Type: application/json" \
-d '{"product_id":"mobilelegends-2","player_id":"123456789","server_id":"1234","client_reference":"SHOP-10045"}'
curl https://unixtopup.com/api/v1/orders/UG-7KQ2MZ4P -H "Authorization: Bearer $UNIX_API_KEY"
PHP
<?php
function unix_api($method, $path, $body = null) {
$ch = curl_init("https://unixtopup.com" . $path);
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => $method,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("UNIX_API_KEY"), "Content-Type: application/json"],
CURLOPT_POSTFIELDS => $body ? json_encode($body) : null,
]);
$res = json_decode(curl_exec($ch), true);
curl_close($ch);
return $res;
}
$r = unix_api("POST", "/api/v1/orders", [
"product_id" => "mobilelegends-2", "player_id" => "123456789", "server_id" => "1234",
"client_reference" => "SHOP-" . $myOrderId, // your own order ID: safe to retry
]);
if ($r["success"]) { saveUnixOrderId($myOrderId, $r["data"]["order_id"]); }
else { echo $r["error"]["code"] . ": " . $r["message"]; }
// Notification receiver: verify the signature
$raw = file_get_contents("php://input");
preg_match('/t=(\d+),v1=([a-f0-9]+)/', $_SERVER["HTTP_X_UNIX_SIGNATURE"] ?? "", $m);
$ok = $m && abs(time() - (int)$m[1]) < 300
&& hash_equals(hash_hmac("sha256", $m[1] . "." . $raw, getenv("UNIX_WEBHOOK_SECRET")), $m[2]);
if (!$ok) { http_response_code(401); exit; }
$event = json_decode($raw, true); // $event["data"]["status"], $event["data"]["client_reference"]
http_response_code(200);
Node.js
const BASE = "https://unixtopup.com";
async function unixApi(method, path, body) {
const res = await fetch(BASE + path, {
method,
headers: { Authorization: `Bearer ${process.env.UNIX_API_KEY}`, "Content-Type": "application/json" },
body: body ? JSON.stringify(body) : undefined,
});
return res.json();
}
const r = await unixApi("POST", "/api/v1/orders", {
product_id: "mobilelegends-2", player_id: "123456789", server_id: "1234", client_reference: `SHOP-${myOrderId}`,
});
if (!r.success) throw new Error(`${r.error.code}: ${r.message}`);
// Notification receiver (Express, raw body):
import crypto from "node:crypto";
app.post("/unix-webhook", express.raw({ type: "application/json" }), (req, res) => {
const [, t, v1] = /t=(\d+),v1=([a-f0-9]+)/.exec(req.get("X-Unix-Signature") || "") || [];
const expected = crypto.createHmac("sha256", process.env.UNIX_WEBHOOK_SECRET).update(`${t}.${req.body}`).digest("hex");
if (!t || Math.abs(Date.now() / 1000 - t) > 300 || !v1 || !crypto.timingSafeEqual(Buffer.from(v1), Buffer.from(expected))) return res.sendStatus(401);
const event = JSON.parse(req.body); // event.data.status, event.data.client_reference
res.sendStatus(200);
});
Python
import os, requests
BASE = "https://unixtopup.com"
H = {"Authorization": f"Bearer {os.environ['UNIX_API_KEY']}"}
r = requests.post(f"{BASE}/api/v1/orders", headers=H, timeout=30, json={
"product_id": "mobilelegends-2", "player_id": "123456789", "server_id": "1234", "client_reference": f"SHOP-{my_order_id}",
}).json()
print(r["data"]["status"] if r["success"] else r["error"]["code"])
Questions? Contact UNIX Gaming on WhatsApp.