GPDS Partner APIDocs
B2B · Prepaid wallet · REST/JSON

GPDS Partner API

Sell GPDS Game Shop top-ups, vouchers and digital codes from your own platform. Orders are paid from your prepaid GPDS wallet and fulfilled automatically; you get the result by callback or by polling.

API root https://admin.gpdsgameshop.com/api Auth Partner key Format JSON over HTTPS Endpoints 6 + 1 callback

Getting Started #

The Partner API is for approved resellers and platforms. Every request is made server-to-server with your secret partner key. Never call it from a browser or a mobile app.

  1. Get onboarded. GPDS creates your reseller account, gives you a partner key, and registers your HTTPS callback URL and callback secret.
  2. Fund your wallet. Orders are paid from your prepaid GPDS balance. Check it with Wallet Balance.
  3. Load the catalogue. List Products, then their Denominations (the purchasable items and your price).
  4. Place orders. POST an order with your own unique partner_ref. Your wallet is charged and fulfillment starts immediately.
  5. Get the result. Receive a signed callback when the order succeeds or fails, or poll Check Order.

Authentication #

Send your partner key in the Authorization header on every request. The raw key is the original format and keeps working.

Headers
Authorization: YOUR_PARTNER_KEY
Accept: application/json
Content-Type: application/json

Next release Authorization: Bearer YOUR_PARTNER_KEY is also accepted.

SituationHTTPMessage
No header400Missing token!
Unknown or revoked key400Invalid credentials!
Account suspended Next release403Your account has been banned

Your partner key can spend your wallet. Keep it in a server-side secret store, never in client code, logs, tickets or chat. If it leaks, ask GPDS to rotate it immediately; the old key stops working at once.

Responses & Envelope #

Successful calls return HTTP 200 with the data in payload:

200 OK
{
  "method": "GET",
  "code": 200,
  "message": "data successfully retrieved",
  "payload": { }
}

Business errors (bad key, not enough balance, inactive item…) return HTTP 400 (or 403) with a readable message and no payload. Input validation errors return HTTP 422:

422 Unprocessable Entity
{
  "success": false,
  "message": "Validation failed",
  "errors": {
    "qty": ["The qty field must be at least 1."]
  }
}

Always branch on the HTTP status. Treat anything other than 200 as "not done", and read message / errors for the reason.

Rate Limits #

ScopeLimit
POST /partner/order15 requests per minute per partner
All API calls180 requests per minute

Over the limit you get HTTP 429. Back off and retry later; repeat an order with the same partner_ref so it can never be charged twice. Cache the catalogue instead of loading it before every order.

Products #

Lists active products (games and services). Each product has denominations you can buy.

GET/api/partner/product

Query parameters

NameTypeDescription
category optionalstringOnly products in this category name.
exclude_category optionalstringComma-separated category names to leave out.
name optionalstringName contains this text.
limit optionalintegerMaximum number of products.
curl -s "https://admin.gpdsgameshop.com/api/partner/product?name=Mobile%20Legends" \
  -H "Authorization: $GPDS_PARTNER_KEY" \
  -H "Accept: application/json"

Use id to load denominations. Additional fields may appear; ignore fields you don't use.

Product Denominations #

Lists the purchasable items of one product at your reseller price, with stock and the account fields the order needs.

GET/api/partner/product-item/{productId}
curl -s "https://admin.gpdsgameshop.com/api/partner/product-item/12" \
  -H "Authorization: $GPDS_PARTNER_KEY" \
  -H "Accept: application/json"
FieldDescription
codeThe item id. Send it as item_code when ordering.
priceYour unit price in the shop base currency, as a formatted string (e.g. "1,250.00"). Strip thousands separators before parsing.
stockRemaining stock, or "∞" for unlimited. Items with zero stock are not listed.
input_formatThe customer-account fields this product needs (e.g. user id, zone id).

payload may be a JSON list or an object keyed by position. Iterate its values (e.g. Object.values(payload)) rather than relying on array indexes.

Wallet Balance #

Returns your current prepaid balance converted to the requested currency at the current GPDS exchange rate.

GET/api/partner/balance?currency_code=PHP
NameTypeDescription
currency_code requiredstringThree uppercase letters, e.g. PHP, USD.
curl -s "https://admin.gpdsgameshop.com/api/partner/balance?currency_code=PHP" \
  -H "Authorization: $GPDS_PARTNER_KEY" \
  -H "Accept: application/json"

