getTopupOrder
Last Updated 11th May, 2025
The getTopupOrder
query retrieves detailed information about a specific top-up order, only if it belongs to the authenticated user.
🔗 Endpoint
URL: https://api.vscgames.com/graphql
Method: POST
Content-Type: application/json
🔍 Query Structure
query getTopupOrder($orderId: String!) {
getTopupOrder(orderId: $orderId) {
orderId
playerID
player_name
productId
name
amount
status
timestamp
}
}
📥 Parameters
Name
Type
Required
Description
orderId
String
✅ Yes
The unique ID of the top-up order
📥 Headers
Header
Required
Description
apikey
✅ Yes
API key of the user
✅ Successful Response
{
"data": {
"getTopupOrder": {
"orderId": "ORD123456",
"playerID": "2265245647",
"player_name": "JJ_MUCH",
"productId": "abc123",
"name": "Free Fire 110 Diamonds",
"amount": 1.66,
"status": "successful",
"timestamp": "2025-05-11T15:30:00Z"
}
}
}
🚫 Error Responses
Message
Reason
API key required
apikey
header was missing
Invalid API key
API key not linked to any user
Order not found
No matching record found in transactions
Unauthorized: Order does not belong to user
Order belongs to a different account
🧪 Code Examples
Python
import requests
url = "https://api.vscgames.com/graphql"
headers = {
"Content-Type": "application/json",
"apikey": "YOUR_API_KEY"
}
query = """
query getTopupOrder($orderId: String!) {
getTopupOrder(orderId: $orderId) {
orderId
playerID
player_name
productId
name
amount
status
timestamp
}
}
"""
variables = { "orderId": "ORD123456" }
response = requests.post(url, json={"query": query, "variables": variables}, headers=headers)
print(response.json())
JavaScript
const fetch = require("node-fetch");
const query = `
query getTopupOrder($orderId: String!) {
getTopupOrder(orderId: $orderId) {
orderId
playerID
player_name
productId
name
amount
status
timestamp
}
}`;
const variables = { orderId: "ORD123456" };
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