Omar Store
🔌 API v2

API documentation

Pull our products and sell them to your customers at reseller prices — purchases are paid automatically from your website wallet, and ready accounts are delivered instantly.

🧩 WordPress (WooCommerce) store?

No code needed: download the ready-made plugin, upload it from Plugins → Add New → Upload Plugin, paste your key in WooCommerce → Omar Store, and pick the matching product in each of your products. Buying, delivery and notifications run by themselves.

Don't use WooCommerce → Settings → Advanced → Webhooks to connect — it sends data the other way and returns a 404 error.

🚀 Quick start in 3 steps

  1. Sign up or sign in, open My account → API and create your key.
  2. Top up your wallet with any payment method — every API purchase is deducted from it.
  3. Call this base URL with your key in the header:
https://shop.ejaz.media/api/v2          ← EGP
https://shop.ejaz.media/api/v2/usd      ← USD

The /usd base is the very same API with amounts in USD (for store software that assumes USD).

🔑 Authentication

Send it in the X-API-Key header, or Authorization: Bearer <key>.

curl https://shop.ejaz.media/api/v2/me \
  -H "X-API-Key: sk_xxxxxxxxxxxxxxxx"

⚠️ Treat the key like a password: use it only from your server — never in a page your customers open. If you think it leaked, rotate it in My account right away.

📋 Endpoints

EndpointWhat it does
GET /productsAll available products at your API price, with stock, category and description. Game editions, gift cards and top-ups (thousands of items) are left out — add ?games=1 to include them.
GET /products/{id}One product.
POST /purchaseBuy with your balance — instant products return the account in the response.
GET /orders/{id}Order status and delivered account.
GET /ordersYour orders (newest first) — ?limit=50&since_id=0
GET /balance · GET /meYour balance and account status.
POST /webhook · GET · DELETEA URL we notify when an order is activated or refunded.

🛒 Purchasing

POST https://shop.ejaz.media/api/v2/purchase
X-API-Key: sk_...
Content-Type: application/json

{
  "product_id": 12,
  "quantity": 1,
  "request_id": "order-1001",
  "input": "[email protected]"
}
  • request_id: your own order ID — always send it. If the connection drops and you retry with the same ID, you get the same order back without being charged again (or use the Idempotency-Key header).
  • input: only for products with needs_input: true — e.g. the customer email to activate on.

Response:

{
  "success": true,
  "order_id": 5231,
  "status": "delivered",
  "state": "completed",
  "product": "Netflix Premium 1M",
  "quantity": 1,
  "paid": 150.0,
  "currency": "EGP",
  "codes": ["[email protected]:password"],
  "balance_after": 850.0,
  "duplicate": false
}

state: completed delivered · pending being activated · processing preparing · cancelled/refunded balance returned.

💻 Ready-made examples

cURL
curl -H "X-API-Key: sk_..." https://shop.ejaz.media/api/v2/products

curl -X POST https://shop.ejaz.media/api/v2/purchase \
  -H "X-API-Key: sk_..." -H "Content-Type: application/json" \
  -d '{"product_id": 12, "quantity": 1, "request_id": "order-1001"}'
PHP
<?php
$ch = curl_init("https://shop.ejaz.media/api/v2/purchase");
curl_setopt_array($ch, [
  CURLOPT_POST => true,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => ["X-API-Key: sk_...", "Content-Type: application/json"],
  CURLOPT_POSTFIELDS => json_encode(["product_id" => 12, "quantity" => 1, "request_id" => "order-1001"]),
]);
$res = json_decode(curl_exec($ch), true);
if (!empty($res["success"])) { $accounts = $res["codes"]; }
else { echo $res["error"]["code"] . " — " . $res["error"]["message"]; }
JavaScript (Node.js)
const r = await fetch("https://shop.ejaz.media/api/v2/purchase", {
  method: "POST",
  headers: { "X-API-Key": "sk_...", "Content-Type": "application/json" },
  body: JSON.stringify({ product_id: 12, quantity: 1, request_id: "order-1001" }),
});
const data = await r.json();
if (data.success) console.log(data.codes); else console.log(data.error.code, data.error.message);
Python
import requests
r = requests.post("https://shop.ejaz.media/api/v2/purchase",
                  headers={"X-API-Key": "sk_..."},
                  json={"product_id": 12, "quantity": 1, "request_id": "order-1001"}, timeout=60)
data = r.json()
print(data["codes"] if data.get("success") else data["error"])

🔔 Webhooks

Manually activated products return pending. Instead of polling, set a URL (or from My account → API) and we notify you as soon as the order is activated or refunded:

POST https://shop.ejaz.media/api/v2/webhook
{"url": "https://your-site.com/store-callback"}

You receive a POST like this, with an X-Signature header = sha256= + HMAC-SHA256 of the body using your key:

{"event": "order.updated", "order": {"order_id": 5231, "state": "completed", "codes": ["..."], "request_id": "order-1001"}}

// PHP — verify it's from us
$sig = "sha256=" . hash_hmac("sha256", file_get_contents("php://input"), "sk_...");
if (!hash_equals($sig, $_SERVER["HTTP_X_SIGNATURE"] ?? "")) { http_response_code(401); exit; }

Reply with 200. We retry several times if you don’t, and you can always call GET /orders/{id}. The URL must start with https://

❗ Errors

{"success": false, "error": {"code": "...", "message": "..."}}
codeMeaning
missing_key · invalid_keyKey missing or invalid (401)
api_disabled · bannedAPI disabled for your account (403)
api_offAPI temporarily paused (503)
insufficient_balanceNot enough balance — top up your wallet
out_of_stockOut of stock (if it runs out mid-order, the amount returns to your balance — 409)
invalid_inputRequired input missing or invalid
product_not_found · order_not_foundNot found (404)
rate_limitedMore than 60 calls per minute (429)