FreeFireMerchantTopup

Last Updated 11th May, 2025

The FreeFireMerchantTopup mutation allows merchant clients to top up Free Fire Diamonds using their merchant key. It deducts the merchant's balance and query count, validates the product, and logs the transaction.

πŸ”— Endpoint URL: https://api.vscgames.com/graphql Method: POST Content-Type: application/json

πŸ“Ž Mutation Structure

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

πŸ“… Parameters

Name
Type
Required
Description

productId

String

Yes

ID of the Free Fire top-up product

playerID

String

Yes

Player ID to receive the top-up

βœ… Successful Response

{
  "data": {
    "FreeFireMerchantTopup": {
      "code": 200,
      "message": "Top-up placed successfully",
      "orderId": "FFM123456",
      "playerID": "2265245647",
      "player_name": "JJ_MUCH",
      "productId": "1",
      "name": "Free Fire 110 Diamonds",
      "amount": 1.28,
      "status": "pending",
      "timestamp": "2025-05-11T12:00:00Z"
    }
  }
}

🚫 Error Codes

Code
Message
Meaning

401

Merchant key required

Missing or invalid merchant header

403

Invalid merchant key

Merchant not found

402

Insufficient merchant query balance

Merchant has 0 remaining query credits

404

Top-up product not found

The product ID is not valid

503

Topup failed

Internal operation failed to process

500

Transaction not found

No record matched after placement

πŸ”ͺ Code Examples Python

import requests

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

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

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

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

JavaScript

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

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

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

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

Last updated