Midasbuy System — API documentation

Use this page to integrate your app or website with Midasbuy System. Send POST requests with JSON bodies as described below. You receive a client API key from the operator.

API endpoint

This value is generated from the current site (protocol, host, and folder). After you upload to your server, open this page again — URLs will match your domain automatically. If your host uses a reverse proxy and links are wrong, set the environment variable PUBLIC_BASE_URL (e.g. https://example.com/myapp). Avoid exposing the client key in public front-end code when possible — prefer a backend that adds the header.

https://www.weecard.almirsystem.cloud/gateway.php

Authentication & headers

HeaderValue
Content-Type application/json
X-Api-Key required Client key issued to you (format like gw_...)

Method & path

Full URL example: https://www.weecard.almirsystem.cloud/gateway.php?action=getPlayer

Actions

getPlayer — player info

Body (JSON):

{"player_id": 555555555}

checkCode — UC code status

{"uc_code": "YOUR_CODE"}

activate — redeem code for a player

{"player_id": 555555555, "uc_code": "YOUR_CODE"}

bulkActivate — redeem up to 5 codes

Each code counts as one operation against the client’s daily quota.

{"player_id": 555555555, "uc_codes": ["CODE1", "CODE2"]}

Common HTTP status codes

HTTPMeaning
200Request executed; check success and data in the JSON from the upstream service
400Unknown action or invalid body
401Missing or invalid client API key
403Client account disabled
405Use POST only
429Daily limit exceeded (per client or global cap)
502Upstream connection failed
503Midasbuy System is not installed or not configured on this server

Example: JavaScript (fetch)

const url = "https://www.weecard.almirsystem.cloud/gateway.php?action=getPlayer";
const res = await fetch(url, {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "X-Api-Key": "YOUR_CLIENT_KEY"
  },
  body: JSON.stringify({ player_id: 555555555 })
});
const data = await res.json();

Example: cURL (Windows)

curl -X POST "https://www.weecard.almirsystem.cloud/gateway.php?action=getPlayer" ^
  -H "Content-Type: application/json" ^
  -H "X-Api-Key: YOUR_CLIENT_KEY" ^
  -d "{\"player_id\":555555555}"

On Linux/mac, use \ for line continuation instead of ^.