Live API — v2 · Auto Top-Up

API Guide

One endpoint, two behaviors. Send player_id and the voucher is bought and redeemed straight into the game account automatically. Leave it out and you get a normal voucher code to redeem by hand — same request, same response shape, same everything else.

This page was rebuilt from scratch to match the current API exactly — every field, example and status below reflects what the server actually returns today.

See it in action

What happens after POST /v1/order — this loops automatically, no clicking needed.

📨
Request Sent
Pending
Result
pending

1 Get your API key

Send this command to the bot in a private DM, or inside your own dedicated group:

Gapikey
  • If it's your first time, a key is generated automatically.
  • If you already have one, the same key is shown again.
  • The message self-destructs after 2 minutes — copy your key somewhere safe.
  • Sent from any other/shared group, the bot deletes your message and DMs you instead, so your key never leaks to other members.
🔒 Keep this key secret. Anyone who has it can place orders — and spend your balance — on your account.

Reset / rotate your key

Gapikeyreset

This immediately deactivates your old key and issues a new one. Update it anywhere you had it saved.

2 Authentication

Every request must include these headers:

X-API-Key: YOUR_API_KEY
Content-Type: application/json
HeaderValue
X-API-Keyyour key, from §1
Content-Typeapplication/json

Missing or invalid keys return 401 Unauthorized.

3 Two ways to order

There's only one endpoint. What it does depends on a single field — whether you include player_id or not:

POST /v1/order{ item, wallet, callback_url, metadata, player_id? }
Did the request include player_id?
🎟️ NO player_id

Normal Voucher Order

You get back a voucher code. The end user redeems it inside the game themselves.

player_id SENT

Auto Top-Up

Our system buys the voucher and redeems it straight into that Free Fire account. Nothing for the user to do.

↳ same endpoint · same auth · same status API for both
💡 Nothing else changes between the two modes — same headers, same item format, same way you check the result. The only difference is one optional field.

4 Place an order

POST https://api.gameflexbd.online/v1/order

This call always responds instantly — it never waits on the supplier. You get an order_id with status pending back immediately, and the real result arrives afterwards — see §6 and §7.

Request body — Normal Voucher Order

{
  "item": "80:1",
  "wallet": "bd",
  "callback_url": "https://yourdomain.com/webhook",
  "metadata": { "your_ref": "INV-1001" }
}

Request body — Auto Top-Up (add player_id)

{
  "item": "80:1",
  "wallet": "bd",
  "player_id": "12345678",
  "callback_url": "https://yourdomain.com/webhook",
  "metadata": { "your_ref": "INV-1001" }
}
FieldTypeRequiredNotes
itemstringFormat: uctype:qty — see below
walletstringbd, bd_baki, usd, or usd_baki
player_idstringoptionalPresent → Auto Top-Up. Absent → Normal Voucher Order
callback_urlstringoptionalFinal result gets POSTed here — see §7
metadataobjectoptionalYour own JSON, echoed back untouched in the status/callback response

The item format

uctype:qty (single package)
uctype:qty, uctype:qty (multiple packages, one order)

Example: "item": "80:2,160:1" orders 2× the 80 package and 1× the 160 package in a single call — one order_id, one final result for the whole basket.

Instant response — 200 OK

{
  "success": true,
  "order_id": "ORD123456",
  "status": "pending"
}
⚠️ pending only confirms the order was accepted — it is never the final result. Fetch the real outcome via §6 or §7.

5 Auto Top-Up fee

Sending player_id adds one small fee per order, on top of the voucher price:

WalletFee
bd / bd_baki৳0.50 BDT
usd / usd_baki$0.005 USD
  • The fee is folded into the total field of the final result.
  • If a voucher fails and gets refunded, the fee is not refunded.
  • Normal Voucher Orders have no fee at all — the fee only applies when player_id is sent.

6 Order status & final result

GET https://api.gameflexbd.online/v1/order/{order_id}

Poll this any time — e.g. if you didn't set a callback_url, or as a backup. Recommended interval: every 3 seconds.

Final response — success

{
  "status": "success",
  "orderid": "ORD123456",
  "player_id": "12345678",
  "player_name": "PlayerName",
  "wallet": "bd",
  "total": 100.50,
  "balance_after": 899.50,
  "due_after": 0.00,
  "fail_reason": null,
  "elapsed_sec": 34.7,
  "timestamp": "2026-07-24T10:00:00Z",
  "metadata": { "your_ref": "INV-1001" },
  "voucher_detail": {
    "api_status": "success",
    "items": [
      {
        "status": "success",
        "code": "BDMB-XXXXXXXX",
        "product": "80UC",
        "unit_price": 50.00,
        "fail_reason": ""
      }
    ],
    "summary": { "total": 1, "success": 1, "consumed": 0, "failed": 0 }
  }
}

On a Normal Voucher Order (no player_id), this same shape comes back — just without player_id/player_name. Read the code straight from voucher_detail.items[].code and hand it to your user to redeem.

Status values

statusMeaning
pendingStill processing — not final yet
successAll packages topped up / delivered successfully
partialSome packages succeeded, the rest were refunded
failedNo package succeeded

Voucher item status — inside voucher_detail.items[]

statusMeaning
successVoucher redeemed successfully
consumedThat specific code was already used previously
failedCould not redeem — see its own fail_reason

7 Callbacks (webhooks)

If you set callback_url, the API POSTs the exact same final-result payload shown in §6 to that URL automatically — no polling needed.