The balance can only be changed by GPDS (top-ups) and by your orders. There is no API to add funds.

Place Order #

Creates an order, charges your wallet and starts fulfillment. Payment is always your GPDS wallet. The price is always taken from GPDS, never from the request.

POST/api/partner/order

Body (JSON)

FieldTypeDescription
partner_ref requiredstringYour unique reference (invoice or transaction id). A repeat with the same value never creates a second order — see Idempotency.
item_code requiredstring / integerThe denomination code.
cust_account requiredobjectThe player account fields from input_format, e.g. {"user_id":"123456","zone_id":"7890"}. Up to 10 fields, 255 characters each.
qty requiredintegerQuantity, at least 1.
cust_phone_number optionalstringCustomer phone, when the product needs it.

Try it — request builder

Fill in the fields to generate a request you can run from your own server. Nothing is sent from this page and no key is stored.

Generated request

Response

200 OK
{
  "method": "POST",
  "code": 200,
  "message": "data successfully retrieved",
  "payload": {
    "id": 99102,
    "code": "GPDS251128A1B2C",
    "created_at": "28 Nov 2026 14:05:11",
    "item": { "id": 845, "name": "Mobile Legends - 86 Diamonds" },
    "cust_account": { "user_id": "123456", "zone_id": "7890" },
    "status": "on-process",
    "qty": 1,
    "price": 93.5,
    "discount_price": 0,
    "admin_fee": 0,
    "total_price": 93.5,
    "payment_code": null,
    "expired_at": "2026-11-28 15:05:11",
    "note": null
  }
}

Store the GPDS code with your partner_ref. The order is usually still on-process when the call returns; the final result arrives by callback.

Idempotency & retries

If you send a partner_ref you have already used, no new order is created and nothing is charged. You get HTTP 422 with the existing GPDS order code:

422 — duplicate partner_ref
{
  "success": false,
  "message": "Validation failed",
  "errors": {
    "status": [false],
    "message": ["transaction.trx_exist"],
    "exist_code": ["GPDS251128A1B2C"]
  }
}

On a timeout or network error, retry with the same partner_ref. If you get exist_code, the first attempt went through — look it up with Check Order. Never generate a new partner_ref for a retry.

Common order errors

HTTPMessageWhat to do
400Your balance is not enoughTop up your GPDS wallet. Nothing was charged.
400Invalid product item, item not activeReload denominations; the item was disabled.
400Product stock was emptyItem is out of stock.
422errors.cust_accountMissing or invalid player account fields, or the player id was not found.
429—Rate limit; retry later with the same partner_ref.

Check Order #

Returns one of your orders by its GPDS code. You can only read your own orders.

GET/api/partner/order/{code}
cURL
curl -s "https://admin.gpdsgameshop.com/api/partner/order/GPDS251128A1B2C" \
  -H "Authorization: $GPDS_PARTNER_KEY" \
  -H "Accept: application/json"

The response has the same fields as Place Order. An unknown code — or another partner's — returns HTTP 400. Poll no more than once every 30 seconds per order; prefer callbacks.

Partner Statistics #

Your sales summary: balance, this month vs last month, today, all time, orders by status, the last 7 days and recent orders.

GET/api/partner/stats?month=11&year=2026
NameTypeDescription
month optionalinteger 1–12Defaults to the current month.
year optionalintegerDefaults to the current year.
Response (abridged)
{
  "code": 200,
  "payload": {
    "balance": 15230.5,
    "month": 11,
    "year": 2026,
    "this_month": { "orders": 412, "turnover": 38410.0, "gross_profit": 2210.4, "gateway_fees": 0, "vat_on_fees": 0, "net_profit": 2210.4 },
    "last_month": { "orders": 389, "turnover": 35120.0, "net_profit": 1980.1 },
    "all_time":   { "orders": 5120, "turnover": 480200.0, "gross_profit": 27100.2, "net_profit": 27100.2 },
    "today":      { "orders": 14, "turnover": 1290.0, "gross_profit": 71.3, "gateway_fees": 0, "vat_on_fees": 0, "net_profit": 71.3 },
    "changes": { "orders": 5.9, "turnover": 9.4, "profit": 11.6 },
    "orders_by_status": { "total": 412, "success": 405, "failed": 4, "expired": 0, "pending": 3 },
    "weekly": [ { "day": "Fri", "date": "Nov 27", "turnover": 1510.0, "profit": 80.2, "orders": 17 } ],
    "recent_orders": [ { "code": "GPDS251128A1B2C", "status": "success", "turnover": 93.5, "profit": 4.1, "product": "Mobile Legends", "created_at": "Nov 28, 2026 14:05" } ]
  }
}

