1. Início
  2. API de pedidos

API de pedidos

Uma API REST para revendedores: lista de preços ao vivo, pedidos únicos e em lote, webhooks assinados e modo de teste grátis.

Documentação completa da API → Obter uma chave de API

Crie uma conta grátis e peça o acesso à API em Perfil → Acesso à API. Aprovamos após uma checagem rápida — isso protege todos os saldos. Depois da aprovação, você mesmo cria a sua chave. Já tem conta? Entrar →

A referência abaixo está em inglês para todos os idiomas.

Base URL
https://api.rechargegame.games
Full reference
api.rechargegame.games/docs — always current, also as plain text and OpenAPI
Auth
X-API-Key: gv_live_… on every request. Create, replace or revoke it yourself in the dashboard under Profile → API access (reseller accounts)
Format
JSON in, JSON out. HTTPS only.
Rate limit
60 order creations per minute per key; status reads are not limited

What the API does

  • Live price list — GET /v1/products returns every pack at your price, each with a product_key. Send that key with an order and you are charged exactly that price. Details →
  • Safe retries — send your own order ID as buyer_ref; sending it again returns the existing order, never a second one. Details →
  • Webhooks — we POST your server the moment an order is delivered or failed. Signed (Standard Webhooks) and retried for hours if your server is down. Set the address in Profile → Webhook. Details →
  • Batch orders — up to 25 orders in one call; each line succeeds or fails on its own. Details →
  • Look up many orders at once — by our order IDs or by yours, 100 per request. Details →
  • Free test mode — send "test": true: nothing is charged or delivered, and the order completes by itself after about 10 seconds and fires your webhook, so you can build the whole flow first. Details →
  • Prepaid USDT balance — top up your balance; each order is charged when it is placed and refunded if it fails. Details →
  • Protected from surprises — an order that has no price, or for a pack that is out of stock, is refused with a clear error. Nothing is created and nothing is charged.

How it works

  1. Your site reads GET /v1/products and shows the packs and prices.
  2. It POSTs an order with the product_key → we get an instant alert.
  3. The order is created as pending and you receive our order_id.
  4. We fulfil it, then mark it delivered or failed (a failed order is refunded to your balance).
  5. We push the result to your webhook — or your site reads the order_id and shows the live status.

Quick start

1. Verify your key

GET https://api.rechargegame.games/v1/ping
X-API-Key: gv_live_...
{ "ok": true, "buyer": "YourShopName" }

2. See what you can order

GET https://api.rechargegame.games/v1/products?game=free-fire
X-API-Key: gv_live_...
{ "currency": "USDT", "categories": [ { "slug": "free-fire", "name": "Free Fire", "kind": "topup",
  "groups": [ { "slug": "brazil", "products": [
    { "name": "100 Diamonds", "price": 0.94, "delivery": "player_id",
      "product_key": "topup/free-fire/brazil/100 Diamonds" } ] } ] } ] }

3. Submit an order

POST https://api.rechargegame.games/v1/orders
Content-Type: application/json
X-API-Key: gv_live_...

{
  "product": "Free Fire 100 Diamonds",
  "product_key": "topup/free-fire/brazil/100 Diamonds",
  "region": "Brazil",
  "quantity": 1,
  "player_id": "51234567",
  "buyer_ref": "SHOP-10231"
}
FieldRequiredNotes
productyesText describing the product. Max 500 chars.
product_keyrecommendedFrom GET /v1/products — fixes the price you are charged. Without a matching key or product text, the order is refused (422 unknown_product).
buyer_refrecommendedYour order ID — makes retries safe. Max 200.
regionnoe.g. EU, MENA, LATAM, Brazil. Max 100.
quantityno1–999, default 1.
player_idnoPlayer / account ID to top up. Max 200.
server_idnoServer or zone ID (required for Mobile Legends). Max 200.
notenoAny note for us. Max 1000.
extranoJSON object with any additional fields you want recorded.
testnotrue = free test order, nothing delivered.

Response 201 — the order, as pending:

{
  "order_id": "ORD-7K3M9Q",
  "buyer_ref": "SHOP-10231",
  "status": "pending",
  "product": "Free Fire 100 Diamonds",
  "region": "Brazil",
  "quantity": 1,
  "player_id": "51234567",
  "delivery_note": null,
  "failure_reason": null,
  "created_at": "2026-10-02T08:36:33.722773Z",
  "updated_at": "2026-10-02T08:36:33.722773Z"
}
Idempotent: sending the same buyer_ref again returns 200 with the existing order — no duplicate alert, no double fulfilment. Treat both 200 and 201 as success and retry freely on network errors.

4. Get told when it is done

Set your webhook address in the dashboard (Profile → Webhook). When an order becomes delivered or failed we POST it to you:

