getUserOrders

Last Updated 11th May, 2025

The getUserOrders query returns a list of all orders placed by an authenticated user, sorted from newest to oldest.


🔗 Endpoint

URL: https://api.vscgames.com/graphql Method: POST Content-Type: application/json


🔍 Query Structure

query {
  getUserOrders {
    orderId
    productId
    name
    amount
    quantity
    playerID
    player_name
    status
    ordertime
    date
  }
}

📥 Headers

Header
Required
Description

apikey

✅ Yes

API key of the user


✅ Successful Response

{
  "data": {
    "getUserOrders": [
      {
        "orderId": "ORD123456",
        "productId": "abc123",
        "name": "Free Fire 110 Diamonds",
        "amount": 1.66,
        "quantity": 1,
        "playerID": "2265245647",
        "player_name": "JJ_MUCH",
        "status": "successful",
        "ordertime": "2025-05-11T15:30:00Z",
        "date": "2025-05-11T15:30:00Z"
      },
      ...
    ]
  }
}

🚫 Error Responses

Message
Reason

API key required

apikey header is missing

Invalid API key

API key does not match any user


🧪 Code Examples

Python

import requests

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

query = """
query {
  getUserOrders {
    orderId
    productId
    name
    amount
    quantity
    playerID
    player_name
    status
    ordertime
    date
  }
}
"""

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

JavaScript

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

const query = `
query {
  getUserOrders {
    orderId
    productId
    name
    amount
    quantity
    playerID
    player_name
    status
    ordertime
    date
  }
}`;

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

Last updated