GET /api/v1/reseller/wallet/balance
Return current reseller wallet balance and currency.
Auth: X-API-KEY, X-TIMESTAMP, X-SIGNATURE
Request
Response
{
"balance": "120.500",
"currency": "USD"
}Developer Portal
Secure reseller API for wallet balance checks, product catalog retrieval, asynchronous order creation, and order status queries. This portal documents the production reseller API contract, including request signing and idempotency requirements.
Resource-oriented endpoints, JSON responses, and standard HTTP status codes.
Use this production domain as the base URL for all reseller API v1 requests.
Production
https://ktopupservice.com
Sandbox / Staging
No public sandbox endpoint for reseller API v1.
All reseller API requests must include API key authentication, a request timestamp, and an HMAC-SHA256 signature. Order creation requests additionally require an idempotency key to ensure safe retries.
When an IP whitelist is configured for your credential, requests must originate from one of its registered addresses. Credentials are managed by an administrator.
X-API-KEY: KTS_2d8c0f...
X-TIMESTAMP: 1760000000
X-SIGNATURE: 4ac3...
X-IDEMPOTENCY-KEY: ord_20260309_001 // POST /orders onlyNew API keys use the KTS_ prefix. Previously issued keys remain valid; send the complete key exactly as issued.
Auth Flow Order
Missing or invalid API keys fail fast before any credential-based rate-limit path.
Build the canonical string exactly as shown and sign it using HMAC-SHA256. Signature output must be lowercase hex.
METHOD
PATH
TIMESTAMP
BODYcurl -X POST "{{BASE_URL}}/api/v1/reseller/orders" \
-H "Content-Type: application/json" \
-H "X-API-KEY: {{API_KEY}}" \
-H "X-TIMESTAMP: {{UNIX_SECONDS}}" \
-H "X-SIGNATURE: {{HMAC_SHA256_HEX}}" \
-H "X-IDEMPOTENCY-KEY: {{UNIQUE_KEY}}" \
-d '{"productId":"product_token","sku":"sku_token","userAccount":"98223878"}'`X-IDEMPOTENCY-KEY` is required for `POST /api/v1/reseller/orders` to prevent duplicate order creation and duplicate wallet debit on retries.
An order signature is bound to its first idempotency key. Changing the key while reusing that signature returns `409 REPLAY_DETECTED`. For a separate order with identical content, wait for a new Unix second and sign with the new timestamp. For a retry after timestamp expiry, sign again and keep the original key and body. A request still in progress may return 409; retry with backoff.
Create your first order in five calls.
curl -X GET "{{BASE_URL}}/api/v1/reseller/products" \
-H "X-API-KEY: {{API_KEY}}" \
-H "X-TIMESTAMP: {{UNIX_SECONDS}}" \
-H "X-SIGNATURE: {{SIGNATURE}}"Send signed requests directly from docs. Credentials stay in browser memory only.
Return current reseller wallet balance and currency.
Auth: X-API-KEY, X-TIMESTAMP, X-SIGNATURE
Request
Response
{
"balance": "120.500",
"currency": "USD"
}Return product catalog with required fields and purchasable SKUs.
Auth: X-API-KEY, X-TIMESTAMP, X-SIGNATURE
Request
Response
{
"products": [
{
"productId": "mobile-legends-brazil_qtupjesknc",
"name": "Mobile Legends - Brazil",
"status": "ACTIVE",
"category": "GAMING",
"fields": [
{
"key": "userAccount",
"label": "User ID",
"required": true
},
{
"key": "server",
"label": "Server",
"required": true
}
],
"skus": [
{
"sku": "psk_wpzyko5vvCvYS2tp-A3CCdO2",
"name": "78 Diamonds + 8 Bonus",
"price": "1.150",
"available": true
},
{
"sku": "psk_wjM_c93kTOPG4oZUMaBGj_Lu",
"name": "156 Diamonds + 16 Bonus",
"price": "2.300",
"available": true
}
]
},
{
"productId": "pubg-mobile-global_htizwdk6ug",
"name": "PUBG Mobile (GLOBAL)",
"status": "ACTIVE",
"category": "GAMING",
"fields": [
{
"key": "userAccount",
"label": "User ID",
"required": true
}
],
"skus": [
{
"sku": "psk_v_lvJK7fNSx4CEoQbj2hMUGx",
"name": "57 + 3 Extra UC",
"price": "0.905",
"available": true
},
{
"sku": "psk_K9DjZWGoMJzMi25nmxSS-FD2",
"name": "300 + 25 Extra UC",
"price": "4.679",
"available": true
}
]
},
{
"productId": "genshin-impact-global_dfycqqr1te",
"name": "Genshin impact - Global",
"status": "ACTIVE",
"category": "GAMING",
"fields": [
{
"key": "userAccount",
"label": "User ID",
"required": true
},
{
"key": "server",
"label": "Server",
"required": true
}
],
"skus": [
{
"sku": "psk_YZ4Maeq8Sft0fnjnnv3-Igk4",
"name": "60 Genesis Crystals",
"price": "0.990",
"available": true
},
{
"sku": "psk_1aUHkuKZXU7XM1RCR8jbW6wN",
"name": "300 + 30 Genesis Crystal",
"price": "4.990",
"available": true
}
]
}
]
}Return full detail for one active product by public productId.
Auth: X-API-KEY, X-TIMESTAMP, X-SIGNATURE
Request
curl -X GET "{{BASE_URL}}/api/v1/reseller/products/mobile-legends-malaysia-id_pfbg3bb5qt" \
-H "X-API-KEY: {{API_KEY}}" \
-H "X-TIMESTAMP: {{UNIX_SECONDS}}" \
-H "X-SIGNATURE: {{SIGNATURE}}"Response
{
"product": {
"productId": "genshin-impact-global_dfycqqr1te",
"name": "Genshin impact - Global",
"status": "ACTIVE",
"category": "GAMING",
"fields": [
{
"key": "userAccount",
"label": "User ID",
"required": true
},
{
"key": "server",
"label": "Server",
"required": true,
"serverList": [
{ "value": "America", "label": "America" },
{ "value": "Asia", "label": "Asia" },
{ "value": "Europe", "label": "Europe" },
{ "value": "TW_HK_MO", "label": "TW_HK_MO" }
]
}
],
"skus": [
{
"sku": "psk_YZ4Maeq8Sft0fnjnnv3-Igk4",
"name": "60 Genesis Crystals",
"price": "0.990",
"available": true
}
]
}
}Create an order asynchronously. Accepted responses return PENDING state.
Auth: X-API-KEY, X-TIMESTAMP, X-SIGNATURE, X-IDEMPOTENCY-KEY
Request
{
"productId": "mobile-legends-brazil_qtupjesknc",
"sku": "psk_wpzyko5vvCvYS2tp-A3CCdO2",
"userAccount": "98223878",
"server": "2507",
"role": null,
"quantity": 1
}Response
{
"success": true,
"order": {
"id": "cmmb4u0d60006rmi9ykacbfri",
"status": "PENDING",
"amount": "1.150",
"receiptNumber": null,
"quantity": 1
},
"message": "Order submitted. Processing in background. Check Orders for updates."
}Return strict public order detail for a reseller-owned order.
Auth: X-API-KEY, X-TIMESTAMP, X-SIGNATURE
Request
Response
{
"order": {
"orderId": "cmmb4u0d60006rmi9ykacbfri",
"receiptNumber": "KTS-20260303-0002",
"status": "SUCCESS",
"amount": "1.150",
"product": {
"productId": "mobile-legends-brazil_qtupjesknc",
"name": "Mobile Legends - Brazil",
"category": "GAMING",
"productType": "TOPUP"
},
"userAccount": "98223878",
"server": "2507",
"role": null,
"sku": "psk_wpzyko5vvCvYS2tp-A3CCdO2",
"skuName": "78 Diamonds + 8 Bonus"
}
}Optional real-time order status updates with polling as fallback.
Webhooks notify your server when an order moves through `PENDING`, `PROCESSING`, `SUCCESS`, `FAILED`, or `REFUNDED`. Webhook delivery is optional but recommended for real-time integrations. Continue polling `GET /api/v1/reseller/orders/:orderId` as a fallback for missed, delayed, or failed webhook deliveries.
Example webhook flow
Webhooks are a notification system. The order lookup endpoint is still the source of truth for the current order state.
Management endpoints
Webhook endpoint requirements
Create a webhook endpoint. The full secret is returned only once.
Auth: X-API-KEY, X-TIMESTAMP, X-SIGNATURE
Request
{
"url": "https://example.com/webhooks/ktopupservice",
"subscribedEvents": ["order.processing", "order.success", "order.failed", "order.refunded"]
}Response
{
"endpoint": {
"id": "cmwebhook123",
"url": "https://example.com/webhooks/ktopupservice",
"isActive": true,
"subscribedEvents": ["order.processing", "order.success", "order.failed", "order.refunded"],
"secretPreview": "whsec_****abcd",
"createdAt": "2026-04-27T00:00:00.000Z",
"updatedAt": "2026-04-27T00:00:00.000Z"
},
"secret": "whsec_full_secret_returned_once"
}order.success payload
{
"id": "evt_abc123",
"type": "order.success",
"createdAt": "2026-04-27T00:00:00.000Z",
"data": {
"orderId": "cmmb4u0d60006rmi9ykacbfri",
"receiptNumber": "KTS-20260303-0002",
"status": "SUCCESS",
"amount": "1.150",
"currency": "USD",
"product": {
"productId": "mobile-legends-brazil_qtupjesknc",
"name": "Mobile Legends - Brazil",
"category": "GAMING",
"productType": "TOPUP"
},
"userAccount": "98223878",
"server": "2507",
"role": null,
"sku": "psk_wpzyko5vvCvYS2tp-A3CCdO2",
"skuName": "78 Diamonds + 8 Bonus",
"voucher": null,
"createdAt": "2026-04-27T00:00:00.000Z",
"updatedAt": "2026-04-27T00:01:00.000Z"
}
}Outgoing headers
Content-Type: application/json
X-KTS-Event: order.success
X-KTS-Timestamp: 1760000000
X-KTS-Signature: <hex hmac sha256>
X-KTS-Webhook-ID: evt_xxxSignature input is timestamp + "." + rawJsonBody; verify the exact raw JSON body you receive.
Node.js signature verification
const crypto = require("crypto");
function verifyKtopupserviceWebhook({ rawBody, signature, timestamp, secret }) {
const now = Math.floor(Date.now() / 1000);
if (Math.abs(now - Number(timestamp)) > 300) {
return false;
}
const expected = crypto
.createHmac("sha256", secret)
.update(`${timestamp}.${rawBody}`)
.digest("hex");
return crypto.timingSafeEqual(
Buffer.from(expected),
Buffer.from(signature)
);
}Idempotency on your side
Webhook events may be delivered more than once because of retries, network failures, or delayed responses.
Retry behavior
A webhook event marked `FAILED` means KTOPUPSERVICE could not deliver the webhook after all retry attempts. It does not mean the order itself failed. Confirm the order state with `GET /api/v1/reseller/orders/:orderId`.
Recommended webhook handling pattern
Avoid
Common webhook issues
Security
Local test note
Do not create fake KTOPUPSERVICE signatures for local testing. Use `POST /api/v1/reseller/webhooks/test` to send a signed `webhook.test` event from KTOPUPSERVICE to your configured endpoint.
{
"endpointId": "cmwebhook123"
}Orders are processed asynchronously. After create order returns, clients should poll order detail until reaching a terminal status.
`POST /api/v1/reseller/orders` returns `202` while processing begins. Use `GET /api/v1/reseller/orders/:orderId` to poll for `PENDING`, `SUCCESS`, or `FAILED`.
API errors use a stable JSON shape with machine-readable code and human-readable message.
{
"error": "Invalid signature",
"code": "INVALID_SIGNATURE"
}Additional terminal statuses may appear from lifecycle mapping (for example REFUNDED or TIMEOUT). Treat non-success terminal states as non-fulfillment outcomes.
Webhooks are recommended for real-time updates. Polling remains supported and should be used as a fallback if webhook delivery fails.
Default policy is 120 requests / 60 seconds / API key.
Invalid signature
Timestamp rejected
Idempotency conflict
Order remains pending