What your endpoint must do

  • Respond with any 2xx status code to acknowledge receipt.
  • Respond within ~10 seconds.
  • Anything else — timeout, non-2xx, connection error — is treated as failed delivery and retried.

Retry timeline (exponential backoff)

1
now
2
~2s
3
~4s
4
~8s
5
~16s
6
~32s

Up to 6 attempts, capped at 120s between attempts. After the last failed attempt, fall back to GET /v1/order/{order_id} to fetch the result directly.

💡 Make your callback handler idempotent — safe to receive the same orderid more than once.

8 Telegram notification

Whether the order finishes as Success, Partial, or Failed, the Telegram bot automatically sends you a notification with:

  • Order ID
  • Player ID & Player Name (Auto Top-Up only)
  • Order status
  • Package summary
  • Voucher status per item
  • Total amount & fee
  • Wallet balance before / after
  • Processing time

This is fully automatic — no setup needed on your end beyond having an API key tied to your Telegram account.

9 Errors & status codes

POST /v1/order only ever validates the request itself — it never returns the order's own success/failure (that comes later, via §6/§7). Error format:

{
  "success": false,
  "message": "Invalid wallet. Valid options: bd, bd_baki, usd, usd_baki"
}
StatusMeaning
400Missing/invalid field — bad item format, unknown uctype, qty out of range, bad wallet, invalid callback_url, malformed metadata, or invalid JSON body
401Missing or invalid API key
404(status-check only) order_id not found, or belongs to a different account
429Rate limit exceeded
500Internal server error — safe to retry

10 Code examples

Same request, three languages. Switch tabs below.

import time
import requests

API_KEY = "YOUR_API_KEY"
BASE_URL = "https://api.gameflexbd.online/v1"

headers = {
    "X-API-Key": API_KEY,
    "Content-Type": "application/json"
}

payload = {
    "item": "80:1",
    "wallet": "bd",
    "player_id": "12345678",          # remove this line for a Normal Voucher Order
    "callback_url": "https://yourdomain.com/webhook",
    "metadata": { "your_ref": "INV-1001" }
}

response = requests.post(f"{BASE_URL}/order", headers=headers, json=payload)
result = response.json()
print(result)

if result.get("success"):
    order_id = result["order_id"]

    while True:
        status = requests.get(f"{BASE_URL}/order/{order_id}", headers=headers).json()
        print(status["status"])

        if status["status"] in ["success", "partial", "failed"]:
            print(status)
            break

        time.sleep(3)

1. Place the order

curl -X POST https://api.gameflexbd.online/v1/order \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "item": "80:1",
    "wallet": "bd",
    "player_id": "12345678",
    "callback_url": "https://yourdomain.com/webhook"
  }'

2. Check status

curl -X GET https://api.gameflexbd.online/v1/order/ORD123456 \
  -H "X-API-Key: YOUR_API_KEY"

3. Or a multi-package Normal Voucher Order (no player_id)

curl -X POST https://api.gameflexbd.online/v1/order \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "item": "80:2,160:1",
    "wallet": "bd",
    "callback_url": "https://yourdomain.com/webhook"
  }'
import java.net.URI;
import java.net.http.*;
import java.time.Duration;

public class GameFlexOrder {
    static final String API_KEY = "YOUR_API_KEY";
    static final String BASE_URL = "https://api.gameflexbd.online/v1";

    public static void main(String[] args) throws Exception {
        HttpClient client = HttpClient.newHttpClient();

        String body = """
            {
              "item": "80:1",
              "wallet": "bd",
              "player_id": "12345678",
              "callback_url": "https://yourdomain.com/webhook",
              "metadata": {"your_ref": "INV-1001"}
            }""";

        HttpRequest placeOrder = HttpRequest.newBuilder()
            .uri(URI.create(BASE_URL + "/order"))
            .header("X-API-Key", API_KEY)
            .header("Content-Type", "application/json")
            .POST(HttpRequest.BodyPublishers.ofString(body))
            .build();

        HttpResponse<String> res = client.send(placeOrder, HttpResponse.BodyHandlers.ofString());
        System.out.println(res.body());  // { "success": true, "order_id": "...", "status": "pending" }

        // naive order_id extraction — use a real JSON library (Jackson / Gson) in production
        String orderId = res.body().split("\"order_id\":\"")[1].split("\"")[0];

        while (true) {
            HttpRequest poll = HttpRequest.newBuilder()
                .uri(URI.create(BASE_URL + "/order/" + orderId))
                .header("X-API-Key", API_KEY)
                .GET()
                .build();

            HttpResponse<String> status = client.send(poll, HttpResponse.BodyHandlers.ofString());
            System.out.println(status.body());

            if (status.body().contains("\"success\"") || status.body().contains("\"partial\"") || status.body().contains("\"failed\"")) {
                break;
            }
            Thread.sleep(Duration.ofSeconds(3).toMillis());
        }
    }
}
💡 The manual string-splitting above is just to keep the example dependency-free — in a real project, parse the JSON with Jackson or Gson instead.

11 After you place an order

Three ways to get the final result — use whichever fits your integration:

  • Callback — set callback_url and the result is POSTed to you automatically (see §7).
  • Status check — poll GET /v1/order/{order_id} (see §6).
  • Telegram — the bot also sends you the full result automatically (see §8), whether or not you set a callback.
💬 Questions or issues? Contact an admin via the Telegram bot.