vscgames
  • Welcome
  • Getting Started
    • CreateAPIKey
    • CreateMerchantKey
  • Products
  • Mutations
    • buyVoucher
    • FreeFireTopupOrder
    • DeltaForceTopupOrder
    • FreeFireMerchantTopup
    • DeltaForceMerchantTopupOrder
  • Queries
    • getProductsByCategory
    • getProductById
    • getOrderById
    • getUserOrders
    • getTopupsProducts
    • getTopupProduct
    • getPlayerDetails
    • getTopupOrder
    • getUserTopupOrders
  • REST API
    • COMING soon
  • CONTACT
    • Support
Powered by GitBook
On this page
  1. Mutations

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));
PreviousbuyVoucherNextDeltaForceTopupOrder

Last updated 23 days ago