Product Order API
Get Product Order API access, connect your website, and integrate the live product catalogue, orders, USD wallet balance and signed callbacks.
📦 Product API · complete reference
Browse all eleven modules. Existing API authentication, signed order/callback formats and Wallet Balance instructions are preserved.
GUIDEOverview & integration flowGetting started⌄
One collection for every enabled product. Customers configure one Product API key pair, fetch the live catalog and use product_id/package_id from its response. No per-product endpoint setup.
SRK Product Order API1. Create your website Product API credentials. 2. Keep API Key and Secret only on your backend. 3. GET the paginated live Product Catalogue. 4. Choose product_id and package_id from the API response. 5. POST an order with a unique client_order_id. 6. GET order status or verify the signed callback. This API charges only the registered customer's USD Wallet. Use only your Product API key for these endpoints.
This is documentation, not a request. API Base URL: https://api.srkexpressbd.com Product key format: sp_... All requests except webhook deliveries require HMAC-SHA256 headers.
AUTH1.0 Signature MethodAuthentication⌄
The request signature uses METHOD + newline + URI path (without query string) + newline + UNIX timestamp + newline + exact raw body. Header value is lowercase hexadecimal; never send your Secret.
HMAC SHA256 + Timestamp<?php
// Run this ONLY on your server. Never expose the Product API Secret in browser code.
$apiKey = getenv('SRK_PRODUCT_API_KEY');
$secret = getenv('SRK_PRODUCT_API_SECRET');
$method = 'GET';
$path = '/api/product-catalog.php'; // exclude ?page=... from the signature
$body = ''; // GET has an empty body
$timestamp = (string) time();
$signature = hash_hmac('sha256', $method . "\n" . $path . "\n" . $timestamp . "\n" . $body, $secret);
$headers = [
'X-SRK-Product-Key: ' . $apiKey,
'X-SRK-Timestamp: ' . $timestamp,
'X-SRK-Signature: ' . $signature,
];
Required headers: X-SRK-Product-Key: sp_YOUR_PRODUCT_API_KEY X-SRK-Timestamp: 1760000000 X-SRK-Signature: 64-character lowercase HMAC-SHA256 hex Timestamp must be within 300 seconds. GET body is empty. Sign POST raw JSON exactly as sent.
GET2.0 List all productsProduct catalogue⌄
One endpoint covers ALL active SRK products and their active packages. Use pagination.has_more and next_page to fetch the rest; no manual per-product API mapping.
/api/product-catalog.php?page=1&limit=100GET https://api.srkexpressbd.com/api/product-catalog.php?page=1&limit=100 X-SRK-Product-Key: sp_YOUR_PRODUCT_API_KEY X-SRK-Timestamp: UNIX_TIMESTAMP X-SRK-Signature: SIGNED_HEX GET parameters: page = 1, 2, 3 ... limit = 1 to 500 (default 100) Continue until pagination.has_more === false.
{
"ok": true,
"currency": "USD",
"products": [
{"product_id": 16818, "name": "PUBG Mobile", "type": "topup",
"price_usd": 0.00, "packages": [
{"package_id": 123, "name": "PACKAGE_NAME", "price_usd": 0.00, "available": true}
]}
],
"pagination": {"page": 1, "limit": 100, "total_products": 1000,
"total_pages": 10, "has_more": true, "next_page": 2}
}
// Sample only: IDs, prices and counts vary; always fetch live data.CODE2.1 Fetch the entire catalog · PHPProduct catalogue⌄
Ready-to-adapt server-side PHP example: sequentially retrieves every page with the correct signature. Use on the customer server, not in the browser.
Backend pagination · no extra endpoint<?php
// Private backend integration, using credentials stored in environment variables.
function srkFetchAllProducts(): array {
$key = getenv('SRK_PRODUCT_API_KEY');
$secret = getenv('SRK_PRODUCT_API_SECRET');
if (!$key || !$secret) throw new RuntimeException('API credentials missing');
$path = '/api/product-catalog.php';
$all = [];
for ($page = 1; $page <= 1000; $page++) {
$stamp = (string) time();
$sig = hash_hmac('sha256', "GET\n{$path}\n{$stamp}\n", $secret);
$url = 'https://api.srkexpressbd.com'.$path.'?page='.$page.'&limit=500';
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 15,
CURLOPT_HTTPHEADER => [
'X-SRK-Product-Key: '.$key,
'X-SRK-Timestamp: '.$stamp,
'X-SRK-Signature: '.$sig,
],
]);
$raw = curl_exec($ch);
$status = (int)curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
$data = is_string($raw) ? json_decode($raw, true) : null;
if ($status !== 200 || !is_array($data) || empty($data['ok'])) {
throw new RuntimeException('Catalogue request failed (HTTP '.$status.')');
}
foreach (($data['products'] ?? []) as $product) $all[] = $product;
if (empty($data['pagination']['has_more'])) return $all;
}
throw new RuntimeException('Catalogue exceeded 1000 pages. Continue pagination.');
}
Returns a PHP array containing every active product and package. If the dataset is unusually large, page through records rather than keeping the whole catalog in memory.
GET2.2 Get one product & packagesProduct catalogue⌄
Same secure catalogue endpoint, filtered by SRK product ID. Returns matching product and its packages in products array.
/api/product-catalog.php?id={{product_id}}GET https://api.srkexpressbd.com/api/product-catalog.php?id=16818 X-SRK-Product-Key: sp_YOUR_PRODUCT_API_KEY X-SRK-Timestamp: UNIX_TIMESTAMP X-SRK-Signature: SIGNED_HEX
{
"ok": true,
"currency": "USD",
"products": [{
"product_id": 16818, "name": "PRODUCT_NAME",
"type": "topup", "price_usd": 0.00,
"packages": [{"package_id": 123, "name": "PACKAGE_NAME", "price_usd": 0.00, "available": true}]
}],
"pagination": {"page": 1, "total_products": 1, "has_more": false}
}
// Illustrative sample; do not hardcode example IDs or prices.POST3.0 Submit OrderOrders⌄
Create one real order. Uses USD Wallet, validates active product/package and required player fields. Unique client_order_id prevents repeat charges. This request spends actual wallet money.
/api/product-order.phpPOST https://api.srkexpressbd.com/api/product-order.php
Content-Type: application/json
X-SRK-Product-Key: sp_YOUR_PRODUCT_API_KEY
X-SRK-Timestamp: UNIX_TIMESTAMP
X-SRK-Signature: SIGNED_HEX
{"client_order_id":"MYORDER_100001","product_id":16818,"package_id":123,"quantity":1,"fields":{"uid":"PLAYER_ID","zone":"SERVER_ID"}}
HTTP 201
{"ok":true,"replayed":false,"client_order_id":"MYORDER_100001","order_id":21921,"status":"processing","canonical_status":"processing","amount_usd":0.25,"currency":"USD"}
HTTP 200 on a safe same-order retry (replayed=true).
HTTP 409 on conflicting reuse of the same client_order_id.
// Example values only; required fields depend on the product.GET3.1 Get Order Detail / StatusOrders⌄
Poll status using the client_order_id that your server previously sent. Returns the current SRK order status and charged USD amount.
/api/product-status.php?client_order_id={{client_order_id}}GET https://api.srkexpressbd.com/api/product-status.php?client_order_id=MYORDER_100001 X-SRK-Product-Key: sp_YOUR_PRODUCT_API_KEY X-SRK-Timestamp: UNIX_TIMESTAMP X-SRK-Signature: SIGNED_HEX
HTTP 200
{"ok":true,"client_order_id":"MYORDER_100001","order_id":21921,"status":"processing","canonical_status":"processing","amount_usd":0.25,"currency":"USD"}
// Example values only. Update by polling or signed webhook.GET3.2 Get your USD Wallet BalanceWallet (read-only)⌄
A signed, read-only endpoint. Returns ONLY the USD wallet owned by your Product API key. No user_id parameter, no wallet debit, no account information of other customers. A signed Product API Key + HMAC request is sufficient; browser-only Merchant Password is NOT required for this API. Never expose API credentials in browser JavaScript.
https://api.srkexpressbd.com/api/product-balance.phpGET /api/product-balance.php\nX-SRK-Product-Key: sp_YOUR_KEY\nX-SRK-Timestamp: CURRENT_UNIX_TIMESTAMP\nX-SRK-Signature: HMAC_SHA256_OF_('GET\n/api/product-balance.php\n'+timestamp+'\n')
HTTP 200\n{\n "ok": true,\n "currency": "USD",\n "balance_usd": 12.34,\n "has_positive_balance": true,\n "as_of": "2026-10-19T00:00:00Z"\n}\nErrors: 401 invalid API key/signature; 403 disabled account; 503 USD wallet unavailable.WEBHOOK4.0 Callback NotificationCallbacks⌄
SRK sends status updates to the callback you registered. Verify X-SRK-Timestamp + raw body HMAC on your own backend; never use a callback as independent proof of wallet credits.
POST to your registered HTTPS callback URL<?php
// HTTPS endpoint on YOUR registered website, not on SRK API's website.
$secret = getenv('SRK_PRODUCT_API_SECRET') ?: '';
$stamp = $_SERVER['HTTP_X_SRK_TIMESTAMP'] ?? '';
$given = strtolower($_SERVER['HTTP_X_SRK_SIGNATURE'] ?? '');
$raw = file_get_contents('php://input');
if ($secret === '' || !ctype_digit($stamp) || abs(time()-(int)$stamp)>300) {
http_response_code(401); exit;
}
$expected = hash_hmac('sha256', $stamp.'.'.$raw, $secret);
if (!hash_equals($expected, $given)) { http_response_code(401); exit; }
$event = json_decode($raw, true);
if (!is_array($event) || ($event['type'] ?? '') !== 'product_order.status') {
http_response_code(400); exit;
}
// Persist order_id + status idempotently and respond 2xx only on success.
http_response_code(204);
POST https://your-own-domain.com/webhooks/srk
Content-Type: application/json
X-SRK-Timestamp: UNIX_TIMESTAMP
X-SRK-Signature: HEX_HMAC_SHA256(TIMESTAMP + "." + RAW_BODY, SECRET)
{"type":"product_order.status","client_order_id":"MYORDER_100001","order_id":21921,"status":"delivered","canonical_status":"confirmed","amount_usd":0.25,"currency":"USD","timestamp":1760000000}
// Sample payload only. status is processing, completed/delivered, or refunded. canonical_status is processing, confirmed, or refunded. Failed/cancelled never mean refunded until the SRK refund is recorded. Each app receives callbacks at its own approved URL.GUIDE5.0 Error CodesReference⌄
Non-2xx responses describe authentication problems, invalid product/package IDs, insufficient wallet balance or temporary service failures. Do not retry a charged order with a different client_order_id. Balance: usd_wallet_unavailable or balance_temporarily_unavailable (503). The Merchant Password applies only to the browser manual order page, not Product API endpoints.
HTTP status and response errors401 invalid_api_auth / invalid_api_key / invalid_signature 402 wallet_insufficient 403 account_locked 404 product_unavailable / package_unavailable / order_not_found 405 GET_only / POST_only 409 idempotency_conflict / out_of_stock 413 body_too_large 422 invalid_order_fields / invalid_player_fields / required_supplier_field_missing 503 product_api_not_configured / usd_rate_unavailable / order_temporarily_unavailable Status meanings and additional errors depend on the endpoint.
{"ok":false,"error":"invalid_signature"}
401 means inspect signature inputs, timestamp skew, raw body, API key and active website registration. Keep request IDs stable on network retries.GUIDE6.0 Security & deployment checklistReference⌄
Implementation rules every integrator should follow. This documentation never edits payments, products or real API credentials. Balance API is READ-ONLY. Product API cannot top up, refund, transfer money or bypass stock and wallet checks. Merchant Password is only used when the account owner manually unlocks packages and orders through the logged-in browser. Signed product API requests use the API key, timestamp and HMAC only.
Keep keys safe · wallet-only · retries• Product API key (sp_) and Secret belong on your own backend only. • Use Product API credentials for product requests only. • Never include the Product Secret in a mobile app or public JavaScript. • No product or package prices should be trusted from the ordering client. • Always fetch the live catalog; use exact product_id and package_id. • Store a unique client_order_id and reuse it for retries of the SAME order. • Signed callbacks need timestamp validation and idempotent processing. • Product API orders charge only the API account's USD Wallet. • Register your own HTTPS callback hostname in Product API workspace. • GET catalog, GET status, and POST order are the only live product endpoints documented here.
For credentials: My Account → Product Order API. For all product information: 2.0 List all products. For integrations: download the Postman Collection from the documentation header.
