Developers · v1

Reseller API

Sell AnaJak Store game top-ups from your own website, app or Telegram bot. Orders are paid from your balance at reseller prices and delivered automatically.

Base URL https://api.anajak-store.com/v1
Log in to get a key The API is for reseller accounts.

Getting started

  1. 1
    Get a reseller account. Ask us to make your account a reseller account. Resellers see reseller prices on the whole site and in the API.
  2. 2
    Create an API key in My account › Reseller API, and add your server's IP to the whitelist.
  3. 3
    Add balance with a deposit. Every API order is paid from your balance.
  4. 4
    Call the API: list products with /service, order with /order, follow it with /status or a webhook.

Authentication

Send your API key with every request. The X-API-Key header is recommended. Authorization: Bearer <key> and an api_key field in the body also work.

Request bodies can be JSON (Content-Type: application/json) or form fields. All endpoints accept POST; /service, /status and /balance also accept GET with query parameters.

curl -X POST https://api.anajak-store.com/v1/balance \
  -H "X-API-Key: YOUR_API_KEY"
Keep your key on your server. Never put it in browser JavaScript or a mobile app. Turn on the IP whitelist, and press Regenerate right away if the key leaks.

Responses & errors

Every response is JSON with the same shape. Check status first.

// success (HTTP 200)
{
  "status": true,
  "msg": "Success",
  "data": { ... }
}
// error (HTTP 4xx / 5xx)
{
  "status": false,
  "code": "insufficient_balance",
  "msg": "Insufficient balance. Required: $1.50, available: $0.20",
  "data": []
}
HTTPcodeMeaning
401missing_api_keyNo key sent.
401invalid_api_keyWrong, regenerated or revoked key.
403not_resellerThe account is not a reseller account.
403ip_not_allowedYour server's IP is not in the key's whitelist. The message shows the IP we saw.
422missing_field, invalid_idtrx, invalid_target, invalid_callback, ambiguous_productA parameter is missing or wrong. Read msg.
422service_unavailableThis product can't be delivered right now. Try later or another product.
402insufficient_balanceNot enough balance. Nothing was charged.
404service_not_found, order_not_foundUnknown or inactive product, or an order that isn't yours.
409duplicate_idtrxThis idtrx was already used. Nothing was charged.
429rate_limitedToo many requests. See rate limits.
502dispatch_failedThe supplier refused the order. Your balance was refunded.
POST/service

List games, products and Premium Accounts

Everything you can sell: all games with their products, and all Premium Accounts with their plans. Each game, product and plan comes with our image (full https URLs you can show in your shop) and your price (reseller_price, USD). Cache it for a few minutes instead of calling it before every order.

ParameterTypeDescription
typestringoptionalall (default), game or premium.
gamecodestringoptionalOnly one game, e.g. mobilelegend (the game's code, or the slug from its page URL such as mlbb-kh). premium = only Premium Accounts.
curl -X POST https://api.anajak-store.com/v1/service \
  -H "X-API-Key: YOUR_API_KEY" \
  -d "gamecode=mlbb-kh"

Response

{
  "status": true,
  "msg": "Successfully retrieved service data",
  "data": {
    "games": [
      {
        "gamecode": "mobilelegend",
        "slug": "mlbb-kh",
        "name": "MLBB KH",
        "image": "https://anajak-store.com/uploads/games/custom-mlbb-kh.webp",
        "url": "https://anajak-store.com/game/mlbb-kh",
        "requires_zone": true,
        "products": [
          {
            "productscode": "2794",
            "service_name": "86 Diamonds",
            "image": "https://anajak-store.com/uploads/pkg-icons/6179f4419b383dc563d9.png",
            "price": 1.45,
            "reseller_price": 1.38,
            "needs_target": true,
            "status": "active"
          }
        ]
      }
    ],
    "premium": [
      {
        "gamecode": "premium",
        "slug": "canva-pro",
        "name": "Canva Pro",
        "category": "Design",
        "image": "https://anajak-store.com/uploads/premium/products/d8mlprmhw2v6vexuei0upn11hilk1zn1fvqfhrht.webp",
        "url": "https://anajak-store.com/premium/canva-pro",
        "description": "Canva Pro",
        "products": [
          {
            "productscode": "premium-1",
            "service_name": "Canva Pro - 1Years",
            "duration": null,
            "image": "https://anajak-store.com/uploads/premium/products/d8mlprmhw2v6vexuei0upn11hilk1zn1fvqfhrht.webp",
            "price": 3.85,
            "reseller_price": 3.85,
            "needs_target": false,
            "requires_email": true,
            "stock": "In stock",
            "status": "active"
          }
        ]
      }
    ],
    "counts": { "games": 1, "game_products": 1, "premium": 1, "premium_products": 1 }
  }
}
image
Our picture for the game, product or plan. Always a full https URL (or null).
price
Normal shop price.
reseller_price
What an order costs you.
requires_zone
The game needs a zone/server: send target as ID|Zone.
needs_target
false for products that need no player ID (ROS invite passes, which return a license_code, and all Premium Accounts).
requires_email
Premium plan that is activated on the customer's email: send email with the order.
POST/order

Place an order

Charges reseller_price to your balance and sends the top-up to the player, or buys the Premium Account plan. If the supplier refuses the order straight away, the money goes back to your balance at once.

ParameterTypeDescription
productscodestringrequiredFrom /service, e.g. 2794, or premium-1 for a Premium Account plan.
gamecodestringrequiredFrom /service (premium for Premium Accounts). Product codes are only unique inside a game.
targetstringrequired*Player ID. For games with requires_zone use ID|Zone, e.g. 12345678|2001. *Not needed when needs_target is false.
emailstringpremium*The customer's email. *Required for Premium plans with requires_email.
idtrxstringoptionalYour own unique order ID (letters, digits, . _ -, max 64). Strongly recommended: if your request times out, retry with the same idtrx and you will get duplicate_idtrx instead of a second charge. Generated for you when left out.
callbackURLoptionalPublic http(s) URL that receives a webhook when the order finishes.
contactstringoptionalYour customer's phone or note, for your own records (max 100).
curl -X POST https://api.anajak-store.com/v1/order \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "productscode": "2794",
    "gamecode": "mobilelegend",
    "target": "12345678|2001",
    "idtrx": "SHOP-10001",
    "callback": "https://your-site.com/anajak/callback"
  }'