Order Statuses #

StatusFinal?Meaning
on-processNoPaid from your wallet; fulfillment running.
delayNoThe supplier is slow or returned an error. GPDS staff complete it or refund it. Your wallet stays charged until then.
successYesDelivered. sn in the callback may hold a serial or voucher code.
failedYesNot delivered. The order amount is returned to your wallet (automatically for most products, otherwise by GPDS staff).
refundedYesRefunded to your wallet by GPDS.

Callbacks are sent for success and failed. For anything else, poll Check Order.

Order Status Callback #

When one of your orders becomes success or failed, GPDS sends a POST to your registered callback URL.

GPDS → your server
POST https://your-domain.example/gpds/callback
Content-Type: application/json
Authorization: Bearer YOUR_CALLBACK_SECRET
X-GPDS-Event-Id: 5b1f0d2e-8a3c-4c43-9f43-2a9c8b0f6c11
X-GPDS-Timestamp: 1795867511
X-GPDS-Signature: sha256=2f1c…e9a0

{
  "name": "Your Shop Name",
  "code": "GPDS251128A1B2C",
  "partner_ref_id": "INV-10001",
  "status": "success",
  "cust_account": "{\"user_id\":\"123456\",\"zone_id\":\"7890\"}",
  "item": "Mobile Legends - 86 Diamonds",
  "description": null,
  "sn": "SN-0099-ABC",
  "price": 93.5
}
FieldDescription
codeGPDS order code.
partner_ref_idYour partner_ref.
statussuccess or failed.
snSerial / voucher / provider reference, when available.
cust_accountThe account fields, as a JSON string.
priceUnit price charged.

Your endpoint must

  • Use HTTPS.
  • Answer 2xx within 10 seconds. Do heavy work after responding.
  • Be idempotent: the same event can arrive more than once. De-duplicate on X-GPDS-Event-Id, or on partner_ref_id + status.
  • Verify the sender (below) before trusting the body. If unsure, confirm with Check Order.

Verifying Signatures Next release #

Every callback carries X-GPDS-Timestamp and X-GPDS-Signature. The signature is an HMAC-SHA256 of "{timestamp}.{raw request body}", keyed with your callback secret, hex-encoded and prefixed with sha256=.

  1. Read the raw body bytes before any JSON parsing.
  2. Reject the request if the timestamp is more than 5 minutes from your clock (stops replays).
  3. Compute the HMAC and compare it to the header with a constant-time comparison.
  4. Reject event ids you have already processed.
<?php
// Laravel-free, plain PHP 8
$secret    = getenv('GPDS_CALLBACK_SECRET');
$raw       = file_get_contents('php://input');
$timestamp = $_SERVER['HTTP_X_GPDS_TIMESTAMP'] ?? '';
$signature = $_SERVER['HTTP_X_GPDS_SIGNATURE'] ?? '';

$fresh    = ctype_digit($timestamp) && abs(time() - (int) $timestamp) <= 300;
$expected = 'sha256=' . hash_hmac('sha256', $timestamp . '.' . $raw, $secret);

if (!$fresh || !hash_equals($expected, $signature)) {
    http_response_code(401);
    exit;
}

$event = json_decode($raw, true, 512, JSON_THROW_ON_ERROR);
// TODO: skip if $_SERVER['HTTP_X_GPDS_EVENT_ID'] was already processed
// TODO: update your order where partner_ref = $event['partner_ref_id']
http_response_code(200);
echo 'ok';

Until the signature headers are live, verify the Authorization: Bearer callback secret with a constant-time comparison, and confirm the status with Check Order before releasing goods. Both checks keep working after the release.

Error Codes #

HTTPMeaningRetry?
200Success — read payload.—
400Business rule or authentication error. See message.Only after fixing the cause.
403Account suspended.No — contact GPDS.
404Wrong path.No.
422Validation failed, or duplicate partner_ref (errors.exist_code).Fix the input. For duplicates, look up the existing order.
429Rate limit.Yes, after a pause, same partner_ref.
500 / 502 / 503Temporary GPDS problem.Yes, with backoff, same partner_ref. Check the order before retrying.

Sandbox Testing #