webhook-id: evt_3f9c...
webhook-timestamp: 1790925751
webhook-signature: v1,<base64 HMAC-SHA256>

{ "type": "order.delivered", "id": "evt_3f9c...", "created_at": "2026-10-02T08:42:31.5Z",
  "data": { ...the same JSON as GET /v1/orders/{order_id}... } }

Answer any 2xx within 10 seconds. Anything else is retried after 1 min, 5 min, 30 min, 2 h and 6 h. Keep a slow status check as a safety net: GET /v1/orders/ORD-7K3M9Q always tells the truth. How to verify the signature →

StatusMeaning
pendingReceived, not yet fulfilled.
deliveredFulfilled — check delivery_note for any code or confirmation.
failedCould not be fulfilled — see failure_reason. Refunded to your balance.

delivered and failed are final. If you poll instead of using a webhook, every 30–60 seconds is plenty. Listing: GET /v1/orders?status=pending, ?since=, ?limit=, ?ids=, ?buyer_ref=.

Errors

Every error, including validation errors, has one shape:

{ "error": { "code": "invalid_api_key", "message": "Invalid or disabled API key" } }
HTTPCodeMeaning
401missing_api_keyNo X-API-Key header sent.
401invalid_api_keyWrong key or disabled account.
403resellers_onlyThe API is for reseller accounts — contact us to be upgraded.
404not_foundOrder does not exist (or belongs to another buyer).
400invalid_statusBad status filter value.
422invalid_requestValidation error — the message names the field.
422unknown_productNo price found for that product. Nothing was created. Use a product_key from GET /v1/products.
409out_of_stockThat pack is out of stock right now. Nothing was created or charged — choose another pack or try later.
402insufficient_balanceBalance below the price. Nothing was created — load balance and retry with the same buyer_ref.
429rate_limitedMore than 60 orders/min — wait Retry-After seconds and retry.

The full list is in the error reference.

Conventions

  • HTTPS only — plain HTTP is not served.
  • No trailing slash — /v1/orders, not /v1/orders/ (the latter 307-redirects, which some clients mishandle on POST).
  • Timestamps are ISO 8601 UTC with microseconds, always ending in Z. Use a real ISO parser.
  • Timeouts: set ~20 s and retry with the same buyer_ref.

Security

  • Call the API from your server, never from a browser. Browser requests are blocked by design (no CORS) — a key in a browser is exposed to your own customers. Keep it in an environment variable.
  • If a key leaks, replace or revoke it yourself in Profile → API access (up to 3 changes per hour), or contact us.
  • Your key scopes every lookup to your own orders. Another buyer's order returns 404, not 403.

Examples

Python

import os, requests

API = "https://api.rechargegame.games"
KEY = os.environ["GV_API_KEY"]

def create_order(product_key, product, player_id, region, buyer_ref):
    r = requests.post(f"{API}/v1/orders", timeout=20,
        headers={"X-API-Key": KEY},
        json={"product_key": product_key, "product": product, "player_id": player_id,
              "region": region, "buyer_ref": buyer_ref})
    r.raise_for_status()          # 200 and 201 are both success
    return r.json()["order_id"]   # 409 out_of_stock / 422 unknown_product raise here

def status(order_id):
    r = requests.get(f"{API}/v1/orders/{order_id}", timeout=20,
        headers={"X-API-Key": KEY})
    r.raise_for_status()
    return r.json()["status"]     # pending | delivered | failed

Node.js

const API = "https://api.rechargegame.games";
const KEY = process.env.GV_API_KEY;

export async function createOrder(body) {
  // body: { product_key, product, player_id, region, buyer_ref }
  const r = await fetch(`${API}/v1/orders`, {
    method: "POST",
    headers: { "X-API-Key": KEY, "Content-Type": "application/json" },
    body: JSON.stringify(body),
  });
  if (!r.ok) throw new Error((await r.json()).error.message);
  return (await r.json()).order_id;
}

PHP

$ch = curl_init("https://api.rechargegame.games/v1/orders");
curl_setopt_array($ch, [
  CURLOPT_POST => true,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_TIMEOUT => 20,
  CURLOPT_HTTPHEADER => ["X-API-Key: " . getenv("GV_API_KEY"), "Content-Type: application/json"],
  CURLOPT_POSTFIELDS => json_encode([
    "product_key" => "topup/free-fire/brazil/100 Diamonds",
    "product" => "Free Fire 100 Diamonds", "region" => "Brazil",
    "player_id" => "51234567", "buyer_ref" => "SHOP-10231",
  ]),
]);
$order = json_decode(curl_exec($ch), true);

Documentação completa da API →

Dúvidas para conectar o seu site?

Uma API REST para revendedores: lista de preços ao vivo, pedidos únicos e em lote, webhooks assinados e modo de teste grátis.