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

FreeFireMerchantTopup

Last Updated 11th May, 2025

PreviousDeltaForceTopupOrderNextDeltaForceMerchantTopupOrder

Last updated 23 days ago

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.

💡 Merchant accounts benefit from discounted pricing — products are charged at 80% of the usual retail price.

🔗 Endpoint URL: 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));
https://api.vscgames.com/graphql