Get the most exclusive deals Do you need website like this? Click Here!

Topup

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>GamesDrop API Tester</title>
  <style>
    body {
      font-family: Arial, sans-serif;
      background: #f7f9fc;
      color: #222;
      margin: 0;
      padding: 0;
    }
    header {
      background: #0057b7;
      color: white;
      text-align: center;
      padding: 1rem;
    }
    main {
      max-width: 800px;
      margin: 2rem auto;
      background: white;
      border-radius: 10px;
      padding: 2rem;
      box-shadow: 0 0 10px rgba(0,0,0,0.1);
    }
    h2 { color: #0057b7; }
    input, button, select {
      padding: 10px;
      margin: 5px 0;
      border: 1px solid #ccc;
      border-radius: 6px;
      width: 100%;
      font-size: 16px;
    }
    button {
      background: #0057b7;
      color: white;
      cursor: pointer;
      transition: background 0.3s;
    }
    button:hover {
      background: #003f88;
    }
    pre {
      background: #111;
      color: #0f0;
      padding: 1rem;
      border-radius: 8px;
      overflow-x: auto;
    }
    .section {
      margin-bottom: 2rem;
    }
  </style>
</head>
<body>
  <header>
    <h1>๐ŸŽฎ GamesDrop API Test Console</h1>
  </header>
  <main>
    <div class="section">
      <h2>๐Ÿ”‘ API Token</h2>
      <input id="token" type="text" placeholder="Enter your GamesDrop API token">
    </div>

    <div class="section">
      <h2>๐Ÿ’ฐ Check Balance</h2>
      <button onclick="checkBalance()">Check Balance</button>
    </div>

    <div class="section">
      <h2>๐Ÿ“ฆ Get Product Info</h2>
      <input id="offerId" type="number" placeholder="Enter Offer ID (e.g. 999)">
      <button onclick="getProductInfo()">Get Product Info</button>
    </div>

    <div class="section">
      <h2>๐Ÿงพ Create Test Order (Offer ID 999)</h2>
      <button onclick="createTestOrder()">Create Test Order</button>
    </div>

    <div class="section">
      <h2>๐Ÿง  API Response</h2>
      <pre id="response">No response yet...</pre>
    </div>
  </main>

  <script>
    const API_BASE = 'https://gamesdrop.io';

    async function checkBalance() {
      const token = document.getElementById('token').value.trim();
      if (!token) return alert("Please enter your API token first.");

      try {
        const res = await fetch(`${API_BASE}/api/v1/balance`, {
          headers: { Authorization: token }
        });
        const data = await res.json();
        showResponse(data);
      } catch (err) {
        showResponse({ error: err.message });
      }
    }

    async function getProductInfo() {
      const token = document.getElementById('token').value.trim();
      const offerId = document.getElementById('offerId').value.trim();
      if (!token || !offerId) return alert("Enter token and offer ID.");

      try {
        const res = await fetch(`${API_BASE}/api/v1/offers/find-one`, {
          method: 'POST',
          headers: {
            Authorization: token,
            'Content-Type': 'application/json'
          },
          body: JSON.stringify({ offerId: Number(offerId) })
        });
        const data = await res.json();
        showResponse(data);
      } catch (err) {
        showResponse({ error: err.message });
      }
    }

    async function createTestOrder() {
      const token = document.getElementById('token').value.trim();
      if (!token) return alert("Please enter your API token first.");

      try {
        const body = {
          offerId: 999,
          price: 23.09,
          transactionId: "test_" + Date.now(),
          customer: {
            email: "[email protected]",
            gameUserId: "123456789"
          }
        };

        const res = await fetch(`${API_BASE}/api/v1/offers/create-order`, {
          method: 'POST',
          headers: {
            Authorization: token,
            'Content-Type': 'application/json'
          },
          body: JSON.stringify(body)
        });

        const data = await res.json();
        showResponse(data);
      } catch (err) {
        showResponse({ error: err.message });
      }
    }

    function showResponse(data) {
      document.getElementById('response').textContent = JSON.stringify(data, null, 2);
    }
  </script>
</body>
</html>
Variyo Shop
Logo
Shopping cart