Response

{
  "status": true,
  "msg": "Order placed successfully. It is being processed.",
  "data": {
    "id": "SHOP-10001",
    "type": "game",
    "service_name": "86 Diamonds",
    "productscode": "2794",
    "gamecode": "mobilelegend",
    "target": "12345678|2001",
    "contact": "",
    "status": "processing",
    "price": 1.38,
    "balance": 48.62
  }
}

Premium Account plan

Premium plans are usually delivered within the request: the response already has "status": "success" and the account details in delivery. If it says processing, check /status later.

curl -X POST https://api.anajak-store.com/v1/order \
  -H "X-API-Key: YOUR_API_KEY" \
  -d "gamecode=premium" \
  -d "productscode=premium-1" \
  -d "[email protected]" \
  -d "idtrx=SHOP-10002"
{
  "status": true,
  "msg": "Order delivered.",
  "data": {
    "id": "SHOP-10002",
    "type": "premium",
    "service_name": "Canva Pro Canva Pro - 1Years",
    "status": "success",
    "price": 3.85,
    "balance": 44.77,
    "delivery": {
      "items": [
        { "label": "Email", "value": "[email protected]" },
        { "label": "Password", "value": "••••••••" }
      ],
      "note": "How to log in…"
    }
  }
}
POST/status

Order status

Current status of one of your orders. Polling every 10–30 seconds is fine; a webhook is better.

ParameterTypeDescription
order_idstringrequiredThe id from /order (your idtrx).
curl -X POST https://api.anajak-store.com/v1/status \
  -H "X-API-Key: YOUR_API_KEY" \
  -d "order_id=SHOP-10001"
{
  "status": true,
  "msg": "Status retrieved successfully",
  "data": {
    "id": "SHOP-10001",
    "type": "game",
    "status": "success",
    "note": "Delivered",
    "service_name": "86 Diamonds",
    "target": "12345678|2001",
    "price": 1.38,
    "license_code": null,
    "created_at": "2026-11-21T10:15:02+07:00"
  }
}

license_code is filled in for products that deliver a code instead of topping up a player (for example ROS invite passes), once the order is success. For Premium Accounts ("type": "premium") the account details are in delivery (same format as in /order) once the order is success.

POST/balance

Balance

curl -X POST https://api.anajak-store.com/v1/balance \
  -H "X-API-Key: YOUR_API_KEY"
{
  "status": true,
  "msg": "Success",
  "data": { "balance": 48.48, "currency": "USD" }
}

Order statuses

statusMeaningFinal?
pendingAccepted, not sent to the supplier yet.No
processingSent to the supplier, waiting for delivery.No
successDelivered to the player (or license_code ready).Yes
failedCould not be delivered. If you were charged, the amount goes back to your balance and the status becomes refund.Yes
refundNot delivered; the price is back in your balance.Yes

Webhooks

If you sent a callback URL with the order, we POST JSON to it once the order reaches a final state: success, or failed (also sent for refunded orders). Answer with any HTTP 2xx.

POST https://your-site.com/anajak/callback
Content-Type: application/json
X-Signature: 3f1c…e9

{
  "id": "SHOP-10001",
  "trx_id": "SHOP-10001",
  "note": "Delivered",
  "status": "success",
  "license_code": null,
  "callback_url": "https://your-site.com/anajak/callback"
}
Verify every webhook. X-Signature = sha256(raw_body + api_key), as a lowercase hex string. Compute it over the raw request body exactly as received, and reject the request if it doesn't match. If you regenerate your key, webhooks for older orders are signed with the new key.
$body = file_get_contents('php://input');
$expected = hash('sha256', $body . getenv('ANAJAK_API_KEY'));

if (!hash_equals($expected, $_SERVER['HTTP_X_SIGNATURE'] ?? '')) {
    http_response_code(401);
    exit;
}
$event = json_decode($body, true);
// mark order $event['id'] as $event['status']
http_response_code(200);

Rate limits

  • 120 requests per minute per API key, and 240 per IP address.
  • Over the limit you get HTTP 429 with rate_limited. Wait and retry; the Retry-After header says how many seconds.
  • Cache /service for a few minutes, and prefer webhooks to frequent /status polling.

Older integrations that use https://anajak-store.com/api/v1 keep working, but please switch to https://api.anajak-store.com/v1.