FreeFireTopupOrder

Last Updated 11th May, 2025

The FreeFireTopupOrder mutation lets your app users directly top up Free Fire Diamonds via the official vscgames API. It deducts user balance, sends a top-up request, and logs the transaction.


🔗 Endpoint

  • URL: https://api.vscgames.com/graphql

  • Method: POST

  • Content-Type: application/json


🧾 Mutation Structure

mutation FreeFireTopupOrder($productId: Int!, $playerID: String!) {
  FreeFireTopupOrder(productId: $productId, playerID: $playerID) {
    code
    message
    orderId
    playerID
    player_name
    productId
    name
    amount
    status
    timestamp
  }
}

📥 Parameters

Name
Type
Required
Description

productId

Int

Product ID from Topup database

playerID

String

Free Fire player UID


✅ Successful Response

{
  "data": {
    "FreeFireTopupOrder": {
      "code": 200,
      "message": "Top-up placed successfully",
      "orderId": "4521",
      "playerID": "2265245647",
      "player_name": "JJ_MUCH",
      "productId": 1,
      "name": "Free Fire 110 Diamonds",
      "amount": 1.66,
      "status": "pending",
      "timestamp": "2025-05-10T12:34:56.123Z"
    }
  }
}

🚫 Error Codes

Code
Message

401

API key required

403

Invalid API key

404

Top-up product not found

402

Insufficient balance

503

Topup API server error. Try again later

500

Transaction not found after placing order


🧪 Code Examples

Python

import requests

url = "https://api.vscgames.com/graphql"
headers = {"Content-Type": "application/json", "apikey": "YOUR_API_KEY"}

query = """
mutation FreeFireTopupOrder($productId: Int!, $playerID: String!) {
  FreeFireTopupOrder(productId: $productId, playerID: $playerID) {
    code
    message
    orderId
    playerID
    player_name
    productId
    name
    amount
    status
    timestamp
  }
}
"""

variables = {
  "productId": 1,
  "playerID": "2255245647"
}

response = requests.post(url, json={"query": query, "variables": variables}, headers=headers)
print(response.json())

JavaScript

const fetch = require("node-fetch");

const query = `
mutation FreeFireTopupOrder($productId: Int!, $playerID: String!) {
  FreeFireTopupOrder(productId: $productId, playerID: $playerID) {
    code
    message
    orderId
    playerID
    player_name
    productId
    name
    amount
    status
    timestamp
  }
}`;

const variables = {
  productId: 1,
  playerID: "2255245647"
};

fetch("https://api.vscgames.com/graphql", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "apikey": "YOUR_API_KEY"
  },
  body: JSON.stringify({ query, variables })
})
  .then(res => res.json())
  .then(data => console.log(data));

Last updated