Real orders on the live API charge your wallet and deliver real products. To build and test your integration:

  • Ask GPDS for staging access: a staging API root, a test partner key and a test wallet. Staging orders never buy real products.
  • Use a separate callback URL for staging, and keep staging and live keys apart.
  • On live, start with a single low-value order and confirm the callback, the wallet debit and your records before going to volume.
  • The request builder on this page only generates code. It never sends requests and never asks for your key.

Integration Examples #

Minimal clients with timeouts, safe retries and secrets read from the environment.

<?php
final class GpdsPartnerClient
{
    private const BASE = 'https://admin.gpdsgameshop.com/api/partner';

    public function __construct(private string $key) {}

    public static function fromEnv(): self
    {
        return new self((string) getenv('GPDS_PARTNER_KEY'));
    }

    public function balance(string $currency = 'PHP'): float
    {
        return (float) $this->call('GET', '/balance?currency_code=' . urlencode($currency));
    }

    public function items(int $productId): array
    {
        return array_values((array) $this->call('GET', '/product-item/' . $productId));
    }

    /** Safe to retry with the same $partnerRef: never creates a second order. */
    public function order(string $partnerRef, int $itemCode, array $account, int $qty = 1): array
    {
        return (array) $this->call('POST', '/order', [
            'partner_ref'  => $partnerRef,
            'item_code'    => $itemCode,
            'cust_account' => $account,
            'qty'          => $qty,
        ]);
    }

    public function find(string $code): array
    {
        return (array) $this->call('GET', '/order/' . rawurlencode($code));
    }

    private function call(string $method, string $path, ?array $body = null): mixed
    {
        $ch = curl_init(self::BASE . $path);
        curl_setopt_array($ch, [
            CURLOPT_CUSTOMREQUEST  => $method,
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_CONNECTTIMEOUT => 5,
            CURLOPT_TIMEOUT        => 30,
            CURLOPT_HTTPHEADER     => [
                'Authorization: ' . $this->key,
                'Accept: application/json',
                'Content-Type: application/json',
            ],
            CURLOPT_POSTFIELDS     => $body === null ? null : json_encode($body, JSON_THROW_ON_ERROR),
        ]);
        $raw    = curl_exec($ch);
        $status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
        $error  = curl_error($ch);
        curl_close($ch);

        if ($raw === false) {
            throw new RuntimeException('GPDS network error: ' . $error); // retry with the same partner_ref
        }
        $json = json_decode($raw, true) ?? [];
        if ($status !== 200) {
            throw new RuntimeException('GPDS ' . $status . ': ' . ($json['message'] ?? 'error'), $status);
        }
        return $json['payload'] ?? null;
    }
}

// $gpds = GpdsPartnerClient::fromEnv();
// $order = $gpds->order('INV-10001', 845, ['user_id' => '123456', 'zone_id' => '7890']);

Security Guidelines #

  • Server-side only. Call the API from your backend. Never put the partner key in a website, app, or public repository.
  • Store secrets properly. Keep the partner key and callback secret in environment variables or a secret manager; redact the Authorization header in logs.
  • Rotate on suspicion. If a key may have leaked, ask GPDS to rotate it. The old key stops working immediately.
  • Unique partner_ref per sale and the same value on every retry — this is what protects you from double charges.
  • Verify every callback (signature or secret, plus timestamp) and treat it as a hint you can confirm with Check Order.
  • Validate player input on your side before ordering, and keep cust_account to the fields in input_format.
  • Watch your wallet. Alert yourself on unusual spend and keep only the balance you need.
  • HTTPS everywhere. Your callback URL must be HTTPS. GPDS only serves the API over HTTPS.
  • Report issues privately to GPDS support. Do not test against the live API with real wallets beyond normal orders.

Changelog #

Next release — security update Rolling out

  • Callbacks are signed: X-GPDS-Event-Id, X-GPDS-Timestamp, X-GPDS-Signature. Payload and Authorization: Bearer header unchanged.
  • Callbacks have a 10-second timeout and are retried once.
  • Duplicate partner_ref protection is per partner and safe under concurrent requests.
  • Wallet is charged before fulfillment starts; a supplier error leaves the order in delay (never lost).
  • Suspended accounts receive HTTP 403.
  • Authorization: Bearer <key> accepted alongside the raw key.
  • New partner keys and callback secrets are at least 32 characters; new callback URLs must be HTTPS.

2026-11 — Documentation portal

  • New developer documentation with request builder, PHP / Node.js / TypeScript examples and signature verification guide.